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

Latex math within \text within math causes parser to fail #1178

Closed
matthew-brett opened this issue Feb 27, 2014 · 3 comments
Closed

Latex math within \text within math causes parser to fail #1178

matthew-brett opened this issue Feb 27, 2014 · 3 comments

Comments

@matthew-brett
Copy link

Converting the following latex doc:

\begin{document}

Some text

$$
X^2 = \sum_{ij} \frac{(Y_{ij}-E_{ij})^2}{E_{ij}} \approx \chi^2_{(k-1)(m-1)} \
\text{under $H_0$}
$$

More text

$$
G = 2\sum_{ij} Y_{ij} \log \left(\frac{Y_{ij}}{E_{ij}}\right)
$$

\end{document}

causes the parser to give incorrect results to (e.g.) markdown (but also the json format):

Some text

$$ X^2^ = ~ij~ ^2^~(k-1)(m-1)~ $$More text$$ G = 2~ij~ Y~ij~ () $$

I think this is due to the \text{under $H_0$} math-within-math, because editing this part of the doc to \text{under H_0} gives the correct output:

Some text

$$X^2 = \sum_{ij} \frac{(Y_{ij}-E_{ij})^2}{E_{ij}} \approx \chi^2_{(k-1)(m-1)} \ \text{under H_0}$$

More text

$$G = 2\sum_{ij} Y_{ij} \log \left(\frac{Y_{ij}}{E_{ij}}\right)$$
@jgm
Copy link
Owner

jgm commented Feb 27, 2014

It's a known isssue. See
jgm/texmath#13

+++ Matthew Brett [Feb 26 14 17:36 ]:

Converting the following latex doc:
\begin{document}

Some text

$$ X^2 = \sum_{ij} \frac{(Y_{ij}-E_{ij})^2}{E_{ij}} \approx \chi^2_{(k-1)(m-1)} \text{under $H_0$} $$

More text

$$ G = 2\sum_{ij} Y_{ij} \log \left(\frac{Y_{ij}}{E_{ij}}\right) $$

\end{document}

causes the parser to give incorrect results to (e.g.) markdown (but
also the json format):
Some text

$$ X^2^ = ij ^2^(k-1)(m-1) $$More text$$ G = 2ij Yij () $$

I think this is due to the \text{under $H_0$} math-within-math, because
editing this part of the doc to \text{under H_0} gives the correct
output:
Some text

$$X^2 = \sum_{ij} \frac{(Y_{ij}-E_{ij})^2}{E_{ij}} \approx \chi^2_{(k-1)(m-1)} \text{under H_0}$$

More text

$$G = 2\sum_{ij} Y_{ij} \log \left(\frac{Y_{ij}}{E_{ij}}\right)$$


Reply to this email directly or [1]view it on GitHub.
[3044__eyJzY29wZSI6Ik5ld3NpZXM6QmVhY29uIiwiZXhwaXJlcyI6MTcwODk5NzgwNCwi
ZGF0YSI6eyJpZCI6MjY1NTQ3Mjh9fQ==--07f7edbbf4b9e8ab8e7da9fb0b892e949cac2
8c2.gif]

References

  1. Latex math within \text within math causes parser to fail #1178

@matthew-brett
Copy link
Author

Thought it might be but couldn't find it by searching - thanks.

@jgm
Copy link
Owner

jgm commented Aug 17, 2014

Moving to jgm/texmath#62. Closing this issue.

@jgm jgm closed this as completed Aug 17, 2014
jgm added a commit to jgm/texmath that referenced this issue Nov 29, 2016
E.g. `\text{if $y$ is greater than $0$}`

Text and math can nest indefinitely.

Closes #62.
Closes jgm/pandoc#1178.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants