Problem
I have a tabu
table where the text in one column is larger than the text in the rest of the table. To avoid the text to come to close to the top rule I insert a strut (where the bottom has been smashed) in the relevant cell (as suggested here).
However, it seems that the \smash[b]{\strut}
causes unintended extra vertical space to be inserted unless inserted inside the \textbf{}
.
If I use an ordinary \strut
(including the decending 0.3\baselineskip
) or if I create the smashed strut manually using a \rule{0pt}{0.7\baselineskip}
(which should have the same dimensions} it seems to work fine no matter where I place it.
Can somebody explain why it matters whether the \smash[b]{\strut}
is inserted inside or outside a \textbf{}
block?
Example
Here is a simple example demonstrating the behaviour. First the result and then the LaTeX source.
Result
LaTeX source
\documentclass[a4paper]{article}
\usepackage[top=3cm, bottom=3cm, width=6cm]{geometry}
\usepackage[parfill]{parskip}
\usepackage{tabu}
\usepackage{amsmath}
\begin{document}
Large text in \verb$tabu$ environment is too close to the uppermost line:
\begin{tabu}{|c|}
\hline
\begin{tabu} {lX[c]r}
left & {\LARGE\textbf{MIDDLE}} & right
\end{tabu} \\
\hline
\end{tabu}
To fix it we insert a smashed strut \emph{outside} the \verb$\textbf$ block but it does not look nice:
\begin{tabu}{|c|}
\hline
\begin{tabu} {lX[c]r}
left & {\LARGE\smash[b]{\strut}\textbf{MIDDLE}} & right
\end{tabu} \\
\hline
\end{tabu}
Putting the smashed strut \emph{inside} \verb$\textbf$ apparently works:
\begin{tabu}{|c|}
\hline
\begin{tabu} {lX[c]r}
left & {\LARGE\textbf{\smash[b]{\strut}MIDDLE}} & right
\end{tabu} \\
\hline
\end{tabu}
If the strut is not smashed it works \emph{outside} \verb$\textbf$:
\begin{tabu}{|c|}
\hline
\begin{tabu} {lX[c]r}
left & {\LARGE\strut\textbf{MIDDLE}} & right
\end{tabu} \\
\hline
\end{tabu}
If the smashed strut is replaced by a \verb$\rule$ is also works:
\begin{tabu}{|c|}
\hline
\begin{tabu} {lX[c]r}
left & {\LARGE\textbf{\rule{0pt}{0.7\baselineskip}MIDDLE}} & right
\end{tabu} \\
\hline
\end{tabu}
\end{document}