Graphics, Figures & TablesTable with ragged right Columns exceeds Margin

Information and discussion about graphics, figures & tables in LaTeX documents.
Post Reply
prof_perriwink
Posts: 1
Joined: Fri Jul 06, 2012 1:21 pm

Table with ragged right Columns exceeds Margin

Post by prof_perriwink »

Hello,

sorry if this is too basic, but trying this table, and it goes off the page (to the right), can anyone just show me how to fix this properly with \raggedright and fixed widths or so.

Code: Select all

\begin{figure}
\begin{tabular}{ l l l | l | }
\hline
 & Free jazz & Postserial music \\ \hline
 & the process (energy) & the product (the work) \\
 & emotional & rational \\
 & intensity & cool \\ 
 & spontaneity & construction \\
 & linear phrase & structure-/material process \\
dynamic & loud, organically evolving & quiet, sudden differences \\
tempo & fast, driving, pulsing & slow, static, no pulse \\
rhythm & also organic, unfolding in an arc & sudden differences, contrasts \\
articulation & mostly legato & varies, much staccato \\
instruments & mostly wind (breath) and percussion (heart) & strings, peripheral percussion \\
pitch & subjective, imprecise & objective, precise \\
composer/interpreter relationship & usually the same person & usually different people \\
way out of musical impasse & emotional expression & through the composer's material \\
fixed composition & usually only for ensemble sections & mostly flexible \\
variety of fixed codes & often orally transmitted by composer and flexible & explicit, on the score \\ \hline
\end{tabular}
\caption{\cite[58]{heffley_northern_2005}}
\label{fig:hot_cool}
\end{figure}
Many thanks!
Tom
Last edited by localghost on Fri Jul 06, 2012 3:35 pm, edited 2 times in total.

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

Learn LaTeX easily with newest books:

The LaTeX Beginner's Guide: 2nd edition and perfect for students writing a thesis

The LaTeX Cookbook: 2nd edition full of practical examples for mathematics, physics, chemistry, and more

LaTeX Graphics with TikZ: the first book about TikZ for perfect drawings in your LaTeX thesis

User avatar
localghost
Site Moderator
Posts: 9202
Joined: Fri Feb 02, 2007 12:06 pm

Table with ragged right Columns exceeds Margin

Post by localghost »

Create a table with a fixed width for the whole table as well as for the single columns by the tabularx package.

Code: Select all

\documentclass[11pt]{article}
\usepackage[T1]{fontenc}
\usepackage{geometry}
\usepackage[tableposition=top]{caption}
\usepackage{booktabs,tabularx}

\newcolumntype{R}{>{\raggedright\arraybackslash}X}

\begin{document}
  \begin{table}[!ht]
    \caption{Table caption}
    \label{tab:table}
    \begin{tabularx}{\linewidth}{RRR}\toprule
      & Free jazz & Postserial music \\ \midrule[1pt]
      & the process (energy) & the product (the work) \\
      & emotional & rational \\
      & intensity & cool \\ 
      & spontaneity & construction \\
      & linear phrase & structure-/material process \\
      dynamic & loud, organically evolving & quiet, sudden differences \\
      tempo & fast, driving, pulsing & slow, static, no pulse \\
      rhythm & also organic, unfolding in an arc & sudden differences, contrasts \\
      articulation & mostly legato & varies, much staccato \\
      instruments & mostly wind (breath) and percussion (heart) & strings, peripheral percussion \\
      pitch & subjective, imprecise & objective, precise \\
      composer/interpreter relationship & usually the same person & usually different people \\
      way out of musical impasse & emotional expression & through the composer's material \\
      fixed composition & usually only for ensemble sections & mostly flexible \\
      variety of fixed codes & often orally transmitted by composer and flexible & explicit, on the score \\ \bottomrule
    \end{tabularx}
  \end{table}
\end{document}
Typesetting the table has been enhanced by the booktabs package.


Best regards and welcome to the board
Thorsten
Post Reply