问题描述
我正在使用tikz-cd
来绘制图表。我想将下面的图表变成对称的、美观的形式,但我不知道该怎么做。
梅威瑟:
\documentclass{article}
\usepackage{tikz-cd}
\begin{document}
\[\begin{tikzcd}
\text{M-Theory} \arrow[r, "\text{low-energy limit}"] \arrow[d, "g_s\to 0" ]
& \text{11d supergavity} \arrow[d, "\text{KK reduction on $S^1$}"] \\
\text{IIA} \arrow[r, "\text{low-energy limit}"]
& \text{IIA supergavity}
\end{tikzcd}\]
\end{document}
任何帮助将不胜感激!
答案1
与@Bernard 答案(+1)类似,但使用包makecell
:
\documentclass{article}
\usepackage{amsmath}
\usepackage{tikz-cd}
\usepackage{makecell}
\begin{document}
\[
\linespread{0.75}
\begin{tikzcd}[column sep=huge,row sep=large]
\text{M-Theory} \rar["\text{\makecell{low-energy\\ limit}}"] \dar["g_s\to 0" ']
& \text{11d supergravity} \dar["\text{\makecell{KK reduction\\ on $S^1$}}"] \\
\text{IIA} \rar["\text{\makecell{low-energy\\ limit}}"]
& \text{IIA supergravity}
\end{tikzcd}
\]
\end{document}
答案2
以下是借助该stackengine
软件包可能找到的解决方案:
\documentclass{article}
\usepackage{amsmath}
\usepackage{tikz-cd}
\usepackage[usestackEOL]{stackengine}
\begin{document}
\[ \tikzcdset{column sep/normal=1.8cm, row sep/normal=2cm}
\setstackgap{S}{1pt}
\begin{tikzcd}
\text{M-Theory} \arrow[r, "\footnotesize\Shortunderstack{low-energy\\ limit}"] \arrow[d,swap, "g_s\to 0" ]
& \text{11d supergravity} \arrow[d, "\text{KK reduction on $S^1$}"] \\
\text{IIA} \arrow[r, "\footnotesize\Shortunderstack{low-energy\\ limit}"]
& \text{IIA supergravity}
\end{tikzcd}\]
\end{document}
答案3
您可以增加列间距(以及行间距)
\documentclass{article}
\usepackage{amsmath}
\usepackage{tikz-cd}
\begin{document}
\[
\begin{tikzcd}[column sep=8em,row sep=3em]
\text{M-Theory} \arrow[r, "\text{low-energy limit}"] \arrow[d, "g_s\to 0" ]
& \text{11d supergravity} \arrow[d, "\text{KK reduction on $S^1$}"] \\
\text{IIA} \arrow[r, "\text{low-energy limit}"]
& \text{IIA supergravity}
\end{tikzcd}
\]
\end{document}
将标签拆分到多行不需要包:
\documentclass{article}
\usepackage{amsmath}
\usepackage{tikz-cd}
\begin{document}
\[
\begin{tikzcd}[column sep=5em,row sep=3em]
\text{M-Theory} \arrow[r, "\substack{\text{low-energy}\\\text{limit}}"] \arrow[d, "g_s\to 0" ]
& \text{11d supergravity} \arrow[d, "\substack{\text{KK reduction}\\\text{on $S^1$}}"] \\
\text{IIA} \arrow[r, "\substack{\text{low-energy}\\\text{limit}}"]
& \text{IIA supergravity}
\end{tikzcd}
\]
\end{document}