2

Can anyone help me to create a simple table in which the cells have the vertical alignments:

  • column 1: top

  • column 2: wrapped

  • column 3: bottom?

I have used constructions like

\begin{tabular}{p{0.1\textwidth} b{0.75\textwidth} b{0.1\textwidth}}

and

\begin{tabular}{r b{0.75\textwidth} r}

and tested those like

\begin{tabular}{r p{0.75\textwidth} b{0.1\textwidth}}

In every case, the resulting vertical alignment for all of the columns is imposed by that for the middle column. I have also tried the tabu and tabularx packages without success.

My code:

\documentclass[12pt]{report}
\usepackage{array}
\begin{document}
\begin{tabular}{p{0.1\textwidth} b{0.75\textwidth} b{0.1\textwidth}}
10.& text text text text text text text text text text text text \dotfill&  10\\
11.& text text text text text text text text text text text text \dotfill&  11\\
12.& text text text text text text text text text text text text \dotfill&  12\\
\end{tabular}
\end{document}

What it produces:

Vertical alignment dominated by middle column

Edit by CarLaTeX:

What the OP actually want (see his/her comment under my answer) is something like a Table of Contents, for unspecified items in the text.

  • Please clarify what you mean by "wrapped" for the middle column? The p, m, and b column type all wrap their material, if needed. – Mico Aug 7 '18 at 19:45
  • OK, I don't care if the text is top- or bottom-aligned, but simply that it is wrapped, as in the printed output. – hross Aug 7 '18 at 20:19
1

As I suspected, you actually want another list like the Table of Contents, but with your own contents.

tocloft package is what you need.

Here is an example:

\documentclass{report}

\usepackage{hyperref}
\usepackage{tocloft}
\newlistof{mylist}{mls}{My list}
\newcommand{\tolist}[1]{%
\refstepcounter{mylist}
{#1}
\phantomsection\addcontentsline{mls}{figure}{\protect\numberline{\themylist.}#1}\par}


\begin{document}
\tableofcontents
\listofmylist

\chapter{A chapter}
\section{A section}
Something I don't want to list

\tolist{Something I want to list}

\section{Another section}
Some blah blah blah

\tolist{Some long blah blah blah blah blah blah blah blah blah blah blah blah I want to list}


\chapter{Another chapter}
\section{A section}
Something else I don't want to list

\tolist{Something else I want to list}


\end{document}

enter image description here

  • I want to achieve something like a Table of Contents, but not for Chapters, Sections, etc. Rather it is for other miscellaneous items in the text where I can place a \label and have the page number listed as described above. – hross Aug 11 '18 at 23:44
  • @hross Please look at my rewed answer. – CarLaTeX Aug 12 '18 at 6:17

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.