3

I'm trying to draw nice arrows in-text arrows between two letters. I think they would look better with right angles instead of a bend (I'm new to tikz). How would I do this? Also open to suggestions on nicer looking arrows. :-)

Note: I have to compile this twice to get the arrows in the right position.

\documentclass[12pt,a4paper]{article} 
\usepackage{tikz}
\usetikzlibrary{arrows,shapes,automata,backgrounds,petri,matrix,fit,calc}

\begin{document}
\tikzstyle{every picture}+=[remember picture]
\tikzstyle{na} = [inner xsep=0pt, inner ysep=0pt, baseline]
This is some text. This is some text. This is some text. 
This is some text. -- {d\tikz\node[na, anchor=base](a1){o};g\tikz\node[na, anchor=base](a2){e};} -- This is some text. 
This is some text. This is some text. This is some text. This is some text.



\begin{tikzpicture}[overlay]
 \draw [<-](a1) to [bend left=90] (a2);
  \draw [->](a1) to [bend left=-90] (a2);
\end{tikzpicture} 
\end{document}
2

like this?

enter image description here

you only need to change tikzpicture to:

\draw [<-] (a1.north) -- ++ (0, 2mm) -| (a2);
\draw [->] (a1.south) -- ++ (0,-2mm) -| (a2);

however, the same result is more simple and correct to obtain with using tikzmark library:

\documentclass[12pt,a4paper]{article}
\usepackage{tikz}
\usetikzlibrary{tikzmark}

\begin{document}
This is some text. This is some text. This is some text.
This is some text. -- d\tikzmarknode{a1}{o}g\tikzmarknode{a2}{e} --  This is some text. This is some text. This is some text. This is some text. This is some text.

    \begin{tikzpicture}[overlay,remember picture]
\draw [<-] (a1.north) -- ++ (0, 2mm) -| (a2);
\draw [->] (a1.south) -- ++ (0,-2mm) -| (a2);
    \end{tikzpicture}
\end{document}
  • Thanks @Zarko, the first option works perfectly. However, the tikzmark library doesn't seem to be working correctly when I run your second suggestion. Do you know why? – user9974638 Apr 28 at 10:28
  • @user9974638, you might have installed old version of tikz. recent version is 3.1.2. try to update your whole latex installation. – Zarko Apr 28 at 10:57

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.