3

When using the spanish option of the babel package, a dot is added after the section number for each section. However, fancyhdr doesn't. Here's a MWE:

\documentclass[11pt]{article}

\usepackage[spanish]{babel}

\usepackage{fancyhdr}
\pagestyle{fancy}
\fancyhead{}
\fancyhead[L]{\nouppercase{\leftmark}}
\setlength{\headheight}{14pt}

\begin{document}
\section{Section 1}
\end{document}

Resulting in the following output: enter image description here As you can see, the dot is missing after the section number in the header. How do I fix this?

1 Answer 1

3

You need to redefine \sectionmark to add the dot, e.g.:

\documentclass[11pt]{article}

\usepackage[spanish]{babel}

\usepackage{fancyhdr}
\fancyhead{}
\fancyhead[L]{\nouppercase{\leftmark}}
\setlength{\headheight}{14pt}
\renewcommand*{\sectionmark}[1]{\markboth{\thesection. #1}{}}
\pagestyle{fancy}

\begin{document}
\section{Section 1}
\end{document}

enter image description here

You must log in to answer this question.

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