7
votes
Accepted
How to center lines of text using fancyhdr
Use a tabular in the head.
\documentclass{article}
\usepackage{fancyhdr}
\pagestyle{fancy}
\lhead{\begin{tabular}[b]{@{}c@{}}
Short Name \\ Really long Name
\end{tabular}}
\chead{Title}
\rhead{Date}
\...
6
votes
Accepted
How to Display the Page Number Only (No Header) for Chapter Pages; Header Only, Elsewhere
Don't use \pagestyle{fancyplain}. It is obsolete, and it messes up your chapter opening pages. And use modern fancyhdr commands like \fancyhead, this is much clearer.
Then the chapter pages ...
5
votes
Accepted
My new definition of the footer is not used in the table of contents: why?
By default, the book document class uses the plain page style for the first pages of chapter-like document units and the headings page style for all other pages. (Aside: The LaTeX kernel defines four ...
5
votes
Accepted
Why is my bottom margin ALWAYS bigger than the other margins even with the package geometry?
You have contradictory requests. The text height you get from your options is
455.24411pt
The pages without titles have 31 lines, with
\topskip=12pt
\baselineskip=14.5pt
If you compute
12 + 30 · 14....
5
votes
Get surnames from \author command
Probably the manual approach is much easier. bib{tex,latex} has a lot of code for that, and it's always based on the fact that in the database you manually divide them.
For example (fake names), I am ...
5
votes
Accepted
fancyhdr long section name overlaps page number
The normal way is to use \section[short title for ToC and header]{Long title for main document}.
\section[ABBREVIATED TITLE]{REALLY REALLY REALLY REALLY REALLY REALLY LONG TITLE OF SECTION}
I'm sure ...
4
votes
How to prevent background image from covering header and footer
You don't need tikz for this. With a current LaTeX you can simply use the shipout hook:
\documentclass{article}
\usepackage{geometry,fancyhdr,graphicx}
\geometry{showframe}
\begin{document}
\...
4
votes
Accepted
Custom Footers for each group of pages using simple commands
You can use the following as a starting point. It defines \newfooter to update \customfooter - a macro that is set in the footer on pages other than the starting chapter page. Since footers are bound ...
4
votes
Accepted
Running heads with amsbook
It's actually easy (possibly an oversight in amsbooka).
\documentclass{amsbook}
\usepackage{amsbooka, lipsum}
% redefine \sectionmark so it doesn't issue a mark
\renewcommand{\sectionmark}[1]{}
\...
4
votes
fancyhdr and rightmark - how to remove the dot
If you wish to keep the entire structure the same, you can patch \sectionmark and perform a search-and-replace; add the following to your preamble:
\usepackage{etoolbox}
% \patchcmd{<cmd>}{<...
4
votes
Accepted
putting two distinct images on event and odd paged headers
Since the page style elements are set when the page numbers are fully known, you can easily condition on whether or not you're on an odd/even page with \ifodd\value{page} <odd page>\else <...
3
votes
Do you have this template for writing article?
With tcolorbox:
\documentclass{article}
\usepackage{mwe}%<--- for testing purpose only
\usepackage{geometry}
\usepackage{setspace}
\usepackage{anyfontsize}
\usepackage[most]{tcolorbox}
\...
3
votes
Accepted
Unwanted Text, when using the Nucleic Acid Research LaTeX template
It's quite curious that the ZIP file provides a very outdated version of crop.sty (1.6, released 2001/11/16), when the current version of crop.sty is 1.10, released 2017/11/19.
If I remove crop.sty ...
3
votes
My new definition of the footer is not used in the table of contents: why?
For a document with a table of contents of more than one page, redefining page style plain will be necessary. But then this will also change the footer of the first page of each chapter. If you don't ...
3
votes
Accepted
confused about setting header and footer information?
Use the package fancyhdr. The plain TeX/LaTeX commands are rather confusing (as you found out).
\documentclass{article}
\usepackage{fancyhdr}
\pagestyle{fancy}
\fancyhead[L]{\leftmark}
\fancyhead[R]{...
3
votes
hrule in footer, alignment
A simple way to place a rule above the pagenumber is to disable the automatic placement and use \setupfootertexts to put the pagenumber in the footer.
\setuppagenumbering
[location=]
\startsetups [...
3
votes
Accepted
jinja template engine statement conflicts with {%
I second the comment about escaping combinations like {% and {{. Even if you could avoid the {% combination, you probably could not avoid all the others.
To answer your last question:
According to ...
3
votes
Accepted
fancyhdr and rightmark - how to remove the dot
Add \renewcommand{\sectionmark}[1]{\markright{\thesection ~ \ #1}}
\documentclass[12pt,twoside]{report}
\usepackage[english]{babel}
\usepackage{blindtext}
\usepackage{fancyhdr}
\pagestyle{fancy}
\...
3
votes
fancyhdr and rightmark - how to remove the dot
The dot is added in \sectionmark, which is defined by
\def\sectionmark##1{%
\markright {\MakeUppercase{%
\ifnum \c@secnumdepth >\z@
\thesection. \ %
\fi
##1}}}}
in standard ...
3
votes
Remove Number Label from \sectionmark
You made the rigid page style using \pagestyle{plain}. Remove this and Try the following:
\documentclass[12pt]{article}
% PREAMBLE ---------------------------------------------------------------------...
3
votes
Different headers for first page and following pages even and odd
You can adjust the page layout using the shipout/after hook.
\documentclass{article}
\usepackage{showframe}
\makeatletter
\newdimen\evenoddheadheightdiff
\def\addtoheadheight#1{%
\@tempdima=#...
3
votes
Accepted
Customize footline{} in Beamer
To completely remove the header use
\setbeamertemplate{headline}{}
\documentclass[10pt,english,8pt]{beamer}
\usetheme{CambridgeUS}
\usetheme{default}
\usecolortheme{crane}
\setbeamertemplate{...
3
votes
scrletter/scrlttr2 footer position and format
In your MWE you set footskip=1cm (distance between the text area and the baseline of the footer) and footheight=2cm (height of the footer box). Therefore the footer overlaps the text area.
The first ...
3
votes
Accepted
horizontal and vertical Headers in long table
Your table is to huge that can be fit on one page with readable size of font in table. As solution can be long table in landscape orientation split between two page.
Off-topic:
by use of tabularray (...
3
votes
Accepted
Formatting \pagemark with LaTeX
Here is a suggestion using \addtokomafont and \setkomafont for the font settings in page header and footer.
\documentclass[twoside]{scrbook}
\usepackage{xcolor}
\usepackage{graphicx}
\usepackage{...
3
votes
Accepted
Headers not aligned with the text frame
Actually, the spaces are introduced by the \addto\extrasenglish command. Add % to the end of the lines that don't end with a macro.
\addto\extrasenglish{%
\renewcommand{\chapterautorefname}{...
2
votes
Help with fancyhdr on custom page sizes
In fact if you set \pdfpagewidth and \pdfpageheight, and then you call \newgeometry with the proper parameters, it will pick up the new page size.
This is not documented, so it may be considered ...
2
votes
Accepted
Page number display issue with proc class
The layout package helps to display margins and other page layout parameters.
There are differences between \documentclass{proc} and \documentclass[twocolumn]{article}, and also when including the ...
2
votes
How can I align a "right" footer with the second column in a twocolumn document?
Got around to figure out how to actually code the text box. It would simply be:
\fancyfoot[R]{\makebox[\columnwidth]{Right footer text \hfill \thepage}}
Minimum working example:
\documentclass[...
2
votes
Accepted
How do I adjust the page size such that I can fit a large header and footer into my page?
I made some changes to the fancy header definitions but mostly to the implementation of the geometry package.
To get back the default geometry on the second page is not an easy task if you don't do ...
Only top scored, non community-wiki answers of a minimum length are eligible
Related Tags
header-footer × 3870fancyhdr × 965
page-numbering × 392
beamer × 302
koma-script × 284
sectioning × 261
table-of-contents × 225
chapters × 185
memoir × 181
margins × 162
geometry × 116
titles × 110
scrlayer-scrpage × 88
formatting × 84
graphics × 83
spacing × 79
tikz-pgf × 73
tables × 69
titlesec × 68
scrpage2 × 67
numbering × 60
rules × 56
color × 54
double-sided × 54
bibliographies × 51