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

It requires four backslash for a newline in math environment #295

Closed
emptymalei opened this issue Jun 5, 2014 · 3 comments
Closed

It requires four backslash for a newline in math environment #295

emptymalei opened this issue Jun 5, 2014 · 3 comments

Comments

@emptymalei
Copy link

demo page

My source code is

\begin{align}
&\delta(x) = \begin{cases} + \infty, &\qquad x=0 \\ 0, &\qquad x\neq 0 \end{cases} \\
&\int_{-\infty}^{+\infty} \delta(x) dx =1
\end{align}

I generated the book and the tex source reads like this

\begin{align}
&\delta(x) = \begin{cases} + \infty, &\qquad x=0 \ 0, &\qquad x\neq 0 \end{cases} \
&\int_{-\infty}^{+\infty} \delta(x) dx =1
\end{align}

It's kind of eats one of my backslashes. Any fix to this?


BTW, the pdf generated doesn't render math. See this book for an example.

@ErnWong
Copy link

ErnWong commented Jun 9, 2014

Hello. I think you need to escape that slash, so instead of \\, you will need \\\' or\'.

That also means that \[x^2\] needs to become \\[x^2\\].

Also, MathJax uses JavaScript to typeset equations, which is done after the page is loaded. It does this to match the font size with the surrounding x-height (to make it look pretty!). This probably explains why math is not rendered in pdf, for now.

@ErnWong
Copy link

ErnWong commented Jun 9, 2014

I guess it's possible to create a plugin which helps you convert all backslashes to two within mathematics, but that might be undesirable as it causes inconsistent markup.

@emptymalei
Copy link
Author

i think i'll just go back to sphinx/readthedocs. gitbook is a very nice way to write just words but not formula, for now.

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

3 participants