Skip to content
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

Pandoc fails to convert embedded TEX formula #1029

Open
Yuri05 opened this issue Apr 4, 2023 · 4 comments
Open

Pandoc fails to convert embedded TEX formula #1029

Yuri05 opened this issue Apr 4, 2023 · 4 comments
Assignees

Comments

@Yuri05
Copy link
Member

Yuri05 commented Apr 4, 2023

Translation.md contains the inline TEX formula Eq. 1: ${\Huge GMFE = 10^{\frac{\sum(|log(\frac{Pred}{Obs})|)}{n}} }$ which is properly displayed in MD:
Eq. 1: ${\Huge GMFE = 10^{\frac{\sum(|log(\frac{Pred}{Obs})|)}{n}} }$

However when converting it to Word via pandoc I get the following:

pandoc --from=markdown+tex_math_dollars+superscript+subscript+raw_attribute -t docx -o output.docx Translation.md
[WARNING] Could not convert TeX math {\Huge GMFE = 10^{\frac{\sum(|log(\frac{Pred}{Obs})|)}{n}} }, rendering as TeX:
  {\Huge GMFE = 10^{\frac{\sum(|log(\frac{
         ^
  unexpected control sequence \Huge
  expecting "%", "\\label", "\\tag", "\\nonumber" or whitespace

and the formula is not properly erendered in Word: output.docx
grafik

Have tried it with the latest pandoc version 3.1.2 - same.
Any ideas how to fix?

@Yuri05
Copy link
Member Author

Yuri05 commented Apr 4, 2023

@pchelle I think it's a pandoc limitation in translating TEX and nothing we can do about it.
Maybe it's somehow possible to tell pandoc "just ignore unknown TEX instructions and proceed anyway"

@pchelle
Copy link
Collaborator

pchelle commented Apr 4, 2023

Indeed, it seems that the translation limits to Math TeX only.
Thus, no LaTeX tags setting fonts seem to work.
I have tried to convert manually to raw openxml but I did not succeed in displaying the equation.
I also tried to set the style of the reference document but did not find where the equation style could be defined.

@Yuri05
Copy link
Member Author

Yuri05 commented Jan 5, 2024

Last tested with pandoc 3.1.11 (released 16.12.2023) - still cannot be rendered.

@pchelle
Copy link
Collaborator

pchelle commented Feb 13, 2024

LaTeX to OMML (word math langage) Pandoc conversion supports only the main LaTeX math package(s): jgm/pandoc#9403
I haven't found the list of LaTeX packages that are actually supported though

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants