I'm a beginner to LaTeX. I want to add a curved arrow pointing from one row to another. And I also want to add a {
on the other side of the table to mark several rows.
\begin{center}
\begin{tabular}{ | l | l |}
\hline
letter & number \\ \hline
A & 1 \\ \hline
A & 2 \\ \hline
A & 1 \\ \hline
B & 1 \\ \hline
B & 2 \\ \hline
\end{tabular}
\end{center}
So my idea is to add a curved arrow outside the table to mark the first line and the third line as "duplicated" on the right and add two {
to mark the first 3 rows as "A" and the last 2 rows as "B" on the left.
Any suggestion on how can I do it?
Best Answer
As percusse said in his comment, the most convenient way to go is to exploit the
tikzmark
macro (just one reference: Adding a large brace next to a body of text).This solution allows to draw both braces and arrows through:
\drawbrace
command;\drawcurvedarrow
command,as well as to put some annotations via
\annote
and it exploits a variant oftikzmark
macro in which it is possible to customize a bit the position of the marker via shifts.The code:
The result:
Remember to compile at least twice to get the result and to put annotations refer to the order in which braces or arrows have been deployed to identify their position (i.e. second brace:
brace-2
, fourth arrow:arrow-4
).