Contents

LaTeX for beginners 1 Do you need LATEX? 8 Labeling & hyperref 14 Basic mathematics in An introduction to TEX and LATEX 2 TeX and friends standard LATEX 9 Other basic settings 3 The basics and declarations 15 Handling bibliography

Jean Hare 4 What is needed 10 Babel 16 Boxes and page breaking Sorbonne Université 5 Getting started 11 Indispensable Laboratoire Kastler Brossel environments 17 Creating commands [email protected] 6 Basic text formating and environments in 12 Floats standard LATEX mars 2020 7 Layout and structure 13 Spacing and breaking

Jean Hare (SU) A-LaTeX mars 2020 1 / 114 Jean Hare (SU) A-LaTeX mars 2020 2 / 114

Why LATEX? Why LATEX? Summary What are they?

1 Do you need LATEX?

2 TeX and friends 9 Other basic settings 14 Basic mathematics in and declarations standard LATEX TEX is a system for producing 3 The basics high quality digital 10 Babel 15 Handling bibliography 4 What is needed typesetting, especially 11 Indispensable 16 Boxes and page mathematical typesetting. 5 Getting started environments breaking

6 Basic text formating 12 Floats 17 Creating commands The first and still alive format for using TEX is the so called plain-TEX and environments in A 7 Layout and structure 13 Spacing and breaking LTEX is a high level format that use TEX, but things much more easy. standard LATEX 8 Labeling & hyperref The name TEXcomes from Greek τεχvoν: the X is a χ, to be pronounced like in “technology” or like in the Scottish “Loch”

Jean Hare (SU) A-LaTeX mars 2020 3 / 114 Jean Hare (SU) A-LaTeX mars 2020 4 / 114 Why LATEX? Why LATEX? Main interest of LATEX Why do you need LATEX?

Typeset by Microsoft Word® Typeset by LAT X TEX produces high quality 1 E e = 2 + typography. 1 1 + This is some text that intends to This is some text that intends to For mathematics, it is almost 1 2 + show you the difference between a the only way ! 1 show you the difference between 1 + Word processor and TeX when it 1 a Word processor and TeX when You are a scientist researcher, so 1 + 1 it comes to high quality typo- comes to high quality typography. — by default — you will like it. 4 + 1 graphy. There is a man called Dr. There is a man called Dr. John, It is the de facto standard of 1 + 1 + John, who likes the Binomial who likes the Binomial theorem, scientific publishing. ··· theorem, which says that for any which says that for any positive Many features, such as hyperlinking, labeling & referring, table of integer n: positive integer 푛: contents, citations, glossaries, indices etc. n 푛 n n k n k It is free and highly portable. 푛 (x + a) = x a − (푥 + 푎)푛 = ∑ ( ) 푥푘 푎푛−푘 k! Better (and easier ?) typesetting than word processors, such as 푘 kX=0 Microsoft Word®, OpenOffice Writer®. 푘=0

Jean Hare (SU) A-LaTeX mars 2020 5 / 114 Jean Hare (SU) A-LaTeX mars 2020 6 / 114

Why LATEX? Why LATEX?

Why do they need LATEX? Will I switch to LATEX?

An instructive diagram :

Alm ost im possible n o i t p u s n o c e m i t d n a t

o f f E

Document size and complexity

Jean Hare (SU) A-LaTeX mars 2020 7 / 114 Jean Hare (SU) A-LaTeX mars 2020 8 / 114 Why LATEX? Why LATEX? User interface WYSIWYG vs WYSIWYM

One the end-user point of view, the essential difference is the approach of the work-flow :

*-Office: WYSIWYG LATEX: WYSIWYM You see something looking to You have to compile from time to what you will obtain on printing: time to see the formatted result: What You See Is What You What You See Is What You ⇓ Get Mean You define the document layout This is normal. You can concentrate on the text and text formating interactively. that you are writing, without care This is bold. And can be distracted by these to the format which is well This is italics. visual details, to the detriment of separated, and will be excellently the content. Often, the result is A This is bold-italics. handled by LTEX. inconsistent.

Jean Hare (SU) A-LaTeX mars 2020 9 / 114 Jean Hare (SU) A-LaTeX mars 2020 10 / 114

TeX and friends TeX and friends

Summary What is TEX?

T X: 1 Do you need LATEX? E Is a computer program aimed at 2 TeX and friends 9 Other basic settings 14 Basic mathematics in typesetting text and much more, and declarations standard LATEX 3 The basics Intend to conform to the fundamental 10 Babel 15 Handling bibliography 4 What is needed rules of typography, 11 Indispensable 16 Boxes and1 page Was developed by Donald E. Knuth 5 Getting started environments breaking between 1968 and 1982, with the aim 6 Basic text formating 12 Floats 17 Creating commands to exploit the new (at that time) arising and environments in digital printers, in the hope to reverse 7 Layout and structure 13 Spacing and breaking standard LATEX the deterioration of typographical 8 Labeling & hyperref quality that he experimented for his Fig. 1: Donald Knuth books and articles. Evolved along the time, the version released in 1982 was labeled 3.0, and the current version is 3.14159265

Jean Hare (SU) A-LaTeX mars 2020 11 / 114 Jean Hare (SU) A-LaTeX mars 2020 12 / 114 TeX and friends TeX and friends

What is TEX? What is LATEX?

TEX evolves slowly, is very stable and LATEX is a large set of TEX macros which run on many kinds of platforms, and is provides a high-level language and enables the reputed to be (almost) bug free. author to typeset complex documents with the It is a full programming language, with typographic quality of TEXwith a document a great facility to create simple macro, layout provided by LATEX documents classes. and the possibility to implement When providing the content, the author inserts complex structure (wizards only :-) ) “LaTeX commands” describing the logical Being mostly aimed at handling text, it structure of the text, which will be used to is very good at handling line breaking structure and format the output. and an page breaking It was first developed by Leslie Lamport in Knuth being a mathematician, TEX features impressive ability to 1982/86 and was at this time the version 2.09, Fig. 2: Leslie Lamport typeset maths. the current one is LATEX 2ε released in 1994... It has, out of the box, quite poor graphics capabilities, but many One of the principal interest is its amazing ability to handle efficient solutions are now available, both in the TEX family or in the cross-references in the document, bibliographies and indexes (with wide world of other programs companies or nonprofit organizations. companion programs), and it also adds several graphics capabilities.

Jean Hare (SU) A-LaTeX mars 2020 13 / 114 Jean Hare (SU) A-LaTeX mars 2020 14 / 114

TeX and friends TeX and friends

Some milestones for LATEX 2ε Which “friends” beside LATEX?

A LTEX 2ε (2 = largest number < 3) was created for the following reasons: The TEX engine is pdftex. Modern siblings: & . 1988 Since 1982, due to the success of LATEX but the small number of “styles”, a big mess of incompatible variants appeared to handle math Calling or actually launch the pdftex motor. By default, articles, posters, presentations, newsletters etc. pdftex produces PDF output, more convenient than the old fashion A 1989 The new font selection scheme (PS)NFSS ebables the handling fonts DVI, but journals don’t accept yet submission in PDF-wise LTEX. other than CM, and namely the Postscript fonts (Adobe Type 1), and pdflatex is simply a wrapper for pdftex with latex format. fixes awful problems. The “companion programs” include notably and for 1990 Cork encoding : Knuth’s CM font only provided ASCII text. In the bibliography, makeidx for the index, dvips, dvipdfm to convert 1990, a TUG conference defined a new encoding (named T1) which DVI, **ht** to produce etc. More that 400 programs... encompasses 256 characters, thus providing true glyphs for the A special mention about METAFONT, also written by D. Knuth at accented characters of occidental European languages. This finally the same time as TEX, and used to create new fonts, including the resulted in the “Latin Modern” font. “Computer Modern”, and METAPOST based on METAFONT for 1994 The maintainers of LATEX decided to create a new version (LATEX 2ε) production of vectorial graphics. containing all the capabilities of the variants as classes or packages, There also also the font files (∼ 10 000 files for me), and all the deeply based on PSNFSS, and compatible with various font encodings package files (∼ 50 000 files) for different languages. Jean Hare (SU) A-LaTeX mars 2020 15 / 114 Jean Hare (SU) A-LaTeX mars 2020 16 / 114 TeX and friends The basics

Some contributors to LATEX 2ε or to LATEX3 project Summary

1 Do you need LATEX?

2 TeX and friends 9 Other basic settings 14 Basic mathematics in and declarations standard LATEX Frank Mittelbach Johannes Braams Michel Goossens 3 The basics 10 Babel 15 Handling bibliography 4 What is needed 11 Indispensable 16 Boxes and page 5 Getting started environments breaking

6 Basic text formating 12 Floats 17 Creating commands Sebastian Rahtz† Hàn Th˜é Thành Ulrike Fischer and environments in 7 Layout and structure 13 Spacing and breaking standard LATEX 8 Labeling & hyperref

Enrico Gregorio Heiko Oberdiek David Carlisle Jean Hare (SU) A-LaTeX mars 2020 17 / 114 Jean Hare (SU) A-LaTeX mars 2020 18 / 114

The basics The basics

General work-flow for LATEX The minimal LATEXfile

The LATEX input file (the code) is a lightweight pure ASCII, Latin1 or The minimal file contains only tree line : (better) UTF-8 text file that can be edited in any text editor. For 1 \documentclass[]{} example a 125 pages long course I wrote three years ago is less than 2 \begin{document} 3 \end{document} 500 Kb, while the PDF is close to 10 Mb. The commands start with a “backslash” . This is an (almost) This files contains the text of the content, sometime the pictures and \ absolute rule of any T X programming. the needed commands or macros. E The command arguments are enclosed in curly braces \{... \}, or in In order to see the result, on has to “compile” the .tex file by using a square braces [... ] for optional arguments. T X compiler, often referred to as the “motor”. E The is the type of the document. The standard classes The output is a .dvi or a .ps or a . file that can be viewed or provided by base LATEX are article, report and book which are printed with the suited program. intended to produce “papers” with different formating according the At each run, the compiler writes to the .aux file the information the length and purpose. There is also a letter class, less used, and needed for the table of contents, cross-references, bibliography etc. this presentation is produced with the class. This file is read and updated at further compile steps. The is a comma separated list of document-wide Elements that require further processing (like bibliography ) are options like a4paper,11pt which defines the size of the paper and of handled by companion programs before the final compilation(s). base font. Others: landscape, twoside, twocolumn, draft, etc. Jean Hare (SU) A-LaTeX mars 2020 19 / 114 Jean Hare (SU) A-LaTeX mars 2020 20 / 114 The basics The basics

Minimal LATEX preamble The compilation chain

.log .fmt dvips gs The lines between the \documentclass and the \begin{document} form the so called “preamble” and are used to define further options, .tex TEX .dvi .pdf commands an settings. dvipdfm figs .aux .toc Most options will be imported by the mean of packages. For example .eps .bbl you will always uses the following packages : 1 \documentclass[a4paper,11pt]{article} .bst 2 \usepackage[utf8]{inputenc} .bib BiBTeX 3 \usepackage[french]{babel} 4 \usepackage[margin=28mm]{geometry} 5 \usepackage[T1]{fontenc} 6 \usepackage{lmodern} figs .aux .toc 7 \begin{document} .pdf .bbl 8 some text... 9 \end{document} .tex pdfLATEX .pdf the meaning of which will be explained latter. .fmt .log

Jean Hare (SU) A-LaTeX mars 2020 21 / 114 Jean Hare (SU) A-LaTeX mars 2020 22 / 114

Needed tools Needed tools

Summary What is needed to run LATEX? What. is needed to run LAT X? .  /  . E 1 Do you need LATEX?

2 TeX and friends 9 Other basic settings 14 Basic mathematics in and declarations standard LATEX 3 The basics 10 Babel 15 Handling bibliography 4 What is needed 11 Indispensable 16 Boxes and page 5 Getting started environments breaking

6 Basic text formating 12 Floats 17 Creating commands and environments in 7 Layout and structure 13 Spacing and breaking standard LATEX 8 Labeling & hyperref

In order to run LATEX you need several kind of tools...

Jean Hare (SU) A-LaTeX mars 2020 23 / 114 Jean Hare (SU) A-LaTeX mars 2020 24 / 114 Needed tools Needed tools

ATEX distribution An editor

Distribution refers to the huge set of “TEX and friends” files needed to compile, choose the fonts, define the layout, various kinds of formating etc. Even if any text editor could be used, you need a TEX oriented IDE On MS-Windows (7 to 10) the best choice is the MiKTeX distribution, featuring at least : to freely download from https://miktex.org/download Support of UTF-8. Take care to choose the ×86 or ×64 according to your computer. Syntax highlighting. Install only the basic- bundle, the other package will be downloaded latter, either manually or on the fly. A spell-checker at least for English, French, and more ... On Mac OS-X, the simplest choice is to use the TEXLive distribution. A contextual help hot-key (or texdoc in the console). Actually, it will install automatically when you will install MacTeX A button and/or hot-key to start the compilation. including both TEXLive and TeXShop Compatibility with Synctex, for direct and inverse search. http://pages.uoregon.edu/koch/texshop. Parsing of the output console with the listing of errors and hyperlink On Unix/, you will also use TEXLive, to download preferably from your package management utility. jump to source. If you prefer the WYSIWIG paradigm, you might want to look at: Scientific The possibility to edit the compilation command line. WorkPlace or BaKoMa TeX ($ and Win only) or at the free and multippatform LyX or TeXmacs. Jean Hare (SU) A-LaTeX mars 2020 25 / 114 Jean Hare (SU) A-LaTeX mars 2020 26 / 114

Needed tools Needed tools An editor Other Tools

Recommended choices Free multi-platform editor, and the best choices in this range are: Programs to handle, create and edit postscript and PDF: The TeXWorks editor/IDE (simple but efficient) included in MiKTeX (∗ means functionality already included in MiKTeX/TeXLive) and in TEXLive, can work “out of the box”. Ghostscript∗ (AGPL) https://www.ghostscript.com/download http://www.xm1math.net/texmaker or TeXstudio Ghostview http://pages.cs.wisc.edu/~ghost https://www.texstudio.org/, with palettes of symbols, project pstoedit http://www.pstoedit.net management, better autocompletion, and a lot of tools. esptopdf∗ https://ctan.org/pkg/epspdf or On MAC OS-X, one will likely use the free and excellent TeXShop, https://ctan.org/pkg/epspdf-setup free which is clearly the “champion in every category” for any platform. pdftk https://www.pdflabs.com or pdfsam https://pdfsam.org On Window, one has several alternative to the former, like the jpeg2ps, sam2p https://pdfsam.org/fr, etc. brilliant WinEdt (shareware) http://www.winedt.com Vectorial drawing programs like On Unix/Linux, the uncontested leader was for a long time inkscape https://inkscape.org https://kile.sourceforge.io/ but it was perhaps superseded by Xfig or winFIG https://projet-plume.org/fiche/xfig-winfig TeXmaker, and other people stick to /AUCTeX TpX http://tpx.sourceforge.net https://www.gnu.org/software/auctex or VIM

Jean Hare (SU) A-LaTeX mars 2020 27 / 114 Jean Hare (SU) A-LaTeX mars 2020 28 / 114 Getting started Getting started Summary About characters

TEXdefines 16 categories of input characters (catcodes 0 to 15) 1 Do you need LATEX? Valid characters are the 95 ASCII characters, on 7 bits (catcodes 11/12). 2 TeX and friends 9 Other basic settings 14 Basic mathematics in Reserved characters are : (@ is used only for internal macros in .sty) and declarations standard LATEX 3 The basics 1 \ is used to introduce the commands(catcode 0) 10 Babel 15 Handling bibliography 2 { and} are used to define"groups"(catcodes 1 & 2) 4 What is needed 3 $ switch math mode on and off(catcode 3) 11 Indispensable 16 Boxes and page 4 & is used for alignment structures(catcode 4) 5 Getting started environments breaking 5 # is used for macro argument names(catcode 6) 6 ^ and_ for supers/subscript(in math)(catcodes 7 & 8) 6 Basic text formating 12 Floats 17 Creating commands 7 ~ is an unbreakable space(catcode 13=active char) and environments in 8 % is used to starta comment(catcode 14) 7 Layout and structure 13 Spacing and breaking standard LAT X E 8 bits chars via inputenc package, with option latin1, latin9 & others. 8 Labeling & hyperref chars with utf8 option. New translations possible via \DeclareUnicodeCharacter{}{}, or with newunicodechar package, \newunicodechar{}{}, e.g. \newunicodechar{†}{$\dag$}.

Jean Hare (SU) A-LaTeX mars 2020 29 / 114 Jean Hare (SU) A-LaTeX mars 2020 30 / 114

Getting started Getting started About commands About declarations

Commands in LATEX can be : “Declarations” define settings (for formatting or sectioning, etc. ) \ followed by a single non-letter symbol : without printing any text. Examples: \pagestyle{headings}, Reserved characters preceded by a backslash, \% gives %; \large, \bfseries, etc.. inserts an explicit space; inserts a line-break (w optional space); \␣ \\ Others commands operate on a given content (explicit or not) and \,, \!, \>, \:, \;, \/ are spacing commands, see below.; Diacritics can be entered as (avoid for western European languages): print it according to their meaning. Examples: \tableofcontents, \textbf{Some bold text}, cmd \‘\’ \^\"\H \~\c\k \=\b\.\d\r\u\v\t . result ò ó ô ö ő õ ç ą ¯o o o˙ o. å ˘o š oo \section[short title]{Long title of the first section} ¯ \( and \) delimit “inline” maths; \[ and \] delimit “display” maths; Both kinds can have none, one or several arguments. Usually optional \ followed by any string made from ASCII letters (a-z and A-Z). argument are given before mandatory argument. Mandatory can sometimes be empty groups {} , but generally a meaningful value is They are case-sensitives : \large is not \Large. √ Digits are (usually) excluded, so $\sqrt{2}$=$\sqrt2$→ 2. expected. Example : \section{} is valid, \pagestyle{} isn’t. The @ char only in .sty files or inside Some declaration are global for the document and will generally be \makeatletter... \makeatother. declared in the preamble. Some other are local to the enclosing group. Special active characters (catcode 13) like ~ (see Babel section). {\bfseries\smalla text} \& another → a text & another

Jean Hare (SU) A-LaTeX mars 2020 31 / 114 Jean Hare (SU) A-LaTeX mars 2020 32 / 114 Getting started Basic text formating Some hints about (horizontal) spacing Summary

1 Do you need LAT X? Successive spaces (including tabs and carriage returns) are interpreted E as a single space with the following exceptions : 2 TeX and friends 9 Other basic settings 14 Basic mathematics in Two consecutive carriage returns (i.e. blank line) close a paragraph, as and declarations standard LATEX does the \par command; 3 The basics The explicit spaces \␣ and the unbreakable ~ are observed. \, (or 10 Babel 15 Handling bibliography 4 What is needed \thinspace) also produces a smaller unbreakable space (0.167 em). 11 Indispensable 16 Boxes and page Larger horizontal space is obtained with \enskip,\quad or \qquad of 5 Getting started environments breaking respectively half, one or two ems. 6 Basic text formating 12 Floats 17 Creating commands Arbitrary space obtained with \hspace{length} or and environments in 7 Layout and structure 13 Spacing and breaking \hspace*{length}, where length is either a literal or defined or standard LATEX computed length, than can be negative. It can also be a “rubber” 8 Labeling & hyperref length (see below). The starred version can be used at the beginning or the end of a line.

Jean Hare (SU) A-LaTeX mars 2020 33 / 114 Jean Hare (SU) A-LaTeX mars 2020 34 / 114

Basic text formating Basic text formating Sizes Styles

Sizes Styles {\tiny tiny} tiny \textrm{Roman}{\rmfamily Roman} Roman {\scriptsize scriptsize} scriptsize \textit{Italics}{\itshape Italics} Italics {\footnotesize footnotesize} footnotesize \textmd{Medium}{\mdseries Medium} Medium {\small small} small \textbf{Boldface}{\bfseries Boldface} Boldface {\normalsize normalsize} normalsize \textsl{Slanted}{\slshape Slanted} Slanted \textsf{Sans serif}{\sffamily Sans serif} Sans serif {\large large} large \textsc{Small caps}{\scshape Small caps} Small caps {\Large Large} Large \texttt{Typewriter}{\ttfamily Typewriter} Typewriter {\LARGE LARGE} Large \emph{} → some text must bee preferred to \textit : {\huge huge} huge it toggles between \textit and \textrm and corrects the spacing. Styles modifications can be locally inverted with the commands: {\Huge Huge} Huge \textnormal or \normalfont : return to main document font; Arbitrary sizes: package anyfontsize; \textup or \upshape The opposite of slanted. Use of relative sizes: package relsize; Styles and size can also be used as \begin{small}... \end{small} Larger or smaller base document fonts: package extsize. or \begin{slshape}... \end{slshape}.

Jean Hare (SU) A-LaTeX mars 2020 35 / 114 Jean Hare (SU) A-LaTeX mars 2020 36 / 114 Layout and structure Layout and structure Summary Sectioning commands

Commands : \chapter[]{}, \section[]{}, \subsection{}, 1 Do you need LATEX? \subsubsection{}, \paragraph{Paragraph}, \subparagraph{} 2 TeX and friends 9 Other basic settings 14 Basic mathematics in Article: Report/Book: and declarations standard LATEX No chapter command 3 The basics Chapter 1 10 Babel 15 Handling bibliography 1 Section 4 What is needed My first chapter 11 Indispensable 16 Boxes and page A section . . . 5 Getting started environments breaking 1.1 Subsection In this chapter . . . 6 12 A subsection . . . Basic text formating Floats 17 Creating commands 1.1 Section 1.1.1 Subsubsection and environments in A section . . . 7 13 Layout and structure Spacing and breaking standard LAT X A subsubsection . . . E 1.1.1 Subsection 8 Labeling & hyperref Paragraph A paragraph . . . A subsection . . .

Subparagraph A subparagraph . . . Subsubsection A subsubsection . . .

Paragraph A paragraph . . .

Subparagraph A subparagraph . . . Jean Hare (SU) A-LaTeX mars 2020 37 / 114 Jean Hare (SU) A-LaTeX mars 2020 38 / 114

Layout and structure Page layout for the standard article class Environments 6 2 1 4 1 un pouce + \hoffset i? 5 ?i i? 6 ?Entête 2 un pouce + \voffset 6 Structure delimited by \begin{} ... \end{} 6 6 3 \oddsidemargin = 54pt 6 like the main environment document. i 4 \topmargin = 21pt 5 \headheight = 18pt verse 6 \headsep = 25pt Voici venir les temps où vibrant sur sa tige 7 \textheight = 541pt 8 \textwidth = 360pt Chaque fleur s’évapore ainsi qu’un encensoir ; Notes Corps 7 margi 9 \marginparsep = 10pt -nales Les sons et les parfums tournent dans l’air du soir ; i 10 \marginparwidth = 59pt -  9 Valse mélancolique1 et langoureux vertige ! i  10 - 11 \footskip = 30pt -  3 i non affiché: i \marginparpush = 5pt abstract  - 8 \hoffset = 0pt 11 i Résumé i? ? \voffset = 0pt Pied de page 6 \paperwidth = 614pt Dans une Note récente, nous avons montré qu’un observateur, pour  1 - i \paperheight = 794pt décrire le mouvement d’un mobile de vitesse β < 1, doit lui associer une

1 un pouce + \hoffset 2 un pouce + \voffset onde sinusoïdale non matérielle se propageant dans la même direction ; To3 \oddsidemargin adjust = 54pt it,exclusively 4 \topmargin = 21pt use geometry package. 5 \headheight = 18pt 6 \headsep = 25pt la fréquence de cette onde est égale à l’énergie totale, par rapport à 7 \textheight = 541pt 8 \textwidth = 360pt 9 \marginparsep = 10pt 10 \marginparwidth = 59pt l’observateur, divisée par la constante h de Planck. The11 \footskip structure = 30pt of header\marginparpush &= 5pt footer (non affiché) are defined with \pagestyle{style} and \hoffset = 0pt \voffset = 0pt \thispagestyle\paperwidth = 614pt \paperheight{style = 794pt} where style is empty, plain, headings, Below : , , , , etc. myheadings or, w. fancyhdr package, fancy. minipage figure tabular displaymath itemize See also commands \markright{...} and \markboth{...}{...}. Jean Hare (SU) A-LaTeX mars 2020 40 / 114

2

1 Labeling & hyperref Labeling & hyperref Summary Handling of (cross-)references and citations

1 Do you need LAT X? E A great advantage of LATEX is the elementary handling of references. 2 TeX and friends 9 Other basic settings 14 Basic mathematics in In most cases the target of a cross-reference is marked with and declarations standard LATEX \label{thelabel}, where thelabel is a valid alphanumeric string1, 3 The basics that is not printed (use package showkeys to see them). 10 Babel 15 Handling bibliography 4 What is needed This holds for all sectioning titles, tables and figures, lists and their 11 Indispensable 16 Boxes and page \items, equations, \footnotes, etc 5 Getting started environments breaking For the callback, one use the command \ref{thelabel}. 6 Basic text formating 12 Floats 17 Creating commands Nevertheless, there are specialized versions like and environments in 7 Layout and structure 13 Spacing and breaking \pageref{thelabel}, \eqref{thelabel} (package amsmath), standard LATEX \titleref{thelabel} (package titleref), or 8 Labeling & hyperref \nameref{thelabel} (package hyperref, with many variations.)... Command \eqref formats the number and adds the parenthesis.

Jean Hare (SU) A-LaTeX mars 2020 41 / 114 Jean Hare (SU) A-LaTeX mars 2020 42 / 114

Labeling & hyperref Labeling & hyperref Examples Hyperreferences

1 ...... 2 \begin{document} 1 A section 3 \section{First section}\label{s:one} 4 This simple text containsa This simple text contains a The package hyperref takes advantage of the hypertext potentiality of reference to the nextpage (2), 5 reference to the which contains the equation (1) PDF format to add hyperlinks to the references (and citations). 6 nextpage(\pageref{s:another}), in the § 2 7 which contains For this purpose hyperref modifies most semantic commands 8 the equation(\ref{e:nice_eq}) (sectioning, labels etc) into commands that add a suitable 1 9 in the\S~\ref{s:another}. hypertarget. 10 \clearpage 2 Second1 section 11 \section{Second section} At the same time, all the \ref and siblings are turned into hyperlinks, 12 \label{s:another} Here is a nice equation : allowing to jump from the \ref to the \label. 13 Here isa nice equation: E = mc2 (1) For the callback, one use the command \ref{}. 14 \begin{equation}\label{e:nice_eq} 15 E=mc^2 that is referenced in section “A 16 \end{equation} section”. 2 17 that is referenced in 18 section\titleref{s:one}’’. 2

Jean Hare (SU) A-LaTeX mars 2020 43 / 114 Jean Hare (SU) A-LaTeX mars 2020 44 / 114 Labeling & hyperref Labeling & hyperref Example with hyperref Other uses of hyperref

1 ...... hyperref also turns the \tableofcontents into a list of hyperlinks 2 1 A section \usepackage[colorlinks]{hyperref} It can produce bookmarks (in French : « signets ») facilitating the 3 \begin{document} This simple text contains a navigation. 4 \section{First section}\label{s:one} reference to the nextpage (2), 5 This simple text containsa It turns the commands, and similar (see below) into which contains the equation (1) \cite{...} 6 reference to the in the §2 hyperlinks pointing to the relative bibliographic references. 7 nextpage(\pageref{s:another}), 8 which contains In some conditions, “back links” can be created. 9 the equation(\ref{e:nice_eq}) 1 Custom hyperlinks can be produced anywhere with the commands : 10 in the\S~\ref{s:another}. \url{someurl} or \hyperref{someurl}{a text}. 11 \clearpage 2 Second1 section 12 \section{Second section} Can set PDF specific parameters, like metadata with pdfinfo option. 13 \label{s:another} Here is a nice equation : With package pdfx, it can be used to create PDF/A ou PDF/X files 14 Here isa nice equation: E = mc2 (1) Many option can be added after loading with \hypersetup, e.g.: 15 \begin{equation}\label{e:nice_eq} \hypersetup{pdfdisplaydoctitle=true, 16 E=mc^2 that is referenced in section “1”. 17 \end{equation} bookmarksopen=true,bookmarksnumbered=true, pdfpagemode=UseOutlines, 18 that is referenced in 2 breaklinks=true, linktocpage=true, colorlinks=true, menucolor=blue, 19 section\titleref{s:one}’’. citecolor=tial, urlcolor=pink} Jean Hare (SU) A-LaTeX 2 mars 2020 45 / 114 Jean Hare (SU) A-LaTeX mars 2020 46 / 114

Other settings Other settings Summary Using lengths

Length are defined in various units (internal length sp is very small !) 1 Do you need LATEX? cm mm in pt em ex sp 0.394 pt 3.94 pt 25.4 mm 1/72.27 in length(M) height(x) 5.36 µm 2 TeX and friends 9 Other basic settings 14 Basic mathematics in & bp, pc, dd, cc, nd, nc, cf. https://en.wikibooks.org/wiki/LaTeX/Lengths and declarations standard LATEX 3 The basics Definition and setting of lengths : \newlength{\myln}, 10 Babel 15 Handling bibliography \setlength{\myln}{12pt}, \addtolength{\myln}{-5cm}, 4 What is needed . 11 Indispensable 16 Boxes and page \settowidth{\myln}{some text} 5 Getting started environments breaking Many length are defined as “rubber length” : \setlength{\parskip}{1ex plus0.5ex minus0.2ex} 6 Basic text formating 12 Floats 17 Creating commands Useful predefined lengths : \textheight, \textwidth, \linewidth, and environments in \baselineskip,\parskip, \topskip,\parindent, \itemindent 7 Layout and structure 13 Spacing and breaking standard LAT X E Example: to see \linewidth do: \the\linewidth → 320.53526pt 8 Labeling & hyperref Length can be multiplied by literal numbers, like 0.5\linewidth. With calc : operations like 2cm-4pt or \widthof{blah}*\real{0.6}. \dimexpr\linewidth-0.2\parskip-1cm\relax can used where LATEX expect a length. Maximal length = 16384pt ≈ 5,758 m Jean Hare (SU) A-LaTeX mars 2020 47 / 114 Jean Hare (SU) A-LaTeX mars 2020 48 / 114 Other settings Babel Using counters Summary

