# How to insert the section name in the footer, without keeping the section name formatting?

The code that I use for the header and footer in the article format is as follows:

\usepackage{fancyhdr}

\pagestyle{fancy}
\fancyhf{}
\renewcommand{\footrulewidth}{1.0pt}
\rfoot{Page \thepage}
\lfoot{\leftmark}


The problem is that this also prints the formatting that I've put to the section name to make it stand out:

\section{\LARGE{\textbf{Introduction}}}


This just increases the size, and makes the section name bold. So how do I put the current section name in the footer, without the footer name also being big and bold.

You're following the wrong approach. You should avoid setting sectional formatting inside the title, since this would make its way into the marks (typically used in headers/footers) and also the ToC, which is not ideal.

Instead, use something like sectsty to format your sectional fonts (see Change size of section, subsection, subsubsection, paragraph and subparagraph title):

\documentclass{article}

\usepackage{sectsty,fancyhdr}
\sectionfont{\LARGE\bfseries}% https://tex.stackexchange.com/q/59726/5764

\pagestyle{fancy}
\fancyhf{}
\renewcommand{\footrulewidth}{1.0pt}
\rfoot{Page \thepage}
\lfoot{\leftmark}

\makeatletter
\renewcommand{\sectionmark}[1]{%
\markboth{\ifnum \c@secnumdepth>\z@
\thesection\hskip 1em\relax
\fi #1}{}}
\makeatother

\begin{document}

\tableofcontents

\section{Introduction}

\end{document}


Above I also updated the \sectionmark macro to avoid inserting \MakeUppercase as part of the default construction. You can remove that if necessary.

• Unfortunately I can't use a table of contents for the project that I'm doing, e.g. its just the section name and then the text. So how would I change the code above to do that. Also what does the code between \makeatletter and \makeaother do? – UniStuffz Nov 6 '16 at 19:45
• @UniStuffz: You can just remove \tableofcontents. I added it just to show that the formatting of the section title doesn't transfer into the ToC. The \makeatletter...\makeatother pair allows the use of @ inside macro names - something that is typically reserved for low-level programming. See What do \makeatletter and \makeatother do? – Werner Nov 6 '16 at 19:50
• this worked perfectly thank you, usually I stay over at maths stack exchange, but thanks for answering my first question here. – UniStuffz Nov 6 '16 at 20:28

If you use a KOMA-class (scrartcl and so on) you can accomplish this without fancyhdr and with scrlayer-scrpage.

\documentclass{scrartcl}

\usepackage{scrlayer-scrpage}
\usepackage{lipsum}

\setkomafont{section}{<formatting>}% changes the formatting of headlines
\KOMAoptions{%
footsepline=1pt
}

\chead{}% if you leave this out the pagehead will contain the sectionnames, too
\ifoot{\headmark}% the i is for inner side of the page if you use twoside and left side if you use oneside
\cfoot{}% if you leave this out the pagenumber will be in the center, too
\ofoot{Page \pagemark}
\automark[section]{section}