在下面的例子中,我想要A需要对齐。我摆弄了环境align
,但没有成功。
\documentclass{article}
\usepackage{tikz-cd}
\begin{document}
\begin{itemize}
\item First diagram:
\[
\begin{tikzcd}
B \rar &A \dar \\
&C
\end{tikzcd}
\]
\item Second diagram:
\[
\begin{tikzcd}
A \dar &B \lar\\
C
\end{tikzcd}
\]
\item The $A$'s are not aligned.
\end{itemize}
\end{document}
答案1
您可以使用trim left
如下trim right
方式:
\documentclass{article}
\usepackage{tikz-cd}
\begin{document}
\begin{itemize}
\item First diagram:
\[
\begin{tikzcd}[trim left=(a),trim right=(a)]
B \rar &|[alias=a]|A \dar \\
&C
\end{tikzcd}
\]
\item Second diagram:
\[
\begin{tikzcd}[trim left=(a),trim right=(a)]
|[alias=a]|A \dar &B \lar\\
C
\end{tikzcd}
\]
\item The $A$'s are aligned.
\end{itemize}
\end{document}