6

How would one achieve a list of two columns like this one:

enter image description here

I only want list bullets on the left side, so in fact if each entry is a single item that's fine. Items never span multiple lines. I've tried using an align block and two-column lists, but I'm not getting anywhere.

9

TeX provides a \rightarrowfill command that does just this. It's a standard part of plain TeX and LaTeX.

\documentclass{article}
\newcommand{\abox}[2]{\makebox[#1][l]{#2 \rightarrowfill}}    
\begin{document}
\begin{itemize}
    \item \abox{1in}{Item 1} Explanation 1
    \item \abox{1in}{Item 2} Explanation 2
    \item \abox{1in}{Item 3} Explanation 3
    \item \abox{1in}{Last item} Last explanation
\end{itemize}
\end{document}

enter image description here

If you want "nicer" arrows, just add \usepackage{mathabx} or otherwise redefine \rightarrow to your favourite arrow symbol. This works because \rightarrrowfill uses the current definition of \rightarrow.

There's also a corresponding \leftarrowfill command.

You can define the command using plain TeX facilities as well, if you wanted to use it without LaTeX:

\def\abox#1#2{\leavevmode\hbox to #1{#2\ \rightarrowfill}}

An alternative approach, that might work better if you have long explanations, would be to make a new list environment that used \rightarrowfill. For example

\documentclass{article}
\usepackage{mathabx}
\usepackage{calc} % needed to use + in \setlength
\newenvironment{arrowlist}[1][1in]%
 {\begin{list}{}{%
   \renewcommand{\makelabel}[1]{\indent\textbullet\ \textit{##1}\ \rightarrowfill}%
   \setlength{\labelwidth}{#1}%
   \setlength{\leftmargin}{\labelwidth+\labelsep}%
   }}
{\end{list}}
\begin{document}

\begin{arrowlist}
  \item[First thing] Explanation 1 
  \item[Second one] Lorem ipsum dolor sit amet, consectetuer adipiscing elit. 
    Ut purus elit, vestibulum ut, placerat ac, adipiscing vitae, felis. 
    Curabitur dictum gravida mauris.
\end{arrowlist}

Or to make the labels longer than 1in...

\begin{arrowlist}[1.4in]
  \item[First thing] Explanation 1 
  \item[Second one] Lorem ipsum dolor sit amet, consectetuer adipiscing elit. 
     Ut purus elit, vestibulum ut, placerat ac, adipiscing vitae, felis.
\end{arrowlist}

\end{document}

enter image description here

  • \rightarrowfill is available also in standard LaTeX; instead of primitive commands, \newcommand{\abox}[2]{\makebox[#1][l]{#2 \rightarrowfill}} should be used. – egreg Feb 12 '14 at 14:10
  • @egreg Yes, I'll update the answer, def and hbox always come more quickly to my fingers... – Thruston Feb 12 '14 at 14:22
4

One possibility:

\documentclass{article}
\usepackage{amsmath}

\newlength\BoxWd
\newlength\TextWd
\newlength\ArrowWd
\setlength\BoxWd{9em}
\newcommand\MyItem[2]{%
  \settowidth\TextWd{#1}%
  \setlength\ArrowWd{\dimexpr\BoxWd-\TextWd\relax}%
  \makebox[\dimexpr\BoxWd+1em\relax][l]{%
    #1$\xrightarrow{\hspace*{\ArrowWd}}$%
  }\parbox[t]{\dimexpr\linewidth-\BoxWd-1em\relax}{#2}%
}

\begin{document}

\begin{itemize}
\item\MyItem{Some text.}{A little description.}
\item\MyItem{Some other text.}{A little description.}
\item\MyItem{Text.}{A longer description. The text now will span more than one line. In fact, it will span three lines just for the example.}
\end{itemize}

\end{document}

enter image description here

The syntax is:

\MyItem{<item>}{<explanation>}

Control the width using the \BoxWd length.

2

I imported a stealth arrow head from mathabx because I thought it looked better than the computer modern version. The parameters \def\arrowlength{3cm} and \def\bulletskip{0.5cm} may be reset to suit.

\documentclass{article}
% Setup the matha font (from mathabx.sty)
\DeclareFontFamily{U}{matha}{\hyphenchar\font45}
\DeclareFontShape{U}{matha}{m}{n}{
      <5> <6> <7> <8> <9> <10> gen * matha
      <10.95> matha10 <12> <14.4> <17.28> <20.74> <24.88> matha12
      }{}
\DeclareSymbolFont{matha}{U}{matha}{m}{n}

% Define a subset character from that font (from mathabx.dcl)
% to completely replace the \subset character, you can replace
% \varsubset with \subset

\DeclareMathSymbol{\varrightarrow}{3}{matha}{"D1}

\usepackage{stackengine}
\usepackage{xcolor}
\def\arrowlength{3cm}
\def\bulletskip{0.5cm}
\def\rarrow#1{\mathrel{\rule[2.15pt]{#1}{0.7pt}\kern-2.5ex\varrightarrow}}
\def\aritem#1#2{\def\stacktype{L}\def\stackalignment{l}\setstackgap{L}{0pt}%
  \noindent$\bullet$\hspace{\bulletskip}%
  \stackon{$\rarrow{\arrowlength}$}{\colorbox{white}{#1}}~\textit{#2}}

\begin{document}

\aritem{Item 1}{Explanation 1}\\
\aritem{Item 2}{Explanation 2}\\
\aritem{Item 3}{Explanation 3}\\
\aritem{Last Item}{Last Explanation}\\

\end{document}

enter image description here

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.