168
Introduction to L A T E X Session #1 Oriol Borrega Pedro Tiago Martins Universitat de Barcelona January 14, 2013 Borrega & Martins (UB) Introduction to L A T E X Session #1 January 14, 2013 1 / 39

First LaTeX session of the BIB

  • Upload
    bibcn

  • View
    1.034

  • Download
    4

Embed Size (px)

DESCRIPTION

Presentation used at the first LaTeX session of the Biolinguistics Initiative Barcelona. You can find the first exercise at http://biolinguistics-bcn.blogspot.com

Citation preview

Page 1: First LaTeX session of the BIB

Introduction to LATEXSession #1

Oriol Borrega Pedro Tiago Martins

Universitat de Barcelona

January 14, 2013

Borrega & Martins (UB) Introduction to LATEX Session #1 January 14, 2013 1 / 39

Page 2: First LaTeX session of the BIB

Outline

1 Preliminary RemarksHow a scientific document must be

2 Why use LATEX instead of a Word Processor?Advantages of LATEXDisadvantages of LATEXThings LATEX is good at and appropriate forThings LATEX is bad at or not appropriate for

3 What is LATEX ?History

TEXLATEX

4 How LATEX worksHow LATEX documents are createdThe basic structure of a LATEX document

5 LATEX commands and a small document

Borrega & Martins (UB) Introduction to LATEX Session #1 January 14, 2013 2 / 39

Page 3: First LaTeX session of the BIB

Preliminary Remarks

Outline

1 Preliminary RemarksHow a scientific document must be

2 Why use LATEX instead of a Word Processor?Advantages of LATEXDisadvantages of LATEXThings LATEX is good at and appropriate forThings LATEX is bad at or not appropriate for

3 What is LATEX ?History

TEXLATEX

4 How LATEX worksHow LATEX documents are createdThe basic structure of a LATEX document

5 LATEX commands and a small document

Borrega & Martins (UB) Introduction to LATEX Session #1 January 14, 2013 3 / 39

Page 4: First LaTeX session of the BIB

Preliminary Remarks How a scientific document must be

A scientific document must be:

Structured

identification (of the author and of the work)(optional) table of contentswell-defined and well-placed sections, paragraphs, footnotes, lists,figures, etc.. . .references

Readable

approx. 66 characters per line (there are actually studies on this. . . )large margins (for A4 size paper or similar) or two columnsserif font for main textno underlining for emphasis (underlining was widely used in the pastwhen emphasis had to be added manually, after the writing was done)no variation between elements of the same kind

Borrega & Martins (UB) Introduction to LATEX Session #1 January 14, 2013 4 / 39

Page 5: First LaTeX session of the BIB

Preliminary Remarks How a scientific document must be

A scientific document must be:

Structured

identification (of the author and of the work)(optional) table of contentswell-defined and well-placed sections, paragraphs, footnotes, lists,figures, etc.. . .references

Readable

approx. 66 characters per line (there are actually studies on this. . . )large margins (for A4 size paper or similar) or two columnsserif font for main textno underlining for emphasis (underlining was widely used in the pastwhen emphasis had to be added manually, after the writing was done)no variation between elements of the same kind

Borrega & Martins (UB) Introduction to LATEX Session #1 January 14, 2013 4 / 39

Page 6: First LaTeX session of the BIB

Preliminary Remarks How a scientific document must be

A scientific document must be:

Structured

identification (of the author and of the work)(optional) table of contentswell-defined and well-placed sections, paragraphs, footnotes, lists,figures, etc.. . .references

Readable

approx. 66 characters per line (there are actually studies on this. . . )large margins (for A4 size paper or similar) or two columnsserif font for main textno underlining for emphasis (underlining was widely used in the pastwhen emphasis had to be added manually, after the writing was done)no variation between elements of the same kind

Borrega & Martins (UB) Introduction to LATEX Session #1 January 14, 2013 4 / 39

Page 7: First LaTeX session of the BIB

Preliminary Remarks How a scientific document must be

A scientific document must be:

Structured

identification (of the author and of the work)(optional) table of contentswell-defined and well-placed sections, paragraphs, footnotes, lists,figures, etc.. . .references

Readable

approx. 66 characters per line (there are actually studies on this. . . )large margins (for A4 size paper or similar) or two columnsserif font for main textno underlining for emphasis (underlining was widely used in the pastwhen emphasis had to be added manually, after the writing was done)no variation between elements of the same kind

Borrega & Martins (UB) Introduction to LATEX Session #1 January 14, 2013 4 / 39

Page 8: First LaTeX session of the BIB

Preliminary Remarks How a scientific document must be

A scientific document must be:

Structured

identification (of the author and of the work)(optional) table of contentswell-defined and well-placed sections, paragraphs, footnotes, lists,figures, etc.. . .references

Readable

approx. 66 characters per line (there are actually studies on this. . . )large margins (for A4 size paper or similar) or two columnsserif font for main textno underlining for emphasis (underlining was widely used in the pastwhen emphasis had to be added manually, after the writing was done)no variation between elements of the same kind

Borrega & Martins (UB) Introduction to LATEX Session #1 January 14, 2013 4 / 39

Page 9: First LaTeX session of the BIB

Preliminary Remarks How a scientific document must be

A scientific document must be:

Structured

identification (of the author and of the work)(optional) table of contentswell-defined and well-placed sections, paragraphs, footnotes, lists,figures, etc.. . .references

Readable

approx. 66 characters per line (there are actually studies on this. . . )large margins (for A4 size paper or similar) or two columnsserif font for main textno underlining for emphasis (underlining was widely used in the pastwhen emphasis had to be added manually, after the writing was done)no variation between elements of the same kind

Borrega & Martins (UB) Introduction to LATEX Session #1 January 14, 2013 4 / 39

Page 10: First LaTeX session of the BIB

Preliminary Remarks How a scientific document must be

A scientific document must be:

Structured

identification (of the author and of the work)(optional) table of contentswell-defined and well-placed sections, paragraphs, footnotes, lists,figures, etc.. . .references

Readable

approx. 66 characters per line (there are actually studies on this. . . )large margins (for A4 size paper or similar) or two columnsserif font for main textno underlining for emphasis (underlining was widely used in the pastwhen emphasis had to be added manually, after the writing was done)no variation between elements of the same kind

Borrega & Martins (UB) Introduction to LATEX Session #1 January 14, 2013 4 / 39

Page 11: First LaTeX session of the BIB

Preliminary Remarks How a scientific document must be

A scientific document must be:

Structured

identification (of the author and of the work)(optional) table of contentswell-defined and well-placed sections, paragraphs, footnotes, lists,figures, etc.. . .references

Readable

approx. 66 characters per line (there are actually studies on this. . . )large margins (for A4 size paper or similar) or two columnsserif font for main textno underlining for emphasis (underlining was widely used in the pastwhen emphasis had to be added manually, after the writing was done)no variation between elements of the same kind

Borrega & Martins (UB) Introduction to LATEX Session #1 January 14, 2013 4 / 39

Page 12: First LaTeX session of the BIB

Preliminary Remarks How a scientific document must be

A scientific document must be:

Structured

identification (of the author and of the work)(optional) table of contentswell-defined and well-placed sections, paragraphs, footnotes, lists,figures, etc.. . .references

Readable

approx. 66 characters per line (there are actually studies on this. . . )large margins (for A4 size paper or similar) or two columnsserif font for main textno underlining for emphasis (underlining was widely used in the pastwhen emphasis had to be added manually, after the writing was done)no variation between elements of the same kind

Borrega & Martins (UB) Introduction to LATEX Session #1 January 14, 2013 4 / 39

Page 13: First LaTeX session of the BIB

Preliminary Remarks How a scientific document must be

A scientific document must be:

Structured

identification (of the author and of the work)(optional) table of contentswell-defined and well-placed sections, paragraphs, footnotes, lists,figures, etc.. . .references

Readable

approx. 66 characters per line (there are actually studies on this. . . )large margins (for A4 size paper or similar) or two columnsserif font for main textno underlining for emphasis (underlining was widely used in the pastwhen emphasis had to be added manually, after the writing was done)no variation between elements of the same kind

Borrega & Martins (UB) Introduction to LATEX Session #1 January 14, 2013 4 / 39

Page 14: First LaTeX session of the BIB

Preliminary Remarks How a scientific document must be

A scientific document must be:

Structured

identification (of the author and of the work)(optional) table of contentswell-defined and well-placed sections, paragraphs, footnotes, lists,figures, etc.. . .references

Readable

approx. 66 characters per line (there are actually studies on this. . . )large margins (for A4 size paper or similar) or two columnsserif font for main textno underlining for emphasis (underlining was widely used in the pastwhen emphasis had to be added manually, after the writing was done)no variation between elements of the same kind

Borrega & Martins (UB) Introduction to LATEX Session #1 January 14, 2013 4 / 39

Page 15: First LaTeX session of the BIB

Preliminary Remarks How a scientific document must be

A scientific document must be:

Structured

identification (of the author and of the work)(optional) table of contentswell-defined and well-placed sections, paragraphs, footnotes, lists,figures, etc.. . .references

Readable

approx. 66 characters per line (there are actually studies on this. . . )large margins (for A4 size paper or similar) or two columnsserif font for main textno underlining for emphasis (underlining was widely used in the pastwhen emphasis had to be added manually, after the writing was done)no variation between elements of the same kind

Borrega & Martins (UB) Introduction to LATEX Session #1 January 14, 2013 4 / 39

Page 16: First LaTeX session of the BIB

Why use LATEX instead of a Word Processor?

Outline

1 Preliminary RemarksHow a scientific document must be

2 Why use LATEX instead of a Word Processor?Advantages of LATEXDisadvantages of LATEXThings LATEX is good at and appropriate forThings LATEX is bad at or not appropriate for

3 What is LATEX ?History

TEXLATEX

4 How LATEX worksHow LATEX documents are createdThe basic structure of a LATEX document

5 LATEX commands and a small document

Borrega & Martins (UB) Introduction to LATEX Session #1 January 14, 2013 5 / 39

Page 17: First LaTeX session of the BIB

Why use LATEX instead of a Word Processor?

Why use LATEX instead of a Word Processor?

Before seeing how to actually use LATEX , let’s look at some of itsadvantages and disadvantages in relation to Word Processors.

Borrega & Martins (UB) Introduction to LATEX Session #1 January 14, 2013 6 / 39

Page 18: First LaTeX session of the BIB

Why use LATEX instead of a Word Processor?

Why use LATEX instead of a Word Processor?

Before seeing how to actually use LATEX , let’s look at some of itsadvantages and disadvantages in relation to Word Processors.

Borrega & Martins (UB) Introduction to LATEX Session #1 January 14, 2013 6 / 39

Page 19: First LaTeX session of the BIB

Why use LATEX instead of a Word Processor? Advantages of LATEX

Advantages of LATEX

portability (since it’s just a plain text document, a LATEX file can bewritten and saved in any device—personal computer, tablet,smartphone, toaster—with any operating system, as long as there’s atext editor available)

does not require a lot of processing power, which makes it basicallycrash-proof and extremely stable

backwards compatibility/longevity (a file written in the late 80s willwork on a 2013 installation of LATEX , and probably the same will betrue 20 years from now)

very good reference management

very high typesetting quality

default document classes that make the work easier (such asarticle, book, etc.)

it’s free software

almost full separation of content and form

Borrega & Martins (UB) Introduction to LATEX Session #1 January 14, 2013 7 / 39

Page 20: First LaTeX session of the BIB

Why use LATEX instead of a Word Processor? Advantages of LATEX

Advantages of LATEX

portability (since it’s just a plain text document, a LATEX file can bewritten and saved in any device—personal computer, tablet,smartphone, toaster—with any operating system, as long as there’s atext editor available)

does not require a lot of processing power, which makes it basicallycrash-proof and extremely stable

