loopspace / tikzmark

The dread tikzmark arrives on github
14 stars 3 forks source link

Tikzmark writes semicolon in nullfont #1

Closed chrmatt closed 6 years ago

chrmatt commented 7 years ago

Using \tikzmark causes the following to appear in the log file:

Missing character: There is no ; in font nullfont!

Can be reproduced with the following code:

\documentclass{article}
\usepackage{tikz}
\usetikzlibrary{tikzmark}

\begin{document}
    Test.\tikzmark{a}
\end{document}

I'm using tikzmark version 1.2 with MiKTeX.


Edit: I just realized that there is a newer version on GitHub (which is not yet on CTAN) that solves the issue above. To provoke the nullfont issue with the newer version, more sophisticated code is necessary:

\documentclass{article}
\usepackage{tikz}
\usetikzlibrary{fit,tikzmark}

\begin{document}
    Test.\tikzmark{a}
    \tikz[overlay,remember picture]\tikzmark{b}{(pic cs:a)} {};
    \tikz[overlay,remember picture]\node[draw] at (pic cs:b) {};
\end{document}
loopspace commented 6 years ago

(My apologies for not responding to this earlier - I missed the notification.)

The message Missing character: There is no ; in font nullfont! is caused by a tikz command that "does nothing". You can get the same by just typing \tikz;.

Probably \tikzmark produced this originally because internally it expanded to effectively an empty \tikz;. The alternative syntax for \tikz; is \tikz{...} and this doesn't produce the nullfont message. \tikzmark now uses this syntax (to avoid issues with catcodes) and so no longer produces the nullfont message.

In your second example, the second line becomes \tikz; because it does no drawing, it only defines a \tikzmark. So it produces that message. Thus this isn't really a \tikzmark issue.

Nevertheless, in investigating this then I found some other characters that were getting into the wrong place so thanks for getting me to look at the log file!

chrmatt commented 6 years ago

Thanks for the explanation!