以下 MWE 工作正常:
\documentclass{article}
%\usepackage[ngerman]{babel}
\usepackage{tikz}
\usetikzlibrary{quotes}
%\usetikzlibrary{babel}
\begin{document}
\begin{tikzpicture}
\coordinate["$A$" below] (A) at (0,0);
\end{tikzpicture}
foo \marginpar{%
\begin{tikzpicture}
\coordinate["$A$" below] (A) at (0,0);
\end{tikzpicture}}
\end{document}
但是,如果我取消注释babel
,marginpar 中的引号会导致错误:
Package pgfkeys Error: I do not know the key '/tikz/"$A$"below' and I am going to ignore it. Perhaps you misspelled it.
我能做什么(除了使用更长的标准语法而不是带引号的简短形式)?
答案1
您可以在创建边缘图像之前关闭速记功能,然后再打开,但这需要在之前完成\marginpar
。
\documentclass{article}
\usepackage[ngerman]{babel}
\usepackage{tikz}
\usetikzlibrary{quotes,babel}
\begin{document}
\begin{tikzpicture}
\coordinate["$A$" below] (A) at (0,0);
\end{tikzpicture}
foo \shorthandoff{"}\marginpar{%
\begin{tikzpicture}
\coordinate["$A$" below] (A) at (0,0);
\end{tikzpicture}%
}
\end{document}