考虑以下代码:
\documentclass{article}
%\usepackage[latvian]{babel}
\usepackage{tikz}
\usetikzlibrary{angles, quotes}
\begin{document}
\begin{tikzpicture}
\coordinate(A) at (0, 0);
\coordinate(B) at (1, 1);
\coordinate(C) at (1, 0);
\draw pic [draw, "$\theta_{p}$" font=\tiny] {angle=A--B--C};
\end{tikzpicture}
\end{document}
如果我取消注释该行
%\usepackage[latvian]{babel}
我收到一个错误:
(/usr/local/texlive/2018/texmf-dist/tex/latex/latexconfig/epstopdf-sys.cfg))
! Missing \endcsname inserted.
<to be read again>
\theta
l.12 "$\theta_{p}$" font=\tiny]
{angle=A--B--C};
问题是什么?如何解决?
@marmot 提出的解决方案在一篇文章中有效。现在,考虑 beamer 中的相同示例:
\documentclass{beamer}
\usepackage[latvian]{babel}
\usepackage{tikz}
\usetikzlibrary{angles, quotes, babel}
\begin{document}
\begin{frame}
\begin{tikzpicture}
\coordinate(A) at (0, 0);
\coordinate(B) at (1, 1);
\coordinate(C) at (1, 0);
\draw pic [draw, "$\theta_{p}$" font=\tiny] {angle=A--B--C};
\end{tikzpicture}
\end{frame}
\end{document}
即使使用 tikz 库,我们也会遇到类似的问题babel
:
(/usr/local/texlive/2018/texmf-dist/tex/latex/translator/translator-theorem-dic
tionary-English.dict) (./latvianpres.nav)
! Missing \endcsname inserted.
<to be read again>
\theta
l.13 \end{frame}