Following up this question:
How to keep a constant baselineskip when using minipages (or \parboxes)?
The answers to the question suggest that \strut
is not perfect to space minipages well with regard to the following line. They suggest a combination of the commands \par\xdef\tpd{\the\prevdepth}
(within the minipage) and \prevdepth\tpd
(outside the minipage).
However, the suggested solution is not working in tables, because \prevdepth\tpd
needs to be written in a separate spaced-out line to work:
...
\par\xdef\tpd{\the\prevdepth}
\end{minipage}
\prevdepth\tpd
...
The command would not allow me to use \\
instead of an empty line. However, the tabular
-environment needs the \\
to separate the lines.
I tried
\begin{tabular}[t]{p{0.2 \linewidth}p{0.2 \linewidth}}
lipsum & %
\begin{minipage}[t]{\linewidth}
lipsum\\lipsum
\par\xdef\tpd{\the\prevdepth}
\end{minipage}\par
\prevdepth\tpd
lipsum & lipsum
\end{tabular}
and similar things. I either get a compilation error from \prevdepth\tpd
or from the tabular
's missing \\
. If I use an empty line and \\
, I get an extra unwanted line break.
Is there a way to get this solution to work?
Edit: As requested, a full example
\documentclass[fontsize=11pt]{scrartcl}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\begin{document}
\setlength{\tabcolsep}{0pt}
\setlength{\parskip}{0pt}
\setlength{\parindent}{0pt}
\begin{tabular}[t]{p{0.2 \linewidth}p{0.2 \linewidth}}
lipsum & %
\begin{minipage}[t]{\linewidth}lipsum\\libsum
\end{minipage}\\
lipsum & lipsum
\end{tabular}
lipsum
\end{document}
Using the spacing command as suggested above I get this:
This close to the desired output, but comes at the cost of a compilation error (because of the missing line separator \\
in the table).
\prevdepth
), just to see what's the alignment you want to fix?p
column makes it.itemize
inside the table, for which you need the minipage. The itemize is not needed to show the problem, so I did not include it in the example.