# \nullfont in mathmode

I made some experiments with TikZ like

\documentclass{minimal}
\usepackage{tikz}
\begin{document}
\tikz \color{blue}  $(a+b)^n$ $n \choose r$; % \tikz Test ; gives nothing
\end{document}


We get a blue result but in a box with null dimensions.

The pgfmanual gives :

Next, the contents of the environment is processed and the graphic commands therein are put into a box. Non-graphic text is suppressed as well as possible, but non-pgf commands inside a {tikzpicture} environment should not produce any “output” since this may totally scramble the positioning system of the backend drivers. The suppressing of normal text, by the way, is done by temporarily switching the font to \nullfont. You can, however, “escape back” to normal TEX typesetting. This happens, for example, when you specify a node.

So my first idea is that \nullfont works only in text mode and not in math mode. I would like to know if my first thought is correct? and what is the equivalent of \nullfont in mathmode?

• put the math into a hbox and don't use it – user2478 Jun 29 '12 at 14:53
• @Herbert Yes I agree with you. I don't want to use it. I am interesting to know if there is a macro for math mode equivalent to \nullfont. I am preparing a paper on TikZ. I try to consider the most common mistakes and give valid explanations. Here I wanted to extend the response given by the manual. – Alain Matthes Jun 29 '12 at 16:09

well.... I supposed the nearest equivalent is to set the text script and scriptscript font to null in all 16 math families

\everymath{%
\loop
\count0=0
\ifnum\count0<16
\textfont\count0\nullfont
\scriptfont\count0\nullfont
\scriptscriptfont\count0\nullfont

! Math formula deleted: Insufficient symbol fonts.

• You can say \newfont\dummyfont=dummy and use \dummyfont instead of \nullfont (dummy has enough \fontdimen parameters, it was devised for syntax check in amstex.tex. – egreg Jun 29 '12 at 14:37
• It was only curiosity because it is surprising. I never use \nullfont, I see this macro in the pgfmanual for the first time. Do you know other application of this macro? – Alain Matthes Jun 29 '12 at 16:18