4

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
4

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
\advance\count0 by 1
\repeat}

But TeX doesn't really like setting math like that:

! Math formula deleted: Insufficient symbol fonts.

so... it depends what you want to do...

  • 2
    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
  • 1
    well it's a primitive rather than a macro it's the "zero" for a fontdef token. It is used internally to make sure (for example) that some "font" is assigned to \scriptfont5 even if you haven't assigned it. Probably just for ease of exposition, rather than describe lots of error conditions, all the edge cases act as if a font had been loaded but with no characters and a specified small set of font parameters. – David Carlisle Jun 29 '12 at 16: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.