mmacells icon indicating copy to clipboard operation
mmacells copied to clipboard

Compilation hangs

Open jondoesntgit opened this issue 8 years ago • 6 comments

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?

jondoesntgit avatar Nov 30 '16 00:11 jondoesntgit

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.

jkuczm avatar Nov 30 '16 12:11 jkuczm

Is there any way to get around "Dimension too large"

On 30 Nov 2016, at 4:07, Jakub Kuczmarski wrote:

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 may be ways to avoid them.

Related to jkuczm/MathematicaCellsToTeX#20.

-- You are receiving this because you authored the thread. Reply to this email directly or view it on GitHub: https://github.com/jkuczm/mmacells/issues/31#issuecomment-263858232

Jonathan Wheeler jamwheeler.com fb.com/jondoesntpost twitter.com/jondoesnttweet

jondoesntgit avatar Nov 30 '16 16:11 jondoesntgit

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 avatar Nov 30 '16 17:11 jkuczm

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

jkuczm avatar Nov 30 '16 17:11 jkuczm

Hey Jakub,

Above code gives the error

jondoesntgit avatar Nov 30 '16 19:11 jondoesntgit

Could you post full .log file produced by compilation?

jkuczm avatar Nov 30 '16 20:11 jkuczm