0

I am using the "twoside" option but the page number is still just written in the bottom in the middle of a page. I would like the page number to alternate between being on the left bottom corner and right as this will be printed as a book.

Here is the main.tex -file

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

% Load custom course package
\usepackage{digsi}

\usepackage{glossaries}

\usepackage{pifont}

\usepackage{xcolor}

\usepackage{colortbl}
\usepackage{tabulary}
\usepackage{etoolbox}
\usepackage{graphicx}

%Packages I added myself
\usepackage{listings}

\usepackage{lmodern}  % for bold teletype font
\usepackage{amsmath}  % for \hookrightarrow
\usepackage{xcolor}   % for \textcolor
\edef\restoreparindent{\parindent=\the\parindent\relax}
\usepackage{parskip}

\lstset{
  basicstyle=\ttfamily,
  columns=fullflexible,
  frame=single,
  breaklines=true,
  postbreak=\mbox{\textcolor{red}{$\hookrightarrow$}\space},
}


% Change to standard Microsoft Word margins
\usepackage[margin=1in]{geometry}

% Change to 1.5 line spacing
%\usepackage{setspace}
%\onehalfspacing

% Set thousands separator in numbers
\npthousandsep{ }

% Fix overfull lines in bibliography
\emergencystretch=1.7em

\makeglossaries

\begin{document}
% Front page
\input{title}

\input{content/abstract.tex}
\input{content/preface.tex}


% Contents and lists
\tableofcontents
\listoffigures
\listoftables
%\begingroup
%\let\clearpage\relax
%\endgroup
\printglossaries

\chapter{Introduction}\label{cha:intro}
\input{content/00_intro.tex}

\chapter{Background Theory}\label{cha:problemDomain}
\input{content/01_problem_domain.tex}

\chapter{Related Work}\label{cha:relatedWork}
\input{content/02_related_work.tex}

\chapter{Method}\label{cha:relatedWork}
\input{content/03_method.tex}

\chapter{Results}\label{cha:relatedWork}
\input{content/04_results.tex}

\chapter{Discussion}\label{cha:relatedWork}
\input{content/05_discussion.tex}

\chapter{Conclusion}\label{cha:relatedWork}
\input{content/06_conclusion.tex}

\printbibliography[heading=bibintoc,title={References}]
\appendix
\input{content/appendix}

\end{document}
  • 3
    possibly you want \pagestyle{headings} (or use the fancyhdr package to set up a more specific heading. Your example code doesn't really help us to answer as no one can run it, it would have been better to make a smaller example with no \input of files that we don't have. – David Carlisle May 18 at 4:34
  • 2
    If I try to make a compilable MWE out of your code, I get a document with the page numbers in the header with odd page numbers on the right and even page numbers on the left. The reason for the page numbering you describe must be hidden in some code you did not show. Therefore, please make a minimal working example (MWE) that allows others to reproduce the issue you describe. Please also include the source of digsi.sty. I could not find it on CTAN. – leandriis May 18 at 9:19

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.