[PDF] [PDF] LaTeX tutorial - IPCMS

5 avr 2018 · The best choice is probably to install the MiKTeX distribution which is an need to select the "LaTeX + dvips + ps2 pdf + See PDF" option



Previous PDF Next PDF





[PDF] LaTeX_Beginners_Guidepdf

Time for action – writing a step-by-step tutorial 108 Time for action – shrinking our tutorial The best place for downloading LaTeX related software is CTAN



[PDF] LaTeX Tutorial

PDF file for printing and sharing; use the PDFLaTeX button to create a PDF file Since LaTeX will stop after any \end{document} command, a good strategy



[PDF] Introduction to LaTeX - Writing papers the right way - MIT

With LATEX, you can be sure you've fit the template, and switch templates easily web mit edu/rsi/www/ pdf s/bibtex-format pdf Google is still your best friend



[PDF] Beginning LATEX

the other hand, TEX cannot synchronize changes in the tex file and the pdf The best way to understand how LATEX deals with space is to experiment With



[PDF] LaTeX in Twenty Four Hours - A Practical Guide - Tezpur University

One of the major advantages of using LATEX is that manual formatting of a document, as usually table environment to place a table at the top of a page 1 3 3



[PDF] LaTeX tutorial - IPCMS

5 avr 2018 · The best choice is probably to install the MiKTeX distribution which is an need to select the "LaTeX + dvips + ps2 pdf + See PDF" option



[PDF] Getting started with LaTeX (pdf) - TCD Maths home

quality comparable with good quality books and journals Simple documents one of the most suitable version of LATEX for beginners to use 1 2 A Typical 



[PDF] LaTeX Tutorial - Wanmin Liu

