# chemfig and MinionPro problem

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!

-

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).
@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 '14 at 16:46