Quiver를 사용하고 있는데 곡선 화살표가 있는 다이어그램을 만드는 데 문제가 있습니다. 예를 들어, 이것은 내 문서입니다.
\begin{tikzcd}[ampersand replacement=\&,column sep=2.25em]
A \& B
\arrow[curve={height=-12pt}, from=1-1, to=1-2]
\end{tikzcd}
그러나 컴파일되지 않습니다. TexMaker는 다음과 같이 말합니다. 패키지 tikz 오류: + 또는 - 예상, \tikz@curveCdot 사용이 해당 정의와 일치하지 않습니다.
나는 서문에서 tikz
및 를 둘 다 사용합니다.tikz-cd
MWE :
\documentclass{article}
\usepackage[french,english]{babel}
\usepackage{tikz-cd}
\usetikzlibrary{calc}
% A TikZ style for curved arrows of a fixed height, due to AndréC.
\tikzset{curve/.style={settings={#1},to path={(\tikztostart)
.. controls ($(\tikztostart)!\pv{pos}!(\tikztotarget)!\pv{height}!270:(\tikztotarget)$)
and ($(\tikztostart)!1-\pv{pos}!(\tikztotarget)!\pv{height}!270:(\tikztotarget)$)
.. (\tikztotarget)\tikztonodes}},
settings/.code={\tikzset{quiver/.cd,#1}
\def\pv##1{\pgfkeysvalueof{/tikz/quiver/##1}}},
quiver/.cd,pos/.initial=0.35,height/.initial=0}
\begin{document}
\begin{tikzcd}[ampersand replacement=\&]
A \& B
\arrow[curve={height=-12pt}, from=1-1, to=1-2]
\end{tikzcd}
\end{document}
답변1
라이브러리 를 로드하는 것을 잊었습니다 babel
.
\documentclass{article}
\usepackage[T1]{fontenc}
\usepackage[french,english]{babel}
\usepackage{tikz-cd}
\usetikzlibrary{calc,babel} % <--- IMPORTANT!
% A TikZ style for curved arrows of a fixed height, due to AndréC.
\tikzset{
curve/.style={
settings={#1},
to path={
(\tikztostart)
.. controls ($(\tikztostart)!\pv{pos}!(\tikztotarget)!\pv{height}!270:(\tikztotarget)$)
and ($(\tikztostart)!1-\pv{pos}!(\tikztotarget)!\pv{height}!270:(\tikztotarget)$)
.. (\tikztotarget)\tikztonodes
},
},
settings/.code={%
\tikzset{quiver/.cd,#1}%
\def\pv##1{\pgfkeysvalueof{/tikz/quiver/##1}}%
},
quiver/.cd,
pos/.initial=0.35,
height/.initial=0,
}
\begin{document}
\begin{tikzcd}[ampersand replacement=\&]
A \& B
\arrow[curve={height=-12pt}, from=1-1, to=1-2]
\end{tikzcd}
\begin{tikzcd}
A & B
\arrow[curve={height=-12pt}, from=1-1, to=1-2]
\end{tikzcd}
\end{document}
.ampersand replacement