backwards compatibility/longevity (a file written in the late 80s willwork on a 2013 installation of LATEX , and probably the same will betrue 20 years from now)

very good reference management

very high typesetting quality

default document classes that make the work easier (such asarticle, book, etc.)

it’s free software

almost full separation of content and form

Borrega & Martins (UB) Introduction to LATEX Session #1 January 14, 2013 7 / 39

Page 21: First LaTeX session of the BIB

Why use LATEX instead of a Word Processor? Advantages of LATEX

Advantages of LATEX

portability (since it’s just a plain text document, a LATEX file can bewritten and saved in any device—personal computer, tablet,smartphone, toaster—with any operating system, as long as there’s atext editor available)

does not require a lot of processing power, which makes it basicallycrash-proof and extremely stable

backwards compatibility/longevity (a file written in the late 80s willwork on a 2013 installation of LATEX , and probably the same will betrue 20 years from now)

very good reference management

very high typesetting quality

default document classes that make the work easier (such asarticle, book, etc.)

it’s free software

almost full separation of content and form

Borrega & Martins (UB) Introduction to LATEX Session #1 January 14, 2013 7 / 39

Page 22: First LaTeX session of the BIB

Why use LATEX instead of a Word Processor? Advantages of LATEX

Advantages of LATEX

portability (since it’s just a plain text document, a LATEX file can bewritten and saved in any device—personal computer, tablet,smartphone, toaster—with any operating system, as long as there’s atext editor available)

does not require a lot of processing power, which makes it basicallycrash-proof and extremely stable

backwards compatibility/longevity (a file written in the late 80s willwork on a 2013 installation of LATEX , and probably the same will betrue 20 years from now)

very good reference management

very high typesetting quality

default document classes that make the work easier (such asarticle, book, etc.)

it’s free software

almost full separation of content and form

Borrega & Martins (UB) Introduction to LATEX Session #1 January 14, 2013 7 / 39

Page 23: First LaTeX session of the BIB

Why use LATEX instead of a Word Processor? Advantages of LATEX

Advantages of LATEX

portability (since it’s just a plain text document, a LATEX file can bewritten and saved in any device—personal computer, tablet,smartphone, toaster—with any operating system, as long as there’s atext editor available)

does not require a lot of processing power, which makes it basicallycrash-proof and extremely stable

backwards compatibility/longevity (a file written in the late 80s willwork on a 2013 installation of LATEX , and probably the same will betrue 20 years from now)

very good reference management

very high typesetting quality

default document classes that make the work easier (such asarticle, book, etc.)

it’s free software

almost full separation of content and form

Borrega & Martins (UB) Introduction to LATEX Session #1 January 14, 2013 7 / 39

Page 24: First LaTeX session of the BIB

Why use LATEX instead of a Word Processor? Advantages of LATEX

Advantages of LATEX

portability (since it’s just a plain text document, a LATEX file can bewritten and saved in any device—personal computer, tablet,smartphone, toaster—with any operating system, as long as there’s atext editor available)

does not require a lot of processing power, which makes it basicallycrash-proof and extremely stable

backwards compatibility/longevity (a file written in the late 80s willwork on a 2013 installation of LATEX , and probably the same will betrue 20 years from now)

very good reference management

very high typesetting quality

default document classes that make the work easier (such asarticle, book, etc.)

it’s free software

almost full separation of content and form

Borrega & Martins (UB) Introduction to LATEX Session #1 January 14, 2013 7 / 39

Page 25: First LaTeX session of the BIB

Why use LATEX instead of a Word Processor? Advantages of LATEX

Advantages of LATEX

portability (since it’s just a plain text document, a LATEX file can bewritten and saved in any device—personal computer, tablet,smartphone, toaster—with any operating system, as long as there’s atext editor available)

does not require a lot of processing power, which makes it basicallycrash-proof and extremely stable

backwards compatibility/longevity (a file written in the late 80s willwork on a 2013 installation of LATEX , and probably the same will betrue 20 years from now)

very good reference management

very high typesetting quality

default document classes that make the work easier (such asarticle, book, etc.)

it’s free software

almost full separation of content and form

Borrega & Martins (UB) Introduction to LATEX Session #1 January 14, 2013 7 / 39

Page 26: First LaTeX session of the BIB

Why use LATEX instead of a Word Processor? Advantages of LATEX

Advantages of LATEX

portability (since it’s just a plain text document, a LATEX file can bewritten and saved in any device—personal computer, tablet,smartphone, toaster—with any operating system, as long as there’s atext editor available)

does not require a lot of processing power, which makes it basicallycrash-proof and extremely stable

backwards compatibility/longevity (a file written in the late 80s willwork on a 2013 installation of LATEX , and probably the same will betrue 20 years from now)

very good reference management

very high typesetting quality

default document classes that make the work easier (such asarticle, book, etc.)

it’s free software

almost full separation of content and form

Borrega & Martins (UB) Introduction to LATEX Session #1 January 14, 2013 7 / 39

Page 27: First LaTeX session of the BIB

Why use LATEX instead of a Word Processor? Advantages of LATEX

Advantages of LATEX

portability (since it’s just a plain text document, a LATEX file can bewritten and saved in any device—personal computer, tablet,smartphone, toaster—with any operating system, as long as there’s atext editor available)

does not require a lot of processing power, which makes it basicallycrash-proof and extremely stable

backwards compatibility/longevity (a file written in the late 80s willwork on a 2013 installation of LATEX , and probably the same will betrue 20 years from now)

very good reference management

very high typesetting quality

default document classes that make the work easier (such asarticle, book, etc.)

it’s free software

almost full separation of content and form

Borrega & Martins (UB) Introduction to LATEX Session #1 January 14, 2013 7 / 39

Page 28: First LaTeX session of the BIB

Why use LATEX instead of a Word Processor? Disadvantages of LATEX

Disadvantages of LATEX

intimidating at first

steep learning curve

although widely used in some academic circuits, it’s not as ubiquitousas, for example, Word; some editors and publishers still don’t acceptit. Working on a document which requires reviewing or corrections byothers can be difficult

there is usually no interface (menus, buttons, etc.)

lack of native reviewing functionalities like commenting,change-tracking, etc. (not as problematic nowadays, since most pdfviewers have commenting functionalities)

the general public sees no clear reason to use it (which contributes tothe third point)

Borrega & Martins (UB) Introduction to LATEX Session #1 January 14, 2013 8 / 39

Page 29: First LaTeX session of the BIB

Why use LATEX instead of a Word Processor? Disadvantages of LATEX

Disadvantages of LATEX

intimidating at first

steep learning curve

although widely used in some academic circuits, it’s not as ubiquitousas, for example, Word; some editors and publishers still don’t acceptit. Working on a document which requires reviewing or corrections byothers can be difficult

there is usually no interface (menus, buttons, etc.)

lack of native reviewing functionalities like commenting,change-tracking, etc. (not as problematic nowadays, since most pdfviewers have commenting functionalities)

the general public sees no clear reason to use it (which contributes tothe third point)

Borrega & Martins (UB) Introduction to LATEX Session #1 January 14, 2013 8 / 39

Page 30: First LaTeX session of the BIB

Why use LATEX instead of a Word Processor? Disadvantages of LATEX

Disadvantages of LATEX

intimidating at first

steep learning curve

although widely used in some academic circuits, it’s not as ubiquitousas, for example, Word; some editors and publishers still don’t acceptit. Working on a document which requires reviewing or corrections byothers can be difficult

there is usually no interface (menus, buttons, etc.)

lack of native reviewing functionalities like commenting,change-tracking, etc. (not as problematic nowadays, since most pdfviewers have commenting functionalities)

the general public sees no clear reason to use it (which contributes tothe third point)

Borrega & Martins (UB) Introduction to LATEX Session #1 January 14, 2013 8 / 39

Page 31: First LaTeX session of the BIB

Why use LATEX instead of a Word Processor? Disadvantages of LATEX

Disadvantages of LATEX

intimidating at first

steep learning curve

although widely used in some academic circuits, it’s not as ubiquitousas, for example, Word; some editors and publishers still don’t acceptit. Working on a document which requires reviewing or corrections byothers can be difficult

there is usually no interface (menus, buttons, etc.)

lack of native reviewing functionalities like commenting,change-tracking, etc. (not as problematic nowadays, since most pdfviewers have commenting functionalities)

the general public sees no clear reason to use it (which contributes tothe third point)

Borrega & Martins (UB) Introduction to LATEX Session #1 January 14, 2013 8 / 39

Page 32: First LaTeX session of the BIB

Why use LATEX instead of a Word Processor? Disadvantages of LATEX

Disadvantages of LATEX

intimidating at first

steep learning curve

although widely used in some academic circuits, it’s not as ubiquitousas, for example, Word; some editors and publishers still don’t acceptit. Working on a document which requires reviewing or corrections byothers can be difficult

there is usually no interface (menus, buttons, etc.)

lack of native reviewing functionalities like commenting,change-tracking, etc. (not as problematic nowadays, since most pdfviewers have commenting functionalities)

the general public sees no clear reason to use it (which contributes tothe third point)

Borrega & Martins (UB) Introduction to LATEX Session #1 January 14, 2013 8 / 39

Page 33: First LaTeX session of the BIB

Why use LATEX instead of a Word Processor? Disadvantages of LATEX

Disadvantages of LATEX

intimidating at first

steep learning curve

although widely used in some academic circuits, it’s not as ubiquitousas, for example, Word; some editors and publishers still don’t acceptit. Working on a document which requires reviewing or corrections byothers can be difficult

there is usually no interface (menus, buttons, etc.)

lack of native reviewing functionalities like commenting,change-tracking, etc. (not as problematic nowadays, since most pdfviewers have commenting functionalities)

the general public sees no clear reason to use it (which contributes tothe third point)

Borrega & Martins (UB) Introduction to LATEX Session #1 January 14, 2013 8 / 39

Page 34: First LaTeX session of the BIB

Why use LATEX instead of a Word Processor? Disadvantages of LATEX

Disadvantages of LATEX

intimidating at first

steep learning curve

although widely used in some academic circuits, it’s not as ubiquitousas, for example, Word; some editors and publishers still don’t acceptit. Working on a document which requires reviewing or corrections byothers can be difficult

there is usually no interface (menus, buttons, etc.)

lack of native reviewing functionalities like commenting,change-tracking, etc. (not as problematic nowadays, since most pdfviewers have commenting functionalities)

the general public sees no clear reason to use it (which contributes tothe third point)

Borrega & Martins (UB) Introduction to LATEX Session #1 January 14, 2013 8 / 39

Page 35: First LaTeX session of the BIB

Why use LATEX instead of a Word Processor? Things LATEX is good at and appropriate for

LATEX is good at and appropriate for

potentially long, well structured documents

typesetting “complicated things” such as math, logic, phoneticsymbols, different writing systems, etc.. . .

slide presentations (such as this one)

scientific posters

managing bibliographic references, cross–references, table of contents,indexes, etc.. . .

figures, tables, lists, etc.. . .

justification and hyphenation

Borrega & Martins (UB) Introduction to LATEX Session #1 January 14, 2013 9 / 39

Page 36: First LaTeX session of the BIB

Why use LATEX instead of a Word Processor? Things LATEX is good at and appropriate for

LATEX is good at and appropriate for

potentially long, well structured documents

typesetting “complicated things” such as math, logic, phoneticsymbols, different writing systems, etc.. . .

slide presentations (such as this one)

scientific posters

managing bibliographic references, cross–references, table of contents,indexes, etc.. . .

figures, tables, lists, etc.. . .

justification and hyphenation

Borrega & Martins (UB) Introduction to LATEX Session #1 January 14, 2013 9 / 39

Page 37: First LaTeX session of the BIB

Why use LATEX instead of a Word Processor? Things LATEX is good at and appropriate for

LATEX is good at and appropriate for

potentially long, well structured documents

typesetting “complicated things” such as math, logic, phoneticsymbols, different writing systems, etc.. . .

