Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

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}
share|improve this question
1  
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
add comment

2 Answers

up vote 1 down vote accepted

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).

share|improve this answer
add comment

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?

share|improve this answer
    
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
1  
@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
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.