Call Windows Support

  • Subscribe to our RSS feed.
  • Twitter
  • StumbleUpon
  • Reddit
  • Facebook
  • Digg

Sunday, 6 March 2011

Packing in the text

Posted on 05:02 by Unknown
I write many documents in LaTeX, and it is great for things like bibliographies, cross-referencing, and defining styles. But the default styles, such as 'article', are a bit wasteful of space. For example
\documentclass[a4paper]{article}
\title{Your Title Here}
\date{}

\begin{document}
\maketitle
\begin{abstract}
Lorem ipsum ...
\end{abstract}
\section*{Introduction}
...
\end{document}
gives the page shown on the right.

This is particularly a problem if you are preparing a document with strict page limits, such as a research proposal or a conference paper. Those places often put their own style requirements. Some provide a LaTeX style file, which is fine (provide the style actually works!), but others are a little less helpful.

Here is a typical requirement:
Font size 11 is the minimum font that is acceptable, and the minimum margin in all directions is 2cm. For accessibility purposes, a sans-serif font style such as Arial or Helvetica should be used as these are more easily readable to those with visual impairment. For the same reason, type should be justified only on the left hand side.
How do we get LaTeX to meet these requirements? Well, there are a few useful packages. 'geometry.sty' lets the margins be easily set. So we can get a conformant document with:
\documentclass[a4paper,11pt]{article} % 11pt font
\usepackage[top=2cm, bottom=2cm, left=2cm, right=2cm]{geometry} %min margins

\renewcommand{\sfdefault}{cmss} % sans serif
\renewcommand{\familydefault}{\sfdefault} % for whole doc

\raggedright % left justified
\parindent 1em % because \raggedright stops indenting

\begin{document}
...as above
\end{document}

Not only is it conformant, it also has more text on it than the plain `article' version. But we can do better. One reason the article style is so fascistic about its left and right margins (try to get more text by dropping a point size, and it reduces the line length!) is that very long lines are hard to read: you lose your place as you track back at the end of a line. A "11pt text, 2cm margin" format results in lines too long to read comfortably. So let's do what the newspapers do, and go to multi (here, two) columns. This actually saves space, as short section titles no longer take up a whole full width line.

Also, let's take the title and abstract into the main body, and tighten up the space around section headings using the 'titlesec.sty' package. Finally, use some 'negative leading' to get the lines a little closer together (without looking cramped), and we get:
\documentclass[a4paper,twocolumn,11pt]{article}
\usepackage[top=2cm, bottom=2cm, left=2cm, right=2cm]{geometry}

\renewcommand{\sfdefault}{cmss}
\renewcommand{\familydefault}{\sfdefault}
\raggedright
\parindent 1em

\usepackage[small,compact]{titlesec} % section headings in smaller font size, less whitespace
\renewcommand{\baselinestretch}{0.9} % closer lines
\begin{document}
\section*{\Large Your Title Here}
\section*{Executive summary}
Lorem ipsum ...
\section*{Introduction}
...
\end{document}
The result has about twice as much text as the original 'article' style, and is fully conformant to the stated requirements.

The 'titlesec' package also allows some fancier formatting of section headers (for example, when things get a little squashed, I like to put a rule over major section titles, to aid the eye), but that's another story.
Email ThisBlogThis!Share to XShare to FacebookShare to Pinterest
Posted in LaTeX | No comments
Newer Post Older Post Home

0 comments:

Post a Comment

Subscribe to: Post Comments (Atom)

Popular Posts

  • hyperbolic hyperbole
    What's with hyperbolic discounting? It's everywhere ! I first consciously noticed the term at a workshop about six weeks ago, and n...
  • better use seaweed
    As Neils Bohr is alleged to have said , “prediction is very difficult, especially about the future”. My smartphone has a weather app on it t...
  • "Windows support" -- not
    Just had another scam phone call -- someone with a strong Indian accent claiming to be calling from "Windows Technical Support" (o...
  • national stereotypes
    I've just got back from a very productive three day meeting in Paris. Just around the corner from where I was working, there was a marv...
  • retrospective holiday diary day 1: travelling north
    We went to the Lake District last “summer” ; this “summer” it was time for touring the other side of the country: Northumbria. The holiday s...
  • retrospective holiday diary day 5: trains
    Monday 24 September, and the long-threatened rain finally arrived. So this was the ideal day for the planned Carlisle-Settle rail trip . Bu...
  • oh dear
    We have a garden pond to help encourage frogs and other amphibians. Hedgehogs may suffer, however. :-(
  • funfair mirror trees
    One of the trees in our garden has died.  It died last summer in the drought, but we gave it a year to prove to us it really was dead.  It i...
  • retrospective holiday diary day 3: Lindisfarne
    Saturday 22 September, and the weather was still fine, sunny holiday weather so we decided to take advantage of the sunshine, and do Lindisf...
  • more scammers
    So not long after the scam phone call , the phone rings again. It's British Gas -- they get to call me because I'm actually a custo...

Categories

  • 3D printer
  • algorithm
  • astronomy
  • birds
  • Bonnie Tyler
  • books
  • cognition
  • computer
  • conference
  • Doctor Who
  • driving
  • ducks
  • duodecimal
  • education
  • electricity
  • estimation
  • Evernote
  • evolution
  • font
  • food
  • fractals
  • game
  • garden
  • graphics
  • grimoire
  • history
  • holiday
  • humour
  • language
  • LaTeX
  • lego
  • lol
  • mathematics
  • medicine
  • money
  • music
  • obituary
  • pedantry
  • politics
  • probability
  • psychology
  • publishing
  • python
  • quotations
  • research
  • robots
  • science
  • science fiction
  • space flight
  • statistics
  • TPS
  • trains
  • tree
  • TV
  • weather
  • web

Blog Archive

  • ►  2013 (119)
    • ►  December (1)
    • ►  November (17)
    • ►  October (12)
    • ►  September (10)
    • ►  August (9)
    • ►  July (8)
    • ►  June (10)
    • ►  May (19)
    • ►  April (10)
    • ►  March (9)
    • ►  February (4)
    • ►  January (10)
  • ►  2012 (103)
    • ►  December (16)
    • ►  November (8)
    • ►  October (14)
    • ►  September (6)
    • ►  August (13)
    • ►  July (8)
    • ►  June (6)
    • ►  May (9)
    • ►  April (10)
    • ►  March (7)
    • ►  February (5)
    • ►  January (1)
  • ▼  2011 (79)
    • ►  December (7)
    • ►  November (5)
    • ►  October (10)
    • ►  September (7)
    • ►  August (6)
    • ►  July (5)
    • ►  June (6)
    • ►  May (6)
    • ►  April (9)
    • ▼  March (9)
      • au revoir, GMT
      • Cold dark sproing
      • Frog day
      • Mercury
      • Recommendations
      • There's always one...
      • FractalLab
      • Coincidence!
      • Packing in the text
    • ►  February (3)
    • ►  January (6)
Powered by Blogger.

About Me

Unknown
View my complete profile