Documente Academic
Documente Profesional
Documente Cultură
1 of 12 1/1/70, 5:09 AM
Headers and footers - ShareLaTeX, Online LaTeX ... https://www.sharelatex.com/learn/Headers_and_f...
errors (/learn
\documentclass[a4paper,12pt,twoside]{book}
About (/about) Blog (/blog) Universities (/university?ref=footer)
/Debugging_Compilation_timeout_errors)
\usepackage[english]{babel}
Knowledge Base \usepackage[utf8]{inputenc}
(/learn
(http://www.twitter.com/sharelatex)
\pagestyle{headings}
/Kb/Knowledge_Base)
(http://www.facebook.com/pages/ShareLaTeX/301671376556660)
\begin{document}
LaTeX Basics \chapter{Sample Chapter}
(https://plus.google.com/115074691861228882827)
\section{New section} (https://github.com/sharelatex/sharelatex)
Creating your �rst
LaTeX document Hello, here is some text without a meaning.
(/learn This text should
/Creating_a_document_in_LaTeX)show what aprinted text will look like at this
place. If you
Choosing a LaTeX read this text, you will get noinformation.
Compiler (/learn Really? Is there
/Choosing_a_LaTeX_Compiler) no information? Is there a diㄦence
Paragraphs and new betweenthis text and some
nonsense like \Huardest gefburn"? Kjift { not
lines (/learn
at all!...
/Paragraphs_and_new_lines)
Bold, italics and \end{document}
underlining (/learn
/Bold,_italics_and_underlining)
Lists (/learn/Lists)
Errors (/learn/Errors)
Mathematics
Mathematical
expressions (/learn
/Mathematical_expressions)
Subscripts and
superscripts (/learn
/Subscripts_and_superscripts)
Brackets and
Parentheses (/learn
/Brackets_and_Parentheses)
(/learn/File:HeadersFootersEx1.png)
Fractions and
Binomials (/learn The command \pagestyle{headings} sets the page style
/Fractions_and_Binomials)
called headings to the current document. You can see more
Aligning Equations page styles in the next section
(/learn
/Aligning_equations) Open an example in ShareLaTeX
Operators (/learn (https://www.sharelatex.com/project/new/template?zipUrl=
2 of 12 1/1/70, 5:09 AM
Headers and footers - ShareLaTeX, Online LaTeX ... https://www.sharelatex.com/learn/Headers_and_f...
/Operators) /project/534173dadd7cb62b32b6f702/download/zip&
Spacing in math mode templateName=Standard_headers_footers&compiler=pd�atex)
(/learn
/Spacing_in_math_mode)
Standard page styles
Integrals, sums and
limits (/learn The standard page styles are invoked in LATEX by means of the
/Integrals,_sums_and_limits) command:
Display style in math
\pagestyle{''style''}
mode (/learn
/Display_style_in_math_mode)
\pagestyle{myheadings}
List of Greek letters
and math symbols
(/learn
/List_of_Greek_letters_and_math_symbols)
Mathematical fonts
(/learn
/Mathematical_fonts)
Figures and
tables
Inserting Images
(/learn
/Inserting_Images)
Tables (/learn/Tables)
Positioning Images
(/learn/File:HeadersFootersEx2.png)
and Tables (/learn
/Positioning_images_and_tables)
The myheadings pagestyle displays the page number on top of
Lists of Tables and the page in the outer corner.
Figures (/learn
/Lists_of_tables_and_�gures) There are other three page styles:
Drawing Diagrams empty: Both the header and footer are cleared (blank) in
Directly in LaTeX
this page style.
(/learn
/Picture_environment) plain: This is the default style. The header is empty and
TikZ package (/learn the footer contains page numbers in the centre.
/TikZ_package)
myheadings: As shown in the introduction,The footer is
References and empty in this page style. The header contains the page
Citations number on right side (on even pages) or on left side (on
Bibliography
odd pages) along with other user-supplied information;
management in LaTeX there is an exception for the �rst page of each chapter,
3 of 12 1/1/70, 5:09 AM
Headers and footers - ShareLaTeX, Online LaTeX ... https://www.sharelatex.com/learn/Headers_and_f...
(/learn where the footer contains centred page number while the
/Bibliography_management_in_LaTeX)
header is blank.
Bibliography
management with
Open an example in ShareLaTeX
biblatex (/learn (https://www.sharelatex.com/project/new/template?zipUrl=
/project/534173dadd7cb62b32b6f702/download/zip&
/Bibliography_management_in_LaTeX)
Biblatex bibliography templateName=Standard_headers_footers&compiler=pd�atex)
styles (/learn
/Biblatex_bibliography_styles) Setting page style for current page
Biblatex citation styles only
(/learn
/Biblatex_citation_styles) Sometimes is convenient to specify the page style only for the
Bibliography current page. For instance, to leave a intentionally blank page or
management with to remove the header and footer from the current chapter page:
natbib (/learn
/Bibliography_management_with_natbib)
\chapter{Sample Chapter}
\thispagestyle{empty}
Natbib bibliography
styles (/learn Lorem ipsum dolor sit amet, consectetur
/Natbib_bibliography_styles) adipiscing elit, sed do
Natbib citation styles eiusmod tempor incididunt ut labore et dolore
magna aliqua. Ut enim
(/learn
}ad minim veniam, quis nostrud exercitation
/Natbib_citation_styles) ullamco laboris nisi
Bibliography ut aliquip ex ea commodo consequat. Duis aute
management with irure dolor in
reprehenderit in voluptate velit es...
bibtex (/learn
\end{document}
/Bibliography_management_with_bibtex)
Bibtex bibliography
styles (/learn
/Bibtex_bibliography_styles)
Languages
International language
support (/learn
/International_language_support)
Quotations and
quotation marks
(/learn
/Typesetting_quotations)
Arabic (/learn/Arabic)
Chinese (/learn
/Chinese)
4 of 12 1/1/70, 5:09 AM
Headers and footers - ShareLaTeX, Online LaTeX ... https://www.sharelatex.com/learn/Headers_and_f...
French (/learn/French)
German (/learn
/German)
Greek (/learn/Greek)
Italian (/learn/Italian)
Japanese (/learn
/Japanese)
Korean (/learn/Korean)
Portuguese (/learn
/Portuguese)
Russian (/learn
/Russian)
Spanish (/learn
/Spanish)
Document
structure
Sections and chapters
(/learn
/Sections_and_chapters)
Table of contents
(/learn
/Table_of_contents)
Cross referencing
sections and
equations (/learn
/Cross_referencing_sections_and_equations)
(/learn/File:HeadersFootersEx3.png)
Indices (/learn/Indices)
Of course, you can replace empty for any of the styles
Glossaries (/learn
mentioned in the previous section
/Glossaries)
Nomenclatures (/learn Open an example in ShareLaTeX
/Nomenclatures) (https://www.sharelatex.com/project/new/template?zipUrl=
Management in a large /project/534173dadd7cb62b32b6f702/download/zip&
project (/learn templateName=Standard_headers_footers&compiler=pd�atex)
/Management_in_a_large_project)
Multi-�le LaTeX
Style customization in single-sided
projects (/learn/Multi-
�le_LaTeX_projects)
documents
Hyperlinks (/learn Styles can be modi�ed beyond the standard layouts by means of
/Hyperlinks) fancyhdr. Below is an example.
5 of 12 1/1/70, 5:09 AM
Headers and footers - ShareLaTeX, Online LaTeX ... https://www.sharelatex.com/learn/Headers_and_f...
Formatting
\documentclass{article}
Lengths in LATEX \usepackage[english]{babel}
(/learn
\usepackage[utf8]{inputenc}
\usepackage{fancyhdr}
/Lengths_in_LaTeX)
Headers and footers \pagestyle{fancy}
(/learn \fancyhf{}
/Headers_and_footers)
\rhead{Share\LaTeX}
\lhead{Guides and tutorials}
Page numbering \rfoot{Page \thepage}
(/learn
/Page_numbering) \begin{document}
6 of 12 1/1/70, 5:09 AM
Headers and footers - ShareLaTeX, Online LaTeX ... https://www.sharelatex.com/learn/Headers_and_f...
Presentations
\lhead{Guides and tutorials}
Beamer (/learn
Prints the text set inside the braces on the left side of the
/Beamer)
header.
Powerdot (/learn
/Powerdot)
\chead{ }
Posters (/learn
Similar to the previous commands, in this case the text is
/Posters)
centred on the header.
Commands
\rfoot{Page \thepage}
Commands (/learn
Prints the word "Page" and next the page number which is
/Commands)
automatically set by \thepage on the right side of the footer.
Environments (/learn
See the reference guide for a list of commands that
/Environments)
automatically generate content (Section numbers, chapters and
Feynman diagrams
Similar to the previous two commands, prints its parameter on
(/learn the centre of the footer.
/Feynman_diagrams)
Molecular orbital Open an example of the fancyhdr package in ShareLaTeX
diagrams (/learn (https://www.sharelatex.com/project/new/template?zipUrl=
/Molecular_orbital_diagrams) /project/53440a3824874b0852c13d61/download/zip&
7 of 12 1/1/70, 5:09 AM
Headers and footers - ShareLaTeX, Online LaTeX ... https://www.sharelatex.com/learn/Headers_and_f...
(/learn/File:HeadersFootersEx6.png)
8 of 12 1/1/70, 5:09 AM
Headers and footers - ShareLaTeX, Online LaTeX ... https://www.sharelatex.com/learn/Headers_and_f...
9 of 12 1/1/70, 5:09 AM
Headers and footers - ShareLaTeX, Online LaTeX ... https://www.sharelatex.com/learn/Headers_and_f...
\documentclass[a4paper,12pt,twoside]{book}
\usepackage[utf8]{inputenc}
\usepackage[english]{babel}
\usepackage{fancyhdr}
\pagestyle{fancy}
\fancyhf{}
\fancyhead[LE,RO]{Share\LaTeX}
\fancyhead[RE,LO]{Guides and tutorials}
\fancyfoot[CE,CO]{\leftmark}
\fancyfoot[LE,RO]{\thepage}
\renewcommand{\headrulewidth}{2pt}
\renewcommand{\footrulewidth}{1pt}
\begin{document}
(/learn/File:HeadersFootersEx7.png)
\renewcommand{\headrulewidth}{2pt}
This sets the header line thickness to 2pt.
\renewcommand{\footrulewidth}{1pt}
10 of 12 1/1/70, 5:09 AM
Headers and footers - ShareLaTeX, Online LaTeX ... https://www.sharelatex.com/learn/Headers_and_f...
Reference guide
The following commands can be used in the headers and
footers to add custom information
\thepage
\thechapter
\thesection
\chaptername
\leftmark
\rightmark
Further reading
For more information see:
11 of 12 1/1/70, 5:09 AM
Headers and footers - ShareLaTeX, Online LaTeX ... https://www.sharelatex.com/learn/Headers_and_f...
12 of 12 1/1/70, 5:09 AM