1

I'm aware that here lots of questions regarding table formatting, but I couldn't fight the fitting answer and meanwhile I think it is any global misconfiguration.

My goal: fit table on page in textwidth, by NOT resizing the font to an unreadable size (what is happening if I some kind managed to fit the table on a page).

My approaches: tabular, tabularx, redefined columntypes, checking textwidth and linewidth (which are correct), resizebox

Settings:

\newgeometry{paper=a4paper,left=35mm,right=25mm,top=30mm,bottom=25mm} 

Latex Code

\begin{tabularx}{\textwidth}{l|l|X}
    {\bf Lore} & {\bf Ipsum} & {\bf Dolor} \\
    Lore & Ipsum & Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum.\\
\end{tabularx}

\resizebox{\textwidth}{!}{%
\begin{tabularx}{\textwidth}{l|l|X}
    {\bf Lore} & {\bf Ipsum} & {\bf Dolor} \\
    Lore & Ipsum & Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum.\\
\end{tabularx}}

\begin{tabular}{l|l|p{5cm}}
    {\bf Lore} & {\bf Ipsum} & {\bf Dolor} \\
    Lore & Ipsum & Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum.\\
\end{tabular}  

\resizebox{\textwidth}{!}{%
\begin{tabular}{lll}
    {\bf Lore} & {\bf Ipsum} & {\bf Dolor} \\
    Lore & Ipsum & Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum.\\                                            
\end{tabular}}

Output

Table Output

In near future I have to deliver a thesis, please help me not having to switch to MS Word :-) Thanks.

Edit: The document class which I'm using: http://pastebin.com/y4ufWdu7

Edit2:

Great, I got it fixed. Now, that I was sure this must be an misbehaviour with my general configuration, I removed completely my documentclass: the table was in the expected position!

After step by step including back the packages, I figured out that the problem was caused by:

\usepackage{pdfsync}
\synctex=1

This is what you have to take into account, when you just use some template, which you don't really understand. I could have tried this debugging before, thanks for helping out a beginner.

This problem was also discussed in the answer of this post before.

2
  • Welcome to TeX.SX! The first three approaches fit nicely in the textwidth of a standard article page (no geometry parameters etc. changed). Whatever you've done to get that weird result, you should show us in order to get some clue
    – user31729
    Commented Sep 8, 2015 at 10:13
  • Thanks for the welcome, I've just removed everything regarding the \geometry package and now the rightmost column is fully visible on the page, but not in the range of \textwidth. Here is my documentclass, which I'm using pastebin.com/y4ufWdu7
    – wotanzero
    Commented Sep 8, 2015 at 10:22

1 Answer 1

1

Similarlly as said Christian Hupfer in his comment, I can not reproduces your result. Since you didnt provide any information about your preamble, I use make from your code the following MWE:

\documentclass[a4paper,pagesize]{scrartcl}
\usepackage[paper=a4paper,left=35mm,right=25mm,top=30mm,bottom=25mm] {geometry}

\usepackage{tabularx}
\usepackage{showframe}

    \begin{document}
\noindent
\begin{tabularx}{\textwidth}{l|l|X}
    \textbf{Lore} & \textbf{Ipsum} & \textbf{Dolor} \\
    Lore & Ipsum & Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum.\\
\end{tabularx}

\bigskip
\noindent
\begin{tabular}{l|l|p{5cm}}
    {\bf Lore} & {\bf Ipsum} & {\bf Dolor} \\
    Lore & Ipsum & Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum.\\
\end{tabular}
    \end{document}

In it I omit your experiments width resizebox and add showframe to show, that tabularx is perfect fit into page. Before table I also put \noindent that the table star at left border:

enter image description here

3
  • Please, remember that \bf (together with all similar two letter commands) has been deprecated for twenty years.
    – egreg
    Commented Sep 8, 2015 at 10:26
  • @egreg, yes, I know. Actualy I try to corect this, but sims that the same time the question was edit and my edit was frozen. I will correct this now
    – Zarko
    Commented Sep 8, 2015 at 10:29
  • Thanks for pointing out the showframe package, really useful.
    – wotanzero
    Commented Sep 8, 2015 at 10:50

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .