0

I have a list, and each item of the list has a header and content, the content can be large so it can wrap. I need to show the list in form of 2 columns. For example :-

  • Heading 1    Content 1
  • Heading 2    Content 2
                      Wraped content 2
4
  • Welcome to TSE. What did you try? Commented Jul 7, 2021 at 20:51
  • I tried to use multicol but for some reason, it wraps the columns instead. Commented Jul 7, 2021 at 20:55
  • tex.stackexchange.com/questions/160044/…
    – js bibra
    Commented Jul 7, 2021 at 23:48
  • @UtkarshGoel, Please provide some code next time ;-) This reduces our guessworking and will lead to even better results :) Thank you.
    – MS-SPO
    Commented Aug 4, 2021 at 9:31

1 Answer 1

0

This version uses either a tabular or tabularx, depending on whether the content fits on one line.

\documentclass{article}
\usepackage{tabularx}
\usepackage{blindtext}

\begin{document}
\noindent
\begin{tabular}{@{\makebox[\labelwidth][r]{\textbullet\hskip\labelsep}}ll}
  Heading 1 & Content 1\\
  Heading 2 & Content 2
\end{tabular}

or

\noindent
\begin{tabularx}{\linewidth}{@{\makebox[\labelwidth][r]{\textbullet\hskip\labelsep}}lX}
  Heading 1 & \blindtext
\end{tabularx}

\end{document}

This version uses \hangindent. It will break across pages, but the content can only be one paragraph long.

\documentclass{article}
\usepackage{blindtext}
\usepackage{showframe}

\makeatletter
\newenvironment{doublelist}{\par\medskip
  \def\item##1{\sbox0{##1}% neasure width of heading
    \par\noindent
    \hangindent=\dimexpr \labelwidth + \wd0 + \labelsep\relax
    \hbox to \labelwidth{\hfill\textbullet\hspace\labelsep}%
    \box0\hspace\labelsep\ignorespaces}}%
  {\par\medskip}
\makeatother

\begin{document}

\begin{doublelist}
\item{Heading 1} Content 1
\item{Heading 2} \blindtext
\end{doublelist}

\end{document}
1
  • It's working using tabularx. Commented Jul 7, 2021 at 21:28

You must log in to answer this question.

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