slide presentations (such as this one)

scientific posters

managing bibliographic references, cross–references, table of contents,indexes, etc.. . .

figures, tables, lists, etc.. . .

justification and hyphenation

Borrega & Martins (UB) Introduction to LATEX Session #1 January 14, 2013 9 / 39

Page 38: First LaTeX session of the BIB

Why use LATEX instead of a Word Processor? Things LATEX is good at and appropriate for

LATEX is good at and appropriate for

potentially long, well structured documents

typesetting “complicated things” such as math, logic, phoneticsymbols, different writing systems, etc.. . .

slide presentations (such as this one)

scientific posters

managing bibliographic references, cross–references, table of contents,indexes, etc.. . .

figures, tables, lists, etc.. . .

justification and hyphenation

Borrega & Martins (UB) Introduction to LATEX Session #1 January 14, 2013 9 / 39

Page 39: First LaTeX session of the BIB

Why use LATEX instead of a Word Processor? Things LATEX is good at and appropriate for

LATEX is good at and appropriate for

potentially long, well structured documents

typesetting “complicated things” such as math, logic, phoneticsymbols, different writing systems, etc.. . .

slide presentations (such as this one)

scientific posters

managing bibliographic references, cross–references, table of contents,indexes, etc.. . .

figures, tables, lists, etc.. . .

justification and hyphenation

Borrega & Martins (UB) Introduction to LATEX Session #1 January 14, 2013 9 / 39

Page 40: First LaTeX session of the BIB

Why use LATEX instead of a Word Processor? Things LATEX is good at and appropriate for

LATEX is good at and appropriate for

potentially long, well structured documents

typesetting “complicated things” such as math, logic, phoneticsymbols, different writing systems, etc.. . .

slide presentations (such as this one)

scientific posters

managing bibliographic references, cross–references, table of contents,indexes, etc.. . .

figures, tables, lists, etc.. . .

justification and hyphenation

Borrega & Martins (UB) Introduction to LATEX Session #1 January 14, 2013 9 / 39

Page 41: First LaTeX session of the BIB

Why use LATEX instead of a Word Processor? Things LATEX is good at and appropriate for

LATEX is good at and appropriate for

potentially long, well structured documents

typesetting “complicated things” such as math, logic, phoneticsymbols, different writing systems, etc.. . .

slide presentations (such as this one)

scientific posters

managing bibliographic references, cross–references, table of contents,indexes, etc.. . .

figures, tables, lists, etc.. . .

justification and hyphenation

Borrega & Martins (UB) Introduction to LATEX Session #1 January 14, 2013 9 / 39

Page 42: First LaTeX session of the BIB

Why use LATEX instead of a Word Processor? Things LATEX is good at and appropriate for

LATEX is good at and appropriate for

potentially long, well structured documents

typesetting “complicated things” such as math, logic, phoneticsymbols, different writing systems, etc.. . .

slide presentations (such as this one)

scientific posters

managing bibliographic references, cross–references, table of contents,indexes, etc.. . .

figures, tables, lists, etc.. . .

justification and hyphenation

Borrega & Martins (UB) Introduction to LATEX Session #1 January 14, 2013 9 / 39

Page 43: First LaTeX session of the BIB

Why use LATEX instead of a Word Processor? Things LATEX is bad at or not appropriate for

LATEX is bad at or not appropriate for

producing badly structured documents (This is really true; if thedocument is not properly structured, LATEX will probably give you anerror and no ouput)

taking notes

graphics-heavy or “creative” documents such as flyers, banners, etc.(although it can be done)

Borrega & Martins (UB) Introduction to LATEX Session #1 January 14, 2013 10 / 39

Page 44: First LaTeX session of the BIB

Why use LATEX instead of a Word Processor? Things LATEX is bad at or not appropriate for

LATEX is bad at or not appropriate for

producing badly structured documents (This is really true; if thedocument is not properly structured, LATEX will probably give you anerror and no ouput)

taking notes

graphics-heavy or “creative” documents such as flyers, banners, etc.(although it can be done)

Borrega & Martins (UB) Introduction to LATEX Session #1 January 14, 2013 10 / 39

Page 45: First LaTeX session of the BIB

Why use LATEX instead of a Word Processor? Things LATEX is bad at or not appropriate for

LATEX is bad at or not appropriate for

producing badly structured documents (This is really true; if thedocument is not properly structured, LATEX will probably give you anerror and no ouput)

taking notes

graphics-heavy or “creative” documents such as flyers, banners, etc.(although it can be done)

Borrega & Martins (UB) Introduction to LATEX Session #1 January 14, 2013 10 / 39

Page 46: First LaTeX session of the BIB

Why use LATEX instead of a Word Processor? Things LATEX is bad at or not appropriate for

LATEX is bad at or not appropriate for

producing badly structured documents (This is really true; if thedocument is not properly structured, LATEX will probably give you anerror and no ouput)

taking notes

graphics-heavy or “creative” documents such as flyers, banners, etc.(although it can be done)

Borrega & Martins (UB) Introduction to LATEX Session #1 January 14, 2013 10 / 39

Page 47: First LaTeX session of the BIB

What is LATEX ?

Outline

1 Preliminary RemarksHow a scientific document must be

2 Why use LATEX instead of a Word Processor?Advantages of LATEXDisadvantages of LATEXThings LATEX is good at and appropriate forThings LATEX is bad at or not appropriate for

3 What is LATEX ?History

TEXLATEX

4 How LATEX worksHow LATEX documents are createdThe basic structure of a LATEX document

5 LATEX commands and a small document

Borrega & Martins (UB) Introduction to LATEX Session #1 January 14, 2013 11 / 39

Page 48: First LaTeX session of the BIB

What is LATEX ? History

History of LATEX

TEXwas designed anddeveloped by DonaldKnuth in 1978 (left)

LATEX was developed byLeslie Lamport as anextension of TEXin 1985(right)

Borrega & Martins (UB) Introduction to LATEX Session #1 January 14, 2013 12 / 39

Page 49: First LaTeX session of the BIB

What is LATEX ? History

TEX

written by Donald Knuth out of frustration with digital typesetting,when attempting to publish part of his long book “The Art ofComputer Programming”

the name TEXis formed by the upper-case Greek letters tau, epsilonand chi, resembling the Greek root for the English tech, as intechnical (hence the pronunciation)

complex typesetting system and programming language

very powerful and versatile

difficult to use

nobody really uses plain TEXanymore

Borrega & Martins (UB) Introduction to LATEX Session #1 January 14, 2013 13 / 39

Page 50: First LaTeX session of the BIB

What is LATEX ? History

TEX

written by Donald Knuth out of frustration with digital typesetting,when attempting to publish part of his long book “The Art ofComputer Programming”

the name TEXis formed by the upper-case Greek letters tau, epsilonand chi, resembling the Greek root for the English tech, as intechnical (hence the pronunciation)

complex typesetting system and programming language

very powerful and versatile

difficult to use

nobody really uses plain TEXanymore

Borrega & Martins (UB) Introduction to LATEX Session #1 January 14, 2013 13 / 39

Page 51: First LaTeX session of the BIB

What is LATEX ? History

TEX

written by Donald Knuth out of frustration with digital typesetting,when attempting to publish part of his long book “The Art ofComputer Programming”

the name TEXis formed by the upper-case Greek letters tau, epsilonand chi, resembling the Greek root for the English tech, as intechnical (hence the pronunciation)

complex typesetting system and programming language

very powerful and versatile

difficult to use

nobody really uses plain TEXanymore

Borrega & Martins (UB) Introduction to LATEX Session #1 January 14, 2013 13 / 39

Page 52: First LaTeX session of the BIB

What is LATEX ? History

TEX

written by Donald Knuth out of frustration with digital typesetting,when attempting to publish part of his long book “The Art ofComputer Programming”

the name TEXis formed by the upper-case Greek letters tau, epsilonand chi, resembling the Greek root for the English tech, as intechnical (hence the pronunciation)

complex typesetting system and programming language

very powerful and versatile

difficult to use

nobody really uses plain TEXanymore

Borrega & Martins (UB) Introduction to LATEX Session #1 January 14, 2013 13 / 39

Page 53: First LaTeX session of the BIB

What is LATEX ? History

TEX

written by Donald Knuth out of frustration with digital typesetting,when attempting to publish part of his long book “The Art ofComputer Programming”

the name TEXis formed by the upper-case Greek letters tau, epsilonand chi, resembling the Greek root for the English tech, as intechnical (hence the pronunciation)

complex typesetting system and programming language

very powerful and versatile

difficult to use

nobody really uses plain TEXanymore

Borrega & Martins (UB) Introduction to LATEX Session #1 January 14, 2013 13 / 39

Page 54: First LaTeX session of the BIB

What is LATEX ? History

TEX

written by Donald Knuth out of frustration with digital typesetting,when attempting to publish part of his long book “The Art ofComputer Programming”

the name TEXis formed by the upper-case Greek letters tau, epsilonand chi, resembling the Greek root for the English tech, as intechnical (hence the pronunciation)

complex typesetting system and programming language

very powerful and versatile

difficult to use

nobody really uses plain TEXanymore

Borrega & Martins (UB) Introduction to LATEX Session #1 January 14, 2013 13 / 39

Page 55: First LaTeX session of the BIB

What is LATEX ? History

TEX

written by Donald Knuth out of frustration with digital typesetting,when attempting to publish part of his long book “The Art ofComputer Programming”

the name TEXis formed by the upper-case Greek letters tau, epsilonand chi, resembling the Greek root for the English tech, as intechnical (hence the pronunciation)

complex typesetting system and programming language

very powerful and versatile

difficult to use

nobody really uses plain TEXanymore

Borrega & Martins (UB) Introduction to LATEX Session #1 January 14, 2013 13 / 39

Page 56: First LaTeX session of the BIB

What is LATEX ? History

LATEX

written by Leslie Lamport as a set of TEXmacros (almost like simpleshortcuts for more complex commands), making it possible formortals to use it

the name LATEX is a combination of the first two letters in Lamportand TEX

much simpler to use than TEX

the user enters commands which the define the structure of thedocument along with the text

the formatting is taken care of by LATEX itself

“packages” add extra functionality

widely used (within the –TEXfamily)

Borrega & Martins (UB) Introduction to LATEX Session #1 January 14, 2013 14 / 39

Page 57: First LaTeX session of the BIB

What is LATEX ? History

LATEX

written by Leslie Lamport as a set of TEXmacros (almost like simpleshortcuts for more complex commands), making it possible formortals to use it

the name LATEX is a combination of the first two letters in Lamportand TEX

much simpler to use than TEX

the user enters commands which the define the structure of thedocument along with the text

the formatting is taken care of by LATEX itself

“packages” add extra functionality

widely used (within the –TEXfamily)

Borrega & Martins (UB) Introduction to LATEX Session #1 January 14, 2013 14 / 39

Page 58: First LaTeX session of the BIB

What is LATEX ? History

LATEX

written by Leslie Lamport as a set of TEXmacros (almost like simpleshortcuts for more complex commands), making it possible formortals to use it

the name LATEX is a combination of the first two letters in Lamportand TEX

much simpler to use than TEX

the user enters commands which the define the structure of thedocument along with the text

the formatting is taken care of by LATEX itself

“packages” add extra functionality

widely used (within the –TEXfamily)

Borrega & Martins (UB) Introduction to LATEX Session #1 January 14, 2013 14 / 39

Page 59: First LaTeX session of the BIB

What is LATEX ? History

LATEX

written by Leslie Lamport as a set of TEXmacros (almost like simpleshortcuts for more complex commands), making it possible formortals to use it

the name LATEX is a combination of the first two letters in Lamportand TEX

much simpler to use than TEX

the user enters commands which the define the structure of thedocument along with the text

the formatting is taken care of by LATEX itself

“packages” add extra functionality

widely used (within the –TEXfamily)

