Document ClassesHeader and Footer

Information and discussion about specific document classes and how to create your own document classes.
Post Reply
wadoud
Posts: 11
Joined: Fri Aug 14, 2015 7:01 pm

Header and Footer

Post by wadoud »

hi, i am new in this forum and also with latex, i need to modify the document class to get page number et the bottom and to get only the chaptre number and name in the top without section in lenny style.
thanks.

Code: Select all

Code, edit and compile here:
%Header and Footer
%---------------------------------------------------------------------------
\pagestyle{fancy}\fancyhf{}
% enregistrer les titres des sections/ chapitres pour les en-têtes et mettre à jour la numérotation des pages après les pages limaires
\newcommand{\partmark}[1]{
\ifthenelse{\boolean{normalnumbering}}{
}{
\ifthenelse{\isodd{\arabic{page}}}
{
\setboolean{numberingstartright}{true}
}
{
\setboolean{numberingstartright}{false}
}
\pagenumbering{arabic} \setcounter{page}{1}
\setboolean{normalnumbering}{true}
\hypersetup{colorlinks,
breaklinks,
citecolor=LHSVDarkBlue,
filecolor=LHSVDarkBlue,
linkcolor=LHSVDarkBlue,
urlcolor=blue
}
}
\markboth{\partname~\thepart: #1}{\partname~\thepart: #1}
}
\renewcommand{\chaptermark}[1]{
\ifthenelse{\boolean{normalnumbering}}{
}{
\ifthenelse{\isodd{\arabic{page}}}
{
\setboolean{numberingstartright}{true}
}
{
\setboolean{numberingstartright}{false}
}
\pagenumbering{arabic} \setcounter{page}{1}
\setboolean{normalnumbering}{true}
\hypersetup{breaklinks,
citecolor=LHSVDarkBlue,
 
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
Last edited by Stefan Kottwitz on Fri Aug 14, 2015 7:52 pm, 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.

User avatar
Stefan Kottwitz
Site Admin
Posts: 10324
Joined: Mon Mar 10, 2008 9:44 pm

Header and Footer

Post by Stefan Kottwitz »

Hi Wadoud,

welcome to the forum!

Code can be marked by a click on the Code button so it would get syntax highlighting and so better readability, and it can even be opened by a single click in the online LaTeX editor. I did it for you above.

I did not try your code yet to get header and footer as you like to have it. The simple reason is, that you posted just code fragments and not a compilable Infominimal working example. That would be useful.

Perhaps post a compilable sample with those settings, and it could help to explain what this means, "name in the top without section in lenny style". lenny sounds like the fancychap package, though I don't understand still what is meant.

Stefan
LaTeX.org admin
wadoud
Posts: 11
Joined: Fri Aug 14, 2015 7:01 pm

Header and Footer

Post by wadoud »

thank you for your reply,Stefan
I use a template for a PhD thesis, i want modify the head and the foot, here file.tex

Code: Select all

Code, edit and compile here:
\documentclass[11pt]{LHSV_thesis}
%Options XeLaTex (recommandé pour Windows
\usepackage{fontspec}
\defaultfontfeatures{Mapping=tex-text} %pour utiliser les guillemets ``''
\setmainfont{Linux Libertine O}
\begin{document}
%---------------------------------------------------------------------------
% Page de titre
%---------------------------------------------------------------------------
\title{Titre de la thèse}
\author{Mon nom}
\speciality{Ma spécialité}
\date{Date de la soutenance}
\AddJuryMember{Rapporteur}{Dr. Truc}{Affiliation}
\AddJuryMember{Rapporteur}{Dr. Machin}{Affiliation}
\AddJuryMember{Examinateur}{Dr. Bidule}{Affiliation}
\AddJuryMember{Directeur de thèse}{Mon directeur}{Affiliation}
\AddJuryMember{Co-encadrant de thèse}{Mon co-encadrant}{Affiliation}
\AddJuryMember{Président du jury}{Prof. Important}{Affiliation}
\AddJuryMember{Invité}{Dr. Ami}{Affiliation}
\maketitle
\clearpage
%---------------------------------------------------------------------------
% Pages liminaires
%---------------------------------------------------------------------------
\begin{center}
~\vspace{6.0cm}\\
\thispagestyle{plain}
\includegraphics[width=0.3\textwidth]{SaintVenant_logo_fr}\vspace{0.5cm}\\
Thèse effectuée au sein du \textbf{Laboratoire d'Hydraulique Saint-Venant}\par
de l'Université Paris-Est\\
6, quai Watier\\
BP 49\\
78401 Chatou cedex\\
 
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
and the document class is (file. cls):

Code: Select all

Code, edit and compile here:
\ProvidesClass{LHSV_thesis}[2014/03/18]
%---------------------------------------------------------------------------
%Options that need to be passed
%---------------------------------------------------------------------------
% pass options to the book class
\DeclareOption*{\PassOptionsToClass{\CurrentOption}{book}}
\ProcessOptions\relax
\LoadClass[a4paper,twoside]{book}
%---------------------------------------------------------------------------
%Packages that are used
%---------------------------------------------------------------------------
%Couleurs
\RequirePackage{xcolor}
%Mise en page
\RequirePackage{setspace}
% Nomenclature
\RequirePackage{ifthen}
\RequirePackage{nomencl}
% En-têtes, etc
\RequirePackage{fancyhdr}
\RequirePackage{lastpage} %pour avoir dernière page
% Equations
\RequirePackage{amsfonts}
\RequirePackage{amsmath}
\RequirePackage{amssymb}
\RequirePackage{mathtools}
\RequirePackage{bm} %pour avoir des symboles en gras quand ils ne sont pas défini dans mathbf
\RequirePackage{amsbsy}
\RequirePackage{xargs}
% Figures
\RequirePackage{float}
\RequirePackage{rotating}
\RequirePackage[format=hang]{subfig,caption}
 
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
Last edited by Johannes_B on Sat Aug 15, 2015 10:14 am, edited 2 times in total.
User avatar
Stefan Kottwitz
Site Admin
Posts: 10324
Joined: Mon Mar 10, 2008 9:44 pm

Re: Header and Footer

Post by Stefan Kottwitz »

Thank you for posting more code! I'm just leaving, I guess it's night for you too, so we can look further tomorrow.

Stefan
LaTeX.org admin
wadoud
Posts: 11
Joined: Fri Aug 14, 2015 7:01 pm

Re: Header and Footer

Post by wadoud »

hi all, i am waiting your help.
i want:
- remove the section from the header.
- the page number must be in the footer.
- in the header i want in the rigth chaptre + number and in the left te title of chaptre.
best regards
wadoud
Posts: 11
Joined: Fri Aug 14, 2015 7:01 pm

Re: Header and Footer

Post by wadoud »

any help!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
User avatar
Johannes_B
Site Moderator
Posts: 4182
Joined: Thu Nov 01, 2012 4:08 pm

Header and Footer

Post by Johannes_B »

I think all you need is

Code: Select all

Code, edit and compile here:
\fancyhf{}
\fancyfoot[LE,RO]{\thepage}
\fancyhead[LE,RO]{\leftmark}
%\begin{document}
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
Put it right before \begin{document}. More information on how to change the pagestyle can be found in the documentation of package fancyhdr.

Please note, that the code above will leave out everything that the class file takes care of concerning headers/footers. Please contact the maintainer for support concerning the template.
The smart way: Calm down and take a deep breath, read posts and provided links attentively, try to understand and ask if necessary.
wadoud
Posts: 11
Joined: Fri Aug 14, 2015 7:01 pm

Re: Header and Footer

Post by wadoud »

ok thank you, i will try
User avatar
Johannes_B
Site Moderator
Posts: 4182
Joined: Thu Nov 01, 2012 4:08 pm

Re: Header and Footer

Post by Johannes_B »

By the way, some of the tests inside the file are trying to do some strange stuff. LaTeX cannot start a new numbering scheme on a left side, and it will also set the page counter to 1 when changing. I would not recommend to use this class (there are more reasons). Please inform the maintainer about this. He also might want to add some license information.
The smart way: Calm down and take a deep breath, read posts and provided links attentively, try to understand and ask if necessary.
User avatar
Stefan Kottwitz
Site Admin
Posts: 10324
Joined: Mon Mar 10, 2008 9:44 pm

Header and Footer

Post by Stefan Kottwitz »

Btw. I saw a lot of \MakeUppercase, but used in a wrong way. It is not a switch, it should be used with an argument.

This changes nothing:

Code: Select all

{\MakeUppercase Remerciements}
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
This would work:

Code: Select all

\MakeUppercase{Remerciements}
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
All uppercase is not good style anyway. \scshape for small caps may be nicer than typewriter-machine-capitalization.

Stefan
LaTeX.org admin
Post Reply