# Setting tabular width

I'm using a tabular within multicols and would like to make a table extend its second column right to the edge of the column within multicols, so the column is pushed over but the text is still left justified. The code I'm trying to use this:

\documentclass[11pt, a4paper]{article}
\usepackage{tikz}
\usepackage{a4wide}
\usepackage{multicol}
\usepackage{amsmath}

\begin{document}
\begin{multicols*}{2}
\section{Notation}
\begin{tabular}{l l}
$Q_r$ & Heat energy rejected \\
$Q_s$ & Heat energy supplied \\
$R$ & Real gas constant for fluid \\
\end{tabular}
\end{multicols*}
\end{document}

-
You probably want \begin{tabularx}{\columnwidth}{lX} from the tabularx package. –  egreg Feb 26 '12 at 20:28
@egreg: \linewidth would also work. –  Martin Schröder Feb 26 '12 at 20:45
@egreg How would I set that just so it worked with the second column? –  Andy Feb 26 '12 at 21:19
@Andy I can't understand. Do you want that the tabular extends into the second column? –  egreg Feb 26 '12 at 21:27
@egreg Sorry I meant so you could choose different widths for different columns, say for column one a width of 4cm and for column two a width of 8cm. –  Andy Feb 27 '12 at 9:37

Assuming you want the first column 4cm wide, flush with the left margin, and the second column to take all the available space, flush with the right margin, then

\usepackage{tabularx}


in the preamble and

\noindent\begin{tabularx}{@{}p{4cm}X@{}}
$Q_r$ & Heat energy rejected \\
$Q_s$ & Heat energy supplied \\
$R$ & Real gas constant for fluid \\
\end{tabularx}


should do.

Note that a4wide is an obsolete package that shouldn't be used any more (see texdoc l2tabuen).

-

If I understand correctly what you want, you can do this with LaTeX's tabular* environment.

\documentclass[11pt, a4paper]{article}

\usepackage{booktabs}
\usepackage{multicol}

\begin{document}
\begin{multicols*}{2}
\noindent
\begin{tabular*}{\columnwidth}{ll}
\toprule
$Q_r$ & Heat energy rejected
\\$Q_s$ & Heat energy supplied
\\$R$   & Real gas constant for fluid
\\\bottomrule
\end{tabular*}
\end{multicols*}
\end{document}


Looking at what you're trying to do, it looks you're trying to make some kind of glossary. Are you sure you don't want to use a dedicated package for this? For example the glossaries package?

-
You probably want a \noindent before the tabular* with the default settings otherwise the line will be over-full with paragraph indentation followed by a full width table. Also tabular* needs some stretch glue adding to allow it to stretch to the requested width. –  David Carlisle Feb 26 '12 at 21:53
@mark-van-dongen No difference in the output, but latex is happier, and wouldn't moan about Underfull \hbox (badness 10000) in alignment at lines 8--14 making LaTeX happy is a virtue:-) actually in either case the result would just look like a tabular –  David Carlisle Feb 26 '12 at 22:39
@MarcvanDongen glossaries would perhaps be more useful, I'm writing a notation section to go at the back of a report with 3 columns; symbol, description and units. –  Andy Feb 27 '12 at 9:42