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.

My purpose is to create a nice resume with the arrows indicating the timeline of my experiences. The left column contains information that is not relevant here.

I have the following code:

\documentclass[a4paper,12pt]{article}%minimal working example
\usepackage[french]{babel}

\usepackage{fontspec}%déjà chargé par luatextra
\defaultfontfeatures{Ligatures=TeX} % to have the automatics ligatures of TeX
\setromanfont{Verdana}

\usepackage{paracol} %%Pour les colonnes sur plusieurs pages

\usepackage{multido}

\begin{document}

\setlength{\parindent}{0em}
\setlength{\parskip}{0.5em}

\columnratio{0.32}
\begin{paracol}{2}
\begin{leftcolumn}
Left column

\multido{\i=2+1}{30}{bla ble bli\\}

\end{leftcolumn}%
\begin{rightcolumn}%

\textbf{A title for something that is a little bit verbose}

{\scriptsize a comment about it}

\hspace{2em}
\begin{minipage}{0.6\columnwidth}

\begin{itemize}
\item {\footnotesize bla bla bla}
\end{itemize}
{\footnotesize bla bla again}

{\footnotesize bla}

{\footnotesize bla}

\begin{itemize}
\item {\footnotesize bla bla}
\end{itemize}
\end{minipage}
\begin{minipage}{0.28\columnwidth}
{\fbox{Some stuff}}\end{minipage}

\textbf{A second title  that is a little bit verbose}

{\scriptsize a comment about it}

\hspace{2em}
\begin{minipage}{0.6\columnwidth}

\begin{itemize}
\item {bla bla bla}
\end{itemize}
{\footnotesize one thing}

{\footnotesize another one}

{\footnotesize a third one}

{\footnotesize a fourth one}

\begin{itemize}
\item {\footnotesize bla bla}
\item {\footnotesize bla bla}
\item {\footnotesize bla bla}
\item {\footnotesize bla bla}
\item {\footnotesize bla bla}
\item {\footnotesize bla bla}
\item {\footnotesize bla bla}
\end{itemize}
{\footnotesize something else}

{\footnotesize a last thing}
\end{minipage}
\begin{minipage}{0.28\columnwidth}
{\fbox{Some stuff}}
\end{minipage}

\textbf{Another title}

{\scriptsize etc}
\end{rightcolumn}
\end{paracol}
\end{document}

I would like to add to the pdf output the red shapes as drawn into this example:

example

The shape should be an arrow as shown there (not necessarily red, I will probably change the color), and will be a vector graphic programmatically drawn. Possibly, I would like it to be filled with a background color.

I want the arrow's height to be constrained to the minipage's height (something like arrow's height = minipage's height - 4em).

I use minipage here because I also draw rounded boxes (the ones with "Some stuff") and have intermediate titles. I give here a minimalist example of what I wish.

I would also like (if possible) that may arrow can be continued when a page break occurs (but I don't know if it is possible using minipage)

How can I achieve this ?

EDIT: here is an exemple of what I would like to do (the left rounded box's height depends on its content, not on the minipage's height)

final look of this part of my resume

share|improve this question
    
What's the point of using minipages if you want page breaks? minipages don't admit page breaks. –  Gonzalo Medina Apr 24 at 2:50
    
Yes, I was not sure about this (so I wrote "if possible"), but minipage was the way I found to draw the rightmost box. –  lauhub Apr 24 at 10:17

3 Answers 3

up vote 9 down vote accepted

One possibility using tcolorbox.

Improved version

This improved version admits page breaks as required. I suppressed your minipages and now the original settings (two minipages) as well as the arrow and the "Some stuff" framed box are produced using a single tcolorbox called myarrow; this, in principle, allows for page breaks, but then it's not clear what would happen with the framed box to the right. The syntax is

\begin{myarrow}[<options for the arrow>]{<text>}
contents
\end{myarrow}

where <options for the arrow> can be used to change the attributes for the arrow (see orange arrow in the example below) and <text> is the text that will be placed centered, framed and to the right.

\documentclass[a4paper,12pt]{article}
\usepackage[french]{babel}
\usepackage{fontspec}%déjà chargé par luatextra
\defaultfontfeatures{Ligatures=TeX} % to have the automatics ligatures of TeX
\setromanfont{Verdana}
\usepackage{paracol} %%Pour les colonnes sur plusieurs pages
\usepackage{multido}
\usepackage[many]{tcolorbox}

% Colors for the arrow
\colorlet{arrowbgcolor}{cyan!20}
\colorlet{arrowbordercolor}{cyan}
% Colors for the framed box to the right
\definecolor{boxbgcolor}{RGB}{232,220,236}
\definecolor{boxbordercolor}{RGB}{157,125,169}

\newtcolorbox{myarrow}[2][]{
  breakable,
  enhanced,
  boxrule=0pt,
  arc=0pt,
  frame code={},
  colback=white,
  overlay unbroken={
    \draw[arrowbordercolor,fill=arrowbgcolor,#1]
      ([xshift=0pt]frame.north west) --
      ([xshift=20pt]frame.north west) --
      ([xshift=20pt,yshift=10pt]frame.south west) --
      ([xshift=10pt,yshift=5pt]frame.south west) --
      ([yshift=10pt]frame.south west) -- cycle;
    \node[
      draw=boxbordercolor,
      text width=.28\columnwidth,
      anchor=west,
      line width=1pt,
      rounded corners=10pt,
      fill=boxbgcolor,
    ] at ([xshift=.02\columnwidth]frame.east) {#2};  
  },
  overlay first={
    \draw[arrowbordercolor,fill=arrowbgcolor,#1]
      ([xshift=0pt]frame.north west) --
      ([xshift=20pt]frame.north west) --
      ([xshift=20pt]frame.south west) --
      (frame.south west) -- cycle;
    \node[
      draw=boxbordercolor,
      text width=.28\columnwidth,
      anchor=west,
      line width=1pt,
      rounded corners=10pt,
      fill=boxbgcolor,
    ] at ([xshift=.02\columnwidth]frame.east) {#2};  
  },
  overlay middle={
    \draw[arrowbordercolor,fill=arrowbgcolor,#1]
      ([xshift=0pt]frame.north west) --
      ([xshift=20pt]frame.north west) --
      ([xshift=20pt]frame.south west) --
      (frame.south west) -- cycle;
    \node[
      draw=boxbordercolor,
      text width=.28\columnwidth,
      anchor=west,
      line width=1pt,
      rounded corners=10pt,
      fill=boxbgcolor,
    ] at ([xshift=.02\columnwidth]frame.east) {#2};  
  },
  overlay last={
    \draw[arrowbordercolor,fill=arrowbgcolor,#1]
      ([xshift=0pt]frame.north west) --
      ([xshift=20pt]frame.north west) --
      ([xshift=20pt,yshift=10pt]frame.south west) --
      ([xshift=10pt,yshift=5pt]frame.south west) --
      ([yshift=10pt]frame.south west) -- cycle;
    \node[
      draw=boxbordercolor,
      text width=.28\columnwidth,
      anchor=west,
      line width=1pt,
      rounded corners=10pt,
      fill=boxbgcolor,
    ] at ([xshift=.02\columnwidth]frame.east) {#2};  
  },
  extrude left by=1em,
  enlarge left by=2em,
  width=0.6\columnwidth+1.5em,
}

\begin{document}

\setlength{\parindent}{0em}
\setlength{\parskip}{0.5em}

\columnratio{0.32}
\begin{paracol}{2}
\begin{leftcolumn}
Left column
\multido{\i=2+1}{30}{bla ble bli\\}
\end{leftcolumn}%
\begin{rightcolumn}%
\textbf{A title for something that is a little bit verbose}

{\scriptsize a comment about it}

\begin{myarrow}{Some stuff\\Some stuff\\Some stuff}
\begin{itemize}
\item {\footnotesize bla bla bla}
\end{itemize}
{\footnotesize bla bla again}

{\footnotesize bla}

{\footnotesize bla}

\begin{itemize}
\item {\footnotesize bla bla}
\end{itemize}
\end{myarrow}

\textbf{A second title  that is a little bit verbose}

{\scriptsize a comment about it}

\begin{myarrow}{Some stuff\\Some stuff\\Some stuff\\Some stuff}
\begin{itemize}
\item {bla bla bla}
\end{itemize}
{\footnotesize one thing}

{\footnotesize another one}

{\footnotesize a third one}

{\footnotesize a fourth one}

\begin{itemize}
\item {\footnotesize bla bla}
\item {\footnotesize bla bla}
\item {\footnotesize bla bla}
\item {\footnotesize bla bla}
\item {\footnotesize bla bla}
\item {\footnotesize bla bla}
\item {\footnotesize bla bla}
\item {\footnotesize bla bla}
\item {\footnotesize bla bla}
\item {\footnotesize bla bla}
\item {\footnotesize bla bla}
\item {\footnotesize bla bla}
\item {\footnotesize bla bla}
\item {\footnotesize bla bla}
\item {\footnotesize bla bla}
\item {\footnotesize bla bla}
\item {\footnotesize bla bla}
\item {\footnotesize bla bla}
\item {\footnotesize bla bla}
\item {\footnotesize bla bla}
\item {\footnotesize bla bla}
\item {\footnotesize bla bla}
\item {\footnotesize bla bla}
\item {\footnotesize bla bla}
\item {\footnotesize bla bla}
\item {\footnotesize bla bla}
\item {\footnotesize bla bla}
\item {\footnotesize bla bla}
\item {\footnotesize bla bla}
\item {\footnotesize bla bla}
\end{itemize}
{\footnotesize something else}

{\footnotesize a last thing}
\end{myarrow}
\end{rightcolumn}
\end{paracol}

\end{document}

enter image description here

First version

In this version the desired decoration is actually a freelance design for a tcolorbox. Take into account that since you are using minipages, page breaks are not allowed.

\documentclass[a4paper,12pt]{article}
\usepackage[french]{babel}
\usepackage{fontspec}%déjà chargé par luatextra
\defaultfontfeatures{Ligatures=TeX} % to have the automatics ligatures of TeX
\setromanfont{Verdana}
\usepackage{paracol} %%Pour les colonnes sur plusieurs pages
\usepackage{multido}
\usepackage[many]{tcolorbox}

\newtcolorbox{myarrow}[1][]{
  breakable,
  freelance,
  boxrule=0pt,
  frame code={},
  colback=white,
  overlay={
    \draw[cyan,fill=cyan!20]
      ([xshift=-20pt]frame.north west) --
      (frame.north west) --
      ([yshift=10pt]frame.south west) --
      ([xshift=-10pt,yshift=5pt]frame.south west) --
      ([xshift=-20pt,yshift=10pt]frame.south west) -- cycle;
  }
}

\begin{document}

\setlength{\parindent}{0em}
\setlength{\parskip}{0.5em}

\columnratio{0.32}
\begin{paracol}{2}
\begin{leftcolumn}
Left column
\multido{\i=2+1}{30}{bla ble bli\\}
\end{leftcolumn}%
\begin{rightcolumn}%
\textbf{A title for something that is a little bit verbose}

{\scriptsize a comment about it}

\hspace{2em}
\begin{minipage}{0.6\columnwidth}
\begin{myarrow}
\begin{itemize}
\item {\footnotesize bla bla bla}
\end{itemize}
{\footnotesize bla bla again}

{\footnotesize bla}

{\footnotesize bla}

\begin{itemize}
\item {\footnotesize bla bla}
\end{itemize}
\end{myarrow}
\end{minipage}%
\begin{minipage}{0.28\columnwidth}
{\fbox{Some stuff}}\end{minipage}

\textbf{A second title  that is a little bit verbose}

{\scriptsize a comment about it}

\hspace{2em}
\begin{minipage}{0.6\columnwidth}
\begin{myarrow}
\begin{itemize}
\item {bla bla bla}
\end{itemize}
{\footnotesize one thing}

{\footnotesize another one}

{\footnotesize a third one}

{\footnotesize a fourth one}

\begin{itemize}
\item {\footnotesize bla bla}
\item {\footnotesize bla bla}
\item {\footnotesize bla bla}
\item {\footnotesize bla bla}
\end{itemize}
{\footnotesize something else}

{\footnotesize a last thing}
\end{myarrow}
\end{minipage}
\begin{minipage}{0.28\columnwidth}
{\fbox{Some stuff}}
\end{minipage}

\end{rightcolumn}
\end{paracol}
\end{document}

enter image description here

share|improve this answer
    
I like a lot the improved version because of its ability to manage break pages. Thanks a lot. However, to draw the some stuff box, I already used a \tcolorbox (I did not mention that in my question). So when I put it as argument of the myarrow env, it complains with "! LaTeX Error: Command \tcb@float already defined." Although, I will investigate with the solution using minipages –  lauhub Apr 24 at 10:43
    
@lauhub please see my updated answer. –  Gonzalo Medina Apr 24 at 11:51
    
That is very nice ! Is it possible to decrease the inner margins of the box where the arrow is drawn ? –  lauhub Apr 24 at 12:36
    
@lauhub sure. However I am not sure exactly what margins do you want to decrease. Can you please describe in more detail? Do you mean to draw the arrow so that it is narrower? –  Gonzalo Medina Apr 24 at 12:38
    
The text that is at the right side of the arrow: I would like a smaller margin around this text. The arrow size and position should not change because it is fine for me –  lauhub Apr 24 at 12:41

With tikzmark:

\documentclass[a4paper,12pt]{article}%minimal working example
\usepackage[french]{babel}

%\usepackage{fontspec}%déjà chargé par luatextra
%\defaultfontfeatures{Ligatures=TeX} % to have the automatics ligatures of TeX
%\setromanfont{Verdana}

\usepackage{paracol} %%Pour les colonnes sur plusieurs pages

\usepackage{multido}

\usepackage{tikz}
\usetikzlibrary{arrows.meta}
\newcommand\tikzmark[1]{%
\tikz[remember picture,baseline=(#1.base)]
\node[inner sep=0,outer sep=3pt] (#1) {};%
}
\newcommand\myarrow[3][]{%
  \begin{tikzpicture}[overlay,remember picture]
    \draw[#1] (#2) to (#3);
  \end{tikzpicture}}

\begin{document}

\setlength{\parindent}{0em}
\setlength{\parskip}{0.5em}

\columnratio{0.32}
\begin{paracol}{2}
\begin{leftcolumn}
Left column

\multido{\i=2+1}{30}{bla ble bli\\}

\end{leftcolumn}%
\begin{rightcolumn}%

\textbf{A title for something that is a little bit verbose}

\tikzmark{a}{\scriptsize a comment about it}
\hspace{2em}
\begin{minipage}[t]{0.6\columnwidth}

\begin{itemize}
\item {\footnotesize bla bla bla}
\end{itemize}
{\footnotesize bla bla again}

{\footnotesize bla}

{\footnotesize bla}

\begin{itemize}
\item \tikzmark{b}{\footnotesize bla bla}
\end{itemize}

\myarrow[-latex, draw=magenta!55, line width=5]{a}{a|-b}
\end{minipage}%
\begin{minipage}{0.28\columnwidth}
{\fbox{Some stuff}}\end{minipage}

\textbf{A second title  that is a little bit verbose}

\tikzmark{a}{\scriptsize a comment about it}

\hspace{2em}
\begin{minipage}{0.6\columnwidth}

\begin{itemize}
\item {bla bla bla}
\end{itemize}
{\footnotesize one thing}

{\footnotesize another one}

{\footnotesize a third one}

{\footnotesize a fourth one}

\begin{itemize}
\item {\footnotesize bla bla}
\item {\footnotesize bla bla}
\item {\footnotesize bla bla}
\item {\footnotesize bla bla}
\item {\footnotesize bla bla}
\item {\footnotesize bla bla}
\item {\footnotesize bla bla}
\end{itemize}
{\footnotesize something else}

\tikzmark{b}{\footnotesize a last thing}
\end{minipage}
\begin{minipage}{0.28\columnwidth}
{\fbox{Some stuff}}
\myarrow[-latex, draw=green!55, line width=5]{a}{a|-b}
\end{minipage}

\textbf{Another title}

{\scriptsize etc}
\end{rightcolumn}
\end{paracol}
\end{document}

enter image description here

Another variant:

\documentclass[a4paper,12pt]{article}%minimal working example
\usepackage[french]{babel}

%\usepackage{fontspec}%déjà chargé par luatextra
%\defaultfontfeatures{Ligatures=TeX} % to have the automatics ligatures of TeX
%\setromanfont{Verdana}

\usepackage{paracol} %%Pour les colonnes sur plusieurs pages

\usepackage{multido}

\usepackage{tikz}
\usetikzlibrary{arrows.meta}
\newcommand\tikzmark[1]{%
\tikz[remember picture,baseline=(#1.base)]
\node[inner sep=0,outer sep=3pt] (#1) {};%
}
\newcommand\myarrow[3][]{%
  \begin{tikzpicture}[overlay,remember picture]
    \draw[fill=orange!30,#1] ([xshift=-1em]#2.south) -- ([xshift=-1em,yshift=1ex]#3.north) -- (#3.north) -- ([xshift=1em,yshift=1ex]#3.north)  -- ([xshift=1em]#2.south)--cycle;
  \end{tikzpicture}}

\begin{document}

\setlength{\parindent}{0em}
\setlength{\parskip}{0.5em}

\columnratio{0.32}
\begin{paracol}{2}
\begin{leftcolumn}
Left column

\multido{\i=2+1}{30}{bla ble bli\\}

\end{leftcolumn}%
\begin{rightcolumn}%

\textbf{A title for something that is a little bit verbose}

\tikzmark{a}{\scriptsize a comment about it}
\hspace{2em}
\begin{minipage}[t]{0.6\columnwidth}

\begin{itemize}
\item {\footnotesize bla bla bla}
\end{itemize}
{\footnotesize bla bla again}

{\footnotesize bla}

{\footnotesize bla}

\begin{itemize}
\item \tikzmark{b}{\footnotesize bla bla}
\end{itemize}

\myarrow[draw=magenta!55]{a}{a|-b}
\end{minipage}%
\begin{minipage}{0.28\columnwidth}
{\fbox{Some stuff}}\end{minipage}

\textbf{A second title  that is a little bit verbose}

\tikzmark{a}{\scriptsize a comment about it}

\hspace{2em}
\begin{minipage}{0.6\columnwidth}

\begin{itemize}
\item {bla bla bla}
\end{itemize}
{\footnotesize one thing}

{\footnotesize another one}

{\footnotesize a third one}

{\footnotesize a fourth one}

\begin{itemize}
\item {\footnotesize bla bla}
\item {\footnotesize bla bla}
\item {\footnotesize bla bla}
\item {\footnotesize bla bla}
\item {\footnotesize bla bla}
\item {\footnotesize bla bla}
\item {\footnotesize bla bla}
\end{itemize}
{\footnotesize something else}

\tikzmark{b}{\footnotesize a last thing}
\end{minipage}
\begin{minipage}{0.28\columnwidth}
{\fbox{Some stuff}}
\myarrow[draw=green!55]{a}{a|-b}
\end{minipage}

\textbf{Another title}

{\scriptsize etc}
\end{rightcolumn}
\end{paracol}
\end{document}

enter image description here

Further beautifications like choosing an appropriate arrow, and placing the first mark at suitable place may be done as per your taste.

share|improve this answer
    
This works fine and I discovered the \tikzmark{a} that allows to place anything where you want in a document. But, I don't feel comfortable with putting a mark at each of my paragraphs, because adding or moving items will make this not practical for me. Also, I did not manage to make it work over several pages (a page break makes the arrow drawn incorrectly). However that is a nice thing I learn there, thank you for that. –  lauhub Apr 24 at 11:45

The following example defines environment timepage that catches the former minipage inside a box for measurement. Then the minipage is placed and the time arrow is drawn via TikZ:

\documentclass[a4paper,12pt]{article}%minimal working example
\usepackage[french]{babel}

\usepackage{fontspec}%déjà chargé par luatextra
\defaultfontfeatures{Ligatures=TeX} % to have the automatics ligatures of TeX
\setromanfont{Verdana}

\usepackage{paracol} %%Pour les colonnes sur plusieurs pages

\usepackage{multido}

\usepackage{tikz}
\newsavebox{\timepagebox}

\newenvironment*{timepage}{%
  \begin{lrbox}{\timepagebox}%
  \begin{minipage}%
}{%
  \end{minipage}
  \end{lrbox}%
  \noindent
  \begin{tikzpicture}[
    inner sep=0pt,
    outer sep=0pt,
    baseline=0pt,
  ]
  \path (0,0) ++(2em,-\dp\timepagebox)
    node [anchor=south west] {\usebox{\timepagebox}}
  ;
  \draw[
    red,
    line join=round,
    semithick,
  ]
    (.5\pgflinewidth,\ht\timepagebox-.5\pgflinewidth) -- ++(1.6em,0) --
    ++(0,-\ht\timepagebox-\dp\timepagebox+\pgflinewidth+.9em) --
    ++(-.8em,-.8em) -- ++(-.8em,.8em) -- cycle
  ;
  \end{tikzpicture}%
}

\begin{document}

\setlength{\parindent}{0em}
\setlength{\parskip}{0.5em}

\columnratio{0.32}
\begin{paracol}{2}
\begin{leftcolumn}
Left column

\multido{\i=2+1}{30}{bla ble bli\\}

\end{leftcolumn}%
\begin{rightcolumn}%

\textbf{A title for something that is a little bit verbose}

{\scriptsize a comment about it}

\begin{timepage}{0.6\columnwidth}

\begin{itemize}
\item {\footnotesize bla bla bla}
\end{itemize}
{\footnotesize bla bla again}

{\footnotesize bla}

{\footnotesize bla}

\begin{itemize}
\item {\footnotesize bla bla}
\end{itemize}
\end{timepage}
\begin{minipage}{0.28\columnwidth}
{\fbox{Some stuff}}\end{minipage}

\textbf{A second title  that is a little bit verbose}

{\scriptsize a comment about it}

\begin{timepage}{0.6\columnwidth}

\begin{itemize}
\item {bla bla bla}
\end{itemize}
{\footnotesize one thing}

{\footnotesize another one}

{\footnotesize a third one}

{\footnotesize a fourth one}

\begin{itemize}
\item {\footnotesize bla bla}
\item {\footnotesize bla bla}
\item {\footnotesize bla bla}
\item {\footnotesize bla bla}
\item {\footnotesize bla bla}
\item {\footnotesize bla bla}
\item {\footnotesize bla bla}
\end{itemize}
{\footnotesize something else}

{\footnotesize a last thing}
\end{timepage}
\begin{minipage}{0.28\columnwidth}
{\fbox{Some stuff}}
\end{minipage}

\textbf{Another title}

{\scriptsize etc}
\end{rightcolumn}
\end{paracol}
\end{document}

Result

share|improve this answer
    
I really like this elegant way of creating an environment to customize the minipage. It has the limitation of minipage and does not allow page break, but I will re-use it in other places. Thanks a lot –  lauhub Apr 24 at 13:32

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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