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

unexpected Tok "source" Symbol "_" when reading latex #4576

Closed
gtheler opened this issue Apr 21, 2018 · 3 comments
Closed

unexpected Tok "source" Symbol "_" when reading latex #4576

gtheler opened this issue Apr 21, 2018 · 3 comments

Comments

@gtheler
Copy link

gtheler commented Apr 21, 2018

The following (valid) LaTeX input (call it mwe.tex)

donde~$\rho$ es la densidad del acero, $\rho_\text{D$_2$O}=\SI{866}{\kilogram\per\cubic\meter}$ la densidad del agua pesada a~$\SI{250}{\celsius}$, y $r_i$ y $r_o$ los radios internos y externos respectivamente.

fails with the following error

$ pandoc mwe.tex 

Error at "source" (line 1, column 54):
unexpected Tok "source" (line 1, column 54) Symbol "_"
expecting end of input
donde~$\rho$ es la densidad del acero, $\rho_\text{D$_2$O}=\SI{866}{\kilogram\per\cubic\meter}$ la densidad del agua pesada a~$\SI{250}{\celsius}$, y $r_i$ y $r_o$ los radios internos y externos respectivamente.
                                                     ^
$

Latest debian package was used:

$ pandoc -v
pandoc 2.1.3
Compiled with pandoc-types 1.17.4.2, texmath 0.10.1.1, skylighting 0.7.0.2
Default user data directory: /home/gtheler/.pandoc
Copyright (C) 2006-2018 John MacFarlane
Web:  http://pandoc.org
This is free software; see the source for copying conditions.
There is no warranty, not even for merchantability or fitness
for a particular purpose.

This bug error was first posted in the pandoc-discuss mailing list and jgm did confirm it was a bug.

@jgm
Copy link
Owner

jgm commented Apr 21, 2018 via email

jgm added a commit that referenced this issue May 8, 2018
This fixes the main problem in #4576.
There is still an issue about `\SI`, but that's a separate issue.
@jgm jgm closed this as completed in 44f1c72 May 8, 2018
@jgm
Copy link
Owner

jgm commented May 8, 2018

There is still a residual issue, shown by the following:

% pandoc -f latex --mathml
$\SI{866}{\kilogram\per\cubic\meter}$
[WARNING] Could not convert TeX math '\SI{866}{\kilogram\per\cubic\meter}', rendering as TeX:
  \SI{866}{\kilogram\per\cubic\meter}
     ^
  unexpected "{"
  expecting "%", "\\label", "\\nonumber" or whitespace
<p><span class="math inline">$\SI{866}{\kilogram\per\cubic\meter}$</span></p>

This is really an issue in jgm/texmath, which doesn't support the \SI command. Feel free to open an issue about this there.

@gtheler
Copy link
Author

gtheler commented May 8, 2018

thanks for your time

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

3 participants