6

I want to list something in my document. Each point in the list has a short heading (one word, for example "Usecase"). This word should be on an own column to the left of the text which gets added under this point. The text is rather long.

Doing this with a table doesn't work, as tables do not support this if the whole stuff goes multipage. I know longtable, but longtable puts the whole text (the right side) into one row. If I do \begin{longtable}{l|p{\textwidth}} or something like that, it kind of sucks, too.

(as you can see in the code snippet above, I want to seperate the "heading"/name of the section with a vertical line from the text)

Adjusting manually the size of the text on the right doesn't seem to be a nice solution. Anyways, if this works, the text for one item isn't able to be a multipage text either.

So, I hope I made clear what my problem is. The point is, I don't even know what to google.

3
  • 1
    Sorry, but where is you "code snippet above"? Perhaps it would be better to supply us with a minimal working example (MWE) rather...
    – Werner
    Mar 31, 2014 at 20:51
  • Well, I would do, but I have non, as I don't know how to achieve what I want... so I cannot get you a WME...
    – musicmatze
    Mar 31, 2014 at 21:00
  • @musicmatze: Just because you don't know exactly how to do it does not mean that you can't mock up a MWE that clearly shows what you want to specify and how you want the output to look. Basically, set up a MWE including \documentclass and the appropriate packages that illustrates the problem. Its not that people here don't want to help, it's just not clear what it is that you desire, at least not to me. A MWE will make it clear how you want to specify things and what output you want. Mar 31, 2014 at 21:06

2 Answers 2

3

It seems like you're interested in a parcolumns setting:

enter image description here

\documentclass{article}
\usepackage{lipsum,parcolumns}
\newcommand{\heading}[1]{\colchunk[1]{\hspace*{-\parindent}\textbf{#1}}}
\newcommand{\desc}[1]{\colchunk[2]{#1}\colplacechunks}
\begin{document}
\begin{parcolumns}[
    colwidths = {1=3cm},% 2=\dimexpr\linewidth-3cm-2em\relax
    rulebetween = true,
    sloppy = true]{2}
  \heading{Usecase}
  \desc{\lipsum[1-2]}
  \heading{Another type of heading}
  \desc{\lipsum[1-2]}
\end{parcolumns}
\end{document}
1
  • This seems to be exactly what I was looking for. Thank you a lot!
    – musicmatze
    Mar 31, 2014 at 21:21
3

Output Here's another solution based on mdframed:

\documentclass{article}
\usepackage{enumitem}
\usepackage{lipsum}
\usepackage[framemethod=tikz]{mdframed}

\newlength{\defparindent}
\setlength{\defparindent}{\parindent}

% The leftrule environment
\newmdenv[
linecolor=black,%
topline=false,
bottomline=false,
rightline=false,
rightmargin=0pt,
skipabove=0pt,
innertopmargin=0pt,
innerrightmargin=0pt,
backgroundcolor=white]{leftrule}

% Fix top alignment
\makeatletter
\renewrobustcmd*\mdf@makebox@out[2][\linewidth]{%
 \noindent\hb@xt@\z@{%
    \noindent\makebox[\dimexpr #1\relax][l]{\vtop{\vskip-\ht\strutbox\vskip-\dp\strutbox\relax#2}}%
 \hss}%
}%
\makeatother

\begin{document}
\lipsum[1-2]
\begin{description}[style=multiline,leftmargin=2cm,font=\normalfont]
\item[Usecase:]
\begin{leftrule}
    \lipsum[9-11]
\end{leftrule}
\item[Whatever:] 
\begin{leftrule}
    \lipsum[3-8]
\end{leftrule}
\item[Works:]
\begin{leftrule}
    \lipsum[1-2]
\end{leftrule}
\end{description}

\end{document}

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .