2

I am working off a thesis template which produces a document in which the left-hand side margin is bigger than the right-side margin, i.e., the text does appear in the middle of the page. What would I need to change in the following code to have equal left and right-hand side margins:

\documentclass[a4paper,12pt,twoside]{report}

\usepackage{graphicx} \usepackage{fancyheadings} \usepackage{longtable} \usepackage{float} \usepackage{amsmath,bm} \usepackage{epstopdf} \usepackage{sectsty} % Allows customizing section commands \usepackage{tabularx,ragged2e,booktabs,caption} \usepackage{booktabs} \usepackage{subfig} \usepackage{multirow} \usepackage{amsfonts} \usepackage{csquotes} \usepackage{rotating} \usepackage{array} \usepackage{siunitx,booktabs} \usepackage{listings} \usepackage[skip=0.333\baselineskip]{caption} \usepackage{caption} \usepackage{textcomp} \allowdisplaybreaks \usepackage{makecell} \usepackage{dcolumn} \usepackage{enumerate} \usepackage{mathtools} \pagestyle{fancyplain} \parskip=0cm \voffset=-0.54cm \hoffset=0.46cm \oddsidemargin=0pt \evensidemargin=0pt \topmargin=0pt \headheight=0.5cm \headsep=0.5cm \textheight=23.7cm \textwidth=15.8cm \setlength{\headwidth}{15.8cm} \setlength{\parindent}{0pt}
\setlength{\parskip}{1ex plus 0.5ex minus 0.2ex}
\setlength{\parskip}{10pt}
\renewcommand{\chaptermark}[1]{\markboth{#1}{}} \renewcommand{\bibname}{References}

\lhead[\fancyplain{}{}]{\fancyplain{\slshape \leftmark}{\slshape\leftmark}} \rhead[\fancyplain{\slshape \leftmark}{\slshape \leftmark}]{\fancyplain{}{}} \cfoot[\fancyplain{\thepage}{\thepage}]{\fancyplain{\thepage}{\thepage}} \setlength{\headrulewidth}{0.4pt} \setlength{\plainheadrulewidth}{0.4pt}

\begin{document}

Many thanks.

Bob1986
  • 479
  • 1
    What's your paper size: a4paper, letterpaper, or something else? – Mico Jul 12 '20 at 11:21
  • 1
    My apologies, the complete code is as follows:\documentclass[a4paper,12pt,twoside]{report} – Bob1986 Jul 12 '20 at 11:23
  • 1
    @Mico, I've updated my code above to provide more information in case there something conflicting with my equal margin requirement. Cheers – Bob1986 Jul 12 '20 at 11:42
  • you are specifying twoside where the outer margins are wider, you could reset the margiins but perhaps you want oneside it is normal for a twoside docuemnt to have unequal margins. – David Carlisle Jul 12 '20 at 11:50
  • after specifying twoside and 14paper you then over-ride that woth low level promitive assignments setting the page size in inches?? and setting the margins by hand with \oddsidemargin=0pt \evensidemargin=0pt – David Carlisle Jul 12 '20 at 11:53
  • @David Carlisle - I should have mentioned that this is a template provided by the university, I had no idea what it was doing until pointed out by Mico below. Thanks for taking the time to comment. – Bob1986 Jul 12 '20 at 13:09
  • If you are writing a thesis, first get permission to change the requirements (which won't happen). – John Kormylo Jul 12 '20 at 19:51

1 Answers1

3

First and foremost, don't specify twoside unless you want an asymmetric layout. The default for the report document class is oneside -- don't override it.

Second, I wouldn't reinvent the wheel, so to say, in terms of setting the page layout parameters. Unless there's no other choice, don't manipulate low-level parameters such as \oddsidemargin and \evensidemargin directly. Instead, I'd use the well-documented and very widely used geometry package. See below for an application.

By the way, since the total height of a4paper is 297mm, setting \textheight to 237cm guarantees that the sum of the vertical margins (60mm) must exceed the sum of the horizontal margins (52mm). Is this intentional?

\documentclass[a4paper,12pt,oneside]{report}

\usepackage[textheight=23.7cm, hmargin=26mm, % 210mm-2*26mm=158mm top=26mm, % same as left and right margins (?) headheight=0.5cm, headsep=0.5cm, %includeheadfoot, % optional %showframe % optional ]{geometry}

\usepackage{fancyheadings} % I would use 'fancyhdr' \pagestyle{fancyplain} \lhead[\fancyplain{}{}]{\fancyplain{\slshape \leftmark}{\slshape\leftmark}} \rhead[\fancyplain{\slshape \leftmark}{\slshape \leftmark}]{\fancyplain{}{}} \cfoot[\fancyplain{\thepage}{\thepage}]{\fancyplain{\thepage}{\thepage}}

\setlength{\parindent}{0pt} \setlength{\parskip}{10pt}

%%\renewcommand{\chaptermark}[1]{\markboth{#1}{}} \renewcommand{\bibname}{References} \usepackage{lipsum} % for filler text

\begin{document} \chapter{Hello} \section{World}

\lipsum[1-40] % generate several pages of filler text

\end{document}

Mico
  • 506,678
  • Thank you for for the above suggestion. One question, this is a template for my phd thesis where text should appear (i.e., print) on both sides of the page. Does changing from twoside to oneside have any implications on this requirement? – Bob1986 Jul 12 '20 at 12:11
  • @Bob1986 - If your university requires you to use a certain template for your Ph.D. thesis, I would under absolutely no circumstance modify any of the template's settings. Do you really want to risk getting your thesis rejected by your university because some librarian determines that your thesis doesn't satisfy the formatting requirements? (Don't expect your advisers or your department to stick up for you in such a pointless fight.) I, for one, would refuse taking on such risk. – Mico Jul 12 '20 at 12:16
  • I'm a little confused, are you saying that changing from twoside to oneside will print the document on only one side of the a4 paper? – Bob1986 Jul 12 '20 at 12:21
  • @Bob1986 - That's absolutely not what I'm saying. Whether the hardcopies of your pdf file are printed on one side only or on both sides of a sheet of paper is between you, your pdf browser, and your printer; it's not determined by TeX or LaTeX. What oneside and twoside refer just some page parameters. – Mico Jul 12 '20 at 12:34
  • 1
    Okay, I understand you now. The changes you suggested work perfect. Thank you for taking the time to answer. I shall accept the answer now. – Bob1986 Jul 12 '20 at 13:06