Monday, 20 May 2013

tabular vertical align based on lowest line in a cell, not on the base line

tabular vertical align based on lowest line in a cell, not on the base line

I want to make an enumeration that looks like this
1.   This is some very long
     sentence that might need
     several lines. Does the
     next cell line up with
     the last line of this
     paragraph?                 yes/no

2.   Did it work again?         yes/no
It seems that there is no easy way to do this in LaTeX. If I could just have a tabu(lar(x)) environment that works like this that would be great. But ideally I would like to have something like this with the output above:
\documentclass{article}
\usepackage[english]{babel}
\usepackage{lipsum}

\newcommand{\yesno}[1]
{
    \begin{tabular}{@{}b{.7\linewidth}b{.3\linewidth}@{}}
        #1 & yes/no
    \end{tabular}
}

\begin{document}

    \begin{enumerate}
        \item \yesno{\lipsum[1]}
        \item \yesno{\lipsum[1]}
    \end{enumerate}

\end{document}
Here I would like to give an extra option to the tabular environment that says that it has to align it's most upper line with the rest. Now I know there are some problems with putting a table inside an enumeration, so I don't mind if I have to make my own environment with my own enumeration. The hardest part is to get the alignment the way I want it.

No comments:

Post a Comment