1

Why is this tabulary narrower than the specified width?

\documentclass{article}
\usepackage{tabulary}

\newcommand{\mytable}{%
    \begin{tabulary}{0.5\textwidth}{@{}L@{}}
    Text\\
    Text\\[2ex]
    \end{tabulary}%
}
\setlength{\parindent}{0pt}

\begin{document}

% Why are these less than 0.5\textwidth?
\mytable 
\mytable 
\mytable 
\mytable

\makebox[0.5\textwidth]{\mytable}
\makebox[0.5\textwidth]{\mytable}
\makebox[0.5\textwidth]{\mytable}
\makebox[0.5\textwidth]{\mytable}

\end{document}

enter image description here

musarithmia
  • 12,463
  • This is a duplicate of http://tex.stackexchange.com/a/87543/1090 which has a patch, but stretching tables should be a non-aim! – David Carlisle Jul 15 '15 at 20:26

1 Answers1

1

It isn't, if you provide sufficient text to fill at least the stated width, or the column will be set at its natural width.

\documentclass{article}
\usepackage{tabulary,lipsum}

\newcommand{\mytable}{%
  \begin{tabulary}{0.5\textwidth}{@{}L@{}}
  \lipsum*[2]\\
  \end{tabulary}%
}
\setlength{\parindent}{0pt}

\begin{document}

% Why are these less than 0.5\textwidth?

\rule{0.5\textwidth}{0.4pt}% to show the stated width

\medskip

\mytable 

\medskip

\begin{tabulary}{0.5\textwidth}{@{}|L|@{}} % add rules to show the width
text\\
\end{tabulary}

\end{document}

enter image description here

egreg
  • 1,121,712