General ⇒ tabulary and textwidth
tabulary and textwidth
For some reason, I can use the /textwidth argument with tabularx but no with tabulary. In fact, it doesn't seem as if the <length> argument makes any difference when I use tabulary. Anybody have an idea why?
NEW: TikZ book now 40% off at Amazon.com for a short time.
tabulary and textwidth
The following example shows that, at least for me, it makes a difference:
I would venture to say that maybe the length of the contents of the columns of your table is responsible for your undesired behavior. The tabulary package calculates the column widths based on the contents of the table.
However, posting a minimal working example showing this undesired behaviour could help us to give more effective advise.
Code: Select all
\documentclass{article}
\usepackage{tabulary}
\begin{document}
\begin{table}[!ht]
\centering
\begin{tabulary}{5cm}{JJ}
\hline
test text test text test text test text test text test text &
test text test text test text test text test text test text \\ \hline
\end{tabulary}
\end{table}
\vspace{1cm}
\begin{table}[!ht]
\centering
\begin{tabulary}{\textwidth}{JJ}
\hline
test text test text test text test text test text test text &
test text test text test text test text test text test text \\ \hline
\end{tabulary}
\end{table}
\end{document}
However, posting a minimal working example showing this undesired behaviour could help us to give more effective advise.
1,1,2,3,5,8,13,21,34,55,89,144,233,...
tabulary and textwidth
I've also just been finding that tabulary doesn't quite behave as I expect. To take up the previous example (upper table in example below), everything seems to work just fine. But delete "text test text" from the end of each cell and suddenly the table doesn't seem to observe the intended width (bottom table in example).
Code: Select all
\documentclass{article}
\usepackage{tabulary}
\begin{document}
\begin{table}[!ht]
\centering
\begin{tabulary}{5cm}{JJ}
\hline
test text test text test text test text test text test text & test text test text test text test text test text test text \\ \hline
\end{tabulary}
\end{table}
\begin{table}[!ht]
\centering
\begin{tabulary}{5cm}{JJ}
\hline
test text test text test text test text test & test text test text test text test text test \\ \hline
\end{tabulary}
\end{table}
\end{document}
Re: tabulary and textwidth
Sorry, just realised that tabulary works just fine in the example I've just posted with the basic article class. Unfortunately it doesn't in the documentclass that I'm using.