The best way to learn how to use each package is reading its manual We list some packages below \usepackage{amsmath} many math symbols \ usepackage{ 



[PDF] A brief LATEX tutorial - Duke University

30 sept 2002 · The best way to use this tutorial is to read this (nice-looking) A guide to LATEX: document preparation for beginners and advanced users,



[PDF] Using LATEX - SEIS

I believe that the best approach to LATEX is to start writing a document and look up the things you don't know and transforms this into a high quality document ( usually a PDF) LATEX tutorials online; ShareLaTeX [12] is particularly good

[PDF] best linux cheat sheet pdf

[PDF] best lms 2020

[PDF] best metro systems in the world

[PDF] best online french course with certificate

[PDF] best practice in therapeutic drug monitoring

[PDF] best restaurants paris 5

[PDF] best ruby on rails tutorial reddit

[PDF] best salesforce certification for business analyst

[PDF] best seats on eurostar to paris

[PDF] best train tickets for europe

[PDF] best vegetarian fine dining paris

[PDF] best website builder

[PDF] best website to learn animation free

[PDF] best western paris orly airport hotel

[PDF] best western plus paris orly airport

LATEX programming

https://www.latex-project.org/

Basic tutorial to LATEX programming

Sébastien LEROUX

sebastien.leroux@ipcms.unistra.fr INSTITUT DEPHYSIQUE ET DECHIMIE DESMATÉRIAUX DESTRASBOURG,

DÉPARTEMENT DESMATÉRIAUXORGANIQUES,

23RUE DULOESS, BP43,

F-67034 STRASBOURGCEDEX2, FRANCE

OCTOBER19, 2020

ContentsContents

ii

1 LATEX ?1

1.1 WYSIWYG vs. LATEX . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .1

1.2 Which LATEX ? . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .2

1.2.1 On-line: collaborative LATEX . . . . . . . . . . . . . . . . . . . . . . . . . . . .2

1.2.2 Off-line: installing LATEX . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .2

1.3 Before running LATEX . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .4

1.3.1 WYSIWYG-like tools for LATEX . . . . . . . . . . . . . . . . . . . . . . . . . .4

1.3.2 LATEX editor . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .4

1.3.3 How to install manually a package for LATEX . . . . . . . . . . . . . . . . . . .4

2 LATEX - the first step9

2.1 Structure of the document . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .. . .9

2.1.1 The document class . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .9

2.1.2 The preamble section . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .11

2.1.3 The main body of the manuscript . . . . . . . . . . . . . . . . . . . . . . . . .11

2.2 Running LATEX . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .12

2.2.1 The tools that you will need . . . . . . . . . . . . . . . . . . . . . . . . . . . .12

2.2.2 The compilation process . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .12

3 LATEX essentials15

3.1 Commands . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .15

3.2 Environments . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .16

3.3 Packages . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ..19

3.4 Files . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .19

4 My first LATEX document21

4.1 Preparing the preamble . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .. .21

4.2 Writing the manuscript . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .23

4.2.1 Writing text . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .23

4.2.2 Title, authoring and abstract . . . . . . . . . . . . . . . . . . . . . . . . . . . .26

4.2.3 Organizing your document . . . . . . . . . . . . . . . . . . . . . . . . . . . . .26

4.2.4 Inserting a math equation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .29

4.2.5 Inserting a table . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .30

4.2.6 Inserting an image . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .31

i

4.2.7 Inserting a list / enumeration . . . . . . . . . . . . . . . . . . . . . . . . . . . .33

4.2.8 Inserting a reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ..34

4.2.9 Inserting web links and emails . . . . . . . . . . . . . . . . . . . . . . . . . . .35

4.2.10 Inserting a bibliography . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .35

5 Spell checking39

5.1 Using the command line . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .39

5.2 Using Texmaker . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ..40

6 LATEX advantages and drawbacks43

7 Examples47

7.1 Title and authors . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .47

7.1.1 RevTex - "revtex4-2" . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ..47

7.1.2 American Chemical Society "achemso" . . . . . . . . . . . . . . . . . . . . . .48

7.1.3 Elsevier "elsarticle" . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .49

7.1.4 Institute Of Physics "iopart" . . . . . . . . . . . . . . . . . . . . . . . . . . . .50

7.2 Tables and figures . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .. . .51

7.3 Equations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .53

8 Partial glossary55

8.1 Useful commands . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ..55

8.1.1 In text mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .55

8.1.2 In math mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .56

8.2 Useful environments . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .. .57

9 Error messages59

9.1 LATEX errors . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .59

9.2 TEX errors . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .61

10 Some useful links63

ii

LATEX ?

LATEX, shortcut for "Lamport TEX", is a document markup language invented by Leslie Lamport in 1983. The purpose of L ATEX is to simplify the utilization of the word processor TEX devel- oped by Donald Knuth since 1977. With typical word processors such as Microsoft Word and LibreOffice Writer, calledWYSI- WYGeditors "WhatYouSeeIsWhatYouGet", one can immediately visualize the formatted text and the final shape of the document on the screen. In L ATEX the writer uses plain text (as opposed to formatted text), relying on markup tagging conventions to: •define the general structure of a document (such as article, book, and letter). •stylize text throughout a document (such as bold and italic). •insert objects in the document (such as tables and figures).

•add citations and cross-referencing.

A T

EX distribution such as

TeX LiveorMiKTeXis used to produce an output file (such as PS, PDF or DVI) suitable for printing or digital distribution.

The latest version of L

ATEX is called LATEX2ε.

Many ideas in this HowTo where inspired by the very good book "L

ATEX par la pratique" (in

French) by Christian Rolland [

1] ...

... and many others by the L

ATEX Wikibooks:

https://en.wikibooks.org/wiki/LaTeX

1.1 WYSIWYG vs. LATEX

L ATEX being a programming language it is required to learn it, or at least a part of it, which scares most of the potential candidates to use it. 1

Chapter 1. LATEX ? 2

Using a WYSIWYG editor you can visualize the result of your workimmediately. With LATEX few steps are required to obtain the final manuscript using the source file(s) in TEX language. The sequence of these steps is called compilation, and the compilation process can slightly change from one case to another.

1.2 Which LATEX ?

1.2.1 On-line: collaborative L

ATEX Over the past few years, and like for many other sofware resources, the LATEX community has taken advantage of cloud computing. Several websites now offers complete and intuitive LATEX interfaces to edit and build your documents on line: https://fr.overleaf.com/

•https://www.sharelatex.com/

•https://papeeria.com/

This is a simple way to start and discover LATEX, and it is likely that these webistes offer one of the most interesting option, if not the best, to setup collaborative work using LATEX. Using such L ATEX-in-the-cloud website would however require to have your research online with all the advantages and drawbacks that internet has to offer in such case.

1.2.2 Off-line: installing L

ATEX

1.2.2.1 Linux

To install T

EX and LATEX2εon Linux you can simply use your favorite package manager (Yumex, Synaptic ...), see bellow for a list of packages. You can also use the command line, remember that you need to belogged in a administrator. To install the complete TeX Live distribution (≂1.5Go):

•RedHat based Linux distributions:

user@localhost ~]$ sudo dnf install texlive-scheme-full

•Debian based Linux distributions:

