# Ignore particular tabular cell height and simple overflow its content (like \multirow)

I want latex to ignore the height of a tabular cell and to overflow its content to the above and below tabular cell (see image - red arrows). First I tried \multirow but this doesn't align the text on the left side in the right way.

\documentclass{standalone}

\usepackage{graphicx}
\usepackage{multirow}

\begin{document}

%%- Cropped Image
\newcommand{\croppedimg}[1]%
{%
}%

\begin{minipage}[t]{13cm}

\begin{tabular}{p{0.008\linewidth}p{0.008\linewidth}p{0.008\linewidth}p{0.4\linewidth}p{0.4\linewidth}}
%-- multirow solution does not work right... dont know why.
%& \multirow{3}{*}{\rotatebox[origin=c]{90}{Property Text 1 large}} &  & %
%
%-- solution without multirow but now the table row hight grows with it's inner elements
& & &
Caption A:\newline Text Text Text Text Text Text Text Text Text Text Text Text Text Text & %
Caption B:\newline Text Text Text Text Text Text Text Text Text Text Text Text Text Text \\
%%
& \rotatebox[origin=c]{90}{Property Text 1 large} %
& \rotatebox[origin=c]{90}{Unit 1 Text} & \croppedimg{black.png} & \croppedimg{black.png} \\
%%
\rotatebox[origin=c]{90}{Property Text 2} & %
& \rotatebox[origin=c]{90}{Unit 2 Text} & \croppedimg{black.png} & \croppedimg{black.png} \\
%%
& \rotatebox[origin=c]{90}{Property Text 3} %
& \rotatebox[origin=c]{90}{Unit 3 Text} & \croppedimg{black.png} & \croppedimg{black.png} \\
%%
\rotatebox[origin=c]{90}{Property Text 4 large} & %
& \rotatebox[origin=c]{90}{Unit 4 Text} & \croppedimg{black.png} & \croppedimg{black.png} \\
& & & \vspace{1cm} & \vspace{1cm}
\end{tabular}
\end{minipage}

\end{document}


I think I need something like the HTML-CSS command "position:absolute" for the "property-text-1-large" cell so that the outer tabular element does not grow with this inner content size. I know this is not a good solution but I think it will be the simplest?

so the result should look like this

Thanks very much

• Is the goal really to produce overlapping black boxes, or do the boxes stand for something else? Aug 18, 2014 at 19:24
• there are images and the boxes/images do not have to overlap: only the text on the left side! I add a Image with the result I need... sorry it is quite hard to express the problem :-) Aug 18, 2014 at 19:26
• Do I understand correctly? The images should spaced consistently next to each other, and the captions on the left side should be separately aligned, so that each is centered relative to the image it describes? The layout of the captions should not change the layout of the images, but the captions should adjust their "vertical" (but rotated) spacing to accomodate the other captions when they overlap? Aug 18, 2014 at 19:40
• Yes, that's right. Aug 18, 2014 at 20:44
• Yes, that's right... so, I think there are two ways doing this: using \multirow to unite the cells above and below the current cell [does not work for me but I don't know why]. Or the other is to write over the borders of the current cell but do not enlarge it [see Answer 1 using \clap]... thanks for your help! Aug 18, 2014 at 20:54

If you really don't care about how the output looks, you can use \clap, which is a variant of \llap and \rlap defined in this TUGboat article to be:

\def\clap#1{\hbox to 0pt{\hss#1\hss}}


Put that definition in the preamble (or load the mathtools package which also defines it) and then enclose any text to be overlapped like so:

\clap{Property Text 1 large}


Warning: This performs absolutely no checks to make sure other nearby text is not overprinted. Use with care!

\documentclass{standalone}

\usepackage{multirow}

\def\clap#1{\hbox to 0pt{\hss#1\hss}}

\begin{document}
%%- Cropped Image
\newcommand{\croppedimg}[1]%
{%                                                      v-- also added height' option to force spacing gaps
}%

\begin{minipage}[t]{13cm}
\begin{tabular}{p{0.008\linewidth}p{0.008\linewidth}p{0.008\linewidth}p{0.4\linewidth}p{0.4\linewidth}}
%-- multirow solution does not work right... dont know why.
%& \multirow{3}{*}{\rotatebox[origin=c]{90}{Property Text 1 large}} &  & %
%
%-- solution without multirow but now the table row hight grows with it's inner elements
& & &
Caption A:\newline Text Text Text Text Text Text Text Text Text Text Text Text Text Text & %
Caption B:\newline Text Text Text Text Text Text Text Text Text Text Text Text Text Text \\
%%
& \rotatebox[origin=c]{90}{\clap{Property Text 1 large}} %
& \rotatebox[origin=c]{90}{Unit 1 Text} & \croppedimg{black.png} & \croppedimg{black.png} \\
%%
\rotatebox[origin=c]{90}{Property Text 2} & %
& \rotatebox[origin=c]{90}{Unit 2 Text} & \croppedimg{black.png} & \croppedimg{black.png} \\
& & & \vspace{1cm} & \vspace{1cm}
\end{tabular}
\end{minipage}
\end{document}


• \clap is actually defined in the mathtools package, which many people already load in place of amsmath — along with \mathllap, mathrlap and \mathclap. Aug 18, 2014 at 19:48
• Thanks @Bernard, I forgot it was also defined there in addition to the \mathXlap variants. Aug 18, 2014 at 19:54

If you don't mind adding automatically (when necessary) some vertical space between the rows of images, here is a solution that uses a simpler code (just 3 columns): I define a \verticaltext command, within a right-aligned column:

\documentclass[draft]{article}
\usepackage{mathtools}
\usepackage{graphicx}

\newcommand\verticaltext[1]{ \rotatebox[origin=c]{90}{\begin{tabular}{c}#1 \end{tabular}}}

\begin{document}

%%- Cropped Image
\newcommand{\croppedimg}[1]%
{%
\adjustbox{valign=c}{\includegraphics[width=1\linewidth,clip=true,trim=90pt 60pt 50pt 140pt, height =2.5cm]{#1}}%
}%
\begin{minipage}[t]{13cm}

\begin{tabular}{rp{0.4\linewidth}p{0.4\linewidth}}
&
Caption A:\newline Text Text Text Text Text Text Text Text Text Text Text Text Text Text & %
Caption B:\newline Text Text Text Text Text Text Text Text Text Text Text Text Text Text \\[-3ex]
%%
\verticaltext{Property Text 1 large \\Unit 1 Text}& \croppedimg{black.png} & \croppedimg{black.png} \\
%%
\verticaltext{Property Text 2 \\Unit 2 Text} & \croppedimg{black.png} & \croppedimg{black.png} \\
%%
\verticaltext{Property Text 3\\ Unit 3 Text}& \croppedimg{black.png} & \croppedimg{black.png} \\
%%
\verticaltext{Property Text 4 large \\Unit 4 Text} & \croppedimg{black.png} & \croppedimg{black.png} \\
& \vspace{1cm} & \vspace{1cm}
\end{tabular}
\end{minipage}
`

\end{document}

• Thanks for your work! The Problem is, that the text on the left hand side (e.g. "Property Text large") is "very" long so the vertical space between the images would be too large for me. Aug 20, 2014 at 10:56