到目前为止我只是实现了CVCV结构如下:
\documentclass[a4paper,12pt, twoside]{report}
\usepackage[table]{xcolor}
\begin{document}
\begin{tabular}{ccccccccc}
C$_{1}$ & V$_{1}$ & C$_{2}$ & V$_{2}$ & C$_{3}$ & V$_{3}$ & C$_{4}$ & V$_{4}$\\
$ \mid $ & & $ \mid $ & & $ \mid $ & $ \mid $ & $ \mid $\\
s & $ \leftarrow $ & k & & w & i & n \\
& & & & & & & j
\end{tabular}
\end{document}
我该如何改进?我该如何绘制从“j”到 C5 的箭头?
答案1
这是 TikZ-cd 的工作:
\documentclass[a4paper,12pt, twoside]{report}
\usepackage{tikz-cd}
\begin{document}
\[
\begin{tikzcd}[column sep=4pt, math mode=false]
C\textsubscript{1}\ar[d, dash] & V\textsubscript{1} & C\textsubscript{2}\ar[d, dash] & V\textsubscript{2} & C\textsubscript{3}\ar[d, dash] & V\textsubscript{3}\ar[d, dash] & C\textsubscript{4}\ar[d, dash] & V\textsubscript{4}& C\textsubscript{5} & V\textsubscript{5}\ar[d, dash]& C\textsubscript{6}\ar[d, dash] & V\textsubscript{6}\\[-6pt]
s & & k\ar[ll] & & w & i & n &&& i & n\\[-20pt]
& & & & & & & j\ar[uur, bend right, red]
\end{tikzcd}
\]
\end{document}
您还可以创建一个新命令,以方便使用,避免\textsubscript
每次都书写(由 Barbara Beaton 建议)。
\documentclass[a4paper,12pt, twoside]{report}
\usepackage{tikz-cd}
\newcommand{\scv}[2][C]{#1\textsubscript{#2}}
\begin{document}
\[
\begin{tikzcd}[column sep=4pt, math mode=false]
\scv{1}\ar[d, dash] & \scv[V]{1} & \scv{2}\ar[d, dash] & \scv[V]{2} & \scv{3}\ar[d, dash] & \scv[V]{3}\ar[d, dash] & \scv{4}\ar[d, dash] & \scv[V]{4}& \scv{5} & \scv[V]{5}\ar[d, dash]& \scv{6}\ar[d, dash] & \scv[V]{6}\\[-6pt]
s & & k\ar[ll] & & w & i & n &&& i & n\\[-20pt]
& & & & & & & j\ar[uur, bend right, red]
\end{tikzcd}
\]
\end{document}
语言学家使用。它允许您直接在文本模式下gb4e
访问_
和(由 Alan Munn 建议)。^
\documentclass[a4paper,12pt, twoside]{report}
\usepackage{tikz-cd}
\usepackage{gb4e}
\begin{document}
\[
\begin{tikzcd}[column sep=4pt, math mode=false]
C_{1}\ar[d, dash] & V_{1} & C_{2}\ar[d, dash] & V_{2} & C_{3}\ar[d, dash] & V_{3}\ar[d, dash] & C_{4}\ar[d, dash] & V_{4}& C_{5} & V_{5}\ar[d, dash]& C_{6}\ar[d, dash] & V_{6}\\[-6pt]
s & & k\ar[ll] & & w & i & n &&& i & n\\[-20pt]
& & & & & & & j\ar[uur, bend right, red]
\end{tikzcd}
\]
\end{document}
输出总是与第一个例子相同。
答案2
以下是我的问题的一个可能的解决方案:
\documentclass[a4paper,12pt, twoside]{report}
\usepackage{tikz-cd}
\begin{document}
\begin{tikzpicture}
\matrix [matrix of nodes, row sep=1em, column sep={2em,between origins}, row 3/.style={font=\scshape}]
{
|(C1)| C\textsubscript{1} & |(V1)| V\textsubscript{1} &
|(C2)| C\textsubscript{2} & |(V2)| V\textsubscript{2}
& |(C3)| C\textsubscript{3} & |(V3)| V\textsubscript{3}
& |(C4)| C\textsubscript{4} & |(V4)| V\textsubscript{4} & |(C5)| C\textsubscript{5} & |(V5)| V\textsubscript{5} & |(C6)| C\textsubscript{6} & |(V6)| V\textsubscript{6}\\
|(c1)| s &
& |(c2)| k & & |(c3)| w &
|(v3)|i & |(c4)| n & & & |(v5)| i & |(c6)| n\\
&
& & & & & & |(f)| j & & & & &\\
};
\draw [-] (C1) to (c1);
\draw [-](C2) to (c2);
\draw [-] (C3) to (c3);
\draw [-] (V3) to (v3);
\draw [-] (C4) to (c4);
\draw [-] (C5) to (f);
\draw [-] (V5) to (v5);
\draw [-] (C6) to (c6);
\draw [->] (c2) to (c1);
\end{tikzpicture}
\end{document}