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.

Please why does

\begin{document}
\begin{tikzpicture}
\foreach \x [remember=\x as \lastx (initially A)] in {B,...,H}{%
  $\overrightarrow{\lastx\x}$,
}
\end{tikzpicture}
\end{document}

give

Missing character: There is no , in font nullfont!

in the log file while in document body? Removing the comma (,) after $ relieves the warning.

share|improve this question
1  
It works for me. You probably need to update some packages. Please add \listfiles before \begin{document}, and post the file versions here. Alternatively, update your packages (and I hope you are not on a 2009 release). –  Peter Grill Nov 14 '12 at 20:13
    
@PeterGrill There are no errors or warnings, the commas are missing in the output and the .log file shows the lines about Missing character quoted in the question. –  Heiko Oberdiek Nov 14 '12 at 20:28

1 Answer 1

up vote 10 down vote accepted

The tikzpicture environment is not intended to put bare text there. It resets the font to \nullfont. The text needs to be placed, for example, as node text.

If you just want to have the \foreach loop, then you do not need the tikzpicture:

\documentclass{article}
\usepackage{tikz}
\begin{document}
\foreach \x [remember=\x as \lastx (initially A)] in {B,...,H}{%
  $\overrightarrow{\lastx\x}$\if\x H\else, \fi
}
\end{document}

Result

share|improve this answer
    
If you just want the \foreach loop with no tikzpictures in your document, you can use \usepackage{pgffor} instead of \usepackage{tikz}. –  Ignasi Nov 15 '12 at 8:25
    
OK, thanks. I first observed the warning when using \newforeach in \tikzpicture environment. I thought it was due to a bug in \newforeach until I got it replicated by \foreach. –  Ahmed Musa Nov 15 '12 at 20:27

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.