# How can I affect my table formatting from the preamble?

I'd like to change my LaTeX table formatting slightly, but due to the way the documents are generated, I can't do so by changing the actual LaTeX code, but can change what will appear in the preamble.

The change I'd like to make is to have the 1st column width fitted to the text. I know this can be achieved from the LaTeX code from changing first the |L| to |l| (i.e making the l lower case)

\begin{tabulary}{\linewidth}{|L|L|}
table stuff
\end{tabulary}


But is there any way that this can be made the default case by changing something in the preamble?

Also, a second question, though less important, is about if it's possible to have a very long string (longer than column width) wrapped around to the next line. Because at the moment I have a hyperlink in a column which ignores the column boundary and just juts out.

If anyone can help with wither or both of these I'd be grateful.

-
After loading tabulary, you can issue \newcolumntype{L}{l} to redefine the L-column type to be the same as l. In order to allow wrapping of column content, you need to use a p{<len>} column type (which will be left-aligned for non-wrapping text). Here <len> is a known length (like 5cm, for example). So, perhaps using a straight L -> p{<len>} replacement would suffice. – Werner Jul 13 '12 at 19:37
Welcome to TeX.sx! Your answer was migrated here from Stack Overflow. Please register on this site, too, and make sure that both accounts are associated with each other (by using the same OpenID), otherwise you won't be able to comment on or edit your answer. – Martin Schröder Jul 14 '12 at 21:10
Are all the tabulary environments of that form? – egreg Jul 14 '12 at 21:25
Related Question: How to separate table content and table style. – Peter Grill Jul 14 '12 at 23:15
@Werner Thanks! I've tried using the newcolumntype{L}{l} command, which does the trick on the second column of one of the two column tables in my document. However, I want the first column to be formatted like this. But using \newcolumntype{l}{L} throws up a bunch of ! Missing # inserted in alignment preamble. errors. I also have a 3-column table in the same document - the first two columns of which I'd like to be fitted to the text. Do you know of any way of making it so that all but the last column of any table (with any no. of columns) has text fitted to the column width? – user1488804 Jul 16 '12 at 10:02

## migrated from stackoverflow.comJul 14 '12 at 21:07

It supports a .. tabular columns:: directive that lets you control column widths of individual tables by using this in you rst formatted text.