我的目标是“干净”的编译,这就是为什么我想Missing ; in nullfont
在以下 MWE 中消除这个问题。一切都编译得很好,但有多达 5 个Missing character: There is no ; in nullfont
警告,我从以前的问题中知道,这通常是由 TikZ 代码中多余的“;”引起的。然而,我在我的代码中没有看到问题。
第一个是Fig01.tikz
:
\begin{tikzpicture}
%\font\nullfont=cmr10
\newcommand\bulkCoordinates[0]{
\coordinate (ex) at (10ex,0);
\coordinate (v1) at (origin);
\coordinate (v2) at ($(v1)!1!-135:(ex)$);
\coordinate (v9) at ($(v1)!1!-45:(ex)$);
\coordinate (v8) at ($0.5*(v2)+0.5*(v9)$);
\coordinate (v3) at ($(v2)!1!-120:(v8)$);
\coordinate (v7) at ($(v2)!1!-60:(v8)$);
\coordinate (v10) at ($(v9)!1!60:(v8)$);
\coordinate (v11) at ($(v9)!1!120:(v8)$);
\coordinate (v4) at ($(v3)!0.8!-115:(v7)$);
\coordinate (v6) at ($(v3)!0.8!-55:(v7)$);
\coordinate (v5) at ($0.5*(v4)+0.5*(v6)$);
}
\tikzstyle{mystyle}=[
circle,draw,
%TODO
%decorate, decoration={random steps,segment length=0.5pt,amplitude=0.1pt},
font=\small\ttfamily,minimum width=1.2em,inner sep=0pt
]%
\tikzstyle{myedgestyle}=[
%TODO
%decorate, decoration={random steps,segment length=0.5pt,amplitude=0.1pt}
]%
\begin{scope}
\coordinate (origin) at (0,0);
\bulkCoordinates
\foreach \x in {1,2,3,4,6,7,8,9,10,11} {
\ifthenelse{\x = 1 \OR \x = 2 \OR \x = 4 \OR \x = 6 \OR \x = 10}
{\node[mystyle,fill=podo02,text=white] (V\x) at (v\x) {\x}}
{\node[mystyle] (V\x) at (v\x) {\x}}
;
}
\foreach \p/\q in {V1/V2,V1/V8,V1/V8,V2/V3,V2/V7,V3/V4,V3/V6,V1/V9,V9/V10,V9/V11} {
\draw (\p) edge[myedgestyle] (\q);
}
\node (picLabel) at ($(V1)!1!35:(V4)$) {(a)};
\node (metkaT) at ($(V1)!1!-45:(V2)$) {$T$}; %OFFENDING LINE
\end{scope}
\begin{scope}[xshift=28ex]
\coordinate (origin) at (0,0);
\bulkCoordinates
\foreach \x in {1,2,3,4,6,7,8,9,10,11} {
\ifthenelse{\x = 1 \OR \x = 2 \OR \x = 4 \OR \x = 6 \OR \x = 10}
{\node[mystyle,fill=podo02,text=white] (V\x) at (v\x) {\x}}
{}
;
}
\foreach \p/\q in {V1/V2,V2/V4,V2/V6,V1/V10} {
\draw (\p) edge[myedgestyle] (\q);
}
\node (picLabel) at ($(V1)!1!35:(V4)$) {(b)};
\node (metkaT) at ($(V1)!1!-45:(V2)$) {$T_X$}; %OFFENDING LINE
\end{scope}
\结束{tikzpicture}
整个内容位于以下包装器内:
\documentclass{standalone}
\usepackage{tikz}
\usepackage{ifthen}
\usetikzlibrary{matrix,arrows.meta,shadings,patterns,tikzmark}
\usetikzlibrary{backgrounds,shadings,shadows,shapes,chains,calc,positioning,decorations.pathreplacing}
\usetikzlibrary{calc,arrows,decorations.pathmorphing,intersections,fit,patterns,fadings}
\usetikzlibrary{calc,arrows,decorations.pathmorphing,intersections,decorations.markings}
\usepackage{xcolor}
\definecolor{podo01}{RGB}{240,228,66} %Yellow
\definecolor{podo02}{RGB}{0,114,178} %Blue
\definecolor{podo03}{RGB}{0,158,115} %Bluish green
\definecolor{podo04}{RGB}{230,159,0} %Orange
\definecolor{podo05}{RGB}{86,180,233} %Sky blue
\definecolor{podo06}{RGB}{0,0,0} %Black
\definecolor{podo07}{RGB}{213,94,0} %Vermillion
\definecolor{podo08}{RGB}{204,121,167} %Reddish purple
\begin{document}
\input{Fig01.tikz}
\end{document}
通过阅读日志,我标记了OFFENDING LINE
暗示问题的地方。
答案1
问题出在
\foreach \x in {1,2,3,4,6,7,8,9,10,11} {
\ifthenelse{\x = 1 \OR \x = 2 \OR \x = 4 \OR \x = 6 \OR \x = 10}
{\node[mystyle,fill=podo02,text=white] (V\x) at (v\x) {\x}}
{}
;
对于非选择的情况,有一个分号。
\foreach \x in {1,2,3,4,6,7,8,9,10,11} {
\ifthenelse{\x = 1 \OR \x = 2 \OR \x = 4 \OR \x = 6 \OR \x = 10}
{\node[mystyle,fill=podo02,text=white] (V\x) at (v\x) {\x};}
{}