user@localhost ~]$ sudo apt-get install texlive-full To install the minimal Tex Live distribution on RedHat based Linux use: user@localhost ~]$ sudo dnf install texlive 2

3 1.2. Which LATEX ?

Afterwards the following commands ensure that you will install on your computer all the packages required to produce the examples proposed in this HowTo, many of which might already be installed by the previous command.

•Math and tables:

~]$ sudo dnf install texlive-amstex ~]$ sudo dnf install texlive-tabls texlive-multirow

•Images and graphics:

~]$ sudo dnf install texlive-graphviz texlive-xcolor

•Scientific editors:

~]$ sudo dnf install texlive-revtex texlive-achemso ~]$ sudo dnf install texlive-iopart tetex-elsevier

•Bibliography:

~]$ sudo dnf install texlive-bibtex

•Others:

~]$ sudo dnf install texlive-hyperref texlive-pslatex ~]$ sudo dnf install texlive-babel

1.2.2.2 Mac

You need to install the

MacTeXdistribution:

•Complete MacTeX package (≂2Go):

•Smaller MacTeX distribution:https://tug.org/mactex/morepackages.html

1.2.2.3 Windows

The best choice is probably to install the MiKTeX distribution which is an up-to-date imple- mentation of TEX, LATEX and related programs for Windows:

•Internet installer:

http://miktex.org/download Alternatively you can install the TeX Live distribution:

•Internet installer:

•Obtain TeX Live on DVD:http://https://www.tug.org/texlive/acquire-dvd.html 3

Chapter 1. LATEX ? 4

1.3 Before running LATEX

1.3.1 WYSIWYG-like tools for L

ATEX To help you start you can install some tools that offer a WYSIWYGinterface for LATEX:

•GNU TeXmacs:

http://www.texmacs.org/

•BaKoMa TEX:http://www.bakoma-tex.com/

Using these softwares you can prepare your LATEX manuscript in a Microsoft Word or Libre- Office Writer kind of way, however they are limited and the source file they produce, if you generate some errors, and you will, is usually complicated to read.

1.3.2 L

ATEX editor

To start working you need to pick a text editor, if your OS is Microsoft Windows remember to use a "Unix Line Endings" editor. Indeed many Windows-based text editors add a particular symbol at the end of each line to signify that the line is breaking, and this symbol is messing with L

ATEX. Among the editors that can be used:

•The basic editors:

GNU Emacs

-gVim

•The tools dedicated to LATEX:

Texmakersee figure [Fig.1.1]

TEXnicCenter

-TeXworks -TeXstudio Hereafter I will use few examples from Texmaker, an opensource multiplateform (Linux, Mac, Windows) software that provides a user interface with spell-checking (see

5), help to many

L

ATEX commands and a PDF reader.

1.3.3 How to install manually a package for L

ATEX

Add-on features for L

ATEX are known as packages. Dozens are pre-installed with LATEX and can be used immediately. They should all be stored in sub-directories of texmf/tex/latexnamed after each package. The directory name " texmf" stands for "TEX and METAFONT". A package is a file or collection of files containing extra L

ATEX commands and programming

which add new styling features or modify those already existing. There are two main file types delivered by packages: 4

5 1.3. Before running LATEX

Figure 1.1The main window of the Texmaker editor

•class files with.clsextension

•style files with

.styextension When you try to typeset a document which requires a package which is not installed on your system, L ATEX will warn you with an error message that it is missing [see

9]. Most LATEX

installations come with a large set of pre-installed style packages, so you can use the package manager of the TEX distribution or the one on your system to manage them. But many more are available on the net. The main place to look for style packages on the Internet is

Comprehensive

TEXArchiveNetwork

,CTAN. Once you have identified a package you need that is not in your distribution, use the search engines of any CTAN server to findit. Download and follow this procedure to install it (after opening the archive):

1. Extract the files of the package: run L

ATEX on the

*.insfile, ex:

•For Linux / Mac:

user@localhost ~]$ latex package.ins •For Windows open the*.insusing Texmaker and run a "Quick Build" [see2.2.2]

2. Create the documentation: run L

ATEX twice on the

*.dtxfile, ex: 5

Chapter 1. LATEX ? 6

•For Linux / Mac:

user@localhost ~]$ latex package.dtx user@localhost ~]$ latex package.dtx •For Windows open the*.dtxusing Texmaker and run a "Quick Build" [see2.2.2]

3. Install the files:

Packages installed manually should always be placed in your"local" directory, not in the directory tree containing all the pre-installed packages.This is done to prevent your new package to accidentally overwrite files in the main TEX directory. 6

