% Metadata handlers
% \renewcommand{\abstract}[1]{\author{#1}}
\newcommand{\R}{R}
\newcommand{\command}[1]{\texttt{#1}}
\newcommand{\sloppy}{\\}
% Some unsupported commands in pandoc
% \renewcommand{\vspace*}[1]{\vspace{#1}} %this commands break r code chunk
% Package name commands (jss style)
% \renewcommand{\pkg}[1]{\emph{#1}}
\renewcommand{\pkg}[1]{\textbf{#1}}
\renewcommand{\proglang}[1]{\textsf{#1}}
\newcommand{\And}{\\}

\newcommand{\CRANpkg}[1]{\href{https://CRAN.R-project.org/package=#1}{\pkg{#1}}}%
\newcommand{\cpkg}[1]{\CRANpkg{#1}}
\newcommand{\BIOpkg}[1]{\href{https://www.bioconductor.org/packages/release/bioc/html/#1.html}{\pkg{#1}}}
\newcommand{\ctv}[1]{\href{https://CRAN.R-project.org/view=#1}{\emph{#1}}}
% acronym
\newcommand{\acronym}[1]{#1}
% R code
\newcommand{\Sexpr}[1]{\verb|r #1|}
\newcommand{\Rcodeplaceholder}[1]{\verb|<!--R_CODE_CHUNK_PLACEHOLDER-->|}
% Algorithm
\newcommand{\Algorithmplaceholder}[1]{\verb|<!--ALGORITHM_PLACEHOLDER-->|}
% code
\DefineVerbatimEnvironment{Sinput}{Verbatim}{}
\DefineVerbatimEnvironment{Soutput}{Verbatim}{}
\DefineVerbatimEnvironment{Scode}{Verbatim}{}
\DefineVerbatimEnvironment{Sin}{Verbatim}{}
\DefineVerbatimEnvironment{Sout}{Verbatim}{}
\DefineVerbatimEnvironment{smallverbatim}{Verbatim}{}
\newenvironment{Schunk}{}{}
\newcommand{\code}[1]{\texttt{#1}}
\newcommand{\file}[1]{\texttt{#1}}
\newcommand{\samp}[1]{\texttt{#1}}
\newcommand{\dfn}[1]{#1}
\newcommand{\email}[1]{\url{#1}}
\newcommand{\option}[1]{\texttt{#1}}
\newcommand{\env}[1]{\texttt{#1}}
\newcommand{\var}[1]{\texttt{#1}}
\newcommand{\strong}[1]{\textbf{#1}}
% figure
\renewcommand{\framebox}[2][]{#2} % allow for one optional argument
\newcommand{\scalebox}[2][]{#2} % skip scaling param
\newcommand{\adjustbox}[2][]{#2} % skip the scaling param
\renewcommand{\textwidth}{\smallskip}
\newcommand{\raisebox}[2]{#2}
\newcommand{\fbox}[2][]{#2}
\newcommand{\parbox}[3][]{#3}
\newcommand{\resizebox}[3]{#3}
\newcommand{\centerline}[1]{#1}
\newcommand{\captionof}[2]{\caption{#2}}
% references
\newcommand{\nameref}[1]{\ref{#1}}
\newcommand{\autoref}[1]{\ref{#1}}
\newcommand{\pageref}[1]{\ref{#1}}
\newcommand{\Cref}[1]{\ref{#1}}
% tables
\renewcommand{\multicolumnx}[3]{\multicolumn{#1}{c}{#3}}
\newcommand{\tabularnewline}{\\}
\newcommand{\cmidrule}[1]{\hline}
\newcommand{\cline}[1]{\hline}
\newcommand{\addlinespace}[1]{\hline}
% math
\renewcommand{\ensuremath}[1]{#1}
\renewcommand{\protect}[1]{#1}
\renewcommand{\mbox}[1]{#1}
\newcommand{\boldmath}[1]{{\mathbf{#1}}}
\newcommand{\mathbbm}[1]{{\mathbf{\mathbb{#1}}}}
\renewcommand{\vspace}[1]{}
\renewcommand{\hspace}[1]{}
\renewcommand{\footnotesize}[1]{#1}
\newcommand{\E}{\mathbb{E}}
\newcommand{\footnotetext}[1]{#1}
\newcommand{\rrbracket}{\right]\!\right]}
\newcommand{\llbracket}{\left[\!\left[}
\newcommand{\mathds}{\mathbb}
\newcommand{\bm}[1]{\boldsymbol{\mathbf{#1}}}
