2

LaTeX Community!

I'm currently working on my Bachelor's thesis in Linguistics and am looking to implement a specific structure within the text. This structure, which I've encountered in a publication, would significantly enhance the readability of my explanations. Typically, creating such visuals using the tikzpicture environment is straightforward, but my challenge lies in incorporating these directly into the text flow.

Inside the text there is the C v C V structure with arrows

I'm using Overleaf for my project and am searching for a method to seamlessly integrate these kinds of structures within the text itself. To provide a clearer picture of what I'm aiming for, I will attach an image excerpted from the thesis that inspired me. What I wnat to do is to put arrows (with the -LaTeX arrowhead and with the double arrow just as in the picture) between characters inside the textflow. The Ideal would be to make bended arrows goind under and above the characters with them being filled (plain arrows) or double ones. Is this possible somehow? Can anyone guide me on how to achieve these structures inside the text using LaTeX? Any advice or suggestions would be immensely appreciated.

Thank you in advance for your help!

Im attaching the picture, Im talking about the C v C V part with the arrows. And my preamble is attached also.

\documentclass[12p]{article}
\usepackage[T2A,T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage[a4paper, margin=1in]{geometry}
\usepackage[greek ,russian, hungarian]{babel}
\usepackage{graphicx}
\usepackage{mathtools}
\usepackage{capt-of}
\usepackage{multicol}
\usepackage{pifont}
\usepackage{stackengine}
\usepackage[table,xcdraw]{xcolor}
\usepackage{tikz-qtree}
\usepackage{textcomp}
\usepackage{sectsty}
\usepackage{array}
\usepackage{bm}
\usepackage{amsmath}
\usetikzlibrary{patterns, patterns.meta, arrows.meta, decorations.pathreplacing, calligraphy, shapes.geometric}
\usepackage{setspace}
\usepackage{tipa}
\usepackage{linguex}
\usepackage{multirow}
\allsectionsfont{\sffamily}

\AtBeginDocument{%
  \DeclareFontFamilySubstitution{T2A}{\familydefault}{Tempora-TLF}%
}

\DeclareMathAlphabet\mathbfcal{OMS}{cmsy}{b}{n}


\doublespacing

\renewcommand{\sfdefault}{cmss}
\newcommand{\sipa}[1]{\textsf{\textipa{#1}}}

\graphicspath{{Images/}}

\begin{document}

So it is a CvCV structure

\end{document}
1
  • Use within text \tikz{•••—} , where you draw your characters and arrows. Basically that‘s. However you may need to watch baseline, height etc.
    – MS-SPO
    Feb 13 at 20:20

3 Answers 3

3

You could use a tikzcd inline.

enter image description here

\documentclass{article}

\usepackage{tikz-cd}
\tikzcdset{arrow style=tikz, diagrams={>=Parenthesis}}
\tikzset{inline/.style={column sep=2mm, cells={nodes={inner xsep=0pt}}}}

\begin{document}

Just some text here. Just some text here. Just some text here. Just some text here. 
Just some text here. Just some text here. Just some text here. The latter type
%
\begin{tikzcd}[inline, math mode=false]
C&v&C\arrow[ll, bend left]&[.2em]V\arrow[l, Rightarrow]\arrow[ll, bend right=45]
\end{tikzcd},
%
is the default case. Just some text here. Just some text here. Just some text here. Just some text here.
Just some text here. Just some text here. Just some text here. Just some text here. 

\end{document}
1

This solution could be improve (and should) but at least somehow works.

  • 1st argument is pre-space (default 1pt) optional
  • 2nd argument is after-space (default 1pt) optional
  • 3rd argument (1st mandatory) is the node name
  • 4th argument (2nd mandatory is the target box (letter in this case).

I've remove some packages because I didn't wanted to install them, and I added a bit of previous text and after text to check line spacing.

Output

\documentclass[12pt]{article}
\usepackage[doublespacing]{setspace}
\usepackage[T2A,T1]{fontenc}
\usepackage[a4paper, margin=1in]{geometry}
\usepackage{amsmath}
\usepackage{tikz-qtree}
\usetikzlibrary{tikzmark}
\usetikzlibrary{patterns, patterns.meta, arrows.meta, decorations.pathreplacing, calligraphy, shapes.geometric}

\NewDocumentCommand{\tmark}{O{1pt} O{1pt} m m }
{\hspace*{#1}\tikzmarknode{#3}{\rule[-2pt]{0pt}{12pt}#4}\hspace*{#2}}
\begin{document}
    
    Aliquam lectus. Vivamus leo. Quisque ornare tellus
    ullamcorper nulla. Mauris porttitor haretra tortor.
    Sed fringilla justo sed mauris. Sed non leo. Nullam 
    ullamcorper nulla. Mauris porttitor haretra tortor.
    So it is a
     \tmark{c1}{C}\tmark{v}{v}\tmark{c2}{C}\tmark[7pt]{V}{V}
    following text. Aliquam lectus. Vivamus leo. Quisque ornare
    tellus ullamcorper nulla. Mauris porttitor haretra tortor
    
    \begin{tikzpicture}[remember picture,overlay]
        \draw[-latex,black] (c2.south) to[in=-25,out=205] (c1.south);
        \draw[-latex,black] (V.north) to[in=25,out=155] (v.north);
        \draw[-{Implies},double,black] (V.west) -- (c2.east);
    \end{tikzpicture}
\end{document}
1

This could be achieved by setting the baseline to (current bounding box.base) and node anchor to base.

\documentclass{report}
\usepackage[doublespacing]{setspace}
\usepackage{tikz}
\newcommand{\inlinestructure}{%
\tikz[baseline=(current bounding box.base)]{
\node (l1) [anchor=base,inner sep=0pt]{C};
\node (l2) [anchor=base,inner sep=0pt,xshift=12pt] at (l1.base){v};
\node (l3) [anchor=base,inner sep=0pt,xshift=12pt] at (l2.base){C};
\node (l4) [anchor=base,inner sep=0pt,xshift=12pt] at (l3.base){$\Leftarrow$};
\node (l5) [anchor=base,inner sep=0pt,xshift=12pt] at (l4.base){V};
\draw [-latex] ([yshift=-2pt]l3.south west) to[out=-155,in=-25] ([yshift=-2pt]l1.south east);
\draw [-latex] ([yshift=2pt]l5.north west) to[out=155,in=25] ([yshift=4pt]l2.north east);}\nobreakspace%
}

\begin{document}
Aliquam lectus. Vivamus leo. Quisque ornare tellus ullamcorper nulla. 
Mauris porttitor haretra tortor. So it is a \inlinestructure following text. Aliquam lectus. Vivamus leo. 
Quisque ornare tellus ullamcorper nulla. Mauris porttitor haretra tortor
\end{document}

enter image description here

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .