0

I have seen this:

Formatting headers in the book class

And I want what the asker has in their question:

\documentclass[10pt]{book}
\usepackage{blindtext}
\usepackage[a4paper]{geometry}
\usepackage{fancyhdr}

\fancyhead[LE,RO]{\thepage}
\fancyfoot{}

\cfoot{} % get rid of the page number 

\pagestyle{fancy}

\begin{document}
  \blinddocument
\end{document}

I am able to run this MWE. However, I have a modular document: I input other .tex files and compile everything together into one document.

For example, I have (thesis.tex):

\documentclass[letterpaper,12pt,titlepage,openright,twoside,final]{book}

\usepackage[flushleft]{threeparttable}
\usepackage{amsfonts}
\usepackage{fancyhdr}

\usepackage{mathtools,dcolumn,epsfig,rotating,bm}

\usepackage[utf8]{inputenc} %just added
\setlength{\marginparwidth}{0pt} % width of margin notes
\setlength{\marginparsep}{0pt} % width of space between body text and margin notes
\setlength{\evensidemargin}{0.125in} % Adds 1/8 in. to binding side of all 
\setlength{\oddsidemargin}{0.125in} % Adds 1/8 in. to the left of all pages
\setlength{\textwidth}{6.375in} % assuming US letter paper (8.5 in. x 11 in.) and 
% side margins as above
\raggedbottom

%\fancyhead[LE,RO]{\thepage}
%\cfoot{} 
%\pagestyle{fancy}
\begin{document}
\input{document1.tex}
\input{document2.tex}
\end{document}

For ease of replication, suppose document1.tex is:

% !TeX root = thesis.tex
\chapter{}
Text is here in chapter 1.

and document2.tex is:

% !TeX root = thesis.tex
\chapter{}
Text is here in chapter 2.

But I can't get the header to be inside the margin. That is, I want "CHAPTER 1" and all other headers to be within the upper margin area, instead of inside the text area.

EDIT: Maybe it's easier to ask: how do I put the header higher up on the page?

Any ideas on how I can do that?

  • It's not exactly clear what you're after. You mention that "the header [should] be inside the margin." Which margin? – Werner Nov 19 '19 at 06:27
  • Thanks @Werner, I mean that I would like the header to be inside the top margin. That is, I want it to be above the first line of text. – StatsSorceress Nov 19 '19 at 19:24
  • @Werner, that is, I'd like to have the header higher up on the page, and bring the bottom of the line that indicates where the header is, up to that point. – StatsSorceress Nov 19 '19 at 19:41
  • Do you really mean header? Or do you mean "chapter head"? When I compile the file you included, on pages 1 and 3 there are no headers, because for the first pages of new chapters a different pagestyle is usually used. On page 2 I see correctly the header "CHAPTER 1" appearing on the top right of the page (near the spine). – Willie Wong Nov 19 '19 at 20:05
  • If you are asking about how to move the words "CHAPTER 1" that appears on page 1 higher up the page, what you are looking for is a way to customize chapter titles, and you should look into the titlesec package. – Willie Wong Nov 19 '19 at 20:06

0 Answers0