Let's say I want to recreate this LaTeX code into a custom block:
\begin{tabularx}{\linewidth}{p{0.5\linewidth} X}
\toprule
Column 1 & Column 2 \\
\midrule
\textbf{Lorem} & Ipsum \\
\bottomrule
\end{tabularx}
I tried to do this:
::: {.tabularx data-latex="{\linewidth}{p{0.5\linewidth} X}"}
\toprule
Column 1 & Column2 \\
\midrule
**Lorem** & Ipsum \\
\bottomrule
:::
But it automatically escapes all of the &
and \\
. Here is the LaTeX output:
\begin{tabularx}{\linewidth}{p{0.5\linewidth} X}
Column 1 \& Column2 \textbackslash{}
\midrule
\textbf{Lorem} \& Ipsum \textbackslash{}
\bottomrule
\end{tabularx}
How do I prevent them from being escaped? The main reason I want to do this is I've been in a situation where I want to use Markdown syntax in a LaTeX table but there's no good R package for creating that LaTeX table.