TEX and LATEX use many counters, mostly for the numbering of (chapters) sections and children, pages, figures, equations, enumi, etc. 1 Do you need LATEX? 31 31 Counters are integers only, between 2 − 1 and −2 . 2 TeX and friends 9 Other basic settings 14 Basic mathematics in A counter cntname is created by \newconter{cntname} (no \); and declarations standard LATEX 3 The basics \newconter{cntname}[othercntname] also request that is reset 10 Babel 15 Handling bibliography each time othercntname is increased. Initial value is 0. 4 What is needed An existing counter can be modified by: 11 Indispensable 16 Boxes and page set to specified value : \setcounter{cntname}{value} 5 Getting started environments breaking increment \stepcounter{cntname} 6 Basic text formating 12 Floats 17 Creating commands increment with label creation \refstepcounter{cntname} and environments in add incr to present value \addtocounter{cntname}{incr} 7 Layout and structure 13 Spacing and breaking standard LAT X \resetcounter{cntname} : set to zero E The value of a counter can be printed with the macro \thecntname 8 Labeling & hyperref For example, the command \section automatically does \stepcounter{section} (which reset the counters subsection and children, and also equation, figure etc. and then use \thesection. Jean Hare (SU) A-LaTeX mars 2020 49 / 114 Jean Hare (SU) A-LaTeX mars 2020 50 / 114

Babel Babel Babel translations Babel usage

Package babel translates the caption of latex structure words like “Chapter” Babel in conjunction with \usepackage[T1]{fontenc} enables the according to the language passed as an option. Some important translated strings: hyphenation for the main (last loaded) language. String english french \abstractname Abstract Résumé When loading several languages, the last one is active. Switch = \appendixname Appendix Annexe globally:\selectlanguage{lan}, \bibname Bibliography Bibliographie locally:\foreignlanguage{lan}{text} \refname References Références Other strings are Babel also defines for each laded language a macro \captions \chaptername Chapter Chapitre also translated, enabling further customization like: \contentsname Contents Table des matières like ordinals, and fields used by the \figurename Fig. Figure 1 \addto\captionsfrench{\renewcommand{\figurename}{Fig.}} letter class. Or \tablename Table Table 2 \addto\captionsfrench{\renewcommand{\bibname}{Articles}} \partfirst, Glossary Glossaire \glossaryname \partsecond, Some formating commands could be added to “Fig.” line “Fig. \indexname Index Index \seename, \small\slshape”. But the proper way is to use \captionsetup. List of Figures Table des figures \listfigurename \alsoname etc. Babel (for French) also makes active the 4 double punctuation signs \listtablename List of Tables Liste des tableaux \pagename Page page to ensure proper spacing before and after. If needed, this behavior \prefacename Preface Préface can be toggled on/off with \shorthandon{;:!?} and \proofname Proof Démonstration \shorthandoff{;:!?}. Jean Hare (SU) A-LaTeX mars 2020 51 / 114 Jean Hare (SU) A-LaTeX mars 2020 52 / 114 Babel Environments Babel for french Summary

For French, babel adapts typesetting rules (if french is the main language): 1 Do you need LATEX? 1 the first paragraph of each section is indented; the default mark in itemize is set to “—” instead of •, and the vertical spacing in lists is reduced. 2 TeX and friends 9 Other basic settings 14 Basic mathematics in 2 Footnotes are displayed « à la française ». and declarations standard LATEX 3 The basics 3 Beside activation of ; : ! ?, the space after \dots is removed. 10 Babel 15 Handling bibliography 4 French quotation marks can be entered by the commands \og/\fg or « / ». 4 What is needed 5 « Boxed Sc » for Family names, with \bsc{name} (avoids hyphenation). 11 Indispensable 16 Boxes and page 6 \today is translated & \frenchdate{year}{month}{day} gives a properly 5 Getting started environments breaking formated date. Lists 6 Basic text formating 17 Creating commands 7 A command \up is provided for superscripts, and \ier, \iere, \iers, Tables and arrays es and environments in \ieres, \ieme, \iemes are defined, for e.g. 3 ; \primo, \secundo,. . . and 7 Layout and structure o o 12 Floats standard LAT X \FrenchEnumerate{num} for 1 , 2 ; Abbreviations for « numéro(s) » E o os \No=N , \Nos, \no, \nos=n and symbols \degre and \degres. 8 Labeling & hyperref 13 Spacing and breaking Further “francisation” settings can be done with \frenchsetup{options}, with many options to be fund in http://mirrors.ctan.org/macros/latex/ contrib/babel-contrib/french/french.pdf. Jean Hare (SU) A-LaTeX mars 2020 53 / 114 Jean Hare (SU) A-LaTeX mars 2020 54 / 114

Environments Lists Environments Lists Lists Customized lists

LATEXdefines three type of lists (can be nested up to 4 levels) Lists can be customized with the enumitem package. All the lengths, counters and labeling can be efficiently customized. \begin{itemize} In the following example we have an enumerate with italic alphabetic labels \item the first item formatted — the first item formatted according French rules according French rules (fr) protruding in the margin, and another with Greek labels. \item[ ] the second item 1 \setlist[enumerate]{leftmargin=*,nosep} • • the second (en) \item[2] the third item 2 Lorem ipsum dolor\ldots 3 \begin{enumerate}[label=\emph{\alph*}), \end{itemize} 2 the third item Lorem ipsum dolor . . . \begin{enumerate} 4 labelindent=-1em,leftmargin=0pt] 5 \item Donec vehicula augue ... a) Donec vehicula augue . . . \item the first item formatted 1. the first item 6 \item Mauris ut leo. b) Mauris ut leo. according French rules 7 \end{enumerate} Lorem ipsum dolor . . . \item the second item 2. the second item 8 Lorem ipsum dolor\ldots α - Donec vehicula augue . . . \item the third item 3. the third item 9 \begin{enumerate}[label=\cgreek* -] β - Mauris ut leo. \end{enumerate} 10 \item Donec vehicula augue ... \begin{description} 11 \item Mauris ut leo. \item[TeX] isa program TeX is a program 12 \end{enumerate} \item[LaTeX] isa set of macros LaTeX is a set of macros To create your own style, clone a standard list & set its properties: \item[Amsmath] enhance math macros \end{description} Amsmath enhance math macros \newlist{myit}{itemize}{2},& \setlist[myit]{label=\diamond}.

Jean Hare (SU) A-LaTeX mars 2020 55 / 114 Jean Hare (SU) A-LaTeX mars 2020 56 / 114

1 Environments Tables and arrays Environments Tables and arrays Environments tabular and array Alignment in tabular and array tabular is a text-only environment to create a simple tabular presentation In the argument of the environment the tree letters l, r, c define the (do not confuse with the |table| floating environment.) alignment of the cells of the corresponding rows. array is a math-only environment to create aligned content like matrix They can be interleaved with vertical bars | and/or \hline to draw or systems of equations. the vertical/horizontal borders. Separator Both use of the character & to delimit the cells in a row. 1 \begin{tabular}{|l|ccc|} 2 \hline Examples : 3 Color:&red& green& blue\\ Color: red green blue 1 \begin{tabular}{lccc} 4 \hline 2 Color: red green blue HTML : #f00 #0f0 #00f Color:&red& green& blue\\ 5 HTML : &\#f00 & \#0f0 &\#00f 3 HTML : #f00 #0f0 #00f HTML : &\#f00 & \#0f0 &\#00f 6 \hline 4 \end{tabular} 7 \end{tabular} 1 \[ \left( 123 0 321 Repeated entries can be grouped with . 2 \begin{array}{lcr} *{num}{algn} 0 123 0 E.g. for the the previous tabular. 3 123 & 0 & 321\\   |l|*{3}{c} 4 0 &123 &0 The options lcr, typeset in LR-mode, can be replaced by p{width} 5 \end{array} Notice the unusual alignment which inserts a , allowing vertical content. 6 \right) \] \parbox[t]

Jean Hare (SU) A-LaTeX mars 2020 57 / 114 Jean Hare (SU) A-LaTeX mars 2020 58 / 114

Environments Tables and arrays Floats Improved tabular and array Summary

