-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
No reference to equations in docx output #1
Comments
Short answerI fixed this with a lua filter. Download the pandoc --lua-filter org_helper.lua --filter pandoc-tex-numbering.py input.org -o output.docx This works well for me on your testing file. However, I have no more org files/projects to test. Please test this on your real project and let me know the result. Long answerThe problem originates from the default Related discussions can also be found in pandoc issue #1764 (codes in |
You can also test the behavior of the EquationsWith: echo "\begin{equation} a=b \end{equation}" | pandoc -f org -t native You get: [ RawBlock
(Format "latex") "\\begin{equation} a=b \\end{equation}\n"
] With: echo "\begin{equation} a=b \end{equation}" | pandoc -f org -t native --lua-filter org_helper.lua You get: [ Div ( "" , [] , [] ) [ Para [ Math DisplayMath "a=b" ] ] ] ReferenceWith: echo "\ref{eq:1}" | pandoc -f org -t native You get: [ Para [ RawInline (Format "latex") "\\ref{eq:1}" ] ] With: echo "\ref{eq:1}" | pandoc -f org -t native --lua-filter org_helper.lua You get: [ Para
[ Link
( ""
, []
, [ ( "reference-type" , "ref" )
, ( "reference" , "eq:1" )
]
)
[ Str "[eq:1]" ]
( "#eq:1" , "" )
]
] |
Thank you very much for adressing this issue 👍 A workaround that works also is first to convert from The last adjustment that could enhance the solution you give is that cross references in orgmode
This does not work : "eqref:eq:1" is treated as raw text. But I guess it is possible to add another lua filter to change text = string.gsub(text, "eqref:(.-)", "\\ref{%1}") Any hint about how to embed this in the appropriate lua pandoc filter function is welcome. Regards |
The pandoc-tex-numbering/org_helper.lua Lines 19 to 26 in 83fd3a8
|
I'm not familiar with |
I use this pandoc filter in the process of translating
org
(emacs) files todocx
.Here is an example of
org
file :It is possible to write raw latex equations in Emacs
org
files, the cross reference syntax is slightly different but latex syntaxcan still be used.
Here is in attachment the output docx file
test.docx
Equations get labeled, but references to them do not appear.
Alternatively, I tried on the command line :
and I get the output :
which seems correct. To the least,
pandoc-tex-numbering
does the job. The curious thing is that I have to escape three times (\) each latex command.However, if I change of input format, but keeping the very same input :
with the output :
In this case,
pandoc-tex-numbering
does not seem to do anything.What am I doing wrong ? and is it possible to extend
pandoc-tex-numbering
toorg
files ?The text was updated successfully, but these errors were encountered: