texblog

Latex page, line and font settings

I was recently asked to write a three page assignment/case study using the following page, line and font settings:

Let’s do one by one.

 

Font type and size

Font types are actually a bit of a pain in Latex and so far, I have almost always been using the standard font, Knuth’s Computer Modern. The reason for not using the fonts provided by the system is that Tex and Latex will give the same distinctive look no matter which platform a document was compile on, making the language system independent.

Some fonts are available, including Times Roman, Helvetica and Courier. Arial however is a “non-free-font” from Microsoft and has to be installed manually — I give up, it’s getting late and I tried various things without success, including installation of the Arial font family.

I will go with XeLaTeX using system fonts, nice :-).

\documentclass[11pt]{article}
\usepackage[english]{babel}
\usepackage{blindtext}
\usepackage{fontspec}
\setmainfont{Arial}
\begin{document}
\blindtext
\end{document}

Another, less clean approach I came across uses Latex with the following two lines added to the preamble:

\renewcommand{\rmdefault}{phv}
\renewcommand{\sfdefault}{phv}

It changes the font family to Helvetica, which is very similar to Arial, but it’s not the same.

The font size is easy, just use the documentclass option:

\documentclass[12pt]{article}

This brings me to the next point on the list above. I will stick to XeLaTeX, but all the examples will perfectly work with LaTeX, assuming you are using Helvetica and not Arial.

 

Linespacing

Basically, 1.5 line spacing is done using the setspace package as follows:

\usepackage{setspace}
\onehalfspacing

Please see my previous post on that topic for more details on line spacing.

 

Setting the margins

If you are lucky enough to require an equal margin on all sides, the geometry package with the margin option will do the trick:

\usepackage[margin=2.5cm]{geometry}

For different margins on every side, the package provides four options: top, left, bottom, right:

\usepackage[top=1.2in, left=0.9in, bottom=1.2in, right=0.9in]{geometry}

See the package documentation for more details.

 

Complete example (XeLaTeX)

\documentclass[12pt]{article}
\usepackage[english]{babel}
\usepackage{blindtext, fontspec, setspace}
\usepackage[margin=2.5cm]{geometry}
\setmainfont{Arial}
\onehalfspacing
\begin{document}
\blindtext
\end{document}

Customizing font, margins and line spacing.

Please leave me a comment if you know of a simple and nice tutorial on how to install non-free-fonts like Arial. Thanks!

Exit mobile version