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

Inline LaTeX is ignored in some output formats, but why not remove other LaTeX environments as well? #2860

Closed
ickc opened this issue Apr 18, 2016 · 9 comments

Comments

@ickc
Copy link
Contributor

ickc commented Apr 18, 2016

From the documentation:

Inline LaTeX is ignored in output formats other than Markdown, LaTeX, and ConTeXt.

How about other LaTeX codes?

e.g. the following Markdown files,

\begin{flushright}
testing
\end{flushright}

pandoc to html becomes

...
<body>
\begin{flushright}
testing
\end{flushright}
</body>
...

Why wasn't it be removed form the HTML output as well, even -R is not used?

@jgm
Copy link
Owner

jgm commented Apr 18, 2016

When I try this input with pandoc -f markdown -t html, I
get an empty file. Are you seeing something different?
What pandoc versionL

+++ ickc [Apr 17 16 21:59 ]:

From the documentation:

Inline LaTeX is ignored in output formats other than Markdown,
LaTeX, and ConTeXt.

How about other LaTeX codes?

e.g. the following Markdown files,

\begin{flushright}
testing
\end{flushright}

pandoc to html becomes

...

\begin{flushright} testing \end{flushright} ...

Why wasn't it be removed form the HTML output as well, even -R is not
used?


You are receiving this because you are subscribed to this thread.
Reply to this email directly or [1]view it on GitHub

References

  1. Inline LaTeX is ignored in some output formats, but why not remove other LaTeX environments as well? #2860

@ickc
Copy link
Contributor Author

ickc commented Apr 18, 2016

The command I used is actually this

pandoc -f markdown+mmd_header_identifiers+abbreviations+autolink_bare_uris+mmd_link_attributes+markdown_attribute+mmd_title_block+tex_math_double_backslash -S --base-header-level=1 --toc --toc-depth=6 -N --normalize -s --mathjax -t html5 -o 

I tried your bare command and it did becomes empty. I don't know where in the command I used above get it wrong. But since -R is not used I guess it is not the expected behavior?

@jgm
Copy link
Owner

jgm commented May 8, 2016

See #1938.
With --mathjax we include raw LaTeX blocks.

@ickc
Copy link
Contributor Author

ickc commented May 8, 2016

I see. Can you take a look at #2758 that @yihui said the raw LaTeX block is not included in his ePub output with --mathjax?

@ickc ickc closed this as completed May 8, 2016
@jgm
Copy link
Owner

jgm commented May 8, 2016

I'm not sure what's going on there. I just tried and the
'equation' environment did get transferred over to epub with
--mathjax. So I can't reproduce what he's describing.

+++ ickc [May 07 16 20:28 ]:

I see. Can you take a look at [1]#2758 that [2]@yihui said the raw
LaTeX block is not included in his ePub output with --mathjax?


You are receiving this because you commented.
Reply to this email directly or [3]view it on GitHub

References

  1. Suggestion: When MathJax Is Used, the LaTeX Environments Included Should Be More Selective (and Put in Math Class) #2758
  2. https://github.com/yihui
  3. Inline LaTeX is ignored in some output formats, but why not remove other LaTeX environments as well? #2860 (comment)

@ickc ickc reopened this May 8, 2016
@ickc
Copy link
Contributor Author

ickc commented May 8, 2016

Sorry I closed it too quickly. Now when I think about the reason I open this issue is about an environment like this:

\begin{flushright}
testing
\end{flushright}

Then the problem is that pandoc include "too much" LaTeX environments. This is closely related to #2758, that only a certain environments should be included in MathJax output.

Quoting from MathJax documentation:

LaTeX environments of the form \begin{XXX} ... \end{XXX} are provided where XXX is one of the following:

align [AMSmath]
align* [AMSmath]
alignat [AMSmath]
alignat* [AMSmath]
aligned [AMSmath]
alignedat [AMSmath]
array
Bmatrix
bmatrix
cases
CD AMSmath
eqnarray
eqnarray*
equation
equation*
gather [AMSmath]
gather* [AMSmath]
gathered [AMSmath]
matrix
multline [AMSmath]
multline* [AMSmath]
pmatrix
smallmatrix AMSmath
split [AMSmath]
subarray AMSmath
Vmatrix
vmatrix

Probably one of these 2 issues (#2758 and #2860) should be closed since they are describing the same issue.

@ickc
Copy link
Contributor Author

ickc commented May 10, 2016

I'm closing this in favor of #2758. Hope that you don't mind.

@ickc ickc closed this as completed May 10, 2016
@jgm
Copy link
Owner

jgm commented May 10, 2016

IT might be worth reproducing the table and the link to MathJax documentation in the other issue.

@ickc
Copy link
Contributor Author

ickc commented May 10, 2016

IT might be worth reproducing the table and the link to MathJax documentation in the other issue.

It is already there. (and I changed the title over there to reflect the situation)

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