2

Only on the first page I would like to suppress the header and to keep the footer.

I tried the command \thispagestyle{plain}, but it suppresses both the header and the footer.

\documentclass[a4paper]{article}
\usepackage[german]{babel}
\usepackage[utf8]{inputenc}
\usepackage[margin=1in]{geometry}
\usepackage{fancyhdr}
\pagestyle{fancy}
\usepackage{hyperref}
\usepackage{tikz} 
\usetikzlibrary{calc,intersections} 

\lhead{Mathe (123)}
\rhead{Course 1}
\cfoot{ - \thepage\hspace{1pt} -}
\lfoot{\vspace{3mm}my name (123)\\ \footnotesize{\href{mailto:test.test@com}{[email protected]}}}
\rfoot{\vspace{3mm}\today}

\begin{document}

%\thispagestyle{plain}
\section*{Section .1}

\end{document}

enter image description here

Thanks

4
  • \thispagestyle{plain}?
    – Johannes_B
    Sep 7, 2017 at 9:08
  • no, that sentence suppresses foot and head :( Sep 7, 2017 at 9:53
  • Wee, i guess it is time to show a minimal working example for us to reproduce your problem. What you are describing is not normal and caused by your document.
    – Johannes_B
    Sep 7, 2017 at 10:09
  • @Johannes_B I updated my question Sep 7, 2017 at 10:44

2 Answers 2

2

With out and MWE I think this is the easiest (assuming you are using fancyhdr)

\documentclass{article}

\usepackage{fancyhdr}
\pagestyle{fancy}

\lfoot{Bottom Left}
\cfoot{\thepage}
\rfoot{Bottom Right}
\lhead{Top Left}
\chead{Top Center}
\rhead{Top Right}

\fancypagestyle{firstpage}{
    \fancyhead{}
    \renewcommand{\headrulewidth}{0pt}}

    \begin{document}
    \thispagestyle{firstpage}
        Lorem Ipsum
        \clearpage
        Lorem Ipsum
        \clearpage
    \end{document}

enter image description here

Basically define your headers and footers, then make a new fancypagestyle{<name>}{<style_settings>} where you clear the head and head rule. The footer will remain intact.

0
2

You don't even have to define a special pagestyle explicitly through fancyhdr:

\AtBeginDocument{\thispagestyle{bybassheader}}
\def\ps@bybassheader{\let\@thehead\@empty}

Note that I used a hook to keep the document itself clean, i.e.

...
\begin{document}
\section*{Section .1}
...

You also have to keep in mind that adding \maketitle will mess up your settings unless you specify something like

\let\ps@plain\ps@fancy
\g@addto@macro\maketitle{\thispagestyle{bybassheader}}

The complete code would be:

\documentclass[a4paper]{article}
\usepackage[german]{babel}
\usepackage[utf8]{inputenc}
\usepackage[margin=1in]{geometry}
\usepackage{fancyhdr}
  \lhead{Mathe (123)}
  \rhead{Course 1}
  \cfoot{ - \thepage\hspace{1pt} -}
  \lfoot{\vspace{3mm}my name (123)\\ \footnotesize{\href{mailto:test.test@com}{[email protected]}}}
  \rfoot{\vspace{3mm}\today}
\usepackage{hyperref}

\makeatletter
\let\ps@plain\ps@fancy
\g@addto@macro\maketitle{\thispagestyle{bybassheader}}
\AtBeginDocument{\thispagestyle{bybassheader}}
\def\ps@bybassheader{\let\@thehead\@empty}
\makeatother

\pagestyle{fancy}

\title{Suppress the header while leaving the footer as is}
\author{Darío A. Gutiérrez}
\date{\today}

\begin{document}
\maketitle
\section*{Section .1}
\clearpage\null
\end{document}

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .