Closed amichuda closed 5 years ago
Thanks for your feedback, @lordflaron. Could you please provide me an example of what you are trying to do? --Tom
Hi,
Sorry for the late reply.
Here's some test code:
---
title: test
output: pdf_document
---
Table: Test Table {#tbl:id}
\begin{tabular}{l|l|l}
a1 & a2 & a3 \\
\hline
2 & 3 & 4
\end{tabular}
Table: Test Markdown Table {#tbl:idm}
|a1 | a2 | a3 |
|---|----|----|
|2 | 3 | 4 |
This is the latex table: @tbl:id
This is the Markdown table: @tbl:idm
The output is:
Am I doing something wrong or was pandoc-tablenos not for this?
I just released pandoc-tablenos 2.0.0 with an update to address your issue.
You are using a LaTeX table with a markdown caption and label. Pandoc doesn't support that. Here is how to code the caption and label in LaTeX:
\begin{table}
\begin{center}
\begin{tabular}{l|l|l}
a1 & a2 & a3 \\
\hline
2 & 3 & 4
\end{tabular}
\caption{Test Table}\label{tbl:id}
\end{center}
\end{table}
Reference to @tbl:id.
Processing this with pandoc + pandoc-tablenos 2.0.0 gives the desired result. Pandoc-tablenos will complain (pandoc-tablenos: Bad reference: @tbl:id
), but don't worry about that. The warning is given simply because it can't find the table you are referring to given that you coded it up in LaTeX. Pandoc-tablenos charges ahead anyway, and lets LaTeX sort it out.
I hope this helps. ☺︎
Cheers, Tom
Thank you so much!
On Tue, Sep 17, 2019, 6:35 PM Thomas J. Duck notifications@github.com wrote:
Closed #15 https://github.com/tomduck/pandoc-tablenos/issues/15.
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/tomduck/pandoc-tablenos/issues/15?email_source=notifications&email_token=ABQVPBHPCU4T6F52CRPFKWDQKGAXPA5CNFSM4IR5ZMAKYY3PNVWWK3TUL52HS4DFWZEXG43VMVCXMZLOORHG65DJMZUWGYLUNFXW5KTDN5WW2ZLOORPWSZGOTV33U5Y#event-2641869431, or mute the thread https://github.com/notifications/unsubscribe-auth/ABQVPBE5H3FNZZCZBA34F7DQKGAXPANCNFSM4IR5ZMAA .
Hi, I followed the aforementioned method and tried the following in file.tex
:
\documentclass[10pt,twoside]{book}
\begin{document}
\chapter{my chapter 1}
\begin{table}
\begin{tabular}{cc}
1&2\\
3&4\\
\end{tabular}
\caption{This is table one.}
\label{tbl:xx}
\end{table}
Please see Table @tbl:xx \ref{tbl:xx}
\end{document}
And issued the command
pandoc --filter pandoc-xnos -N file.tex -t html -M xnos-number-by-section=True
but the last line of output is
<p>Please see Table @tbl:xx <a href="#tbl:xx" data-reference-type="ref" data-reference="tbl:xx">[tbl:xx]</a></p>
(desired value should be 1). How should I do? Thanks.
Thanks for your note. Pandoc-tablenos is only for converting markdown to other formats. You're trying to convert a tex file to a different format, which isn't something the filter can help with.
In @lordflaron's example he embeds TeX in a markdown document. This might sound like a minor difference, but pandoc treats the two file types differently.
Hi,
Is there some way to get the filter to work when you put the
Table
identifier under a latex table?Right now, it doesn't seem to recognize it and only works for markdown tables.
If this isn't, in fact, a bug, are there plans to incorporate that into
pandoc-tablenos
?