Page LayoutQuestions about fancyhdr

Information and discussion about page layout specific issues (e.g. header and footer lines, page formats, page numbers).
Post Reply
foofighter
Posts: 2
Joined: Mon Aug 02, 2010 11:51 am

Questions about fancyhdr

Post by foofighter »

Hello there

I'm studying physics and have to do some experiments next month. Since I'm pretty new to Latex I thought it would be a good idea to finish the layout before it will become stressful.

The problem I am facing at the moment is that I want to see the Section name or a short version of it on the left of the headline. Most things I've found about it was a bit confusing to me so here I am :)

My current document looks like this:

Code: Select all

\documentclass[a4paper,fontsize=11pt]{scrartcl}  
\usepackage[utf8]{inputenc}					%Enable umlaut input
\usepackage[ngerman]{babel}					%Enable umlaut output
\usepackage{amsmath}						%Enable
\usepackage{graphicx}						%Enable pictures

\usepackage{fancyhdr}						%Enable Fancy pagestyle
\pagestyle{fancy} 						%Use Fancy pagestyle

  \fancyhf{} 							%Clear head-/footline
  \fancyhead[L]{} 						%Header left
  \fancyhead[C]{} 						%Header center
  \fancyhead[R]{\thepage} 					%Header right
  \renewcommand{\headrulewidth}{0.4pt} 				%Seperate headline



\date{\today}
\title{Versuchsprotokoll}
\author{}	%Authors

\begin{document}
\maketitle
\tableofcontents
\thispagestyle{empty}

\newpage
\pagenumbering{arabic}						%Reset Page numbering
\section{Versuchsziel}

[...]

\end{document}
Another problem I am having (that doesn't really belong here) is that I get a warning when I convert it.
Package babel Warning: No hyphenation patterns were loaded for
(babel) the language `ngerman'
(babel) I will use the patterns loaded for \language=0 instead.
This just occurs when I convert on Linux (Kubuntu, Kile, TexLive) not on Windows (Win7, Texmaker, MikTex)

I'm thankfull for ANY comments on that document.

Greetings Raoul
Last edited by foofighter on Tue Aug 03, 2010 10:31 am, edited 1 time in total.

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

NEW: TikZ book now 40% off at Amazon.com for a short time.

Stefan Kottwitz
Site Admin
Posts: 10345
Joined: Mon Mar 10, 2008 9:44 pm

Questions about fancyhdr

Post by Stefan Kottwitz »

Hi Raoul,

welcome to the board!
foofighter wrote:The problem I am facing at the moment is that I want to see the Section name or a short version of it on the left of the headline.
Just add \leftmark in this one of youf fanyhdr commands:

Code: Select all

\fancyhead[L]{\leftmark}
Though, I would use scrpage2 instead of fancyhdr. scrpage2 is described in the KOMA-Script manual.

Stefan
LaTeX.org admin
User avatar
localghost
Site Moderator
Posts: 9202
Joined: Fri Feb 02, 2007 12:06 pm

Questions about fancyhdr

Post by localghost »

As Stefan already mentioned, the »scrpage2« package is the better choice.

Code: Select all

\documentclass[%
  fontsize=11pt,
  paper=a4,
  headinclude=on
]{scrartcl}
\usepackage[automark,headsepline]{scrpage2}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage[ngerman]{babel}
\usepackage{blindtext}

\automark{section}
\clearscrheadings
\ihead{\headmark}
\ohead{\pagemark}
\pagestyle{scrheadings}

\begin{document}
  \blinddocument
\end{document}
Regarding your second problem I have only an assumption because Ubuntu is not my Linux system². As far as I know there is a package »texlive-lang-german«. Install it with the package manager (Apt?) and afterwards update the formats on the command line (as »root«).

Code: Select all

fmtutil-sys --all

Best regards and welcome to the board
Thorsten
foofighter
Posts: 2
Joined: Mon Aug 02, 2010 11:51 am

Re: Questions about fancyhdr

Post by foofighter »

Thanks allot for your help. I will have a look in scrpage2 soon but at the moment everything looks like I want it, even the warning disappeared.
Post Reply