Per Erik Strandberg /cv /kurser /blog

Your boss might tell you: "I don't care if you use LaTeX or not, it has to look like Word!" This will, of course, break your heart. But just a few lines of LaTeX will uglify it for you.

Here a quick before and after image:

A typical header I use to make LaTeX-documents look good is this:


\author{Henry David Thoreau}



See the tex [1], or pdf [2] for an example.

A common, also beautiful alternative, is to ignore the \usepackage{times}, so that the default computer modern (see Wikipedia: [3]) is used instead. For some reason I am not as font of this typeface -- perhaps because it is not rendered as nice on screens as I believe times is. Again, see tex [4] or pdf [5] for an example.

First we have to make the font bigger and make sure we use Times: \documentclass[12pt,a4paper]{article} and \usepackage{times} takes care of that.

Now we need to break the typography by screwing up the margins and introducing a ragged right: \usepackage{a4wide} and \raggedright fixes this.

Another default in word processors is to use a horizontal gap between paragraphs. I find this acceptable, even in beautiful documents, even though it might smell a little. \usepackage{parskip} does the trick.

We also need to screw up the title. The easiest way is to remove \maketitle and just use bold text instead.

To summarize, the diff is:

$ diff walking0-my-default.tex walking2-word-like.tex 
< \documentclass[10pt,a4paper]{article}
< \usepackage{times}
> \documentclass[12pt,a4paper]{article}
> \usepackage{a4wide}
> \usepackage{times}
> \usepackage{parskip}
> \raggedright
< \maketitle
> % \maketitle
> \textbf{Walking, Henry David Thoreau, 1862}

The uglified version is available in tex [6] as well as in pdf [7].

If your boss is an apple fan-boy or a "designer" he/she might expect you to use helvetica instead. This is achieved by using the helvet package instead of the times package, like so: \usepackage[scaled]{helvet}. Here is an example of uglified LaTeX with Helvetica in tex [8] and pdf [9].


The text in these examples is from Walking, a text by Thoreau: [10].

This page belongs in Kategori Mallar.
See also Latex Template.