# Seemingly random left margin after page break

My document seems to be switching left margins at random and I do not know what is causing this. I am running MacTex and compiling it like this

latex thesis.tex
bibtex A
bibtex B
latex thesis.tex
dvips -t letter -o thesis.ps thesis.dvi
ps2pdf14 -dPDFSETTINGS=/prepress -dEmbedAllFonts=true thesis.ps thesis.pdf

\documentclass[twoside,11pt,openright]{report}

\usepackage[latin1]{inputenc}
\usepackage[american]{babel}
\usepackage{a4}
\usepackage{latexsym}
\usepackage{amssymb}
\usepackage{amsmath}
\usepackage{epsfig}
\usepackage[T1]{fontenc}
\usepackage{lmodern}
\usepackage[labeled]{multibib}
\usepackage{color}
\usepackage{datetime}

\usepackage{etoolbox}
\makeatletter
\patchcmd{\chapter}{\if@openright\cleardoublepage\else\clearpage\fi}{}{}{}
\makeatother

\renewcommand*\ttdefault{txtt}

\newcommand{\todo}[1]{{\color[rgb]{.5,0,0}\textbf{\$\blacktriangleright\$#1\$\blacktriangleleft\$}}}

\newcites{A,B}{Primary Bibliography,Secondary Bibliography}

Below is a link to a screenshot of what looks like, I inserted a ruler to highlight the issue. There is no command in the paragraph except the \todo you can see in red.

The \patchcmd is simply to avoid pagebreaks for empty chapters, the problem persists if I remove it.

-
It is because you are using twoside option. Try change to oneside. The spacing you refer to will only be the same if you have the same margin sizes on the left and right side of the text. Try printing it in duplex and you will see why it does this. –  zeroth May 16 '12 at 8:18
You're doing two contradictory actions: \usepackage{a4} (which is obsolete, by the way) and dvips -t letter ... –  egreg May 16 '12 at 8:21
Indeed. \usepackage[a4paper]{geometry} please - and read l2tabu-en. –  Martin Schröder May 16 '12 at 8:24
Whoa! Thanks for all the help guys. Seems like my template is a bit outdated and not very optimized. Having trouble with eps to pdf conversion now, but I'm sure others have solved that problem and wrote about it somewhere. btw. I was quite sure it wasn't random, that's why i wrote "seemingly" :-) –  andsens May 17 '12 at 10:46

It's not random. You're using the twoside option, so the margins are different on even (left hand) and odd (right hand) pages.

If you need "symmetric" setup on the pages, remove the options.

There's another source of problems: you're using the obsolete package a4 that should set the text block for being positioned on ISO A4 paper, but then you convert the DVI file by passing to dvips the option -t letter, that is, printing on American letter paper. Be consistent: if you plan to output on letter paper, then say

\documentclass{report}

If you instead plan to output on ISO A4 paper, use

\documentclass[a4paper]{report}

The openright option is useless if you don't call the twoside option.

Consider also to use the modern package graphicx for the inclusion of graphic objects, rather than the obsolete epsfig (which is included in the distributions only for back compatibility).

If you have a fairly recent TeX distribution (MacTeX 2010 or later), there is no need to do the "LaTeX-dvips-ps2pdf" route: run directly pdflatex. If you use graphicx instead of epsfig, the EPS files will be automatically converted to PDF for inclusion.

-
@AndreasWallner Thanks for fixing the silly typo which I'm sorry of. –  egreg May 16 '12 at 10:02