如何压缩 tikz-cd 中箭头上方文字的大小?
\documentclass{article}
\usepackage{amsmath}
\usepackage{tikz-cd}
\usetikzlibrary{arrows, matrix}
\tikzcdset{every label/.append style = {font = \tiny}}
\begin{document}
\[\begin{tikzcd}
0\rar & \mathrm{Hom}_R(L, E) \arrow{r}{\mathrm{Hom}(\beta, \mathrm{id}_E)} & \mathrm{Hom}_R(N, E) \arrow{r}{\mathrm{Hom}(\alpha, \mathrm{id}_E)} & \mathrm{Hom}_R(M, E)
\end{tikzcd}\]
\end{document}
答案1
您可以将其缩放到任意大小
\documentclass{article}
\usepackage{amsmath}
\usepackage{tikz-cd}
\usetikzlibrary{arrows, matrix}
\tikzcdset{every label/.append style = {scale=0.5,yshift=0.2ex}}
\begin{document}
\[\begin{tikzcd}
0\rar & \mathrm{Hom}_R(L, E) \arrow{r}{\mathrm{Hom}(\beta, \mathrm{id}_E)} & \mathrm{Hom}_R(N, E) \arrow{r}{\mathrm{Hom}(\alpha, \mathrm{id}_E)} & \mathrm{Hom}_R(M, E)
\end{tikzcd}\]
\end{document}
但我个人宁愿按照 Joule V 的建议增加柱子之间的距离。
答案2
您只需扩大列宽即可。
\documentclass{article}
\usepackage{amsmath}
\usepackage{tikz-cd}
\usetikzlibrary{arrows, matrix}
\tikzcdset{every label/.append style = {font = \tiny}}
\begin{document}
\[\begin{tikzcd}[column sep=1.5cm]
0\rar & \mathrm{Hom}_R(L, E) \arrow{r}{\mathrm{Hom}(\beta, \mathrm{id}_E)} & \mathrm{Hom}_R(N, E) \arrow{r}{\mathrm{Hom}(\alpha, \mathrm{id}_E)} & \mathrm{Hom}_R(M, E)
\end{tikzcd}\]
\end{document}
答案3
我不会用tikzcd
这个。无论如何,通过减小字体大小和扩大列间距,你会得到一些结果。下面我也展示了我将如何做到这一点。
\documentclass{article}
\usepackage{amsmath}
\usepackage{tikz-cd}
\DeclareMathOperator{\Hom}{Hom}
\newcommand{\id}{\mathrm{id}}
\begin{document}
\[
\begin{tikzcd}[column sep=large]
0\arrow[r] &
\Hom_R(L, E) \arrow[r,"{\scriptscriptstyle\Hom(\beta, \id_E)}"] &
\Hom_R(N, E) \arrow[r,"{\scriptscriptstyle\Hom(\alpha, \id_E)}"] &
\Hom_R(M, E)
\end{tikzcd}
\]
\[
0\longrightarrow
\Hom_R(L, E) \xrightarrow{\Hom(\beta, \id_E)}
\Hom_R(N, E) \xrightarrow{\Hom(\alpha, \id_E)}
\Hom_R(M, E)
\]
\end{document}