Borrega & Martins (UB) Introduction to LATEX Session #1 January 14, 2013 14 / 39

Page 60: First LaTeX session of the BIB

What is LATEX ? History

LATEX

written by Leslie Lamport as a set of TEXmacros (almost like simpleshortcuts for more complex commands), making it possible formortals to use it

the name LATEX is a combination of the first two letters in Lamportand TEX

much simpler to use than TEX

the user enters commands which the define the structure of thedocument along with the text

the formatting is taken care of by LATEX itself

“packages” add extra functionality

widely used (within the –TEXfamily)

Borrega & Martins (UB) Introduction to LATEX Session #1 January 14, 2013 14 / 39

Page 61: First LaTeX session of the BIB

What is LATEX ? History

LATEX

written by Leslie Lamport as a set of TEXmacros (almost like simpleshortcuts for more complex commands), making it possible formortals to use it

the name LATEX is a combination of the first two letters in Lamportand TEX

much simpler to use than TEX

the user enters commands which the define the structure of thedocument along with the text

the formatting is taken care of by LATEX itself

“packages” add extra functionality

widely used (within the –TEXfamily)

Borrega & Martins (UB) Introduction to LATEX Session #1 January 14, 2013 14 / 39

Page 62: First LaTeX session of the BIB

What is LATEX ? History

LATEX

written by Leslie Lamport as a set of TEXmacros (almost like simpleshortcuts for more complex commands), making it possible formortals to use it

the name LATEX is a combination of the first two letters in Lamportand TEX

much simpler to use than TEX

the user enters commands which the define the structure of thedocument along with the text

the formatting is taken care of by LATEX itself

“packages” add extra functionality

widely used (within the –TEXfamily)

Borrega & Martins (UB) Introduction to LATEX Session #1 January 14, 2013 14 / 39

Page 63: First LaTeX session of the BIB

What is LATEX ? History

LATEX

written by Leslie Lamport as a set of TEXmacros (almost like simpleshortcuts for more complex commands), making it possible formortals to use it

the name LATEX is a combination of the first two letters in Lamportand TEX

much simpler to use than TEX

the user enters commands which the define the structure of thedocument along with the text

the formatting is taken care of by LATEX itself

“packages” add extra functionality

widely used (within the –TEXfamily)

Borrega & Martins (UB) Introduction to LATEX Session #1 January 14, 2013 14 / 39

Page 64: First LaTeX session of the BIB

How LATEX works

Outline

1 Preliminary RemarksHow a scientific document must be

2 Why use LATEX instead of a Word Processor?Advantages of LATEXDisadvantages of LATEXThings LATEX is good at and appropriate forThings LATEX is bad at or not appropriate for

3 What is LATEX ?History

TEXLATEX

4 How LATEX worksHow LATEX documents are createdThe basic structure of a LATEX document

5 LATEX commands and a small document

Borrega & Martins (UB) Introduction to LATEX Session #1 January 14, 2013 15 / 39

Page 65: First LaTeX session of the BIB

How LATEX works How LATEX documents are created

How LATEX documents are created

you write a file with all the commands and text, which will have theextension .tex

you run LATEX on that file, which will interpret all the commands inorder to produce the output, at which point you will also be promptedto choose a folder for your document

a beautiful .pdf file is created, suitable for printing

(some auxiliary files will be created too, but there’s usually no need tomess with them)

Borrega & Martins (UB) Introduction to LATEX Session #1 January 14, 2013 16 / 39

Page 66: First LaTeX session of the BIB

How LATEX works How LATEX documents are created

How LATEX documents are created

you write a file with all the commands and text, which will have theextension .tex

you run LATEX on that file, which will interpret all the commands inorder to produce the output, at which point you will also be promptedto choose a folder for your document

a beautiful .pdf file is created, suitable for printing

(some auxiliary files will be created too, but there’s usually no need tomess with them)

Borrega & Martins (UB) Introduction to LATEX Session #1 January 14, 2013 16 / 39

Page 67: First LaTeX session of the BIB

How LATEX works How LATEX documents are created

How LATEX documents are created

you write a file with all the commands and text, which will have theextension .tex

you run LATEX on that file, which will interpret all the commands inorder to produce the output, at which point you will also be promptedto choose a folder for your document

a beautiful .pdf file is created, suitable for printing

(some auxiliary files will be created too, but there’s usually no need tomess with them)

Borrega & Martins (UB) Introduction to LATEX Session #1 January 14, 2013 16 / 39

Page 68: First LaTeX session of the BIB

How LATEX works How LATEX documents are created

How LATEX documents are created

you write a file with all the commands and text, which will have theextension .tex

you run LATEX on that file, which will interpret all the commands inorder to produce the output, at which point you will also be promptedto choose a folder for your document

a beautiful .pdf file is created, suitable for printing

(some auxiliary files will be created too, but there’s usually no need tomess with them)

Borrega & Martins (UB) Introduction to LATEX Session #1 January 14, 2013 16 / 39

Page 69: First LaTeX session of the BIB

How LATEX works How LATEX documents are created

How LATEX documents are created

you write a file with all the commands and text, which will have theextension .tex

you run LATEX on that file, which will interpret all the commands inorder to produce the output, at which point you will also be promptedto choose a folder for your document

a beautiful .pdf file is created, suitable for printing

(some auxiliary files will be created too, but there’s usually no need tomess with them)

Borrega & Martins (UB) Introduction to LATEX Session #1 January 14, 2013 16 / 39

Page 70: First LaTeX session of the BIB

How LATEX works The basic structure of a LATEX document

Basic structure of a LATEX file

There are three basic commands that all LATEX documents must have:

\documentclass{article}

\begin{document}

\end{document}

Borrega & Martins (UB) Introduction to LATEX Session #1 January 14, 2013 17 / 39

Page 71: First LaTeX session of the BIB

How LATEX works The basic structure of a LATEX document

Basic structure of a LATEX file

There are three basic commands that all LATEX documents must have:

\documentclass{article}

\begin{document}

\end{document}

Borrega & Martins (UB) Introduction to LATEX Session #1 January 14, 2013 17 / 39

Page 72: First LaTeX session of the BIB

How LATEX works The basic structure of a LATEX document

Basic structure of a LATEX file

There are three basic commands that all LATEX documents must have:

\documentclass{article}

\begin{document}

\end{document}

Borrega & Martins (UB) Introduction to LATEX Session #1 January 14, 2013 17 / 39

Page 73: First LaTeX session of the BIB

How LATEX works The basic structure of a LATEX document

Basic structure of a LATEX file

There are three basic commands that all LATEX documents must have:

\documentclass{article}

\begin{document}

\end{document}

Borrega & Martins (UB) Introduction to LATEX Session #1 January 14, 2013 17 / 39

Page 74: First LaTeX session of the BIB

How LATEX works The basic structure of a LATEX document

Basic structure of a LATEX file

There are three basic commands that all LATEX documents must have:

\documentclass{article}

\begin{document}

\end{document}

Borrega & Martins (UB) Introduction to LATEX Session #1 January 14, 2013 17 / 39

Page 75: First LaTeX session of the BIB

How LATEX works The basic structure of a LATEX document

Basic structure of a LATEX file

The existence of these commands defines different parts of your file:

\documentclass[options]{article}

everything that appears here is called the Preamble. Here is whereyou define general characteristics of your document besides thedocument class, such as the title, the author, the date, the inputlanguage, and other options which will influence the general layout.All of this is accomplished through the use of commands

\begin{document}

here is where the content of your document is going to be, along withcommands that define its internal structure

\end{document}

anything that appears here will be completely ignored, even if it’s thecomplete works of Shakespeare

Borrega & Martins (UB) Introduction to LATEX Session #1 January 14, 2013 18 / 39

Page 76: First LaTeX session of the BIB

How LATEX works The basic structure of a LATEX document

Basic structure of a LATEX file

The existence of these commands defines different parts of your file:

\documentclass[options]{article}

everything that appears here is called the Preamble. Here is whereyou define general characteristics of your document besides thedocument class, such as the title, the author, the date, the inputlanguage, and other options which will influence the general layout.All of this is accomplished through the use of commands

\begin{document}

here is where the content of your document is going to be, along withcommands that define its internal structure

\end{document}

anything that appears here will be completely ignored, even if it’s thecomplete works of Shakespeare

Borrega & Martins (UB) Introduction to LATEX Session #1 January 14, 2013 18 / 39

Page 77: First LaTeX session of the BIB

How LATEX works The basic structure of a LATEX document

Basic structure of a LATEX file

The existence of these commands defines different parts of your file:

\documentclass[options]{article}

everything that appears here is called the Preamble. Here is whereyou define general characteristics of your document besides thedocument class, such as the title, the author, the date, the inputlanguage, and other options which will influence the general layout.All of this is accomplished through the use of commands

\begin{document}

here is where the content of your document is going to be, along withcommands that define its internal structure

\end{document}

anything that appears here will be completely ignored, even if it’s thecomplete works of Shakespeare

Borrega & Martins (UB) Introduction to LATEX Session #1 January 14, 2013 18 / 39

Page 78: First LaTeX session of the BIB

How LATEX works The basic structure of a LATEX document

Basic structure of a LATEX file

The existence of these commands defines different parts of your file:

\documentclass[options]{article}

everything that appears here is called the Preamble. Here is whereyou define general characteristics of your document besides thedocument class, such as the title, the author, the date, the inputlanguage, and other options which will influence the general layout.All of this is accomplished through the use of commands

\begin{document}

here is where the content of your document is going to be, along withcommands that define its internal structure

\end{document}

anything that appears here will be completely ignored, even if it’s thecomplete works of Shakespeare

Borrega & Martins (UB) Introduction to LATEX Session #1 January 14, 2013 18 / 39

Page 79: First LaTeX session of the BIB

How LATEX works The basic structure of a LATEX document

Basic structure of a LATEX file

The existence of these commands defines different parts of your file:

\documentclass[options]{article}

everything that appears here is called the Preamble. Here is whereyou define general characteristics of your document besides thedocument class, such as the title, the author, the date, the inputlanguage, and other options which will influence the general layout.All of this is accomplished through the use of commands

\begin{document}

here is where the content of your document is going to be, along withcommands that define its internal structure

\end{document}

anything that appears here will be completely ignored, even if it’s thecomplete works of Shakespeare

Borrega & Martins (UB) Introduction to LATEX Session #1 January 14, 2013 18 / 39

Page 80: First LaTeX session of the BIB

How LATEX works The basic structure of a LATEX document

Basic structure of a LATEX file

The existence of these commands defines different parts of your file:

\documentclass[options]{article}

everything that appears here is called the Preamble. Here is whereyou define general characteristics of your document besides thedocument class, such as the title, the author, the date, the inputlanguage, and other options which will influence the general layout.All of this is accomplished through the use of commands

\begin{document}

here is where the content of your document is going to be, along withcommands that define its internal structure

\end{document}

anything that appears here will be completely ignored, even if it’s thecomplete works of Shakespeare

Borrega & Martins (UB) Introduction to LATEX Session #1 January 14, 2013 18 / 39

Page 81: First LaTeX session of the BIB

How LATEX works The basic structure of a LATEX document

Minimal example

Using only the mandatory commands, we can write a minimaldocument:

\documentclass{article}

\begin{document}

Hello!

\end{document}

Borrega & Martins (UB) Introduction to LATEX Session #1 January 14, 2013 19 / 39

Page 82: First LaTeX session of the BIB

How LATEX works The basic structure of a LATEX document

Minimal example

Using only the mandatory commands, we can write a minimaldocument:

\documentclass{article}

\begin{document}

Hello!

\end{document}

Borrega & Martins (UB) Introduction to LATEX Session #1 January 14, 2013 19 / 39

Page 83: First LaTeX session of the BIB

How LATEX works The basic structure of a LATEX document

Minimal example

Using only the mandatory commands, we can write a minimaldocument:

\documentclass{article}

\begin{document}

