1

I want to enlarge the height of the 3rd and 4th rows such that there is enough space for the caption "Adjustable size?" and it looks nice. My setting below is my attempt but it still looks ugly for the 1st and 2nd rows.

MWE

\documentclass[preview,border=12pt,12pt,varwidth]{standalone}
\usepackage{longtable,array,multirow,graphicx}

\LTpre=0pt\relax% to remove excessive border at the top of longtable.

\let\mc=\multicolumn
\let\mr=\multirow
\let\cl=\cline
\renewcommand\arraystretch{5}

\begin{document}
\topskip=0pt\relax
\begin{longtable}{|*4{c|}}\cl{3-4}
\mc{2}{c|}{\mr{2}{*}{}}                                     & \mc{2}{c|}{A container?}\\\cl{3-4}
\mc{2}{c|}{}                                                            & No & Yes \\\hline
\mr{2}{*}{\rotatebox[origin=c]{90}{Adjustable size?}}
                                                                                    & No    & \verb|\cnode| & \verb|\circlenode| \\\cl{2-4}
                                                                                    & Yes & \verb|\Cnode| & \verb|\Circlenode|\\\hline
\end{longtable}
\end{document}

enter image description here

Question

How to enlarge the height of the 3rd and 4th rows only?

  • Kind of an ugly work-around, but couldn't you just pad the two rows with empty lines, like & & & \\ before and after the actual content? – Inquisitive Lurker Nov 21 '18 at 11:54
  • @InquisitiveLurker: Your comment has been converted to a real solution. Thank you! – Money Oriented Programmer Nov 21 '18 at 12:04
2

Another alternative would be to add some vertical space to each of the lines of interest, which would allow for a finer tuning.

\documentclass[preview,border=12pt,12pt,varwidth]{standalone}
\usepackage{longtable,array,multirow,graphicx}

\LTpre=0pt\relax% to remove excessive border at the top of longtable.

\let\mc=\multicolumn
\let\mr=\multirow
\let\cl=\cline
\renewcommand\arraystretch{1.5}

\begin{document}
\topskip=0pt\relax
\begin{longtable}{|*4{c|}}\cl{3-4}
\mc{2}{c|}{\mr{2}{*}{}} & \mc{2}{c|}{A container?}                 \\\cl{3-4}
\mc{2}{c|}{}            & No  & Yes                                \\\hline
\mr{2}{*}{\rotatebox[origin=c]{90}{Adjustable size?~}}
                        & No  & \verb|\cnode| & \verb|\circlenode| \\[2em]\cl{2-4}
                        & Yes & \verb|\Cnode| & \verb|\Circlenode| \\[2em]\hline
\end{longtable}
\end{document}

enter image description here

  • Vertically unbalanced. :-) – Money Oriented Programmer Nov 21 '18 at 12:29
  • @ArtificialStupidity True, it sure could be refined. But the means to add vertical space to individual lines is therein. – gusbrs Nov 21 '18 at 12:31
0

Inspired by this comment from Inquisitive Lurker:

\documentclass[preview,border=12pt,12pt,varwidth]{standalone}
\usepackage{longtable,array,multirow,graphicx}

\LTpre=0pt\relax% to remove excessive border at the top of longtable.

\let\mc=\multicolumn
\let\mr=\multirow
\let\cl=\cline
\renewcommand\arraystretch{1.5}

\begin{document}
\topskip=0pt\relax
\begin{longtable}{|*4{c|}}\cl{3-4}
\mc{2}{c|}{\mr{2}{*}{}}                              & \mc{2}{c|}{A container?}\\\cl{3-4}
\mc{2}{c|}{}                                         & No & Yes \\\hline
\mr{6}{*}{\rotatebox[origin=c]{90}{Adjustable size?}}
                                                     &&&\\
                                                     & No   & \verb|\cnode| & \verb|\circlenode| \\
                                                     &&&\\\cl{2-4}
                                                     &&&\\
                                                     & Yes &    \verb|\Cnode| & \verb|\Circlenode|\\
                                                     &&&\\\hline
\end{longtable}
\end{document}

enter image description here

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.