tags:

views:

736

answers:

5

Hi!

I had to learn Latex in a hurry and am now trying to fix a report. Most of the things works fine, but I have some problems.

  1. The abstract has very much padding. This makes the abstract break and end up in two pages. How do I make it fit on one page, by removing padding, not making the text smaller?
  2. I have a long table, which I use longtable for. But the table is wide so I use p{Xmm} to make it fit the page. That works fine. But then all text in the columns will use the whole column width, which I don't want.
  3. I use \setlength{\parskip}{Xmm} to get some spacing between paragraphs. That works fine. But then the sections will get lots of spacing. Is there any way to only set the bottom spacing?

Then I have another question about Latex. Why are the standards so terrible? I mean. Do you ever want a table not to break automatically if the contents it too wide? And do you ever want there to be 0 spacing between paragraphs? I don't get it...

Thanks!

+4  A: 

The defaults in the standard LaTeX classes were chosen to take advantage of the best reading-ergonomic data that was available at the time. (The reason for the surprisingly wide margins in single column documents is that good readers can take in about 60--65 characters without having to scan their eyes, for instance.)

Generally you should be reluctant to override the defaults without a good reason. 'Course, if the rules come from on high, you can't do anything about that.


BTW-- The answer to a lot of "How do I control X?" type questions is "Use package Xcontrol which you can download from CTAN".

dmckee
The wide margins are also a result of the base LaTeX classes being developed for US paper sizes. As standard paper sizes in Europe are different the page borders usually look way too wide. The KOMAScript package is better suited for documents intended to be printed on EU paper sizes.
bluebrother
+1 For mentioning the 60-65 character limit. Somewhat surprising this isn't a better-known and better-adhered-to standard.
Adam Bernier
+6  A: 

The defaults of LaTeX aren't terrible at all. You need to accept that LaTeX is a typesetting system -- not a word processor. From a typesetting view a table isn't breakable at all. Even if it breaks, how should it break? A typesetting system will require you (and it should do so!) to tell yourself how it should behave. Furthermore, if there is no spacing between paragraphs (you are writing paragraphs, not inserting line breaks, are you?) you are using a document class that doesn't do that: it's a perfectly acceptable way of formatting paragraphs to use indents of the first paragraph line without additional space between the paragraphs. I just picked two random prose books and both format this way. Seriously, the standards LaTeX uses (especially when using KOMAScript) are much saner and way better looking than anything I've seen created with Word or similar. If you're used to LaTeX output Word looks like crap. It doesn't deal properly with spacing at all.

Also, learning LaTeX is nothing to be done in a hurry. If you are in a hurry I suggest using a word processor instead. Alternatively, get the required time.

As for your questions:

  1. What exactly do you mean by "much padding"? Why did you add that padding in the first place? If the paragraph is only too long by one or two lines you might be able to use \enlargethispage.
  2. you might be interested in the tabularx package. If you use tabular you might want to make the p column \raggedright
  3. I don't understand this question. If you modify \parskip you modify the amount of space that is added after a paragraph.
bluebrother
A: 

Hi, sorry if I was unclear. This is the structure of my report. I use article because I didn't want the sections to start at 0.

\documentclass[a4wide,titlepage,12pt]{article}

\usepackage[english,swedish]{babel}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage[pdftex]{graphicx}
\usepackage{fancyhdr}
\usepackage{longtable}
\usepackage{array}
\usepackage{colortbl}
\usepackage{a4wide}

\setlength{\parskip}{3mm plus3mm minus3mm}
\setlength{\parindent}{0mm}

\begin{document}

\begin{titlepage}
  ...
\end{titlepage}

\begin{abstract}
  ...
\end{abstract}

\selectlanguage{english}
\begin{abstract}
  ...
\end{abstract}
\selectlanguage{swedish}

  ... 

\begin{document}

About question number two. Here's a screenshot of what I mean. As you can see the text uses 100% of the width. So there's some spacing between some words. If I was unclear about something else. Please ask.

rejeep
Of course formatting a table column as p makes it behave like that: p is a paragraph, and unless otherwise stated paragraphs are *always* justified. You need to make that column {\raggedright}p{3cm}. If your table does not exceed a page in length I'd recommend using tabularx instead of tabular or longtable.
bluebrother
It does exceed a page, so I have to use longtable. It works with raggedright, except if I do it for the last column. Then it fails on my \hline's.
rejeep
raggedright is one option. I'd also make sure the hyphenation patterns for swedish are properly installed. Details depend on your installation; most likely you want to run texconfig.
laalto
What do you mean with one option? I still don't see how I can apply it to all columns.
rejeep
he means one option as in "one possible reason for the issue". As I said above, you need to tell explicitly how LaTeX should behave if a table doesn't fit. With the reasoning I gave above it doesn't make sense to globally change alignment in tables, right?
bluebrother
A: 
  1. By "much padding" I mean that even though there's plenty of space above and below the text, it wraps it so it become two pages. I didn't add any padding myself. The abstract pages has more padding than the other pages.

  2. {\raggedright}p{3cm} works, almost... I can set raggedright on all columns but the last. Setting it on the last will give a compile error.

  3. "you modify the amount of space that is added after a paragraph": I do? Is a {sub}section considered as a paragraph? Because I get extra spacing below these too.

Latex was a requirement for this report. I understand after playing around a bit with it that you really should learn it by heart. And I will!

As you say. Latex is really good looking. And to specify a standard to the best reading-ergonomic makes lots of sense.

rejeep
DO you know that you can edit the question? That is generally preferred to writing explanatory "answers".
dmckee
The subsection command *uses* the value of parskip. If you change parskip it will change the spacing around your subsection...
dmckee
"DO you know that you can edit the question?": Ok, thanks for the tip!"it will change the spacing around your subsection": That explains it.
rejeep
+1  A: 

When you insert \raggedright, it redefines \\ to mean "text line end" rather than "tabular row end". You can use \tabularnewline instead.

Will Robertson
Great, that fixed it. Thanks!
rejeep