TikZ 图表无法在 classicthesis 中编译

TikZ 图表无法在 classicthesis 中编译

你好,我正在使用 Andre Miede 的 classicthesis 模板,可以从以下位置下载这里。一切顺利,但在尝试包含 Tikz 图形时,我遇到了意外错误。此错误指出:

! Argument of \language@active@arg> has an extra }.
<inserted text> 
                \par 
l.128 \draw [arrows=<->, shorten >=3.5pt]
                                          (3.5,2) arc (0:45:1.5) node[midway...
I've run across a `}' that doesn't seem to match anything.
For example, `\def\a#1{...}' and `\a}' would produce
this error. If you simply proceed now, the `\par' that
I've just inserted will cause me to report a runaway
argument that might be the root of the problem. But if
your `}' was spurious, just type `2' and it will go away.

我尝试使用scrreprt类并调用classicthesis包在不同的文档中编译这个 Tikz 图形,但它在没有任何警告的情况下显示了该图形。

Tikz 图形的代码是:

\begin{tikzpicture}

\draw[thick, rounded corners=8pt] (1.74,1.5)-- (1.75, 2) --
(2,2.5)--(2.25,2)--(2.25,1.5);
\draw[thick] (1.5,1.5)-- (2.5,1.5);

\fill[pattern=north east lines] (1.5,1) rectangle (2.5,1.5);

\draw[arrows=->,very thick,black] (0,0) -- (5,0) node[right] {$x$};
\draw[arrows=->,very thick,black] (0,0) -- (0,5) node[left] {$y$};


\draw[-,black] (2,2) -- (4,2);

\draw [thick, double distance=1.5mm] (2,2)--(4,4);
\filldraw [thick, fill=white] (2,2) circle (5pt) node[below,left,xshift=-0.2cm] {$A$};
\fill[thick, black] (2,2) circle (2pt);
\filldraw [thick, fill=white] (4,4) circle (5pt) node[above,right,yshift=0.3cm] {$B$};
\fill[thick, black] (4,4)circle (2pt);

\draw [arrows=<->, shorten >=3.5pt] (3.5,2) arc (0:45:1.5) node[midway,fill=white] {$\theta$};
\end{tikzpicture}

classicthesis-config在调用classicthesis包后在 texfile 中添加了以下几行

\usepackage{tikz}
\usetikzlibrary{patterns}
\usetikzlibrary{arrows}

有人知道是什么原因导致了这种行为,或者知道如何修复它吗?抱歉没有发布 MWE,但需要下载整个模板。

编辑调用 tikz 库babel我可以编译我的图形,但是当我尝试使用 subfig 包选项将其放入图形环境中时会出现相同的错误。

这是图中的代码,顺便说一下,这在另一个文档中编译成功,我也在使用\usepackage{subfig}

\begin{figure}
    \myfloatalign
    \subfloat[Coordenadas generalizadas de la barra $AB$, la cual se mueve en un solo plano.]
    {\label{fig:barraaba}%
\begin{adjustbox}{width=0.45\textwidth}
\begin{tikzpicture}
\draw[arrows=->,very thick,black] (0,0) -- (5,0) node[right] {$x$};
\draw[arrows=->,very thick,black] (0,0) -- (0,5) node[left] {$y$};

\draw[-,black] (2,2) -- (2,1);
\draw[-,black] (4,4) -- (4,5);

\draw[-,black] (4,4) -- (5,4);

\draw[-,black] (2,2) -- (4,2);

\draw[-,black] (2,2) -- (1.6,2.4);
\draw[-,black] (4,4) -- (3.6,4.4);

\draw [thick, double distance=1.5mm] (2,2)--(4,4);
\filldraw [thick, fill=white] (2,2) circle (5pt) node[below,left,xshift=-0.1cm] {$A$};
\fill[thick, black] (2,2) circle (2pt);
\filldraw [thick, fill=white] (4,4) circle (5pt) node[above,right,yshift=0.3cm] {$B$};
\fill[thick, black] (4,4)circle (2pt);

\draw[arrows=<->,black] (0,1.5) -- node[fill=white] {$x_A$} (2,1.5);
\draw[arrows=<->,black] (0,4.5) -- node[fill=white] {$x_B$} (4,4.5);

\draw[arrows=<->,black] (3.5,0) -- node[fill=white] {$y_B$} (3.5,2);
\draw[arrows=<->,black] (4.5,0) -- node[fill=white] {$y_B$} (4.5,4);

\draw [arrows=<->, shorten >=3.5pt] (3.5,2) arc (0:45:1.5) node[midway,fill=white] {$\theta$};

\draw[arrows=<->,black] (1.7,2.3) -- node[fill=white] {$r$} (3.7,4.3);

\end{tikzpicture}
\end{adjustbox}
} \quad
\subfloat[La barra $AB$ posee tres grados de libertad por ser un cuerpo rígido en el plano.]
{\label{fig:barraabb}%
\begin{adjustbox}{width=0.45\textwidth}
\begin{tikzpicture}
\draw[arrows=->,very thick,black] (0,0) -- (5,0) node[right] {$x$};
\draw[arrows=->,very thick,black] (0,0) -- (0,5) node[left] {$y$};

\draw[-,black] (2,2) -- (2,1);

\draw[-,black] (2,2) -- (4,2);


\draw [thick, double distance=1.5mm] (2,2)--(4,4);
\filldraw [thick, fill=white] (2,2) circle (5pt) node[below,left,xshift=-0.1cm] {$A$};
\fill[thick, black] (2,2) circle (2pt);
\filldraw [thick, fill=white] (4,4) circle (5pt) node[above,right,yshift=0.3cm] {$B$};
\fill[thick, black] (4,4)circle (2pt);

\draw[arrows=<->,black] (0,1.5) -- node[fill=white] {$x_A$} (2,1.5);
\draw[arrows=<->,black] (3.5,0) -- node[fill=white] {$y_B$} (3.5,2);

\draw [arrows=<->, shorten >=3.5pt] (3.5,2) arc (0:45:1.5) node[midway,fill=white] {$\theta$};


\end{tikzpicture}
\end{adjustbox}
} \quad
\subfloat[Al fijar uno de los extremos de la barra $AB$ pierde dos grados de libertad.]
{\label{fig:barraabc}%
\begin{adjustbox}{width=0.45\textwidth}
\begin{tikzpicture}

\draw[thick, rounded corners=8pt] (1.74,1.5)-- (1.75, 2) --
(2,2.5)--(2.25,2)--(2.25,1.5);
\draw[thick] (1.5,1.5)-- (2.5,1.5);

\fill[pattern=north east lines] (1.5,1) rectangle (2.5,1.5);

\draw[arrows=->,very thick,black] (0,0) -- (5,0) node[right] {$x$};
\draw[arrows=->,very thick,black] (0,0) -- (0,5) node[left] {$y$};


\draw[-,black] (2,2) -- (4,2);

\draw [thick, double distance=1.5mm] (2,2)--(4,4);
\filldraw [thick, fill=white] (2,2) circle (5pt) node[below,left,xshift=-0.2cm] {$A$};
\fill[thick, black] (2,2) circle (2pt);
\filldraw [thick, fill=white] (4,4) circle (5pt) node[above,right,yshift=0.3cm] {$B$};
\fill[thick, black] (4,4)circle (2pt);

\draw [arrows=<->, shorten >=3.5pt] (3.5,2) arc (0:45:1.5) node[midway,fill=white] {$\theta$};
\end{tikzpicture}
\end{adjustbox}
}
\caption[Barra $AB$ con movimiento plano.]{Barra $AB$ con movimiento plano.}\label{fig:barrab}
\end{figure}

相关内容