Limit notation causes leaders not followed by proper glue error

I am a beginner at Latex, and I am trying to learn it to use for my math courses. Following is a minimal example of what's causing the problem. This works fine without Nath, but I want Nath to get better parentheses, among other things.

\documentclass[12pt,a4paper]{article}
\usepackage{nath}

\begin{document}

$$\lim_{T \to \infty} T$$

\end{document}


Is there another notation for limits when using Nath that I'm not aware of? If so, I can't seem to find any references of that in the Nath documentation.

• If you are a beginner (or even if not) I'd use normal latex math markup rather than nath it makes any expressions you use far more portable and usable. Nov 5, 2014 at 15:29
• Well yes, generally I agree with you that as a beginner it's best to stick to the defaults, but I think typing alot of \left(, \right) obfuscates the source code in such a degree that it's really hard to know where I am in my mathematical expressions. Nov 5, 2014 at 15:38
• It seems that the error is caused by \to; no error if \rightarrow is used. My advice is to consider nath as just an interesting attempt that's unfortunately incompatible with most packages. Nov 5, 2014 at 15:39
• Maybe you should start with plain math environment, and later maybe use amsmath e.g. that improves and ease many things (included parenthesis). I never used nath so I can't say a thing about it. Nov 5, 2014 at 15:40
• redefining everything to avoid typing \left is brave though, you should rarely need it anyway, just use suitable environments or commands that add it, eg using pmatrix rather than matrix not only adds \left( \right) it further fine tunes the spacing. Nov 5, 2014 at 15:50

I tried to compile an example in nath documentation:

\documentclass[12pt,a4paper]{article}
\usepackage{nath}

\begin{document}
$$A \to^f_{\text{isomorphism}} B, \qquad a \mapsto^f a’$$
\end{document}


and, while the output is as expected, LaTeX stops with the error message

! Leaders not followed by proper glue.
\mskip
l.6 A \to^f_{\text{isomorphism}} B
?


In order to be sure that possible recent changes have spoiled nath, I typeset the code using TeX Live 2009.

The conclusion is that \to is buggy. The same is for \ot, \otto and \mapsto. Maybe the bug can be fixed, but nath seems to be undeveloped since 2003.

Using \rightarrow is safe.

I can't recommend using nath. It's incompatible with several packages and offers much less than amsmath.

There is an error in nath.sty in the definition of \axis@@, which occurs in the definition of \longrightarrow@ which is invoked by \to (and other commands, including \mapsto). Here is what that definition is:

\def\axis@@{\mkern-4.5mu    %%% mkern setting adjusted 24 Sept. 2002
\axis@@@\mskip 3mu plus \arrow@expandability mu   %%% thanks to E.H. Lohse
\mkern-4.5mu}


The error is that \axis@@@ should be followed by \hfill, so here is what it should be:

\def\axis@@{\mkern-4.5mu    %%% mkern setting adjusted 24 Sept. 2002
\axis@@@\hfill\mskip 3mu plus \arrow@expandability mu   %%% thanks to E.H. Lohse
\mkern-4.5mu}


The added \hfill supplies "proper glue". When it is not present, the \cleaders command invoked by \axis@@@ sees an \mskip command, which is "improper glue".