我正在使用以下代码
\documentclass{scrartcl}
\usepackage{german}
% ^^^^^^^^^^^^
% This is where the error comes from
\usepackage{tikz}
\usetikzlibrary{calc, patterns, angles, quotes}
\begin{document}
Die Werte der \textbf{trigonometrischen Funktionen} für beliebige Winkel $\alpha \in R$ definiert man anhand des Einheitskreises mit Radius 1 und Mittelpunkt $(0, 0)$.
% ^^^
% Regardless of whether or not there is an 'ü' here, it does not work.
\begin{tikzpicture}[scale=1.5, >=stealth]
% cordinates
\coordinate[label=below right:$0$] (o) at (0.0,0);
\coordinate[label=below left: $x$] (x) at (1.5,0);
\coordinate[label=below left: $y$] (y) at (0,1.5);
% axis
\draw[->] (-1.5,0) -- (x);
\draw[->] (0,-1.5) -- (y);
% circle
\draw (o) circle (1cm)
(1,0) node[below right] {$1$};
\draw[thick] (o) -- (125:1) coordinate[label=left:{$(\cos\alpha, \sin\alpha)$}] (p);
% labels
\path[draw=gray, densely dashed, very thin]
(p) -- ([yshift=-1] p |- o) node[below] {$\cos\alpha$}
(p) -- ([xshift= 1] p -| o) node[right]{$\sin\alpha$};
\pic[draw,"$\alpha$",angle radius=5mm,angle eccentricity=1.3,->]{angle=x--o--p};
\end{tikzpicture}
\end{document}
按照建议我的另一个问题如果我不使用,代码确实可以工作\usepackage{german}
,但是,如果我使用,我会收到错误
!缺少插入的 \endcsname。\errhelp l.12 ...nate[label=below right:$0$] (o) at (0.0,0) ;?
这是为什么?有什么方法可以解决这个问题或者有其他的替代方案吗german
?
答案1
该german
软件包已经过时很久了。使用\usepackage[ngerman]{babel}
和 \usetikzlibrary{babel}
而是为了防止因使用特殊简写和特定语言的活动字符而导致的错误tikz
。
也可使用in \mathbb{R}
而不是\in R
。
\documentclass{scrartcl}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage[ngerman]{babel}
% ^^^^^^^^^^^^
% This is where the error comes from
\usepackage{tikz}
\usetikzlibrary{calc, patterns, angles, quotes,babel}
\usepackage{amssymb}
\begin{document}
Die Werte der \textbf{trigonometrischen Funktionen} für beliebige Winkel $\alpha \in \mathbb{R}$ definiert man anhand des Einheitskreises mit Radius 1 und Mittelpunkt $(0, 0)$.
% ^^^
% Regardless of whether or not there is an 'ü' here, it does not work.
\begin{tikzpicture}[scale=1.5, >=stealth]
% cordinates
\coordinate[label=below right:$0$] (o) at (0.0,0);
\coordinate[label=below left: $x$] (x) at (1.5,0);
\coordinate[label=below left: $y$] (y) at (0,1.5);
% axis
\draw[->] (-1.5,0) -- (x);
\draw[->] (0,-1.5) -- (y);
% circle
\draw (o) circle (1cm)
(1,0) node[below right] {$1$};
\draw[thick] (o) -- (125:1) coordinate[label=left:{$(\cos\alpha, \sin\alpha)$}] (p);
% labels
\path[draw=gray, densely dashed, very thin]
(p) -- ([yshift=-1] p |- o) node[below] {$\cos\alpha$}
(p) -- ([xshift= 1] p -| o) node[right]{$\sin\alpha$};
\pic[draw,"$\alpha$",angle radius=5mm,angle eccentricity=1.3,->]{angle=x--o--p};
\end{tikzpicture}
\end{document}