pandoc-crossref
pandoc-crossref copied to clipboard
Latex to docx cannot generate table number
Im using pandoc-crossref v0.3.14.0 pandoc-2.19.2
my command is:
pandoc -F pandoc-crossref -F pandoc-tablenos -M chapters -s testbook.tex -f latex -t docx --toc --toc-depth=4 --top-level-division=chapter --default-image-extension ".png" --reference-doc=test_ref.docx --metadata-file=metadata.yaml -o output2.docx
it can generate figure num correctly. but table num is empty
metadata like this:
---
numbersections: true
subparagraph: yes
# Filter preferences:
# - pandoc-crossref
numberSections: true
linkReferences: true
toc: true
lot: true
lof: true
toc-title: "Contents"
chapter: true
chaptersDepth: 1
sectionsDepth: 0
setLabelAttribute: true
secHeaderDelim: " "
tableTitle: "Table:"
figureTitle: "Figure"
#titleDelim: " "
---
what's wrong with my code?
Does it change if swapping order of the filter applies?
i.e. pandoc -F pandoc-tablenos -F pandoc-crossref ... ?
Does it change if swapping order of the filter applies? i.e.
pandoc -F pandoc-tablenos -F pandoc-crossref ...?
I tried it, but it's no different ...
You're using LaTeX as input format. This is not directly supported, but see #250
Tables should be, broadly speaking, recognized by Pandoc, but latex is a zoo with a circus, so the particular way you have your tables setup might not be recognized :shrug:
Also, why are you running pandoc-tablenos and pandoc-crossref together? What are you trying to achieve here, exactly?
Also, why are you running pandoc-tablenos and pandoc-crossref together? What are you trying to achieve here, exactly?
Emm, this problem has troubled me for a long time, I want to number figures and tables with chapter like Figure 2-1, Table 2-1 ... so I tried different methods,but had no effect . pandoc-tablenos is also an invalid experiment.
I use longtable in my tex proj:
\newcommand{\BeginLongTable} [3]
{
\begin{center}
\begin{footnotesize}
\begin{longtable}{#2}
\caption{#1} \label{tbl:#1} \\
\hline
\rowcolor{gray50} #3 \\
\hline
\endhead
\hline
\endfoot
\endlastfoot
}
\newcommand{\EndLongTable}
{
\end{longtable}
\end{footnotesize}
\end{center}
}
everything else is good except that there is no table number ...
But thinks to pandoc-crossref,figure number is correct.
maybe I should edit table caption in document.xml? I don't think it's a good way
I was making the elementary mistak. the first few tables in my tex is:
\begin{table}[htbp]
\centering
\begin{tabular}[c]{|l|l|}
\hline
\rowcolor{lightgray} Option & Action \\
\hline
a & c \\
\hline
b & d \\
\hline
\end{tabular}
\caption{command line option} \label{tbl:command line option}
\end{table}
and all my longtable performed normally. Now my job is to modify these.
btw:
lot: true
lof: true
seems to have no effect,Maybe it should rely on the docx template?
thanks a lot
lot: true
lof: true
:confused: these are not pandoc-crossref options. If you want list-of-figures etc, use \listoffigures in the source document and use latex+raw_tex as the input format.