Hello!

\end{document}

Borrega & Martins (UB) Introduction to LATEX Session #1 January 14, 2013 19 / 39

Page 84: First LaTeX session of the BIB

LATEX commands and a small document

Outline

1 Preliminary RemarksHow a scientific document must be

2 Why use LATEX instead of a Word Processor?Advantages of LATEXDisadvantages of LATEXThings LATEX is good at and appropriate forThings LATEX is bad at or not appropriate for

3 What is LATEX ?History

TEXLATEX

4 How LATEX worksHow LATEX documents are createdThe basic structure of a LATEX document

5 LATEX commands and a small document

Borrega & Martins (UB) Introduction to LATEX Session #1 January 14, 2013 20 / 39

Page 85: First LaTeX session of the BIB

LATEX commands and a small document

Document class

The document class defines the general layout of the document.Common document classes are:

article (which we will be using for now)bookthesisreportletter

We can define the document class by using the appropriate commandfollowed by the name of the class enclosed in braces, which wouldmake it the main argument of the command:

\documentclass{article}

Borrega & Martins (UB) Introduction to LATEX Session #1 January 14, 2013 21 / 39

Page 86: First LaTeX session of the BIB

LATEX commands and a small document

Document class

The document class defines the general layout of the document.Common document classes are:

article (which we will be using for now)bookthesisreportletter

We can define the document class by using the appropriate commandfollowed by the name of the class enclosed in braces, which wouldmake it the main argument of the command:

\documentclass{article}

Borrega & Martins (UB) Introduction to LATEX Session #1 January 14, 2013 21 / 39

Page 87: First LaTeX session of the BIB

LATEX commands and a small document

Document class

The document class defines the general layout of the document.Common document classes are:

article (which we will be using for now)bookthesisreportletter

We can define the document class by using the appropriate commandfollowed by the name of the class enclosed in braces, which wouldmake it the main argument of the command:

\documentclass{article}

Borrega & Martins (UB) Introduction to LATEX Session #1 January 14, 2013 21 / 39

Page 88: First LaTeX session of the BIB

LATEX commands and a small document

Document class

The document class defines the general layout of the document.Common document classes are:

article (which we will be using for now)bookthesisreportletter

We can define the document class by using the appropriate commandfollowed by the name of the class enclosed in braces, which wouldmake it the main argument of the command:

\documentclass{article}

Borrega & Martins (UB) Introduction to LATEX Session #1 January 14, 2013 21 / 39

Page 89: First LaTeX session of the BIB

LATEX commands and a small document

Document class

The document class defines the general layout of the document.Common document classes are:

article (which we will be using for now)bookthesisreportletter

We can define the document class by using the appropriate commandfollowed by the name of the class enclosed in braces, which wouldmake it the main argument of the command:

\documentclass{article}

Borrega & Martins (UB) Introduction to LATEX Session #1 January 14, 2013 21 / 39

Page 90: First LaTeX session of the BIB

LATEX commands and a small document

Document class

The document class defines the general layout of the document.Common document classes are:

article (which we will be using for now)bookthesisreportletter

We can define the document class by using the appropriate commandfollowed by the name of the class enclosed in braces, which wouldmake it the main argument of the command:

\documentclass{article}

Borrega & Martins (UB) Introduction to LATEX Session #1 January 14, 2013 21 / 39

Page 91: First LaTeX session of the BIB

LATEX commands and a small document

Document class

The document class defines the general layout of the document.Common document classes are:

article (which we will be using for now)bookthesisreportletter

We can define the document class by using the appropriate commandfollowed by the name of the class enclosed in braces, which wouldmake it the main argument of the command:

\documentclass{article}

Borrega & Martins (UB) Introduction to LATEX Session #1 January 14, 2013 21 / 39

Page 92: First LaTeX session of the BIB

LATEX commands and a small document

Document class

The document class defines the general layout of the document.Common document classes are:

article (which we will be using for now)bookthesisreportletter

We can define the document class by using the appropriate commandfollowed by the name of the class enclosed in braces, which wouldmake it the main argument of the command:

\documentclass{article}

Borrega & Martins (UB) Introduction to LATEX Session #1 January 14, 2013 21 / 39

Page 93: First LaTeX session of the BIB

LATEX commands and a small document

Document class

The document class defines the general layout of the document.Common document classes are:

article (which we will be using for now)bookthesisreportletter

We can define the document class by using the appropriate commandfollowed by the name of the class enclosed in braces, which wouldmake it the main argument of the command:

\documentclass{article}

Borrega & Martins (UB) Introduction to LATEX Session #1 January 14, 2013 21 / 39

Page 94: First LaTeX session of the BIB

LATEX commands and a small document

Optional arguments

However, we can also modify the class a little bit by using optionalarguments, which don’t have to be there (hence the name), and areenclosed in square brackets. If more than one is used, they must beseparated by commas.

Some common options include:

Font size: 10pt (default), 11pt, 12pt. . .Paper size: a4paper (usually default), letterpaper. . .Orientation: portrait (default), landscape. . .

Let’s say we want to write an article with 12pt fontsize and a4paper.We would declare it in the preamble the following way:

\documentclass[a4paper,12pt]{article}

Borrega & Martins (UB) Introduction to LATEX Session #1 January 14, 2013 22 / 39

Page 95: First LaTeX session of the BIB

LATEX commands and a small document

Optional arguments

However, we can also modify the class a little bit by using optionalarguments, which don’t have to be there (hence the name), and areenclosed in square brackets. If more than one is used, they must beseparated by commas.

Some common options include:

Font size: 10pt (default), 11pt, 12pt. . .Paper size: a4paper (usually default), letterpaper. . .Orientation: portrait (default), landscape. . .

Let’s say we want to write an article with 12pt fontsize and a4paper.We would declare it in the preamble the following way:

\documentclass[a4paper,12pt]{article}

Borrega & Martins (UB) Introduction to LATEX Session #1 January 14, 2013 22 / 39

Page 96: First LaTeX session of the BIB

LATEX commands and a small document

Optional arguments

However, we can also modify the class a little bit by using optionalarguments, which don’t have to be there (hence the name), and areenclosed in square brackets. If more than one is used, they must beseparated by commas.

Some common options include:

Font size: 10pt (default), 11pt, 12pt. . .Paper size: a4paper (usually default), letterpaper. . .Orientation: portrait (default), landscape. . .

Let’s say we want to write an article with 12pt fontsize and a4paper.We would declare it in the preamble the following way:

\documentclass[a4paper,12pt]{article}

Borrega & Martins (UB) Introduction to LATEX Session #1 January 14, 2013 22 / 39

Page 97: First LaTeX session of the BIB

LATEX commands and a small document

Optional arguments

However, we can also modify the class a little bit by using optionalarguments, which don’t have to be there (hence the name), and areenclosed in square brackets. If more than one is used, they must beseparated by commas.

Some common options include:

Font size: 10pt (default), 11pt, 12pt. . .Paper size: a4paper (usually default), letterpaper. . .Orientation: portrait (default), landscape. . .

Let’s say we want to write an article with 12pt fontsize and a4paper.We would declare it in the preamble the following way:

\documentclass[a4paper,12pt]{article}

Borrega & Martins (UB) Introduction to LATEX Session #1 January 14, 2013 22 / 39

Page 98: First LaTeX session of the BIB

LATEX commands and a small document

Optional arguments

However, we can also modify the class a little bit by using optionalarguments, which don’t have to be there (hence the name), and areenclosed in square brackets. If more than one is used, they must beseparated by commas.

Some common options include:

Font size: 10pt (default), 11pt, 12pt. . .Paper size: a4paper (usually default), letterpaper. . .Orientation: portrait (default), landscape. . .

Let’s say we want to write an article with 12pt fontsize and a4paper.We would declare it in the preamble the following way:

\documentclass[a4paper,12pt]{article}

Borrega & Martins (UB) Introduction to LATEX Session #1 January 14, 2013 22 / 39

Page 99: First LaTeX session of the BIB

LATEX commands and a small document

Optional arguments

However, we can also modify the class a little bit by using optionalarguments, which don’t have to be there (hence the name), and areenclosed in square brackets. If more than one is used, they must beseparated by commas.

Some common options include:

Font size: 10pt (default), 11pt, 12pt. . .Paper size: a4paper (usually default), letterpaper. . .Orientation: portrait (default), landscape. . .

Let’s say we want to write an article with 12pt fontsize and a4paper.We would declare it in the preamble the following way:

\documentclass[a4paper,12pt]{article}

Borrega & Martins (UB) Introduction to LATEX Session #1 January 14, 2013 22 / 39

Page 100: First LaTeX session of the BIB

LATEX commands and a small document

Optional arguments

However, we can also modify the class a little bit by using optionalarguments, which don’t have to be there (hence the name), and areenclosed in square brackets. If more than one is used, they must beseparated by commas.

Some common options include:

Font size: 10pt (default), 11pt, 12pt. . .Paper size: a4paper (usually default), letterpaper. . .Orientation: portrait (default), landscape. . .

Let’s say we want to write an article with 12pt fontsize and a4paper.We would declare it in the preamble the following way:

\documentclass[a4paper,12pt]{article}

Borrega & Martins (UB) Introduction to LATEX Session #1 January 14, 2013 22 / 39

Page 101: First LaTeX session of the BIB

LATEX commands and a small document

Optional arguments

However, we can also modify the class a little bit by using optionalarguments, which don’t have to be there (hence the name), and areenclosed in square brackets. If more than one is used, they must beseparated by commas.

Some common options include:

Font size: 10pt (default), 11pt, 12pt. . .Paper size: a4paper (usually default), letterpaper. . .Orientation: portrait (default), landscape. . .

Let’s say we want to write an article with 12pt fontsize and a4paper.We would declare it in the preamble the following way:

\documentclass[a4paper,12pt]{article}

Borrega & Martins (UB) Introduction to LATEX Session #1 January 14, 2013 22 / 39

Page 102: First LaTeX session of the BIB

LATEX commands and a small document

Packages

Packages are extensions of the basic functionality of LATEX ,providing additional features when declared in the preamble.

There are hundreds of packages available, for doing anything you canthink of, and many of them come with the basic installation of LATEX ;they just need to be called by us.

If we were to use a package in our document—we won’t for thissession, but we will later—we would do it the following way:

\documentclass[a4paper,12pt]{article}

\usepackage{nameofthepackage}

(let’s ignore packages for now and delete this command from ourdocument)

Borrega & Martins (UB) Introduction to LATEX Session #1 January 14, 2013 23 / 39

Page 103: First LaTeX session of the BIB

LATEX commands and a small document

Packages

Packages are extensions of the basic functionality of LATEX ,providing additional features when declared in the preamble.

There are hundreds of packages available, for doing anything you canthink of, and many of them come with the basic installation of LATEX ;they just need to be called by us.

If we were to use a package in our document—we won’t for thissession, but we will later—we would do it the following way:

\documentclass[a4paper,12pt]{article}

\usepackage{nameofthepackage}

(let’s ignore packages for now and delete this command from ourdocument)

Borrega & Martins (UB) Introduction to LATEX Session #1 January 14, 2013 23 / 39

Page 104: First LaTeX session of the BIB

LATEX commands and a small document

Packages

Packages are extensions of the basic functionality of LATEX ,providing additional features when declared in the preamble.

There are hundreds of packages available, for doing anything you canthink of, and many of them come with the basic installation of LATEX ;they just need to be called by us.

If we were to use a package in our document—we won’t for thissession, but we will later—we would do it the following way:

\documentclass[a4paper,12pt]{article}

\usepackage{nameofthepackage}

(let’s ignore packages for now and delete this command from ourdocument)

Borrega & Martins (UB) Introduction to LATEX Session #1 January 14, 2013 23 / 39

Page 105: First LaTeX session of the BIB

LATEX commands and a small document

Packages

Packages are extensions of the basic functionality of LATEX ,providing additional features when declared in the preamble.

