Graphics, Figures & TablesTable with Fixed-width columns extends rulers

Information and discussion about graphics, figures & tables in LaTeX documents.
Post Reply
Silver
Posts: 4
Joined: Tue Nov 11, 2008 12:30 pm

Table with Fixed-width columns extends rulers

Post by Silver »

Hi,

In the past I used the command p{4cm} with tabular to fix all the column widths in a table. This used to work, when required for uniform tables and proper wrapping. After an upgrade to WinEdt6 and MikTex2.9 (and several packages with that) it appears to bug out.

I use the code example below (actually from another site), and include the pdf with the result. At first the code appears to work, but when I add the \hline or rules it shows the real problem. I use a minimum of packages compared to my ongoing work, but the problem persists.

Is there a remedy for this or am I doing something wrong??

Code: Select all

\documentclass{article}
\usepackage{multicol}
\usepackage{array}
\begin{document}
\section{Work Experience}

\begin{tabular}{>{\hfill}p{5cm}|p{11cm}}
    \hline
  Current & Your job at Your Company, Town \\
  Jan 2009 & What your company does \\
  & A description of what you do\\
  \multicolumn{2}{c}{}
\end{tabular}


\end{document}
Attachments
tabletest.pdf
Example of result
(26.57 KiB) Downloaded 181 times

Recommended reading 2024:

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

NEW: TikZ book now 40% off at Amazon.com for a short time.

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

Table with Fixed-width columns extends rulers

Post by localghost »

Silver wrote:[…] I use the code example below (actually from another site), and include the pdf with the result. At first the code appears to work, but when I add the \hline or rules it shows the real problem. […]
This code never worked properly. The \hrule command only revealed that. See warnings in the log file.
Silver wrote:[…] Is there a remedy for this or am I doing something wrong? […]
Depends on what you want to achieve. Seems like you are writing a CV. So you should take a look at some classes or packages which support this [1].

[1] The TeX Catalogue Online, Topic Index: Writing Applications for a Job / CV


Thorsten
Silver
Posts: 4
Joined: Tue Nov 11, 2008 12:30 pm

Table with Fixed-width columns extends rulers

Post by Silver »

Hi Thorsten

Aye, you were right on the spot with the \hline just revealing the problem. Sloppy of me to present an example with an unintended bug, and not the real issue.

With your input however I managed to find the cause of the real problem: \usepackage{pdfsync}. Try the code below with and without \usepackage{pdfsync}...

\documentclass[a4paper,10pt]{scrartcl}
\pdfminorversion=6 %
\usepackage{array}
\usepackage{multirow}
\usepackage{multicol}

%\usepackage{pdfsync}

\pagestyle{plain}

\begin{document}

\section{Work Experience}

\begin{tabular}{p{3cm}|p{5cm}}
\hline
Current & Your job at Your Company, Town \\
Jan 2009 & What your company does \\
& A description of what you do\\
\multicolumn{2}{c}{}
\end{tabular}

\begin{tabular}{p{2.7cm}p{2.7cm}p{3.7cm}}
\hline
Revision & Author & Change note \\
\hline
1.0 & Daniel Löfgren & Release 1. \\
blahblah & Daniel Löfgren & Added chapter (flanges) \\
& & Added chapter (rings) \\
& &
\end{tabular}
\newline
\newline


\end{document}
User avatar
localghost
Site Moderator
Posts: 9202
Joined: Fri Feb 02, 2007 12:06 pm

Table with Fixed-width columns extends rulers

Post by localghost »

The pdfsync package can be considered obsolete since nowadays modern compiler engines support the SyncTeX technology. In combination with an appropriate editor this works better.
Post Reply