Is there some way of getting the current column width in a tabu table in the same way that one can refer to \columnwidth
in a multicol?
For example, the following gallery works but its a bit ugly since the column content had to know its width. i.e. we had to specify [width=.45\textwidth]
whereas we would prefer not to have to do that. If this were a multicol then we could have just used [width=\columnwidth]
in its place.
I searched through the tabu documentation looking for all occurrences of width
but did not find it.
\documentclass{article}
\usepackage{graphicx}
\usepackage{tabu}
\begin{document}
\begin{tabu}{XX}
\framebox{\includegraphics[width=.45\textwidth]{myfig}} &
\framebox{\includegraphics[width=.45\textwidth]{myfig}} \\
Some text. & Some more Text. \\
\end{tabu}
\end{document}
Best Answer
I don't know if it's documented, but you can always refer to the current width of a parbox by
\linewidth
:Just say
\linewidth
instead of the complicated\dimexpr...\relax
if you don't want the frame.Of course the
\linewidth
would change in a nestedlist
based environment; in this case you can always use\hsize
(this is surely undocumented).