There are hundreds of packages available, for doing anything you canthink of, and many of them come with the basic installation of LATEX ;they just need to be called by us.

If we were to use a package in our document—we won’t for thissession, but we will later—we would do it the following way:

\documentclass[a4paper,12pt]{article}

\usepackage{nameofthepackage}

(let’s ignore packages for now and delete this command from ourdocument)

Borrega & Martins (UB) Introduction to LATEX Session #1 January 14, 2013 23 / 39

Page 106: First LaTeX session of the BIB

LATEX commands and a small document

Packages

Packages are extensions of the basic functionality of LATEX ,providing additional features when declared in the preamble.

There are hundreds of packages available, for doing anything you canthink of, and many of them come with the basic installation of LATEX ;they just need to be called by us.

If we were to use a package in our document—we won’t for thissession, but we will later—we would do it the following way:

\documentclass[a4paper,12pt]{article}

\usepackage{nameofthepackage}

(let’s ignore packages for now and delete this command from ourdocument)

Borrega & Martins (UB) Introduction to LATEX Session #1 January 14, 2013 23 / 39

Page 107: First LaTeX session of the BIB

LATEX commands and a small document

Packages

Packages are extensions of the basic functionality of LATEX ,providing additional features when declared in the preamble.

There are hundreds of packages available, for doing anything you canthink of, and many of them come with the basic installation of LATEX ;they just need to be called by us.

If we were to use a package in our document—we won’t for thissession, but we will later—we would do it the following way:

\documentclass[a4paper,12pt]{article}

\usepackage{nameofthepackage}

(let’s ignore packages for now and delete this command from ourdocument)

Borrega & Martins (UB) Introduction to LATEX Session #1 January 14, 2013 23 / 39

Page 108: First LaTeX session of the BIB

LATEX commands and a small document

Title, author and date

Like we mentioned before, it’s a good idea to identify the document.There are three basic things:

TitleAuthorDate (if we don’t use the command, the current date is fetched fromthe system and used)

Let’s give our document a title, author and date, using theaptly-named \title, \author and \date commands:

\documentclass[a4paper,12pt]{article}

\title{It is very simple to write good-looking documents}

\author{John Smith}

\date{June 10, 2020}

Borrega & Martins (UB) Introduction to LATEX Session #1 January 14, 2013 24 / 39

Page 109: First LaTeX session of the BIB

LATEX commands and a small document

Title, author and date

Like we mentioned before, it’s a good idea to identify the document.There are three basic things:

TitleAuthorDate (if we don’t use the command, the current date is fetched fromthe system and used)

Let’s give our document a title, author and date, using theaptly-named \title, \author and \date commands:

\documentclass[a4paper,12pt]{article}

\title{It is very simple to write good-looking documents}

\author{John Smith}

\date{June 10, 2020}

Borrega & Martins (UB) Introduction to LATEX Session #1 January 14, 2013 24 / 39

Page 110: First LaTeX session of the BIB

LATEX commands and a small document

Title, author and date

Like we mentioned before, it’s a good idea to identify the document.There are three basic things:

TitleAuthorDate (if we don’t use the command, the current date is fetched fromthe system and used)

Let’s give our document a title, author and date, using theaptly-named \title, \author and \date commands:

\documentclass[a4paper,12pt]{article}

\title{It is very simple to write good-looking documents}

\author{John Smith}

\date{June 10, 2020}

Borrega & Martins (UB) Introduction to LATEX Session #1 January 14, 2013 24 / 39

Page 111: First LaTeX session of the BIB

LATEX commands and a small document

Title, author and date

Like we mentioned before, it’s a good idea to identify the document.There are three basic things:

TitleAuthorDate (if we don’t use the command, the current date is fetched fromthe system and used)

Let’s give our document a title, author and date, using theaptly-named \title, \author and \date commands:

\documentclass[a4paper,12pt]{article}

\title{It is very simple to write good-looking documents}

\author{John Smith}

\date{June 10, 2020}

Borrega & Martins (UB) Introduction to LATEX Session #1 January 14, 2013 24 / 39

Page 112: First LaTeX session of the BIB

LATEX commands and a small document

Title, author and date

Like we mentioned before, it’s a good idea to identify the document.There are three basic things:

TitleAuthorDate (if we don’t use the command, the current date is fetched fromthe system and used)

Let’s give our document a title, author and date, using theaptly-named \title, \author and \date commands:

\documentclass[a4paper,12pt]{article}

\title{It is very simple to write good-looking documents}

\author{John Smith}

\date{June 10, 2020}

Borrega & Martins (UB) Introduction to LATEX Session #1 January 14, 2013 24 / 39

Page 113: First LaTeX session of the BIB

LATEX commands and a small document

Title, author and date

Like we mentioned before, it’s a good idea to identify the document.There are three basic things:

TitleAuthorDate (if we don’t use the command, the current date is fetched fromthe system and used)

Let’s give our document a title, author and date, using theaptly-named \title, \author and \date commands:

\documentclass[a4paper,12pt]{article}

\title{It is very simple to write good-looking documents}

\author{John Smith}

\date{June 10, 2020}

Borrega & Martins (UB) Introduction to LATEX Session #1 January 14, 2013 24 / 39

Page 114: First LaTeX session of the BIB

LATEX commands and a small document

Title, author and date

Like we mentioned before, it’s a good idea to identify the document.There are three basic things:

TitleAuthorDate (if we don’t use the command, the current date is fetched fromthe system and used)

Let’s give our document a title, author and date, using theaptly-named \title, \author and \date commands:

\documentclass[a4paper,12pt]{article}

\title{It is very simple to write good-looking documents}

\author{John Smith}

\date{June 10, 2020}

Borrega & Martins (UB) Introduction to LATEX Session #1 January 14, 2013 24 / 39

Page 115: First LaTeX session of the BIB

LATEX commands and a small document

Actually writing something

now that we have defined our layout (an A4 paper article with 12 ptfont), let’s begin our document and write something:

\documentclass[a4paper,12pt]{article}

\title{It is very simple to write good-looking documents}

\author{John Smith}

\date{June 10, 2020}

\begin{document}

Hello, world! This is a good-looking document.

\end{document}

Borrega & Martins (UB) Introduction to LATEX Session #1 January 14, 2013 25 / 39

Page 116: First LaTeX session of the BIB

LATEX commands and a small document

Actually writing something

now that we have defined our layout (an A4 paper article with 12 ptfont), let’s begin our document and write something:

\documentclass[a4paper,12pt]{article}

\title{It is very simple to write good-looking documents}

\author{John Smith}

\date{June 10, 2020}

\begin{document}

Hello, world! This is a good-looking document.

\end{document}

Borrega & Martins (UB) Introduction to LATEX Session #1 January 14, 2013 25 / 39

Page 117: First LaTeX session of the BIB

LATEX commands and a small document

Actually writing something

now that we have defined our layout (an A4 paper article with 12 ptfont), let’s begin our document and write something:

\documentclass[a4paper,12pt]{article}

\title{It is very simple to write good-looking documents}

\author{John Smith}

\date{June 10, 2020}

\begin{document}

Hello, world! This is a good-looking document.

\end{document}

Borrega & Martins (UB) Introduction to LATEX Session #1 January 14, 2013 25 / 39

Page 118: First LaTeX session of the BIB

LATEX commands and a small document

Making the title appear

Notice, however, that the title, author and date are nowhere to beseen. That’s because we only told LATEX what those things are in thepreamble. After beginning our document we didn’t actually tell LATEXto use it. To do that, we simple add the \maketitle command,which takes no arguments, in the beginning of our document:

\documentclass[a4paper,12pt]{article}

\title{It is very simple to write good-looking documents}

\author{John Smith}

\date{June 10, 2020}

\begin{document}

\maketitle

Hello, world! This is a good-looking document.

\end{document}

Borrega & Martins (UB) Introduction to LATEX Session #1 January 14, 2013 26 / 39

Page 119: First LaTeX session of the BIB

LATEX commands and a small document

Making the title appear

Notice, however, that the title, author and date are nowhere to beseen. That’s because we only told LATEX what those things are in thepreamble. After beginning our document we didn’t actually tell LATEXto use it. To do that, we simple add the \maketitle command,which takes no arguments, in the beginning of our document:

\documentclass[a4paper,12pt]{article}

\title{It is very simple to write good-looking documents}

\author{John Smith}

\date{June 10, 2020}

\begin{document}

\maketitle

Hello, world! This is a good-looking document.

\end{document}

Borrega & Martins (UB) Introduction to LATEX Session #1 January 14, 2013 26 / 39

Page 120: First LaTeX session of the BIB

LATEX commands and a small document

Making the title appear

Notice, however, that the title, author and date are nowhere to beseen. That’s because we only told LATEX what those things are in thepreamble. After beginning our document we didn’t actually tell LATEXto use it. To do that, we simple add the \maketitle command,which takes no arguments, in the beginning of our document:

\documentclass[a4paper,12pt]{article}

\title{It is very simple to write good-looking documents}

\author{John Smith}

\date{June 10, 2020}

\begin{document}

\maketitle

Hello, world! This is a good-looking document.

\end{document}

Borrega & Martins (UB) Introduction to LATEX Session #1 January 14, 2013 26 / 39

Page 121: First LaTeX session of the BIB

LATEX commands and a small document

Font types

Now that we have some text, we can easily change the font type.Some of the most common ones are:

font type command effect

bold \textbf{text} textemphasis \emph{text} text

small caps \textsc{text} text

Let’s try it with our text:

Hello, \textbf{world}! This is a \emph{good-looking} document.

Borrega & Martins (UB) Introduction to LATEX Session #1 January 14, 2013 27 / 39

Page 122: First LaTeX session of the BIB

LATEX commands and a small document

Font types

Now that we have some text, we can easily change the font type.Some of the most common ones are:

font type command effect

bold \textbf{text} textemphasis \emph{text} text

small caps \textsc{text} text

Let’s try it with our text:

Hello, \textbf{world}! This is a \emph{good-looking} document.

Borrega & Martins (UB) Introduction to LATEX Session #1 January 14, 2013 27 / 39

Page 123: First LaTeX session of the BIB

LATEX commands and a small document

Font types

Now that we have some text, we can easily change the font type.Some of the most common ones are:

font type command effect

bold \textbf{text} textemphasis \emph{text} text

small caps \textsc{text} text

Let’s try it with our text:

Hello, \textbf{world}! This is a \emph{good-looking} document.

Borrega & Martins (UB) Introduction to LATEX Session #1 January 14, 2013 27 / 39

Page 124: First LaTeX session of the BIB

LATEX commands and a small document

Font types

Now that we have some text, we can easily change the font type.Some of the most common ones are:

font type command effect

bold \textbf{text} textemphasis \emph{text} text

small caps \textsc{text} text

Let’s try it with our text:

Hello, \textbf{world}! This is a \emph{good-looking} document.

Borrega & Martins (UB) Introduction to LATEX Session #1 January 14, 2013 27 / 39

Page 125: First LaTeX session of the BIB

LATEX commands and a small document

Font types

Now that we have some text, we can easily change the font type.Some of the most common ones are:

font type command effect

bold \textbf{text} textemphasis \emph{text} text

small caps \textsc{text} text

Let’s try it with our text:

Hello, \textbf{world}! This is a \emph{good-looking} document.

Borrega & Martins (UB) Introduction to LATEX Session #1 January 14, 2013 27 / 39

Page 126: First LaTeX session of the BIB

LATEX commands and a small document

Paragraphs

Hopefully, we will want to write more than a paragraph. It’s verysimple to accomplish that; we just need an empty line:

\documentclass[a4paper,12pt]{article}

\title{It is very simple to write good-looking documents}

\author{John Smith}

\date{June 10, 2020}

\begin{document}

\maketitle

Hello, \textbf{world}! This is a \emph{good-looking} document.

After this sentence we want to start a new paragraph.

