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.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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

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.