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

Compilation hangs #31

Open
jondoesntgit opened this issue Nov 30, 2016 · 6 comments
Open

Compilation hangs #31

jondoesntgit opened this issue Nov 30, 2016 · 6 comments

Comments

@jondoesntgit
Copy link

jondoesntgit commented Nov 30, 2016

Hello,

When I use pdflatex on the following code, compilation never completes.

\begin{mmaCell}{Output}
    \mmaFrac{1}{4} \
  (-\mmaFrac{\mmaSup{e}{-\mmaFrac{\mmaSup{(-I0+ID)}{2}}{2 \
  \mmaSup{s0}{2}}} \
  \mmaSqrt{\mmaFrac{2}{\(\pi\)}}}{s0}+\mmaFrac{\mmaSup{e}{-\mmaFrac{\m\
maSup{(I1-ID)}{2}}{2 \mmaSup{s1}{2}}} \mmaSqrt{\mmaFrac{2}{\(\pi\)}}}{s1})
\end{mmaCell}

Any idea why it hangs?

@jkuczm
Copy link
Owner

jkuczm commented Nov 30, 2016

You have newlines in places where they shouldn't be. Especially \mmaSup command is split between 5th and 6th line:

...\m\
maSup{...

Also due to some peculiarities of listings - fancyvrb interface, newlines can't be used inside formatting commands like \mmaFrac, and too many formatting commands can't be used in single line.

There are two main cases when listings in mmacells is useful: automatic styling of identifiers, and replacements of infix operators, none seems to be applicable here, so you can switch off listings by using uselistings=false option:

\documentclass[12pt]{article}

\usepackage{mmacells}

\begin{document}

\begin{mmaCell}[uselistings=false]{Output}
\mmaFrac{1}{4}(-\mmaFrac{\mmaSup{e}{-\mmaFrac{\mmaSup{(-I0+ID)}{2}}{2 \mmaSup{s0}{2}}} \mmaSqrt{\mmaFrac{2}{\(\pi\)}}}{s0}\
+ \mmaFrac{\mmaSup{e}{-\mmaFrac{\mmaSup{(I1-ID)}{2}}{2 \mmaSup{s1}{2}}} \mmaSqrt{\mmaFrac{2}{\(\pi\)}}}{s1})
\end{mmaCell}

\end{document}

Those excessive newlines are usually added by Mathematica. Depending on how you transfer string with TeX code from Mathematica to outside world, there are different ways to avoid them.

Related to jkuczm/MathematicaCellsToTeX#20.

@jondoesntgit
Copy link
Author

jondoesntgit commented Nov 30, 2016 via email

@jkuczm
Copy link
Owner

jkuczm commented Nov 30, 2016

Again this error most probably originates in listings - fancyvrb interface, try uselistings=false, but without code that gives this error it's hard to say.

@jkuczm
Copy link
Owner

jkuczm commented Nov 30, 2016

Or did you mean that code that I posted above gives you this error?

@jondoesntgit
Copy link
Author

jondoesntgit commented Nov 30, 2016 via email

@jkuczm
Copy link
Owner

jkuczm commented Nov 30, 2016

Could you post full .log file produced by compilation?

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