Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

I want this

enter image description here

How can you make such an arrow for enumerate's items?

share|improve this question
add comment

marked as duplicate by karlkoeller, Peter Jansson, Werner, Andrew Swann, Martin Schröder Feb 1 at 18:01

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

1 Answer

up vote 6 down vote accepted

This can be done using \tikzmark from the tikzmark library:

\documentclass{article}
\usepackage{tikz}
\usetikzlibrary{tikzmark,decorations.pathreplacing,calc}

\newcommand\MyText[4][0pt]{%
\begin{tikzpicture}[overlay, remember picture]
\draw [decoration={brace},decorate,thick]
   ( $ ({pic cs:#3}|-{pic cs:#2}) + (#1,1.3ex) $ ) --  
    node[anchor=west,xshift=5pt,text width=5cm] {#4} 
  ( $ (pic cs:#3) + (#1,0) $ );
\end{tikzpicture}%
}

\begin{document}

\MyText[2em]{start1}{end1}{some explanatory text}
\MyText[2em]{start2}{end2}{some explanatory text}
\begin{itemize}
\item First item.\tikzmark{start1}
\item Second item.\tikzmark{end1}
\item Third item.
\item Fourth item.\tikzmark{start2}
\item Fifth item.
\item Sixth item with more text.\tikzmark{end2}
\end{itemize}


\end{document}

enter image description here

You set some marks using \tikzmark and then use \MyText to draw the brace between the marks; the optional argument allows to control the horizontal distance between the previous text and the brace. The second and third arguments are for the initial and final marks, and the fourth argument for the text besides the brace.

share|improve this answer
    
Thank you for your answer! –  Masi Feb 1 at 16:37
    
Do you know why my braces goes upset here with the fololwing? pastebin.com/naScCGfM as dl.dropboxusercontent.com/u/62073194/… and exactly with the same definitions in the beginning as you write here. –  Masi Feb 10 at 11:09
1  
@Masi use a larger value for the first optional argument: \MyText[10em]{start2}{end2}{text text text} (change 10em to the value that it's required to avoid overlapping). –  Gonzalo Medina Feb 10 at 13:48
add comment

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