More column options and much more are enabled by the package array. A m{width} & b{width} like p{width} but alignment middle/bottom 1 Do you need LTEX? In regular environments, @{text} could be used to prepend text to 2 TeX and friends 9 Other basic settings 14 Basic mathematics in the cell. With array, formating code can be prepended and and declarations standard LATEX appended the cells with >{code} and <{code}. And !{code} replace 3 The basics 10 Babel 15 Handling bibliography the vertical bar by code. 4 What is needed A stupid example: 11 Indispensable 16 Boxes and page \begin{tabular}{p{3em}% 5 Getting started environments breaking >{$\sim}r<{\:$kg}>{$\sim}r<{\:$m}} Man ∼ 80 kg ∼ 180 m 6 Man & 70 & 175 \\ Woman ∼ 55 kg ∼ 170 m Basic text formating 12 Floats 17 Creating commands Woman & 55 & 165 \\ and environments in Kid ∼ 35 kg ∼ 120 m 7 Layout and structure 13 Spacing and breaking Kid & 35 & 120 standard LATEX \end{tabular} Regularly used columns formats can be named : with 8 Labeling & hyperref \newcolumntype{C}{>{$}c<{$}}, C switches to math mode in tabular and to LR-mode in array option [t] & [b] : alignment with respect to surrounding text. Jean Hare (SU) A-LaTeX mars 2020 59 / 114 Jean Hare (SU) A-LaTeX mars 2020 60 / 114 Floats Floats Regulars floats : figure and table Placement A float is an environment placed by T X at an optimized position (after its E Placement of floats is the worst headache that LAT X users can experience. definition), trying to keep the page organization as clever as possible. E LATEX defines two floats: figure and table. The difference is The best position is generally top, but what ever you choose, it will semantics, as their content can be any thing that doesn’t concern interfere with page breakingJacques control, Hadamard and float the floats to the end of page breaking. You can defines other floats with package floats. chapter or document. Résumé Example: [h] & [Jacques!h] have SalomonbadnessHadamardmaximal(né le 8 décembre and must 1865 à Versailles,be avoided. mort le 17 octobre 1 \begin{figure}[thbp] To ensure1963 à that Paris) floats est un mathématicien are not floated français, to connu the pour end ses one travaux can: en théorie des nombres, en analyse complexe, en analyse fonctionnelle, en géométrie différentielle et en 2 \centering Allowsthéorie LAT desXto équations be more aux tolerant dérivées partielles. about floats placement with: 3 \includegraphics[width=0.9\textwidth]{mafigure} E 4 \caption{Ma belle figure} \renewcommand{\topfraction}{0.9} % max fraction at top 5 \label{f-belle} \Tablerenewcommand des matières{\bottomfraction}{0.6} % max fraction at bottom 6 \renewcommand{\textfraction}{0.1} % minimal textw. figs \end{figure} 1 Biographie1 \setcounter{topnumber}{2}\setcounter{bottomnumber}{2} % floats/page Floats have a critical optiona [tbhp] defining the allowed positions: 1.1 Famille et années de formation...... 1 Force1.2 a Carrière float page d’universitaire (p) with...... command \afterpage{\clearpage}. 1 [t]/[b] top/bottom of pages, [p] full page of float(s), [h] here. Limit floating with command of package : 2 Postérité scientifique2 \FloatBarrier placeins Note the \includegraphics[]{} which the swiss-army-knife provided by \usepackage[section]{placeins} automatically adds \FloatBarrier to graphicx to insert external content. . . \3section Les matrices. de Hadamard2 Jean Hare (SU) A-LaTeX mars 2020 61 / 114 Jean Hare (SU) A-LaTeX mars 2020 62 / 114 1 Biographie

