welcome to information literacy ii good morning! · latex – general idea. focus on . the content....

21
Welcome to Information Literacy II Good 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

Upload: others

Post on 18-Aug-2020

0 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Welcome to Information Literacy II Good morning! · Latex – General Idea. Focus on . the content. Do . not. focus on the design/layout Latex will choose automatically the best design

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

Page 2: Welcome to Information Literacy II Good morning! · Latex – General Idea. Focus on . the content. Do . not. focus on the design/layout Latex will choose automatically the best design

Lecture 4 – Introduction to LaTeXFinal lecture on Python Matplotlib

Information Literacy II – EN(IL2) Course

Page 3: Welcome to Information Literacy II Good morning! · Latex – General Idea. Focus on . the content. Do . not. focus on the design/layout Latex will choose automatically the best design

Today

What and why Latex?

Overleaf

Introduction to Latex- Basic commands

- Structure of the document

- Mathematical expressions

Homework #2

Page 4: Welcome to Information Literacy II Good morning! · Latex – General Idea. Focus on . the content. Do . not. focus on the design/layout Latex will choose automatically the best design

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.

Page 5: Welcome to Information Literacy II Good morning! · Latex – General Idea. Focus on . the content. Do . not. focus on the design/layout Latex will choose automatically the best design

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.

Page 6: Welcome to Information Literacy II Good morning! · Latex – General Idea. Focus on . the content. Do . not. focus on the design/layout Latex will choose automatically the best design

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!

Page 7: Welcome to Information Literacy II Good morning! · Latex – General Idea. Focus on . the content. Do . not. focus on the design/layout Latex will choose automatically the best design

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/

Page 8: Welcome to Information Literacy II Good morning! · Latex – General Idea. Focus on . the content. Do . not. focus on the design/layout Latex will choose automatically the best design

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

Page 9: Welcome to Information Literacy II Good morning! · Latex – General Idea. Focus on . the content. Do . not. focus on the design/layout Latex will choose automatically the best design

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”

Page 10: Welcome to Information Literacy II Good morning! · Latex – General Idea. Focus on . the content. Do . not. focus on the design/layout Latex will choose automatically the best design

Overleaf (Web App)

Page 11: Welcome to Information Literacy II Good morning! · Latex – General Idea. Focus on . the content. Do . not. focus on the design/layout Latex will choose automatically the best design

Overleaf – Registration

Option 2

Option 1

Page 12: Welcome to Information Literacy II Good morning! · Latex – General Idea. Focus on . the content. Do . not. focus on the design/layout Latex will choose automatically the best design

Overleaf – Example Project

1

2

Page 13: Welcome to Information Literacy II Good morning! · Latex – General Idea. Focus on . the content. Do . not. focus on the design/layout Latex will choose automatically the best design

Overleaf – Interface

Source file

This is whatyou will write

Output file

This is whatyou will obtain

Page 14: Welcome to Information Literacy II Good morning! · Latex – General Idea. Focus on . the content. Do . not. focus on the design/layout Latex will choose automatically the best design

Overleaf – Blank Project

Page 15: Welcome to Information Literacy II Good morning! · Latex – General Idea. Focus on . the content. Do . not. focus on the design/layout Latex will choose automatically the best design

Latex Introduction

Page 16: Welcome to Information Literacy II Good morning! · Latex – General Idea. Focus on . the content. Do . not. focus on the design/layout Latex will choose automatically the best design

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

Page 17: Welcome to Information Literacy II Good morning! · Latex – General Idea. Focus on . the content. Do . not. focus on the design/layout Latex will choose automatically the best design

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

Page 18: Welcome to Information Literacy II Good morning! · Latex – General Idea. Focus on . the content. Do . not. focus on the design/layout Latex will choose automatically the best design

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}

Page 19: Welcome to Information Literacy II Good morning! · Latex – General Idea. Focus on . the content. Do . not. focus on the design/layout Latex will choose automatically the best design

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}

Page 20: Welcome to Information Literacy II Good morning! · Latex – General Idea. Focus on . the content. Do . not. focus on the design/layout Latex will choose automatically the best design

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}

Page 21: Welcome to Information Literacy II Good morning! · Latex – General Idea. Focus on . the content. Do . not. focus on the design/layout Latex will choose automatically the best design

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).