Replies: 3 comments 1 reply
-
LLM has no idea. "During the LaTeX parsing phase, map \caption and \ref to Word's SEQ and REF fields." Pandoc parses the LaTeX into a format-agnostic Pandoc structure, not something docx-specific. What we could perhaps do is add a specially marked Span around the generated numbers; this would be enough of a hook for the docx reader to substitute a field. I'll convert this to an issue with the suggestion. |
Beta Was this translation helpful? Give feedback.
0 replies
-
What we could perhaps do is add a specially marked Span around the generated numbers; this would be enough of a hook for the docx reader to substitute a field.
I think that there is enough information in the link object currently made up from e.g. \ref{fig:myfig}:
```
[ Link
( ""
, []
, [ ( "reference-type" , "ref" )
, ( "reference" , "myfig" )
]
)
[ Str "1" ]
( "#myfig" , "" )
]
```
|
Beta Was this translation helpful? Give feedback.
1 reply
-
There is none, but it is easy to add an OOXML field at the beginning of the content of the Caption within a Figure, isn't it?
However, I must confess that inserting a number in the link but not in the caption looks a bit strange.
|
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
When using LaTeX2docx conversion, how can we achieve field-based cross-references (for captions and text references) rather than hyperlinks? This is crucial for automatic numbering updates when merging DOCX documents.
Current Behavior:
pandoc -o output.docx main.tex
can convert\caption{XX}
in thetable
andfigure
environments in LaTeX to captions in plain text, above tables or below figures. The\ref{}
in the text can be converted to hyperlinks.pandoc -F pandoc-crossref -o output.docx main.tex
can convert\caption{XX}
in thetable
andfigure
environments in LaTeX to captions with numbering in plain text, above tables or below figures. The\ref{}
in the text can be converted to hyperlinks.pandoc -F pandoc-tex-numbering -o output.docx main.tex
can customize captions well, whereFigure X-XX: XXXXX
hasFigure X-XX
as a hyperlink and: XXXXX
as plain text. The\ref
in the text can be converted to hyperlinks. This is also the recommended latex2docx filter in thepandoc-crossref
documentation.Problem:
Haven't found any existing method produces Word field codes (like SEQ fields) for captions/references. Manual conversion (inserting caption fields + replacing hyperlinks with cross-reference fields) is prohibitively tedious.
Questions:
LLM is recommending something like below, wondering correction:
\caption
and\ref
to Word'sSEQ
andREF
fields.Figure { SEQ Figure \* ARABIC }
).Appreciate any recommendations or implementation insights!
Beta Was this translation helpful? Give feedback.
All reactions