Questions tagged [fancyhdr]

{fancyhdr} is a package which allows the creation of custom page headers and footers.

Filter by
Sorted by
Tagged with
5
votes
1answer
4k views

Pagenumbering on chapter pages

As part of a recent project, I want to have even and odd pagenumbering, as the document is to be printed double sided. I have added even and odd pagenumbering, which works as intended, however on ...
5
votes
1answer
3k views

Can't make fancyhdr work with pandoc + yaml header

I am trying to convert my document from Markdown to PDF using Pandoc. At the beginning of my Markdown file, I have included an YAML header. Every parameters seems to be processed, except header-...
5
votes
2answers
1k views

Choosing \firstmark and \botmark with \leftmark?

I'm very new to LaTeX, and I'm having a terribly difficult time understanding the marking system. I'm not really grasping what The LaTeX Companion and the fancyhdr manual are saying. I'm creating a ...
5
votes
1answer
436 views

Only show header if section number > 0

The current section name + chapter.section number is shown in the header. This is normal behaviour (what I want). Example: How can I remove the header text, if there is no section on the page. The ...
5
votes
1answer
1k views

Add chapter number in roman numbers using fancyhdr

I am trying to add the chapter number to the footer using fancyhdr. What I would like to do is have the chapter number in roman numbers and the page number in arabic together like so: VI - 8 This ...
5
votes
1answer
5k views

Remove Footer without removing the header

I created a header and footer using fancyhdr. I want to remove the footer from a particular page without touching the header. I tried changing the page styles but nothing worked. any idea?
5
votes
1answer
5k views

How do put a header inside the margins?

I have to create a document that obeys the following guidelines: "Margins must be set at a minimum of ¾" (1.87 cm); Your name must appear outside the set margins of the page, at the top ...
5
votes
2answers
100 views

Putting the first and the last values of a counter on a page at the header

I use a counter for my Questions. I use fancyhdr. I need to show the first and last values of the value of the counter on a page at its header. In the following example, Page 2 header should read: ...
5
votes
1answer
3k views

newlfm stopped working

I have been using the newlfm package for many years for my correspondence. Recently when I compile a letter, I get the following error message: ! Undefined control sequence. \@zfancyhead ...1\hbox ...
5
votes
2answers
924 views

header with logo on first page only of documentclass article

I am writing an article with a header on the first page only; the header includes a logo. Here is a MWE using fancyhdr: \documentclass[a4paper]{article} \usepackage{fancyhdr,graphicx} \usepackage{...
5
votes
1answer
536 views

Wrong rfoot placing after setting \newgeometry

I have a document where from a certain point onward the width of the left margin changes. To do so, I used the \newgeometry command of the geometry package. However, in the part of the document with ...
5
votes
1answer
4k views

Missing footer problem

I am trying to format my document with different header and footer for first page. I have done it successfully for the first page but the footer of the second page is not visible. I think the margins ...
5
votes
1answer
134 views

Why doesn't fancyhdr like random numbers?

In the following MWE I use \lhead{\stepcounter{step}\arabic{step}} and it works perfectly, incrementing by 1 each page. I also use \chead{\setrand{100}\arabic{rand}} and get the same number every ...
5
votes
1answer
7k views

How to remove 'Chapter 1.' from 'Chapter 1. Introduction' while using \leftmark?

MWE is below: \documentclass{report} \usepackage{fancyhdr} %\newcommand{\currentchapter}{} %\let\oldchapter\chapter %\renewcommand{\oldchapter}[1]{\oldchapter{#1}\renewcommand{\currentchapter}{#1}} %...
5
votes
1answer
1k views

Two sections on one page make fancyhdr takes the second one as page header

I have two sections on one page. Unfortunately fancyhdr takes the second one as the page header, which will result in something like seen in the image below. I want to have the first section as the ...
5
votes
1answer
7k views

Font size of the headline

I wrote a text in LaTeX with the font size as 12 pt. Now, when I create a headline the size is also 12pt. How can I change only the size of the headline? I need a 10 pt size for headlines. MWE: \...
5
votes
1answer
1k views

Change fancyhdr settings in preamble after they have already been set

I have a "standard" preamble (portion in the code below that I indicated that I really don't want to change) that I am trying to reuse. But, I want to adjust the right margin for one particular ...
5
votes
1answer
469 views

Change the color of the header line

The answer to the question fancyhdr - Change horizontal line color on top of footer is not completely satisfactory, because it changes the position of the header line, for example with this example. \...
5
votes
1answer
745 views

Header on odd pages

Is there any way to create a (multiline!) header on odd pages and no header at all on even pages? It should look like this: My code so far: \documentclass[a4paper, twoside, 12pt]{article} \...
5
votes
2answers
2k views

Small-caps headers with no standard uppercase letters (fancyhdr)

Using fancyhdr to format my headers, I want them to display the current chapter name in small caps. So with no surprise I’ve ended up doing something like this: \usepackage{fancyhdr} \pagestyle{fancy}...
5
votes
2answers
4k views

rightmark without subsection?

Does anyone know how using \documentclass{article} and \pagestyle{fancy} to define the header to display only \section and not \subsection? Fancy I defined as follows: \fancyhead{} \fancyhead[LO, LE]...
5
votes
1answer
2k views

Reduce space between header and headrule

Problem I'm trying to create fancy headers for my documents using fancyhdr. I want the headrule to be dotted, which can be achieved using \renewcommand{\headrule}{\vbox to 0pt{\hbox to\headwidth{\...
5
votes
1answer
7k views

Customize \chaptermark for \mainmatter

Hey guys it's me again, I tried to add \leftmark to my header, but I want to change it from Chapter 1. Introduction to 1 Introduction. My MWE: \documentclass[12pt, oneside, a4paper]{book} \...
5
votes
1answer
2k views

topline of fancyhdr disappears when I use tocloft

I have the problem that when I use package tocloft the line under the fancyheader disappears. It only disappears on pages with lists, like table of contents or list of figures. I would like to have ...
5
votes
1answer
3k views

Section and subsection name in headings

I'd like to make the headings of my article look like this: <Section name> <Subsection number> <Subsection name> | <Page number> and I wrote this code: ...
5
votes
1answer
944 views

Using \thesubsection in header references last instance - not first

I would like to include \thesubsection in my header, referring to the first instance of subsection, and not the last as seems to be the default. The following MWE says it all: \documentclass[a5paper]...
5
votes
1answer
2k views

How to apply custom headers/footers on pages with new chapters?

I'm writing my final report in LaTeX for my bachelor's degree. I'm aiming at having a document similar to the .doc template used normally. I want to have my customs headers and footers applied on ...
5
votes
1answer
179 views

Create a mix of horizontal and vertical text in a footer

I'm trying to make a footer in the bottom corners that has a mix of a horizontal page number, with a colored background, plus some vertical text containing fixed text (for example the title of the ...
5
votes
3answers
3k views

How to correctly include a header image only on the first page

I found a nice Latex template here and I would like to include an image to to the header which is aligned in the right side. I like the template, which is why I would like to adapt it. I included a ...
5
votes
1answer
144 views

Prepackaged tikz routine

I would like to have a single definition of my company logo. Right now, I have it defined to just fit on a letter sized paper. It is completely defined in TikZ filled paths. As you would expect, it ...
5
votes
1answer
666 views

I am at sea with the \markboth \leftmark \rightmark and so on ! Is there a simple explanation?

My problem follows from my difficulties with the english explanations on the marks, from the readmes of fancyhd or titleps, in order to modify the headers. I do not understand the business behind the ...
5
votes
1answer
2k views

Is there way to make horizontal line on the top of the page that contains only a page number

I tried to write a book of the following style: Is there a way to modify the upper horizontal line such that it does not have the word "Sisältö" or any other text except page numbers? \documentclass[...
5
votes
1answer
958 views

Two Page Numbers in One Page

I am using LyX to layout a collection of essays. There is one page-number-position per spread in the design. Please find the example below. Instead of showing 59, is it possible to show 58—59? I am ...
5
votes
1answer
492 views

move page number in a standard book shell

I'm using a standard Latex book shell to typeset a book. Does anyone know how to format page numbering as follows: for preliminary pages, e.g. title page, contents, preface, etc., put page number at ...
5
votes
2answers
6k views

section title and page number overlapping in heading; fancyhdr

I have set the headings to show the section number and name on the left side of the page, and the page number on the right. This works fine for most section names, but one particular one is a little ...
5
votes
1answer
738 views

Synctex fails for input files. Related to fancyhdr + graphicx?

I have run into a problem with the synctex option of pdflatex that seems to be related to the fancyhdr and graphicx package. Problem: Forward and inverse search between editor and PDF viewer work ...
5
votes
0answers
49 views

Special plain header gets deleted by editing font size in doc [closed]

After reading on this website, I have created a header on the first page that is different from the rest of the pages headers writing this in the preamble: \documentclass[twoside,12pt]{article} \...
4
votes
4answers
691 views

Center footer wrt paper, not margins

Im writing a thesis. The requirements are 1.5in left margin and 1 in right. In addition, the page number must be in the right hand corner except on the first page of every chapter where it must be ...
4
votes
3answers
636 views

How to align a picture in a 2 lines fancyhdr header

I use fancyhdr to create my header, i have this code: \usepackage{fancyhdr} \pagestyle{fancy} \usepackage{lastpage} \fancyhead[L]{\includegraphics[width=1cm]{logosmall.jpg} \textbf{Title of my ...
4
votes
2answers
138 views

Headers forget chapter name

I'm trying to insert headings in my report using fancyhdr. I want the current chapter's name on the right corner of each page (one sided document). the problem is that when, inside a chapter, I add ...
4
votes
1answer
1k views

\chaptermark in tikz header (book design)

How can I add the current chapter and section to the node? \node[color=white, anchor=west] at ($(current page.north west) - (-10ex,3.5ex)$) {\ifnum\value{chapter}>0 \thechapter.~\chaptermark\fi}; ...
4
votes
3answers
1k views

Fancyhdr - Is it possible to have a small table inside header?

Ok, I'm trying to create this type of formatting for each of my pages: Now, I want to have this on every single page, in the header on the right hand side. I currently have the following: \...
4
votes
3answers
12k views

Header or footer of title page differs with that of main text

My purpose is that every page except title page has same header and footer. for title page, ==> it has exactly same footer with that of other page. ==> and it has completely different header with ...
4
votes
2answers
1k views

No page number on the first page of an Index (not ToC)

The publishing house I am going to publish a book with demands no page number on the first page of each chapter. I used \thispagestyle{empty} in most cases and had to use \renewcommand{\bibsetup}{\...
4
votes
3answers
17k views

Different header and footer on the title page (first page)

I have been racking my brains over how in bloody hell can you have a different header for the title (or first) page of a document. I am not asking here how I can not have a header by clearing the ...
4
votes
2answers
715 views

How to include headers and footers for pages between chapters?

\documentclass[12pt,a4paper,openright]{mwrep} \usepackage{lipsum} \usepackage[top=2cm,bottom=2cm,left=3cm,right=2cm,twoside]{geometry} \usepackage{fancyhdr} \pagestyle{fancy} \fancyhf{}\fancyfoot[EL,...
4
votes
1answer
8k views

How to get header and footer over ToC, LoF and Nomeclature?

I would like to know how we include header and footer over Table of Contents, List of Figures and Nomenclature? Do we need to renew any command? or any package is used to do that? Sample script would ...
4
votes
1answer
261 views

Changing \headheight pushes footer off page

Preface: NOT a duplicate of My footer disappears when I increase headheight - I tried the accepted answer here and still ran into issues. I am using Overleaf to create some documentation for ...
4
votes
2answers
7k views

How do I show the subsection name and the subsubsection number and name in a fancyhdr header?

For example: \documentclass{article} \usepackage{fancyhdr} \usepackage{blindtext} \pagestyle{fancy} \fancyhf{} \fancyhead[L]{\leftmark} % displays the section (1. SECTION NAME) \fancyhead[R]{\...
4
votes
2answers
1k views

Replacing \fancyhdr with \titlesec in complicated design documents

Thes page on the picture below (from this post) has been created within \fancyhdr package, but I need to something like this keeping incompatible \titlesec usage and using twopage layout. Really, I ...

1
3 4
5
6 7
29