I have resorted to defining a table using inline-Latex in a Pandoc Markdown document. The reason is that I need to group table rows (using a horizontal line only between certain rows).
I'm trying to get pandoc-tablenos
to work with this inline-Latex table, by doing the following:
- Adding
Table: Caption. {#tbl:id}
below the table (with a single newline between this text and the last line of the inline Latex) (as described here)- Result: the verbatim text
Table: Caption. {#tbl:id}
is present in the output PDF (below the table) andtbl:id
is not recognized as a valid ID
- Result: the verbatim text
Example Pandoc markdown document with inline Latex table:
# Expressions
Test 123. Table:
\begin{footnotesize}
\begin{tabular}{ | l l l | } \hline
\textbf{Expression} & \textbf{Meaning} & \textbf{Associativity} \\ \hline
\texttt{e1 grouped by e2} & Add a group to a grouping & left \\
\texttt{e1 where e2} & Filter a grouping & left \\ \hline
\end{tabular}
\end{footnotesize}
Some more text. *I would like to reference the table here.*
I execute pandoc
as follows to build a Latex document:
pandoc --standalone --from markdown -F pandoc-tablenos --pdf-engine=xelatex <input-file>.md -o <output-file>.tex
Best Answer
You need to add the caption and table id within the latex table. Since you are using
tabular
and no floating environment, you have to use\captionof
from the packagecaption
. You can load that in the yaml-header:You can ignore the warning:
It just means, that you haven't defined the label in
pandoc-tablenos
-syntax