Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Missing character: There is no ; in font nullfont! #751

Closed
nschloe opened this issue Feb 15, 2021 · 4 comments
Closed

Missing character: There is no ; in font nullfont! #751

nschloe opened this issue Feb 15, 2021 · 4 comments

Comments

@nschloe
Copy link

nschloe commented Feb 15, 2021

When using pgfplots with tectonic, I'm getting errors like

Running TeX ...
warning: c.tex:16: Missing character: There is no ; in font nullfont!
warning: could not represent character ";" (0x3b) in font "nullfont"
warning:   you may need to load the `fontspec` package and use (e.g.) \setmainfont to
warning:   choose a different font that covers the unrepresentable character(s)

MWE:

\documentclass{article}

\usepackage{pgfplots}

\begin{document}

% warning
% \begin{tikzpicture}
% \begin{axis}
% ;
% \end{axis}
% \end{tikzpicture}

% warning
\begin{tikzpicture}
\begin{axis}[]
\draw[draw=none,fill=red] (axis cs:-0.4,0) rectangle (axis cs:-0.1,3.2);
\addlegendimage{ybar,ybar legend,draw=none,fill=red};
\end{axis}
\end{tikzpicture}

% no warning
% \begin{tikzpicture}
% \begin{axis}[]
% \addplot [
% red,
% domain=-3e-3:3e-3,
% samples=201,
% ]
% {exp(-x^2 / (2e-3^2)) / (1e-3 * sqrt(2*pi))};
% \end{axis}
% \end{tikzpicture}

\end{document}

It is indeed possible to remove some semicolons in the tikzpicture, but the official documentation uses semicolons everywhere. (They don't hurt.) pdflatex doesn't warn, either.

@pkgw
Copy link
Collaborator

pkgw commented Feb 16, 2021

Thanks for reporting. Are the results OK or is there something wrong with them? I think this might be a case where Tectonic is just surfacing a warning that normally remains hidden.

@nschloe
Copy link
Author

nschloe commented Feb 16, 2021

Output looks okay. The weird thing is that this

\draw[draw=none,fill=red] (axis cs:-0.4,0) rectangle (axis cs:-0.1,3.2);
\addlegendimage{ybar,ybar legend,draw=none,fill=red};

gives the warning, but when removing both or either one of the semicolons, the warning goes away.

@blefloch
Copy link

This is not a bug.

The \draw command (from the tikz package) expects to be ended by a semicolon, but \addlegendimage from pgfplots does not expect a semicolon. So the second semicolon gets typeset. But the tikzpicture environment sets the font to \nullfont to avoid accidentally typesetting text outside of the tikz commands, so the semicolon gets typeset in \nullfont, which does not have any character, hence the Missing character information message.

When compiling with pdflatex/xelatex/lualatex instead of tectonic, this information message is only put in the log. (This default behavior can be changed by putting \tracinglostchars=2 near the start of the file, which makes the information message appear in the terminal too.) The only difference in tectonic is to show the message more explicitly, which I think is a better default.

If you remove the second semicolon, it doesn't get typeset, so there is no message. If you remove the first one, the \draw command ends at the second semicolon (since the first is missing), so there is no message (it's surprising that there is no error, but not relevant here).

@nschloe
Copy link
Author

nschloe commented May 28, 2021

Thanks @blefloch for the concise explanation!

The only difference in tectonic is to show the message more explicitly, which I think is a better default.

I agree. Let's close this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants