Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

While trying to answer a tabular related question here I found the following behavior which surprised me:

I'm trying to overlap a multi-line text in an otherwise left aligned column with the empty cell above. This is intended as an alternative to the multirow package in this case. I tried \raisebox{<amount>}[0pt]{\begin{minipage}[t]{<width>} .. \end{minipage}} (or \begin{adjustbox}{minipage=[t]{<width>},raise={<amount>}{0pt}) but this does not raise the minipage at all when a l, c or r column type is used. It works for p{<width>}.

A MWE is:

\documentclass{article}
\usepackage{blindtext}
\begin{document}

\begin{tabular}{lp{6cm}}
    text & .\raisebox{1ex}{Text} \\
    text &
    .\raisebox{2\baselineskip}{\begin{minipage}[t]{5cm}% baseline is raised
        \blindtext
    \end{minipage}} \\
\end{tabular}

\clearpage
\begin{tabular}{ll}% same for c and r
    text & .\raisebox{1ex}{Text} \\
    text &
    .\raisebox{2\baselineskip}{\begin{minipage}[t]{5cm}% baseline is not raised!
        \blindtext
    \end{minipage}} \\
\end{tabular}

\end{document}

Result with 'p' type:

With 'p' type

Result with 'l' type:

With 'l' type

This behavior escapes me. It is usually always possible to use a minipage in an otherwise horizontal mode. I guess that maybe some internal macro is redefined which interferes with this? Can anyone explain why this happens and how to make \raisebox work also for non-p column types?

share|improve this question

1 Answer 1

up vote 7 down vote accepted

Your example is too complicated. The problem is that you are using \baselineskip that's set to zero in l-columns:

\documentclass{article}

\begin{document}

\begin{tabular}{ll}% same for c and r
    text & .\raisebox{1ex}{Text} \\
    text &
    .\the\baselineskip. \raisebox{\baselineskip}{blub}\raisebox{1cm}{BLA}\\
\end{tabular}

\end{document}
share|improve this answer
2  
And \normalbaselineskip can be used in place of \baselineskip –  egreg May 21 '12 at 10:35
    
Thanks Ulrike and @egreg. I knew it must be some macro redefinition, but would not have guessed \baselineskip to be the cause. You are right Ulrike, I should have used a direct value instead. –  Martin Scharrer May 21 '12 at 11:45

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.