Welcome to Information Literacy II Good morning! · Latex – General Idea. Focus on . the content....
Transcript of Welcome to Information Literacy II Good morning! · Latex – General Idea. Focus on . the content....
Welcome to Information Literacy IIGood morning!
• Lecture will start at 10:45 (let's wait for everyone).• If you have any question, please ask in the chat.• Note that lecture will be recorded.
• Please write your name there:https://forms.gle/GQ6mEjGHxJZhAXH66
Lecture 4 – Introduction to LaTeXFinal lecture on Python Matplotlib
Information Literacy II – EN(IL2) Course
Today
What and why Latex?
Overleaf
Introduction to Latex- Basic commands
- Structure of the document
- Mathematical expressions
Homework #2
LaTeX
A document preparation system developed by L. Lamportbased on the TeX system created by D. Knuth.Takes a document created using the Latex markup language and converts into a format suitable for printing (typically PDF).Free software.
Latex (cont)
Powerful support for mathematical formulas and diagrams, citations, cross-references, footnote, bibliographies, etc.Commonly used by publishers for preparation of books and academic journals.Flexible programming environment for creating new commands, environments, packages, etc.
Using Latex on your own computer
Main Latex website: https://www.latex-project.org/
On MacOS: Install MacTeX: http://www.tug.org/mactex/On Windows: Install MiKTeX: https://miktex.org/Both distributions contain a complete system (including editor)Plenty of documentation online Easy to find help!
A few more linksThe Not So Short Introduction to LATEX 2εhttps://tobi.oetiker.ch/lshort/lshort.pdf
Wikibook on Latexhttps://en.wikibooks.org/wiki/LaTeX
Possible to use Latex online (without installing anything)e.g. https://www.overleaf.com/
Latex vs. WordAdvantage of Latex:
- Portable: can be used on any computer- Stable: old documents can still be read- Standard in Academic world- Easier to use but only after some time
Drawback of Latex:- Not WYSIWYG- Not so common outside of university- May be more difficult at the beginning
Latex – General IdeaFocus on the contentDo not focus on the design/layout Latex will choose automatically the best design
How to use Latex:1 – Write a source file “report.tex”2 – Compile using Latex2’ – Fix the errors and compile again3 – Check the result, typically “report.pdf”
Overleaf (Web App)
Overleaf – Registration
Option 2
Option 1
Overleaf – Example Project
1
2
Overleaf – Interface
Source file
This is whatyou will write
Output file
This is whatyou will obtain
Overleaf – Blank Project
Latex Introduction
Latex – First ExampleAlways start with \documentclass[…]{…}
Latex commands use backslash: \commandname
{…} is for mandatory arguments
[…] is for optional arguments
Use the \title{…}, \author{…}, and \date{…} to give title, author, and date
The main content of the document is between the \begin{document} and \end{document} commands
The command \maketitle creates the top of the document
\documentclass{article}
\title{My first Latex document}\author{Francois Bonnet}
\begin{document}
\maketitleThis is my first document written in Latex. It seems complex but as we will see, it is not so difficult to write good documents using Latex!
\end{document}
example1.tex
Latex – First Example\documentclass{article}
\title{My first Latex document}\author{Francois Bonnet}
\begin{document}
\maketitleThis is my first document written in Latex. It seems complex but as we will see, it is not so difficult to write good documents using Latex!
\end{document}
example1.tex
Latex – Document structureUse the commands \section{…}and \subsection{…}to structure your document.
Use an empty line to start a new paragraph.
Automatic numbering of sections and subsections
Try subsubsection or subsubsubsection or …
...\begin{document}\section{How to use matplotlib}I describe here how to use matplotlib
\section{How to use \LaTeX}I describe here how to use LaTeX. I will first explain history of Latex, then some basic commands, then ...
New paragraph starts after an empty line.
\subsection{History}Bla bla bla bla
\subsection{Basic commands}Bla bla bla bla
\subsection{Something else}\end{document}
Latex – ListThe itemize environment can be used to create a list of items.
To create numbered list, one should use the enumerate environment.
Try enumerate on your computer.
Try nested lists on your computer.
...\begin{document}
There are three main OS:\begin{itemize}\item macOS\item Linux\item Windows\end{itemize}
There are three main OS:\begin{enumerate}\item macOS\item Linux\item Windows\end{enumerate}
\end{document}
Latex – Math expressionsInline mathematical expression appears between $...$
Use the `` and '' for quotes. Do not use the “ (double quotation mark)
Note also the \ldots command that produces …
Display mode is activated using \[ … \] and should be used for more complex formulas
...\begin{document}
It is very easy to write ``complex'' mathematical expressions. You can write Greek letters; for example $\alpha$, $\beta$, $\gamma$, $\Gamma$, \ldots
It is also possible to write some mathematical terms: $\sqrt{256} = 16$ or $x_1 + x_2 + x_3$ or $(x+y)(x-y) = x^2 - y^2$.
If you need bigger formula, you can use the display mode as follow:\[\sum_{n=1}^{\infty} \frac{1}{n^2} = \frac{\pi^2}{6}\]\end{document}
Homework #2Create a simple Latex document that contains:
- A title and your name (as author)- The mathematical expression on the right,
including the parenthesis and the +/- sign.(you can look for help online)
- A short text explaining the previous equation.
Download the two files from Overleaf: ‘homework2.tex’ and ‘homework2.pdf’. Compress them in ‘homework2.zip’.Submit via OCW-i the compressed file before July 27 (23:50).