That was easy. We have now started a new paragraph.

\end{document}

Borrega & Martins (UB) Introduction to LATEX Session #1 January 14, 2013 28 / 39

Page 127: First LaTeX session of the BIB

LATEX commands and a small document

Paragraphs

Hopefully, we will want to write more than a paragraph. It’s verysimple to accomplish that; we just need an empty line:

\documentclass[a4paper,12pt]{article}

\title{It is very simple to write good-looking documents}

\author{John Smith}

\date{June 10, 2020}

\begin{document}

\maketitle

Hello, \textbf{world}! This is a \emph{good-looking} document.

After this sentence we want to start a new paragraph.

That was easy. We have now started a new paragraph.

\end{document}

Borrega & Martins (UB) Introduction to LATEX Session #1 January 14, 2013 28 / 39

Page 128: First LaTeX session of the BIB

LATEX commands and a small document

Paragraphs

Hopefully, we will want to write more than a paragraph. It’s verysimple to accomplish that; we just need an empty line:

\documentclass[a4paper,12pt]{article}

\title{It is very simple to write good-looking documents}

\author{John Smith}

\date{June 10, 2020}

\begin{document}

\maketitle

Hello, \textbf{world}! This is a \emph{good-looking} document.

After this sentence we want to start a new paragraph.

That was easy. We have now started a new paragraph.

\end{document}

Borrega & Martins (UB) Introduction to LATEX Session #1 January 14, 2013 28 / 39

Page 129: First LaTeX session of the BIB

LATEX commands and a small document

Line-breaks

We might also want something less drastic than a new paragraph, likea line-break. If we use \\, everything that follows it will start in thenext line:

\documentclass[a4paper,12pt]{article}

\title{It is very simple to write good-looking documents}

\author{John Smith}

\date{June 10, 2020}

\begin{document}

\maketitle

Hello, \textbf{world}!\\ This is a \emph{good-looking} document.

After this sentence we want to start a new paragraph.

That was easy. We have now started a new paragraph.

\end{document}

Borrega & Martins (UB) Introduction to LATEX Session #1 January 14, 2013 29 / 39

Page 130: First LaTeX session of the BIB

LATEX commands and a small document

Line-breaks

We might also want something less drastic than a new paragraph, likea line-break. If we use \\, everything that follows it will start in thenext line:

\documentclass[a4paper,12pt]{article}

\title{It is very simple to write good-looking documents}

\author{John Smith}

\date{June 10, 2020}

\begin{document}

\maketitle

Hello, \textbf{world}!\\ This is a \emph{good-looking} document.

After this sentence we want to start a new paragraph.

That was easy. We have now started a new paragraph.

\end{document}

Borrega & Martins (UB) Introduction to LATEX Session #1 January 14, 2013 29 / 39

Page 131: First LaTeX session of the BIB

LATEX commands and a small document

Line-breaks

We might also want something less drastic than a new paragraph, likea line-break. If we use \\, everything that follows it will start in thenext line:

\documentclass[a4paper,12pt]{article}

\title{It is very simple to write good-looking documents}

\author{John Smith}

\date{June 10, 2020}

\begin{document}

\maketitle

Hello, \textbf{world}!\\ This is a \emph{good-looking} document.

After this sentence we want to start a new paragraph.

That was easy. We have now started a new paragraph.

\end{document}

Borrega & Martins (UB) Introduction to LATEX Session #1 January 14, 2013 29 / 39

Page 132: First LaTeX session of the BIB

LATEX commands and a small document

New page

Or maybe we want something more drastic, like starting a new pagealtogether. For that, we can use the \newpage command, andeverything that follows it will start in the next page:

\documentclass[a4paper,12pt]{article}

\title{It is very simple to write good-looking documents}

\author{John Smith}

\date{June 10, 2020}

\begin{document}

\maketitle

Hello, \textbf{world}!\\ This is a \emph{good-looking} document.

After this sentence\newpage we want to start a new paragraph.

That was easy. We have now started a new paragraph.

\end{document}

Borrega & Martins (UB) Introduction to LATEX Session #1 January 14, 2013 30 / 39

Page 133: First LaTeX session of the BIB

LATEX commands and a small document

New page

Or maybe we want something more drastic, like starting a new pagealtogether. For that, we can use the \newpage command, andeverything that follows it will start in the next page:

\documentclass[a4paper,12pt]{article}

\title{It is very simple to write good-looking documents}

\author{John Smith}

\date{June 10, 2020}

\begin{document}

\maketitle

Hello, \textbf{world}!\\ This is a \emph{good-looking} document.

After this sentence\newpage we want to start a new paragraph.

That was easy. We have now started a new paragraph.

\end{document}

Borrega & Martins (UB) Introduction to LATEX Session #1 January 14, 2013 30 / 39

Page 134: First LaTeX session of the BIB

LATEX commands and a small document

New page

Or maybe we want something more drastic, like starting a new pagealtogether. For that, we can use the \newpage command, andeverything that follows it will start in the next page:

\documentclass[a4paper,12pt]{article}

\title{It is very simple to write good-looking documents}

\author{John Smith}

\date{June 10, 2020}

\begin{document}

\maketitle

Hello, \textbf{world}!\\ This is a \emph{good-looking} document.

After this sentence\newpage we want to start a new paragraph.

That was easy. We have now started a new paragraph.

\end{document}

Borrega & Martins (UB) Introduction to LATEX Session #1 January 14, 2013 30 / 39

Page 135: First LaTeX session of the BIB

LATEX commands and a small document

Sections

After a while, it will be important to organize our text through theuse of sections. The basic commands for doing it are the following:

\part{title}

\chapter{title}

\section{title}

\subsection{title}

\subsubsection{title}

\paragraph{title}

Since we are using the article document class, let’s stick tosections, subsections and subsubsections.

Borrega & Martins (UB) Introduction to LATEX Session #1 January 14, 2013 31 / 39

Page 136: First LaTeX session of the BIB

LATEX commands and a small document

Sections

After a while, it will be important to organize our text through theuse of sections. The basic commands for doing it are the following:

\part{title}

\chapter{title}

\section{title}

\subsection{title}

\subsubsection{title}

\paragraph{title}

Since we are using the article document class, let’s stick tosections, subsections and subsubsections.

Borrega & Martins (UB) Introduction to LATEX Session #1 January 14, 2013 31 / 39

Page 137: First LaTeX session of the BIB

LATEX commands and a small document

Sections

After a while, it will be important to organize our text through theuse of sections. The basic commands for doing it are the following:

\part{title}

\chapter{title}

\section{title}

\subsection{title}

\subsubsection{title}

\paragraph{title}

Since we are using the article document class, let’s stick tosections, subsections and subsubsections.

Borrega & Martins (UB) Introduction to LATEX Session #1 January 14, 2013 31 / 39

Page 138: First LaTeX session of the BIB

LATEX commands and a small document

Sections

After a while, it will be important to organize our text through theuse of sections. The basic commands for doing it are the following:

\part{title}

\chapter{title}

\section{title}

\subsection{title}

\subsubsection{title}

\paragraph{title}

Since we are using the article document class, let’s stick tosections, subsections and subsubsections.

Borrega & Martins (UB) Introduction to LATEX Session #1 January 14, 2013 31 / 39

Page 139: First LaTeX session of the BIB

LATEX commands and a small document

Sections

After a while, it will be important to organize our text through theuse of sections. The basic commands for doing it are the following:

\part{title}

\chapter{title}

\section{title}

\subsection{title}

\subsubsection{title}

\paragraph{title}

Since we are using the article document class, let’s stick tosections, subsections and subsubsections.

Borrega & Martins (UB) Introduction to LATEX Session #1 January 14, 2013 31 / 39

Page 140: First LaTeX session of the BIB

LATEX commands and a small document

Sections

After a while, it will be important to organize our text through theuse of sections. The basic commands for doing it are the following:

\part{title}

\chapter{title}

\section{title}

\subsection{title}

\subsubsection{title}

\paragraph{title}

Since we are using the article document class, let’s stick tosections, subsections and subsubsections.

Borrega & Martins (UB) Introduction to LATEX Session #1 January 14, 2013 31 / 39

Page 141: First LaTeX session of the BIB

LATEX commands and a small document

Sections

After a while, it will be important to organize our text through theuse of sections. The basic commands for doing it are the following:

\part{title}

\chapter{title}

\section{title}

\subsection{title}

\subsubsection{title}

\paragraph{title}

Since we are using the article document class, let’s stick tosections, subsections and subsubsections.

Borrega & Martins (UB) Introduction to LATEX Session #1 January 14, 2013 31 / 39

Page 142: First LaTeX session of the BIB

LATEX commands and a small document

Sections

After a while, it will be important to organize our text through theuse of sections. The basic commands for doing it are the following:

\part{title}

\chapter{title}

\section{title}

\subsection{title}

\subsubsection{title}

\paragraph{title}

Since we are using the article document class, let’s stick tosections, subsections and subsubsections.

Borrega & Martins (UB) Introduction to LATEX Session #1 January 14, 2013 31 / 39

Page 143: First LaTeX session of the BIB

LATEX commands and a small document

Sections

After a while, it will be important to organize our text through theuse of sections. The basic commands for doing it are the following:

\part{title}

\chapter{title}

\section{title}

\subsection{title}

\subsubsection{title}

\paragraph{title}

Since we are using the article document class, let’s stick tosections, subsections and subsubsections.

Borrega & Martins (UB) Introduction to LATEX Session #1 January 14, 2013 31 / 39

Page 144: First LaTeX session of the BIB

LATEX commands and a small document

Sections

Let’s delete the line-break and new page commands for the sake ofsimplicity, add some text and divided it into sections, which take titlesas the main arguments.

\begin{document}

\maketitle

\section{First Section}

Hello, \textbf{world}! This is a \emph{good-looking} document.

After this sentence we want to start a new paragraph.

That was easy. We have now started a new paragraph.

\subsection{Something more specific}

This is a subsection.

\subsubsection{Something really specific}

This a subsubsection.

\end{document}

Borrega & Martins (UB) Introduction to LATEX Session #1 January 14, 2013 32 / 39

Page 145: First LaTeX session of the BIB

LATEX commands and a small document

Sections

Let’s delete the line-break and new page commands for the sake ofsimplicity, add some text and divided it into sections, which take titlesas the main arguments.

\begin{document}

\maketitle

\section{First Section}

Hello, \textbf{world}! This is a \emph{good-looking} document.

After this sentence we want to start a new paragraph.

That was easy. We have now started a new paragraph.

\subsection{Something more specific}

This is a subsection.

\subsubsection{Something really specific}

This a subsubsection.

\end{document}

Borrega & Martins (UB) Introduction to LATEX Session #1 January 14, 2013 32 / 39

Page 146: First LaTeX session of the BIB

LATEX commands and a small document

Sections

Let’s delete the line-break and new page commands for the sake ofsimplicity, add some text and divided it into sections, which take titlesas the main arguments.

\begin{document}

\maketitle

\section{First Section}

Hello, \textbf{world}! This is a \emph{good-looking} document.

After this sentence we want to start a new paragraph.

That was easy. We have now started a new paragraph.

\subsection{Something more specific}

This is a subsection.

\subsubsection{Something really specific}

This a subsubsection.

\end{document}

Borrega & Martins (UB) Introduction to LATEX Session #1 January 14, 2013 32 / 39

Page 147: First LaTeX session of the BIB

LATEX commands and a small document

Table of Contents

Now that we have a seemingly structured document, withautomatically numbered sections, we might want to have a table ofcontents. The only thing we need to do is to add the\tableofcontents command to the beginning of our document:

\begin{document}

\maketitle

\tableofcontents

\section{First Section}

Hello, \textbf{world}! This is a \emph{good-looking} document.

After this sentence we want to start a new paragraph.

That was easy. We have now started a new paragraph.

\subsection{Something more specific}

This is a subsection.

\subsubsection{Something really specific}

