当将多语种的语言设置为德语时,会出现quotes
库问题:当使用整体作为参数时,按照第 511 页的建议TikZ
将标签交给角度会失败。pic
pgfmanual
tikzpicture
newcommand
下面我给出了三个例子:第一个按预期工作(tikzpicture
未在宏中使用),第二个引发错误(在宏中使用),第三个尝试通过使用选项来规避问题text=
,但结果没有角度标签。
\documentclass{article}
\usepackage{tikz}
\usetikzlibrary{angles, quotes}
\RequirePackage{polyglossia}
\setdefaultlanguage{german}
\newcommand{\figC}[1]{\begin{center}#1\end{center}}
\begin{document}
This one works due to 'quotes' library:
\begin{center}
\begin{tikzpicture}\shorthandoff{"}
\draw (2,0) coordinate (A) -- (0,0) coordinate (B) -- (1,1) coordinate (C)
pic ["$\alpha$", draw] {angle};
\end{tikzpicture}
\end{center}
This one throws an error:
\figC{\begin{tikzpicture}\shorthandoff{"}
\draw (2,0) coordinate (A) -- (0,0) coordinate (B) -- (1,1) coordinate (C)
pic ["$\alpha$", draw] {angle};
\end{tikzpicture}}
This one compiles but does not show the label (using 'text=' as I understood from pgfmanual p. 511):
\begin{center}
\begin{tikzpicture}
\draw (2,0) coordinate (A) -- (0,0) coordinate (B) -- (1,1) coordinate (C)
pic [text={$\alpha$}, draw] {angle};
\end{tikzpicture}
\end{center}
\end{document}
问题是:
- 我是否应该将此作为一个错误提交到某处,或者这是我的错误?
tikzpicture
当我想在宏中使用它时,我可以以某种方式保护它吗?- 或者还有其他建议吗?
答案1
在第三个例子中,您只能使用pic text
。text
可以使用 添加角度标签的选项pic text options
:
\documentclass{article}
\usepackage{tikz}
\usetikzlibrary{angles, quotes}
\RequirePackage{polyglossia}
\setdefaultlanguage{german}
\newcommand{\figC}[1]{\begin{center}#1\end{center}}
\begin{document}
\begin{center}
\begin{tikzpicture}
\draw (2,0) coordinate (A) -- (0,0) coordinate (B) -- (1,1) coordinate (C)
pic [pic text={$\alpha$},draw] {angle};
\end{tikzpicture}
\end{center}
\begin{center}
\begin{tikzpicture}
\draw (2,0) coordinate (A) -- (0,0) coordinate (B) -- (1,1) coordinate (C)
pic [pic text={$\alpha$},pic text options={red,font=\tiny}, draw] {angle};
\end{tikzpicture}
\end{center}
\end{document}