2

This is a minimal working example. Compiling this main code:

\documentclass[a4paper,oneside,italian,12pt,openright]{memoir}
\usepackage{tocloft}
\aliaspagestyle{part}{empty}
\usepackage[font=small]{quoting}
\usepackage[utf8]{inputenc} % scrivere in italiano correttamente
\usepackage[italian]{babel}
\usepackage[T1]{fontenc}
\usepackage[natbibapa]{apacite}
\usepackage{indentfirst}
\usepackage[sectionbib]{chapterbib}
\usepackage[usenames]{color}
\definecolor{citations}{rgb}{0,.5,.5} 
\definecolor{link}{rgb}{0,0,1}
\usepackage{doi}
\usepackage{hyperref}
\hypersetup{
   colorlinks,breaklinks,
   linkcolor = {black}, % e.g. footnotes
   urlcolor = {link},
   anchorcolor = {link},
   citecolor = {citations}}
\usepackage{microtype}
\usepackage{mathptmx}
\usepackage{rotating}
\usepackage{multirow}
\usepackage{amsmath}
\usepackage{url}
\urlstyle{rm}
\usepackage{graphicx}

\usepackage[font=footnotesize,labelfont=bf,labelsep=space]{caption}

\usepackage{textcomp}

\pagestyle{ruled}

\raggedbottom

% numerare sottosezioni e mostrarle nell'indice
\settocdepth{subsection}
\setsecnumdepth{subsection}

\renewcommand*\rmdefault{ppl} % font palatino

\graphicspath{{Figures/}}

\usepackage[top=3cm,bottom=3cm,right=3cm,left=4cm]{geometry} % margins

% Bibliografia non numerata
\AtBeginDocument{
  \renewcommand{\bibsection}{%
    \section*{\bibname}
    \bibmark
    \ifnobibintoc\else
      \phantomsection
      \addcontentsline{toc}{section}{\bibname}
    \fi
    \prebibhook
  }
}

\begin{document}
    \OnehalfSpacing
    \chapterstyle{madsen}
    \renewcommand*{\chapnumfont}{\normalfont\HUGE\bfseries\rmfamily}
    \renewcommand*{\chaptitlefont}{\normalfont\HUGE\bfseries\rmfamily}
    \frontmatter
    \begin{KeepFromToc}
        \tableofcontents
    \end{KeepFromToc}
    \mainmatter
    \include{Chapter}
\end{document}

with this chapter file:

\chapter{Chapter title}

Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur mollis luctus libero. Duis accumsan a eros ut fringilla. Quisque leo metus, sodales quis accumsan nec, posuere at nisi. Aliquam vitae scelerisque justo. Nulla facilisi. Fusce leo augue, fringilla ut tincidunt nec, pharetra in est. Duis ultrices tempor suscipit. Sed sit amet quam et nisi lacinia pulvinar. Sed quis mattis tellus. Sed adipiscing pulvinar sem, nec egestas orci.

Pellentesque ante nisl, adipiscing sed neque et, tempus ultricies erat. Integer sed viverra ipsum. Morbi consequat vehicula justo id ullamcorper. Vivamus ut tortor auctor, ultrices sem quis, luctus metus. Curabitur augue mauris, cursus sed condimentum sit amet, commodo ut lorem. Pellentesque sit amet sodales metus, ac ultricies purus. Praesent eu dui sed lectus elementum hendrerit id in tellus. Phasellus malesuada vestibulum tincidunt.

Suspendisse sollicitudin quam sed congue scelerisque. Nulla arcu dolor, euismod ac est a, posuere volutpat nulla. Nullam cursus nulla eu augue commodo, eu vehicula lectus accumsan. Duis et tortor pellentesque, tristique quam sit amet, porta dui. Phasellus in semper ligula, ac pretium diam. Integer hendrerit mi eget mauris porta euismod vel in massa. Etiam felis nulla, porta nec iaculis eget, ultricies sed nisi. Aenean suscipit posuere rutrum. Sed posuere vestibulum laoreet. Curabitur eros sapien, imperdiet non sapien adipiscing, dapibus venenatis tortor. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Sed vel justo aliquet, consequat turpis sed, tempor felis. Mauris ornare metus nisi, ac consequat nunc vestibulum non. Phasellus eu pellentesque nulla, sit amet mattis diam.

Duis auctor eget nisi adipiscing interdum. Phasellus at blandit lectus. Praesent venenatis quis justo in euismod. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia Curae; In quis risus adipiscing, vulputate risus et, ornare justo. Curabitur tincidunt, libero non iaculis bibendum, felis odio aliquet quam, luctus volutpat libero nisl in nibh. Phasellus sodales neque augue, in cursus neque feugiat a. Nam egestas arcu et enim consequat varius. Cras convallis lobortis fermentum. Suspendisse fringilla leo nec purus semper gravida. Nulla facilisi. Sed pharetra quam quis quam interdum venenatis. Pellentesque aliquet quis tellus non facilisis. Donec nec metus posuere, porttitor felis cursus, lobortis metus.

Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Vivamus tincidunt, lacus in varius venenatis, nibh orci luctus leo, ut mollis dui dui eu justo. Suspendisse id iaculis lacus. Ut porttitor risus at lectus congue iaculis et nec erat. Aliquam eleifend ultrices massa, vitae vulputate tortor. Pellentesque venenatis condimentum nisi, at bibendum ipsum sollicitudin at. Maecenas in ipsum ornare, sagittis ipsum in, volutpat velit. Integer pharetra diam in gravida rhoncus.

The first page of the Table of contents and of the chapter has the page number centered, while the others have the page on the right.

I want that all the pages have the page number on the right, also the first page. How can I do that?

4

It is tradition that chapter(-like) headers etc have no content because that ruins the chapter design. So most people just center the page number on chapter-like pages.

I would leave the headers empty on chapter like pages, and perhaps instead place the page number at the bottom of the page at the side instead. The code would be

\makepagestyle{mychapter}
\makeoddfoot{mychapter}{}{}{\thepage}
\makeevenfoot{mychapter}{\thepage}{}{}
% replace the std chapter alias
\aliaspagestyle{chapter}{mychapter}

One can also get away with

\copypagestyle{mychapter}{ruled}
\makeoddhead{mychapter}{}{}{}
\makeevenhead{mychapter}{}{}{}
\aliaspagestyle{chapter}{mychapter}
  • It works, thanks. BTW, my page numbers were already at the bottom, not at the top. – this.is.not.a.nick Jan 22 '14 at 14:21

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.