This a subsubsection.

\end{document}

Borrega & Martins (UB) Introduction to LATEX Session #1 January 14, 2013 33 / 39

Page 148: First LaTeX session of the BIB

LATEX commands and a small document

Table of Contents

Now that we have a seemingly structured document, withautomatically numbered sections, we might want to have a table ofcontents. The only thing we need to do is to add the\tableofcontents command to the beginning of our document:

\begin{document}

\maketitle

\tableofcontents

\section{First Section}

Hello, \textbf{world}! This is a \emph{good-looking} document.

After this sentence we want to start a new paragraph.

That was easy. We have now started a new paragraph.

\subsection{Something more specific}

This is a subsection.

\subsubsection{Something really specific}

This a subsubsection.

\end{document}

Borrega & Martins (UB) Introduction to LATEX Session #1 January 14, 2013 33 / 39

Page 149: First LaTeX session of the BIB

LATEX commands and a small document

Table of Contents

Now that we have a seemingly structured document, withautomatically numbered sections, we might want to have a table ofcontents. The only thing we need to do is to add the\tableofcontents command to the beginning of our document:

\begin{document}

\maketitle

\tableofcontents

\section{First Section}

Hello, \textbf{world}! This is a \emph{good-looking} document.

After this sentence we want to start a new paragraph.

That was easy. We have now started a new paragraph.

\subsection{Something more specific}

This is a subsection.

\subsubsection{Something really specific}

This a subsubsection.

\end{document}

Borrega & Martins (UB) Introduction to LATEX Session #1 January 14, 2013 33 / 39

Page 150: First LaTeX session of the BIB

LATEX commands and a small document

Footnotes

When something is not essential to the main text but still very usefulto include in the document, it might be a good idea to use afootnote. Although some authors are fond of them, the generalconsensus is that they should be used sparingly, as they may bedistracting to the reader or “clutter” the page.

To place a footnote, simply write the command \footnote{text} inthe exact place you want the footnote marker to be shown. Anumbered footnote will be automatically created at the bottom of thepage:

Hello, \textbf{world}!\footnote{It’s easy to create footnotes.}

This is a \emph{good-looking} document.

Borrega & Martins (UB) Introduction to LATEX Session #1 January 14, 2013 34 / 39

Page 151: First LaTeX session of the BIB

LATEX commands and a small document

Footnotes

When something is not essential to the main text but still very usefulto include in the document, it might be a good idea to use afootnote. Although some authors are fond of them, the generalconsensus is that they should be used sparingly, as they may bedistracting to the reader or “clutter” the page.

To place a footnote, simply write the command \footnote{text} inthe exact place you want the footnote marker to be shown. Anumbered footnote will be automatically created at the bottom of thepage:

Hello, \textbf{world}!\footnote{It’s easy to create footnotes.}

This is a \emph{good-looking} document.

Borrega & Martins (UB) Introduction to LATEX Session #1 January 14, 2013 34 / 39

Page 152: First LaTeX session of the BIB

LATEX commands and a small document

Footnotes

When something is not essential to the main text but still very usefulto include in the document, it might be a good idea to use afootnote. Although some authors are fond of them, the generalconsensus is that they should be used sparingly, as they may bedistracting to the reader or “clutter” the page.

To place a footnote, simply write the command \footnote{text} inthe exact place you want the footnote marker to be shown. Anumbered footnote will be automatically created at the bottom of thepage:

Hello, \textbf{world}!\footnote{It’s easy to create footnotes.}

This is a \emph{good-looking} document.

Borrega & Martins (UB) Introduction to LATEX Session #1 January 14, 2013 34 / 39

Page 153: First LaTeX session of the BIB

LATEX commands and a small document

Footnotes

When something is not essential to the main text but still very usefulto include in the document, it might be a good idea to use afootnote. Although some authors are fond of them, the generalconsensus is that they should be used sparingly, as they may bedistracting to the reader or “clutter” the page.

To place a footnote, simply write the command \footnote{text} inthe exact place you want the footnote marker to be shown. Anumbered footnote will be automatically created at the bottom of thepage:

Hello, \textbf{world}!\footnote{It’s easy to create footnotes.}

This is a \emph{good-looking} document.

Borrega & Martins (UB) Introduction to LATEX Session #1 January 14, 2013 34 / 39

Page 154: First LaTeX session of the BIB

LATEX commands and a small document

Special characters

Some characters are reserved for LATEX commands, which meansthat, in order for them not to be interpreted as commands but ascharacters, there are special commands just for them. These are someexamples, from which it’s possible to infer how other accentuationmarks can be typed:

character command

\ \textbackslash

{ \{

} \}

\_

% \%

# \#$ \$

a \~{a}

a \^{a}

a \"{a}

Borrega & Martins (UB) Introduction to LATEX Session #1 January 14, 2013 35 / 39

Page 155: First LaTeX session of the BIB

LATEX commands and a small document

Special characters

Some characters are reserved for LATEX commands, which meansthat, in order for them not to be interpreted as commands but ascharacters, there are special commands just for them. These are someexamples, from which it’s possible to infer how other accentuationmarks can be typed:

character command

\ \textbackslash

{ \{

} \}

\_

% \%

# \#$ \$

a \~{a}

a \^{a}

a \"{a}

Borrega & Martins (UB) Introduction to LATEX Session #1 January 14, 2013 35 / 39

Page 156: First LaTeX session of the BIB

LATEX commands and a small document

Special characters

Some characters are reserved for LATEX commands, which meansthat, in order for them not to be interpreted as commands but ascharacters, there are special commands just for them. These are someexamples, from which it’s possible to infer how other accentuationmarks can be typed:

character command

\ \textbackslash

{ \{

} \}

\_

% \%

# \#$ \$

a \~{a}

a \^{a}

a \"{a}

Borrega & Martins (UB) Introduction to LATEX Session #1 January 14, 2013 35 / 39

Page 157: First LaTeX session of the BIB

LATEX commands and a small document

Special characters

We can try a couple of them out:

Hello, \textbf{world}!\footnote{It’s easy to create footnotes \&

other things.}

This is a \emph{good-looking} document, and that’s 100\% true.

Borrega & Martins (UB) Introduction to LATEX Session #1 January 14, 2013 36 / 39

Page 158: First LaTeX session of the BIB

LATEX commands and a small document

Special characters

We can try a couple of them out:

Hello, \textbf{world}!\footnote{It’s easy to create footnotes \&

other things.}

This is a \emph{good-looking} document, and that’s 100\% true.

Borrega & Martins (UB) Introduction to LATEX Session #1 January 14, 2013 36 / 39

Page 159: First LaTeX session of the BIB

LATEX commands and a small document

Special characters

We can try a couple of them out:

Hello, \textbf{world}!\footnote{It’s easy to create footnotes \&

other things.}

This is a \emph{good-looking} document, and that’s 100\% true.

Borrega & Martins (UB) Introduction to LATEX Session #1 January 14, 2013 36 / 39

Page 160: First LaTeX session of the BIB

LATEX commands and a small document

Special characters

Different dashes and quotation marks also have their own special wayof being typed in LATEX :

name command result

hyphen - -n-dash -- –m-dash --- —

single quotes ‘text’ ‘text’double quotes ‘‘text" “text”

Borrega & Martins (UB) Introduction to LATEX Session #1 January 14, 2013 37 / 39

Page 161: First LaTeX session of the BIB

LATEX commands and a small document

Special characters

Different dashes and quotation marks also have their own special wayof being typed in LATEX :

name command result

hyphen - -n-dash -- –m-dash --- —

single quotes ‘text’ ‘text’double quotes ‘‘text" “text”

Borrega & Martins (UB) Introduction to LATEX Session #1 January 14, 2013 37 / 39

Page 162: First LaTeX session of the BIB

LATEX commands and a small document

Special characters

Different dashes and quotation marks also have their own special wayof being typed in LATEX :

name command result

hyphen - -n-dash -- –m-dash --- —

single quotes ‘text’ ‘text’double quotes ‘‘text" “text”

Borrega & Martins (UB) Introduction to LATEX Session #1 January 14, 2013 37 / 39

Page 163: First LaTeX session of the BIB

LATEX commands and a small document

Special characters

Let’s try them out (the hyphen is already there):

Hello, \textbf{world}!\footnote{It’s easy to create footnotes \&

other ‘‘things."}

This is a \emph{good-looking} ‘document’, and that’s

90--100\%---as far as I know---true. Here’s an umlaut: \"{a}.

Don’t worry, in future sessions we will show you easier ways of typing“special” characters and accents.

Borrega & Martins (UB) Introduction to LATEX Session #1 January 14, 2013 38 / 39

Page 164: First LaTeX session of the BIB

LATEX commands and a small document

Special characters

Let’s try them out (the hyphen is already there):

Hello, \textbf{world}!\footnote{It’s easy to create footnotes \&

other ‘‘things."}

This is a \emph{good-looking} ‘document’, and that’s

90--100\%---as far as I know---true. Here’s an umlaut: \"{a}.

Don’t worry, in future sessions we will show you easier ways of typing“special” characters and accents.

Borrega & Martins (UB) Introduction to LATEX Session #1 January 14, 2013 38 / 39

Page 165: First LaTeX session of the BIB

LATEX commands and a small document

Special characters

Let’s try them out (the hyphen is already there):

Hello, \textbf{world}!\footnote{It’s easy to create footnotes \&

other ‘‘things."}

This is a \emph{good-looking} ‘document’, and that’s

90--100\%---as far as I know---true. Here’s an umlaut: \"{a}.

Don’t worry, in future sessions we will show you easier ways of typing“special” characters and accents.

Borrega & Martins (UB) Introduction to LATEX Session #1 January 14, 2013 38 / 39

Page 166: First LaTeX session of the BIB

LATEX commands and a small document

Special characters

Let’s try them out (the hyphen is already there):

Hello, \textbf{world}!\footnote{It’s easy to create footnotes \&

other ‘‘things."}

This is a \emph{good-looking} ‘document’, and that’s

90--100\%---as far as I know---true. Here’s an umlaut: \"{a}.

Don’t worry, in future sessions we will show you easier ways of typing“special” characters and accents.

Borrega & Martins (UB) Introduction to LATEX Session #1 January 14, 2013 38 / 39

Page 167: First LaTeX session of the BIB

LATEX commands and a small document

The whole document

\documentclass[a4paper,12pt]{article}

\title{It is very simple to write good-looking documents}

\author{John Smith}

\date{June 10, 2020}

\begin{document}

\maketitle

\tableofcontents

\section{First Section}

Hello, \textbf{world}!\footnote{It’s easy to create footnotes \&

other ‘‘things."}

This is a \emph{good-looking} ‘document’, and that’s

90--100\%---as far as I know---true. Here’s an umlaut: \"{a}.

After this sentence we want to start a new paragraph.

That was easy. We have now started a new paragraph.

\subsection{Something more specific}

This is a subsection.

\subsubsection{This has to be really specific}

I don’t even know what to write here.

\end{document}Borrega & Martins (UB) Introduction to LATEX Session #1 January 14, 2013 39 / 39

Page 168: First LaTeX session of the BIB

LATEX commands and a small document

The whole document

\documentclass[a4paper,12pt]{article}

\title{It is very simple to write good-looking documents}

\author{John Smith}

\date{June 10, 2020}

\begin{document}

\maketitle

\tableofcontents

\section{First Section}

Hello, \textbf{world}!\footnote{It’s easy to create footnotes \&

other ‘‘things."}

This is a \emph{good-looking} ‘document’, and that’s

90--100\%---as far as I know---true. Here’s an umlaut: \"{a}.

After this sentence we want to start a new paragraph.

That was easy. We have now started a new paragraph.

\subsection{Something more specific}

This is a subsection.

\subsubsection{This has to be really specific}

I don’t even know what to write here.

\end{document}Borrega & Martins (UB) Introduction to LATEX Session #1 January 14, 2013 39 / 39