8
\documentclass{report}
\usepackage{lipsum}
\begin{document}
\begin{tabular}{cp{4cm}}
\hline
\shortstack{A\\B\\C\\D} & \lipsum[1] \\
\hline
\end{tabular}
\end{document}

Results in :

------------------------------------
A
B
C
D    Lorem ipsum dolor sit amet,
     consectetuer adipiscing elit.
     Ut purus elit, vestibulum
     ut, placerat ac, adipiscing
     vitae, felis. Curabitur
     dictum gravida mauris. Nam
------------------------------------

While I'd like to achieve:

------------------------------------
A    Lorem ipsum dolor sit amet,
B    consectetuer adipiscing elit.
C    Ut purus elit, vestibulum
D    ut, placerat ac, adipiscing
     vitae, felis. Curabitur
     dictum gravida mauris. Nam
------------------------------------

How to do this using \shortstack ?

P.S. I've found solution using \matrix \ShortStack Align - I am curious if it's possible to do with \shortstack ?

2 Answers 2

8

The important thing is to trim off the depth of the "substack"

\documentclass{report}
\usepackage{amsmath} % for \smash[b]{...}
\usepackage{lipsum}

\newcommand{\blap}[1]{\smash[b]{\begin{tabular}[t]{@{}c@{}}#1\end{tabular}}}

\begin{document}

\begin{tabular}{cp{4cm}}
\hline
\blap{A\\B\\C\\D}
& \lipsum[1] \\
\hline
\end{tabular}

\end{document}

In the following picture, on the left is what results from my code, on the right with the other proposed one

enter image description here

\documentclass{article}

\usepackage{amsmath}

\newcommand{\blap}[1]{%
  \smash[b]{\begin{tabular}[t]{@{}c@{}}#1\end{tabular}}}

\begin{document}

\begin{tabular}{cp{4cm}}
\hline
\blap{A\\B\\C\\D}
&
some text to fill four lines
some text to fill four lines
some text to fill four lines
some text to fill four lines
some text to fill four lines
\\
\hline
\end{tabular}\qquad
\begin{tabular}{cp{4cm}}
\hline
\vbox to 0pt{\hbox{
\shortstack{A\\B\\C\\D}
}\vss}
&
some text to fill four lines
some text to fill four lines
some text to fill four lines
some text to fill four lines
some text to fill four lines
\\
\hline
\end{tabular}

\end{document}
0

I've found solution here : https://tex.stackexchange.com/a/23848/7128 ,

so I'd like to share.

I adopted macro:

\newcommand{\blap}[1]{\vbox to 0pt{\hbox{#1}\vss}}

Here is complete working example:

\documentclass{report}
\usepackage{lipsum}
\begin{document}
\begin{tabular}{cp{4cm}}
\hline
\vbox to 0pt{\hbox{
\shortstack{A\\B\\C\\D} 
}\vss}
& \lipsum[1] \\
\hline
\end{tabular}
\end{document}

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.