3

Have a couple of documents with the following sort of construct:

\begin{equation}
y=\sqrt[n]{\prod_{i=1}^{n} x_{i}}
\end{equation}

Compiles/renders fine using 'standard' LaTeX, but fails miserably using LuaLaTeX. (I'm using MikTeX 2.9 for both).

Any suggestions? Here is a MWE to 'play with'. As noted, the problem arises because of the 'product' inside the square root. luaLaTeX seems to be having problems handling 'big expressions' nested within the square-root construct.

Thanks in advance.

\documentclass{article}
\usepackage{amsmath}

\begin{document}

This equation is properly rendered using a standard \LaTeX. However, it is not when compiled using lua\LaTeX.

\begin{equation*}
y=\sqrt[n]{\prod_{i=1}^{n} x_{i}}
\end{equation*}

This simpler expression compiles correctly.

\begin{equation*}
y=\sqrt[n]{x}
\end{equation*}

\end{document} 

OK, tried

\usepackage{unicode-math}
\setmathfont{Asana Math}

and it compiles fine, except I don't particular want to use Asana Math (given everything else is CM). So, for my (never-ending) edification, the * trick* (solution) hinges on using unicode?

It seems as if the problem (as originally described) relates specifically to the \prod operator. For example,

\begin{equation}
y=\sqrt[n]{\frac{x^n-y^n}{1+u^{2n}}}
\end{equation}

compiles/renders fine.


Here is what the PDF I'm rendering before adding the suggested unicode-math package.

http://canuck.dnr.cornell.edu/misc/mah-example.pdf

7
  • 4
    Welcome to TeX.SX! I get the same result with both engines; the horizontal line over the product seems misaligned where the two pieces connect, but it's a problem with the PDF viewer.
    – egreg
    Jul 2, 2012 at 15:26
  • @egreg I can reproduce the problem (with miktex and texlive 2012). And the problem is not directly related to \prod. I get it with \frac too if I put something big in its argument, e.g. \displaystyle\int and so force LaTeX to use the largesymbols font for the square root. Jul 2, 2012 at 16:20
  • @UlrikeFischer Can't test now on 2012; with 2009, 2010 and 2011 it's correct
    – egreg
    Jul 2, 2012 at 16:26
  • Looks like a bug I introduced in the latest LuaTeX, why such bugs are only found that late :(. Jul 2, 2012 at 18:03
  • @KhaledHosny: Is it possible to get corrected binaries into TL2012 at some point? Or are we stuck with this bug for a year?
    – Caramdir
    Jul 2, 2012 at 18:25

1 Answer 1

3

With LuaLaTeX try

\documentclass{article}
\usepackage{amsmath}
\usepackage{unicode-math}
\setmathfont{Latin Modern Math}

...
3
  • 1
    You don't need to set LMMath explicitly, it's loaded by default.
    – Caramdir
    Jul 2, 2012 at 18:21
  • 2
    @Caramdir: Not in pre-TL2012 versions of unicode-math. Jul 2, 2012 at 18:35
  • @KhaledHosny: I thought that it did that for some time now, but apparently that version of unicode-math never made it into TL2011.
    – Caramdir
    Jul 2, 2012 at 18:37

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.