Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

Well, this is rather minor, but

\documentclass{minimal}
\usepackage{chemfig}
\usepackage{MinionPro}
\begin{document}
Hello, World!
\chemfig{*6(=N-*6(-N-=N)=--N-)}
\end{document}

produces

! Undefined control sequence.
<everyeof> @nil

but the output is fine, so far as I can tell. Why? (Btw, using MinionPro occasionally produces such errors with undefined this or that.)

Thanks!

share|improve this question

1 Answer 1

up vote 4 down vote accepted

This comes about because \chemfig sets up some processing to do at the end of every file that is read, with \everyeof{\@nil} (I'm not sure why it does this, but \@nil is intentionally undefined and latex programmers use it to denote the end of a list, so it seems chemfig wants to automatically terminate some list at the end of an input file). Meanwhile, the minionpro font files are loaded "on-demand" (like other latex font files (except computer modern, which is "preloaded")).

In your example, the first time a mathmode character is needed happens to be inside \chemfig so the font file is loaded but then at the end of the file there will be this \@nil inserted, causing the observed error.

One workaround is to force the font to load before your \chemfig command. For example \setbox0\vbox{$N$} will do so without producing any output (by typesetting a mathmode $N$ and then discarding the result).

share|improve this answer
    
Thanks for the quick response! –  JohnJamesSmith Aug 2 '11 at 16:13
    
@lev-bishop by any chance do you have a reference for @nil ? I looked at the LaTeX Companion book but found none. –  Sergio Parreiras May 12 at 16:46

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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