9

I need to get the following output: enter image description here

So far, I just realized the CVCV structure as follows:

\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}

How can I improve this? How can I draw the arrow from the 'j' to C5?

MariaCo
  • 215
  • 1
    Welcome to TeX.se. Instead of posting a fragment of code, it's better to put the fragment into a complete document that people can play with. – Alan Munn May 14 '23 at 15:36
  • If you need to draw full syllable structure diagrams, you might find https://github.com/amunn/syllable-struc-forest/ useful. – Alan Munn May 14 '23 at 18:28

2 Answers2

12

This is a job for 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}

enter image description here

You can also create a new command, for convenience, avoiding writing \textsubscript every time (suggested by 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}

Linguists use gb4e. It allows you to have access to _ and ^ in text mode directly (suggested by 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}

The output is always the same as the first example.

CarLaTeX
  • 62,716
2

Here is a possible solution to my question:

\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 - 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}

MariaCo
  • 215