2

I need help with the preamble. Here is the code

\documentclass[12pt,letterpaper]{book}
\ProvidesLanguage{Italian}
\usepackage[italian]{babel}
\usepackage[ansinew]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{fancyhdr}
\usepackage[pdftex]{graphicx}
\usepackage{booktabs}
\usepackage{fancyhdr}
\usepackage{geometry}
\usepackage{amsmath}
\usepackage{amscd}
\usepackage{amsxtra}
\usepackage{amsthm}
\usepackage{enumerate}
\usepackage{amsfonts}
\usepackage{amssymb}
\usepackage{float}
\usepackage{titlesec}
\usepackage{xcolor}
\usepackage{parskip}
\usepackage{lipsum}

% THEOREMS -------------------------------------------------------
\theoremstyle{definition}
\newtheorem{thm}{Teorema}[section]
\newtheorem{cor}[thm]{Corollario}
\newtheorem{lem}[thm]{Lemma}
\newtheorem{prop}[thm]{Proposizione}
\theoremstyle{definition}
\newtheorem{defn}[thm]{Definizione}
\newtheorem{conj}[thm]{Congettura}
\newtheorem{ex}{Esempio}[section]
\theoremstyle{remark}
\newtheorem{oss}[thm]{Osservazione}
% ----------------------------------------------------------------

\pagestyle{fancy}
\fancyhead{}
\fancyhead[R]{\itshape\nouppercase\rightmark}
\fancyhead[L]{\itshape\bfseries\nouppercase\thepage}
\fancyfoot{}
\renewcommand{\headrulewidth}{0.5pt}
\renewcommand{\footrulewidth}{0pt}

\fancypagestyle{plain}{
\fancyhead{}
\fancyfoot{}
\renewcommand{\headrulewidth}{0pt}
\renewcommand{\footrulewidth}{0pt}
}

%--CHANGE CHAPTER TITLE------------------------------
\titleformat{\chapter}[display]
 {\normalfont\bfseries}{}{0pt}{\Huge}
\titlespacing*{\chapter}
 {0pt}{20pt}{40pt}
%----------------------------------------------------


\begin{document}
\sffamily

\frontmatter

\begin{titlepage}
\centering
\huge{Title}
\end{titlepage}
\cleardoublepage

\tableofcontents

\chapter*{Introduction}

\lipsum[1-10]

\mainmatter

\part{Part1Name}

\chapter{Chapter1Name}

\lipsum[1-2]

\section{Section11Name}

\lipsum

\section{Section11Name}

\lipsum[1-2]

\chapter{Chapter2Name}

\lipsum[1-2]

\section{Section21Name}

\lipsum

\end{document}

How can I have blank pages when they are empty? As you can see pages ii,iv,viii,6 are not blank. I'd like them to be blank but without altering the numeration.

Furthermore pages vi and vii have the wrong name on top (it should be "Introduction").

Is there also a way to have the number of the page on the top-left in the left pages and on the top-right in the right pages of the book?

0
3

Your preamble includes a lot of packages that aren't relevant to the problem (or rather: the three problems) at hand, but your example does show those problems. So here are the answers:

  1. Load the emptypage package.

  2. Add \markboth{Introduction}{Introduction} immediately after \chapter*{Introduction}. (Alternatively, you could simply use \chapter{Introduction} -- this will cause a ToC entry for the introduction, but -- as it is located in the \frontmatter -- won't turn on chapter numbering.)

  3. Specify different settings for even and odd pages in the optional argument of \fancyhead.

Other notes:

  • The \cleardoublepage before \tableofcontents is superfluous.

  • The preferred way to switch to sans-serif as main font is to add \renewcommand*{\familydefault}{\sfdefault} in the preamble.


\documentclass{book}

\usepackage{fancyhdr}
\usepackage{emptypage}
\usepackage{lipsum}

\pagestyle{fancy}
\fancyhead{}
\fancyhead[RE,LO]{\itshape\nouppercase\rightmark}
\fancyhead[LE,RO]{\itshape\bfseries\nouppercase\thepage}
\fancyfoot{}
\renewcommand{\headrulewidth}{0.5pt}
\renewcommand{\footrulewidth}{0pt}

\fancypagestyle{plain}{
\fancyhead{}
\fancyfoot{}
\renewcommand{\headrulewidth}{0pt}
\renewcommand{\footrulewidth}{0pt}
}

\renewcommand*{\familydefault}{\sfdefault}

\begin{document}

\frontmatter

\begin{titlepage}
\centering
\huge{Title}
\end{titlepage}

\tableofcontents

\chapter*{Introduction}
\markboth{Introduction}{Introduction}

\lipsum[1-10]

\mainmatter

\part{Part1Name}

\chapter{Chapter1Name}

\lipsum[1-2]

\section{Section11Name}

\lipsum

\section{Section11Name}

\lipsum[1-2]

\chapter{Chapter2Name}

\lipsum[1-2]

\section{Section21Name}

\lipsum

\end{document}
7
  • Three-in-one question with non-minimal working example -- meta.tex.stackexchange.com/questions/2414/… ?
    – doncherry
    Nov 7 '12 at 17:47
  • Thank you for your help, now it works. I knew some packages were not relevant but I left them because I didn't know if the problem was due to some conflit among them.
    – Emmet
    Nov 7 '12 at 21:55
  • @doncherry Three questions and non-minimal: true. But it is a working example, which sadly isn't true for a lot of other questions.
    – lockstep
    Nov 7 '12 at 23:18
  • @lockstep Implying that we're lowering our standards?
    – doncherry
    Nov 7 '12 at 23:48
  • @doncherry Perhaps implying that we don't raise them.
    – lockstep
    Nov 7 '12 at 23:52
1

Put the command \thispagestyle{empty} on the pages that shall be left blank.

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.