1.1 Famille et années de formation Floats Le père de Jacques, Amédée HadamardFloats , d’origine juive, était professeur d’histoire, de grammaire et de littérature classique au lycée impérial de Versailles, puis au lycée Char- Floats (not floating) in text Usinglemagnefloatflt à Paris. Jacques étudia au lycée Charlemagne, et paradoxalement excellait sauf en mathématiques. En 1875, Amédée devint professeur au lycée Louis-le-Grand où Jacques continua ses études. Il fut reçu premier au concours général en algèbre et en mécanique en Packages wrapfig, picins and floatflt allow to place small 1883. L’année suivante, il entra premier à l’École normale supérieure. floating figures inside text as shown on next slide. Specify the requested width, and optionally the placement (r/l). 1.2 Carrière d’universitaire Example : The figure is produced by : En 1889, il enseigna au lycée Saint-Louis puis à partir de 1890 au Lycée Buffon. Il eut comme élève Maurice Fréchet et eut des 1 L’année suivante, il entra premier à l’École [...]. contacts avec Émile Borel à l’École normale, jusqu’au départ de 2 \subsection{Carrière d’universitaire} ce dernier pour la faculté des sciences de Lille en 1893. Il obtint 3 \begin{floatingfigure}[r]{40mm} son doctorat en 1892, sous la direction d’Émile Picard, pour des recherches sur les fonctions définies par séries de Taylor. 4 \flushright Il enseigne alors à la faculté des sciences de l’université de 5 \includegraphics[width=35mm]{hadamard-pic} Bordeaux en tant que chargé de cours de juillet 1893 à février 6 {\centering Jacques\textsc{Hadamard}\par} 1896 puis professeur titulaire. Il retourna ensuite à Paris en tant 7 \end{floatingfigure} que maître de conférences (en remplacement de Paul Painlevé à 8 En 1889, il enseigna au lycée Saint-Louis [...] la faculté des sciences de l’université de Paris, et obtient le titre Jacques Hadamard de professeur adjoint en février 1900. En novembre 1897, il devient également suppléant de These floats conflict with list, and often with sectioning commands. Maurice Lévy à la chaire de mécanique analytique et mécanique céleste du Collège de France is the most popular, but , are obsolete, and (à la suite de Paul Painlevé). wrapfig wrapfig picins À la suite de l’affaire Dreyfus (la femme de Dreyfus était la fille de David Hadamard, it is better to use floatflt un cousin du père de Jacques), il s’engagea politiquement dans la reconnaissance juive à partir de 1897. Jean Hare (SU) A-LaTeX mars 2020 63 / 114 JeanEn Hare1909, (SU) il obtient la chaire de mécaniqueA-LaTeX analytique et mécanique célestemars au 2020 Collège 64 / 114 de France. Trois ans plus tard, il succède à Henri Poincaré à l’Académie des sciences

1 Floats Floats Captions Subcaptions Floats generally include captions, explaining the content, defined by: Package subcaption allows captioning if composite figures : 1 \begin{figure}[htbp] 1 \usepackage{caption} 2 \includegraphics[width=35mm]{hadamard-pic} 2 \usepackage{subcaption} 3 \caption[Portrait de Jacques Hadamard] % Short title for\lof 3 [...] 4 {Jacques\textsc{Hadamard}, photographie prise en 1898 à \ldots} 4 \begin{figure} 5 \end{figure} 5 \begin{subfigure}[t]{0.7\textwidth} Genuine captions for “non-floating” illustration (with numbering etc.): 6 \includegraphics[width=0.7\textwidth]{example-image-a} 7 \caption{of subfig a} 1 \usepackage{caption} % option[hypcap=true] willbe recquired latter 8 \end{subfigure} 2 [...] 9 \begin{subfigure}[t]{0.49\textwidth} 3 \begin{minipage}{14cm} 10 \includegraphics[width=0.7\textwidth]{example-image-b} 4 \includegraphics[width=35mm]{hadamard-pic} 11 \caption{of subfig b} 5 \captionof{figure}{Portrait de Jacques Hadamard} 12 \end{subfigure} 6 \end{minipage} 13 \caption{of whole figure} Package caption enables customization with, for example: 14 \end{figure} 1 \captionsetup[figure]{labelsep=endash,labelfont={rm,bf},% The subfigure environment is defined in subcaption, but is not 2 textfont=sl,font=small} mandatory: any grouping is sufficient. which can be set globally or inside a given figure. subfigure & subfig : obsolete and incompatible with hyperref. Jean Hare (SU) A-LaTeX mars 2020 65 / 114 Jean Hare (SU) A-LaTeX mars 2020 66 / 114

Spacing and breaking Spacing and breaking Summary Horizontal spacing

1 Do you need LAT X? E Successive spaces (including tabs and carriage returns) are interpreted 2 TeX and friends 9 Other basic settings 14 Basic mathematics in as a single space with the following exceptions : and declarations standard LATEX Two consecutive carriage returns (i.e. blank line) close a paragraph, as 3 The basics does the \par command; 10 Babel 15 Handling bibliography The explicit spaces \␣ and the unbreakable ~ are observed. \, also 4 What is needed produce an smaller unbreakable space (0.167 em). 11 Indispensable 16 Boxes and page 5 Getting started environments breaking Larger horizontal space is obtained with \enskip,\quad or \qquad of respectively half, one or two ems. 6 Basic text formating 12 Floats 17 Creating commands and environments in Arbitrary space obtained with \hspace{} or 7 Layout and structure 13 Spacing and breaking standard LATEX \hspace*{}, where which can be negative is either a literal or a defined length. I the latter case length, it can be a 8 Labeling & hyperref “rubber” length. The starred version can be used at the beginning or the end of a line.

Jean Hare (SU) A-LaTeX mars 2020 67 / 114 Jean Hare (SU) A-LaTeX mars 2020 68 / 114 Spacing and breaking Spacing and breaking Line breaking Vertical spacing

Three ways to break a line : \newline, \linebreak and \\ (with an Between lines : \baselineskip (do not modify!) optional vertical spacing). Compare effects : Between paragraph : (do not modify!) Lorem ipsum dolor sit amet, consectetuer \parskip ←- \newline adipiscing elit. Curabitur dictum gravida mauris. Fixed skips : \smallskip, \medskip, \bigskip or \\ There are also \smallbreak, \medbreak, \bigbreak with the same Lorem ipsum dolor sit amet, consectetuer← effect, plus reducing break-page penalty. \linebreak - adipiscing elit. Curabitur dictum gravida mauris. Arbitrary skip : \vspace{} |\vspace*{}, like Line ending can be hinted with conditional hyphenation \- \hspace Lorem ipsum dolor sit amet, consectetuer adi- adi\-piscing Line breaking with space: piscing elit. Curabitur dictum gravida mauris. Lorem ipsum dolor sit amet, consectetuer adipisc\-ing Lorem ipsum dolor sit amet, consectetuer adipisc- \\[6pt] ing elit. Curabitur dictum gravida mauris. adipiscing elit. Curabitur dictum gravida mauris. Lorem ipsum dolor sit amet, consectetuer \hfill, \hrulefill, \dotfill can also influence line breaking : \\[-1ex] adipiscing elit. Curabitur dictum gravida mauris. Lorem ipsum dolor sit amet, consectetuer ...... adipiscing elit. acting like in vertical direction. Curabitur dictum gravida mauris. \vfill \hfill

Jean Hare (SU) A-LaTeX mars 2020 69 / 114 Jean Hare (SU) A-LaTeX mars 2020 70 / 114

Basic mathematics in standard LATEX Basic mathematics in standard LATEX Summary Math in standard LATEX(I)

By conception, TEXis specially efficient for typesetting math. The basic A 1 Do you need LTEX? math in LATEXis described first. 2 TeX and friends 9 Other basic settings 14 Basic mathematics in Math input defines “mathmode” in two version and four styles: and declarations standard LATEX – In-line mode, with $...$, \(...\), environment math. 3 The basics – Display mode, with \[...\] or environment displaymath. 10 Babel 15 Handling bibliography 4 What is needed – \displaystyle, \textstyle, \scriptstyle and 11 Indispensable 16 Boxes and page \scriptscriptstyle, mostly related to size of symbols. 5 Getting started environments breaking In mathmode, each letter is supposed to be single variable, so that 6 Basic text formating 12 Floats 17 Creating commands $abs$ gives abs and not abs and environments in Typed spaces are ignored. TEXintroduces the required spacing on the 7 Layout and structure 13 Spacing and breaking standard LATEX basis of the class of symbols, variables, operators, delimiter, binary 8 Labeling & hyperref relations, etc. Tweaking this spacing is sometimes required, with the commands (unit mu=1/18em): \quad \qquad \␣ \; \; \, \! 18mu 36mu 9mu 5mu 4 mu 3mu -3mu

Jean Hare (SU) A-LaTeX mars 2020 71 / 114 Jean Hare (SU) A-LaTeX mars 2020 72 / 114 Basic mathematics in standard LATEX Basic mathematics in standard LATEX Math in standard LATEX(II) Math in standard LATEX(III) : Integrals, sums and limits

Basic math constructions Indices and exponents: The Euler-Mascheroni constant γ • In (in-line math) γ = lim ( n 1 − n dx ) $2^3=8$ → 23 = 8 $\delta_{ij}=\pm1$ → δ = ±1 textstyle n k=1 k 1 x ij is produced by the command : →∞ 32 9 P R $a^3^2$ → Error $a^{3^2}=a^{9}$ → a = a \lim_{n\to\infty}(\sum_{k=1}^n\frac{1}{k}-\int_1^n\frac{dx}{x}) 4 + $C_2^4=6$ → C = 6 $\mathrm{H_3O^+}$ → H3O 2 n 1 n dx • Better result obtained in displaystyle : lim ( − ) → x = 1 → (x2) = 2x n k x $x’=1$ 0 $(x^2)’=2x$ 0 →∞ k 1 Primes : – With the displaymath environment \[···\] X=1 Z $x’’=0$ → x = 0 ${(x^3)}’=3x$ → (x3)0 = 3x 00 – By adding the command \displaystyle in front of the formula: Fractions and roots : \displaystyle\lim_{n\to\infty}(\sum_{k=1}^n\frac{1}{k} ··· √ a $\frac{a}{b}$ → b $\sqrt{4}=2$ → 4 = 2 • To change the default behavior, the limits position is can controlled with a √ commands \limits or \nolimits inserted between operator and limits. \[\frac{a}{b}\] → $\sqrt[3]{27}=3$ → 3 27 = 3 b

Jean Hare (SU) A-LaTeX mars 2020 73 / 114 Jean Hare (SU) A-LaTeX mars 2020 74 / 114

Basic mathematics in standard LATEX Basic mathematics in standard LATEX Math in standard LATEX(IV) Fonts Math in standard LATEX (V): operators and relations “Binary operators”, “Binary relations”and “unary operators”. E.g.: Regular math is in “mathematical italic”(lmmi for latinmodern) Bin ops, automatically surrounded by medium space (4 mu): Styles and families work like in text, but with \math