7 1.3. Before running LATEX

The folder to look for should probably be calledtexmf/ortexmf-local/and its loca- tion depends on your operating system:

•Linux:

$HOME/texmf/

•Mac (MacTeX):/Users/username/Library/texmf/

•Windows (MikTeX): any folder registered as a user-managed texmf directory The "right place" sometimes causes confusion, the "right place" for a LATEX .styfile is a suitably-named sub-directory of texmf/tex/latex/"Suitably-named" means sensible, meaningful and probably short.

Often there is just a

.styfile to move, but for complex packages there may be more, and they may belong in different locations. For example, newBibTeX packages or font packages will typically have several files to install. This is why it is a good idea to create a sub-directory for the package rather than dump the files into misc along with other unrelated stuff. In any case read the documentation to find out if there is a special or preferred location to move them to.

Table 1.1

Where to put the files from the packages

Type Directory(intexmf/ortexmf-local/)Description

.afm fonts/afm/foundry/typefaceAdobe Font Metrics for Type 1 fonts .bst bibtex/bst/packagenameBibTeX style .cls tex/latex/baseDocument class file .dvi docpackage documentation .enc fonts/encFont encoding .fd tex/latex/mfnfssFont Definition files for METAFONT fonts .fd tex/latex/psnfssFont Definition files for PostScript Type 1 fonts .map fonts/mapFont mapping files .mf fonts/source/public/typefaceMETAFONT outline .pdf docPackage documentation .pfb fonts/type1/foundry/typefacePostScript Type 1 outline .sty tex/latex/packagenameStyle file: the normal package content .tex docTEX source for package documentation .tex tex/plain/packagenamePlain TEX macro files .tfm fonts/tfm/foundry/typefaceTEX Font Metrics for METAFONT and Type 1 fonts .ttf fonts/truetype/foundry/typefaceTrueType font .vf fonts/vf/foundry/typefaceTEX virtual fonts others tex/latex/packagenameOther types of file unless instructed otherwise 7

Chapter 1. LATEX ? 8

4. Update your index:

Run your T

EX indexer program to update the package database. This program comes with every version of TEX and has various names depending on the LATEX distribution you use:

•Linux - TeX Live:

texhash user@localhost ~]$ texhash

•Mac - MacTeX does the job for you.

•Windows - MiKTeX:

-Windows XP through 7: Start menu→All Programs→MiKTeX→Settings -Windows 8: use the keyword Settings and choose the option of Settings with the MiKTeX logo. In Settings menu choose the first tab and click on Refresh FNDB-button, after that just verify by clicking "OK". 8

LATEX - the first step

2.1 Structure of the document

In the most simple case the structure of a LATEX document is as follow: \documentclass{article} % Some (important) information here \begin{document}

Science is great, I love it !

\end{document}=?the document class - [see

2.1.1]

=?the preamble section - [see

2.1.2]

=?the article starts here the main body section - [see

2.1.3]

=?the article ends here The L

ATEX file is a simple text file with the

*.texextension.

2.1.1 The document class

The document class is the first line of your L

ATEX file, it is a command that tells LATEX which

type of document you are going to write, among the default choices provided you can find:

•letter

•article

•book

•beamer=?to write a letter

=?to write an article =?to write a book (like your thesis) =?to create a presentation 9

Chapter 2. LATEX - the first step 10

On the document class declaration line you can also find additional options, or keywords, separated by a coma: \documentclass[a4paper,12pt]{article} In this example the first keyword specify the paper layout, the second is used to change the default font size in the entire document. 3 different font sizes are available in the bookand articleclasses:10pt,11ptor12pt, other are available using packages [see3.3]. For more details about the different keywords or options, please refer the documentation of the corresponding document class. Almost all scientific journals provide their own guidelinesfor LATEX publishing, including the document class you need to use, the trick is only, when needed, to download the class from the web site of the journal and to know how to install it [See

1.3.3]. For example theAmerican

PhsyicalSociety,APS(Phys. Rev., Phys. Rev. Lett....) and theAmericanInstitute ofPhysics, AIP(J. Chem. Phys., Appl. Phys. Lett....) use therevtexclass: IOP Publishing (J. Phys.: Cond. Mat., Rep. Prog. Phys....) uses theiopartclass: TheAmericanChemicalSociety,ACS(J. Am. Chem. Soc., Chem. Mater....) uses the achemsoclass:quotesdbs_dbs14.pdfusesText_20