How do I reproduce the lines like the image below in LaTeX?


In this image, common characters are connected by a line.

I've tried using \overbrace and \underbrace, but I couldn't reproduce it successfully on my own (I've never used Tikz).


Something like this?

%So we can use south later
\newcommand{\Nice}[2]{\tikz[remember picture, inner sep=0pt, baseline, anchor=base]\node(#1){#2};}
Et \Nice{l1}{l}es \Nice{f1}{f}ruits \Nice{p1}{p}as\Nice{s1}{s}eront \Nice{l2}{l}a \Nice{p2}{p}romes\Nice{s2}{s}e des \Nice{f2}{f}\Nice{l3}{l}eurs
\begin{tikzpicture}[remember picture, overlay]
%Adjust the distance changing 1ex if you want a different spacing
\draw (l1.south) -- ++ (south:1ex) -| (l2.south);
\draw (l1.south) -- ++ (south:1ex) -| (l3.south);
\draw (f1.south) -- ++ (south:2ex) -| (f2.south);
\draw (p1.south) -- ++ (south:3ex) -| (p2.south);
\draw (s1.south) -- ++ (south:4ex) -| (s2.south);

enter image description here

  • This is what I was looking for! Thanks so much ! – necotanouqui Jul 15 '20 at 0: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.