Tuesday 8 May 2012

Alternating Page Margins in Latex

Recently I had to do a final year project for my Computer Science course. I did it on GPU programming (with OpenCL) which was very fun! Perhaps more on that later...

However, I had to use alternating margins with a very specific set of parameters for A4. Thus, have a look below for my header for latex...
The margins at the binding side could not be less than 40mm and all the others not less than 15mm. Hopefully this should have sorted it out! The numbers are negative because latex includes something like 1inch + the value. Therefore, if you want your margin to be less than 1inch (like I do) you supply a negative number. This page contains some pretty useful guidance...see below for a quick and dirty solution.

% Tell it to use two sided a4 paper with the article style
\documentclass[twoside, a4paper]{article} 
\setlength{\topmargin}{-1.04cm} 
\setlength{\oddsidemargin}{1.46cm}
\setlength{\evensidemargin}{-1.04cm}
\setlength{\textheight}{26.7cm}
\setlength{\textwidth}{15.5cm}
\setlength{\headheight}{0cm}
\setlength{\headsep}{0cm}

No comments:

Post a Comment

Leave a comment!

Can we just autofill city and state? Please!

Coming from a country that is not the US where zip/postal codes are hyper specific, it always drives me nuts when you are filling in a form ...