4th presentation of the bib latex course

39
Introduction to L A T E X Session #4 Oriol Borrega Pedro Tiago Martins Universitat de Barcelona February 18, 2013 Borrega & Martins (UB) Introduction to L A T E X Session #4 February 18, 2013 1 / 26

Upload: bibcn

Post on 17-May-2015

1.045 views

Category:

Technology


1 download

TRANSCRIPT

Page 1: 4th presentation of the BiB LaTeX course

Introduction to LATEXSession #4

Oriol Borrega Pedro Tiago Martins

Universitat de Barcelona

February 18, 2013

Borrega & Martins (UB) Introduction to LATEX Session #4 February 18, 2013 1 / 26

Page 2: 4th presentation of the BiB LaTeX course

This presentation

https://dl.dropbox.com/u/4636832/sessio4.pdf

Borrega & Martins (UB) Introduction to LATEX Session #4 February 18, 2013 2 / 26

Page 3: 4th presentation of the BiB LaTeX course

Outline

1 Writing phonetics

2 Glosses

3 Trees

Borrega & Martins (UB) Introduction to LATEX Session #4 February 18, 2013 3 / 26

Page 4: 4th presentation of the BiB LaTeX course

Writing phonetics

Outline

1 Writing phonetics

2 Glosses

3 Trees

Borrega & Martins (UB) Introduction to LATEX Session #4 February 18, 2013 4 / 26

Page 5: 4th presentation of the BiB LaTeX course

Writing phonetics

[f@U"nEtIks]

In the preamble. . .

\usepackage{tipa}

In the text. . .

\LaTeX\ is pronounced \textipa{["leItEx]}

LATEX is pronounced ["leItEx]

Get a full chart of symbols and equivalences here.

Borrega & Martins (UB) Introduction to LATEX Session #4 February 18, 2013 5 / 26

Page 6: 4th presentation of the BiB LaTeX course

Writing phonetics

[f@U"nEtIks]

In the preamble. . .

\usepackage{tipa}

In the text. . .

\LaTeX\ is pronounced \textipa{["leItEx]}

LATEX is pronounced ["leItEx]

Get a full chart of symbols and equivalences here.

Borrega & Martins (UB) Introduction to LATEX Session #4 February 18, 2013 5 / 26

Page 7: 4th presentation of the BiB LaTeX course

Writing phonetics

[f@U"nEtIks]

In the preamble. . .

\usepackage{tipa}

In the text. . .

\LaTeX\ is pronounced \textipa{["leItEx]}

LATEX is pronounced ["leItEx]

Get a full chart of symbols and equivalences here.

Borrega & Martins (UB) Introduction to LATEX Session #4 February 18, 2013 5 / 26

Page 8: 4th presentation of the BiB LaTeX course

Writing phonetics

[f@U"nEtIks]

roman letters transcript for their phonetic counterparts: [abcdefgh]

capital roman letters transcript for related sounds: [ABCDEFGH]

some sounds need specific commands:

[ï] \textipa{[\:n]}[th] \textipa{[t\super h]}

[ì] \textipa{[\textbeltl]}

diacritics, suprasegmentals and tones require specific commands:

[A˚] \textipa{[\r*A]}

[A] \textipa{[\u{A}]}[>tS] \textipa{[\t{tS}]}

Borrega & Martins (UB) Introduction to LATEX Session #4 February 18, 2013 6 / 26

Page 9: 4th presentation of the BiB LaTeX course

Writing phonetics

[f@U"nEtIks]

roman letters transcript for their phonetic counterparts: [abcdefgh]

capital roman letters transcript for related sounds: [ABCDEFGH]

some sounds need specific commands:

[ï] \textipa{[\:n]}[th] \textipa{[t\super h]}

[ì] \textipa{[\textbeltl]}

diacritics, suprasegmentals and tones require specific commands:

[A˚] \textipa{[\r*A]}

[A] \textipa{[\u{A}]}[>tS] \textipa{[\t{tS}]}

Borrega & Martins (UB) Introduction to LATEX Session #4 February 18, 2013 6 / 26

Page 10: 4th presentation of the BiB LaTeX course

Writing phonetics

[f@U"nEtIks]

roman letters transcript for their phonetic counterparts: [abcdefgh]

capital roman letters transcript for related sounds: [ABCDEFGH]

some sounds need specific commands:

[ï] \textipa{[\:n]}[th] \textipa{[t\super h]}

[ì] \textipa{[\textbeltl]}

diacritics, suprasegmentals and tones require specific commands:

[A˚] \textipa{[\r*A]}

[A] \textipa{[\u{A}]}[>tS] \textipa{[\t{tS}]}

Borrega & Martins (UB) Introduction to LATEX Session #4 February 18, 2013 6 / 26

Page 11: 4th presentation of the BiB LaTeX course

Writing phonetics

[f@U"nEtIks]

roman letters transcript for their phonetic counterparts: [abcdefgh]

capital roman letters transcript for related sounds: [ABCDEFGH]

some sounds need specific commands:

[ï] \textipa{[\:n]}[th] \textipa{[t\super h]}

[ì] \textipa{[\textbeltl]}

diacritics, suprasegmentals and tones require specific commands:

[A˚] \textipa{[\r*A]}

[A] \textipa{[\u{A}]}[>tS] \textipa{[\t{tS}]}

Borrega & Martins (UB) Introduction to LATEX Session #4 February 18, 2013 6 / 26

Page 12: 4th presentation of the BiB LaTeX course

Writing phonetics

[f@U"nEtIks]

Can you transcribe your name and surnames? Like, for instance,. . .

[uRi"Olbu"rEG@"TEp@]\textipa{[uRi"Olbu"rEG@"TEp@]}

Borrega & Martins (UB) Introduction to LATEX Session #4 February 18, 2013 7 / 26

Page 13: 4th presentation of the BiB LaTeX course

Glosses

Outline

1 Writing phonetics

2 Glosses

3 Trees

Borrega & Martins (UB) Introduction to LATEX Session #4 February 18, 2013 8 / 26

Page 14: 4th presentation of the BiB LaTeX course

Glosses

An example of glosses

(1) Cant.oSing.-1-sg-pres

un.aa.-fem

cancosong

‘I sing a song’

(2) a. * Jo cantes una canco

b. Tu cantes una canco

As we have seen in examples 1 and 2b,. . .

Borrega & Martins (UB) Introduction to LATEX Session #4 February 18, 2013 9 / 26

Page 15: 4th presentation of the BiB LaTeX course

Glosses

Glosses

In the preamble. . .

\usepackage{gb4e}

In the text. . .

\begin{exe}

\ex This is an example

\ex[*]{This are a agrammatical example}

\end{exe}

(3) This is an example

(4) * This are a agrammatical example

Borrega & Martins (UB) Introduction to LATEX Session #4 February 18, 2013 10 / 26

Page 16: 4th presentation of the BiB LaTeX course

Glosses

Glosses

In the preamble. . .

\usepackage{gb4e}

In the text. . .

\begin{exe}

\ex This is an example

\ex[*]{This are a agrammatical example}

\end{exe}

(5) This is an example

(6) * This are a agrammatical example

Borrega & Martins (UB) Introduction to LATEX Session #4 February 18, 2013 10 / 26

Page 17: 4th presentation of the BiB LaTeX course

Glosses

Glosses

Glosses automatically align words:

\begin{exe}

\ex\gll A clause that serves as example \\

Una oracio que serveix d’ exemple \\

\end{exe}

(7) AUna

clauseoracio

thatque

servesserveix

asd’

exampleexemple

Notice the \gll and the linebreaks!

Borrega & Martins (UB) Introduction to LATEX Session #4 February 18, 2013 11 / 26

Page 18: 4th presentation of the BiB LaTeX course

Glosses

Glosses

Using small caps for categories:

\begin{exe}

\ex\gll Li escric una carta \\

{\sc 3-sg-dat} write.{\sc 1-sg-pres} a.{\sc -fem} letter.{\sc -fem} \\

\end{exe}

(8) Li3-sg-dat

escricwrite.1-sg-pres

unaa.-fem

cartaletter.-fem

{\sc ...} is equivalent to \textsc{...}

Borrega & Martins (UB) Introduction to LATEX Session #4 February 18, 2013 12 / 26

Page 19: 4th presentation of the BiB LaTeX course

Glosses

Glosses with translation

A third line with the translation can be added:

\begin{exe}

\ex\gll Li escric una carta \\

{\sc 3-sg-dat} write.{\sc 1-sg-pres} a.{\sc -fem} letter.{\sc -fem} \\

\trans ‘I write him/her a letter’\\

\end{exe}

(9) Li3-sg-dat

escricwrite.1-sg-pres

unaa.-fem

cartaletter.-fem

‘I write him/her a letter’

Borrega & Martins (UB) Introduction to LATEX Session #4 February 18, 2013 13 / 26

Page 20: 4th presentation of the BiB LaTeX course

Glosses

Several levels in glosses

The xlist environment introduces a further level:

\begin{exe}

\ex

\begin{xlist}

\ex This is an example

\ex[*]{\gll This is a example} \\

[ ]{Aixo es un exemple} \\

\end{xlist}

\end{exe}

(10) a. This is an example

b. * This is a example

c. Aixo es un exemple

Borrega & Martins (UB) Introduction to LATEX Session #4 February 18, 2013 14 / 26

Page 21: 4th presentation of the BiB LaTeX course

Glosses

Just for trying. . .

Examples can be labelled and refered to as usual. Give all this a try:

(11) Cant.oSing.-1-sg-pres

un.aa.-fem

cancosong

‘I sing a song’

(12) a. * Jo cantes una canco

b. Tu cantes una canco

As we have seen in examples 11 and 12b,. . .

Borrega & Martins (UB) Introduction to LATEX Session #4 February 18, 2013 15 / 26

Page 22: 4th presentation of the BiB LaTeX course

Glosses

...solution

\begin{exe}

\ex\gll Cant.o un.a canco \label{canto} \\

Sing.{\sc-1-sg-pres} a.{\sc-fem} song \\

\trans ‘I sing a song’ \\

\end{exe}

\begin{exe}

\ex

\begin{xlist}

\ex[*]{Jo cantes una canco}

\ex[ ]{Tu cantes una canco} \label{cantes}

\end{xlist}

\end{exe}

As we have seen in examples \ref{canto} and \ref{cantes},\ldots

Borrega & Martins (UB) Introduction to LATEX Session #4 February 18, 2013 16 / 26

Page 23: 4th presentation of the BiB LaTeX course

Trees

Outline

1 Writing phonetics

2 Glosses

3 Trees

Borrega & Martins (UB) Introduction to LATEX Session #4 February 18, 2013 17 / 26

Page 24: 4th presentation of the BiB LaTeX course

Trees

An example of a tree

S

This VP

V

is

NP

a simple tree

Borrega & Martins (UB) Introduction to LATEX Session #4 February 18, 2013 18 / 26

Page 25: 4th presentation of the BiB LaTeX course

Trees

Trees

In the preamble. . .

\usepackage{qtree}

In the text. . .

\Tree [.SX Spec [.X’ X^0 Compl ] ]

SX

Spec X’

X0 Compl

The spaces after the closing brackets are important!

Borrega & Martins (UB) Introduction to LATEX Session #4 February 18, 2013 19 / 26

Page 26: 4th presentation of the BiB LaTeX course

Trees

Trees

In the preamble. . .

\usepackage{qtree}

In the text. . .

\Tree [.SX Spec [.X’ X^0 Compl ] ]

SX

Spec X’

X0 Compl

The spaces after the closing brackets are important!

Borrega & Martins (UB) Introduction to LATEX Session #4 February 18, 2013 19 / 26

Page 27: 4th presentation of the BiB LaTeX course

Trees

Trees

In the preamble. . .

\usepackage{qtree}

In the text. . .

\Tree [.SX Spec [.X’ X^0 Compl ] ]

SX

Spec X’

X0 Compl

The spaces after the closing brackets are important!

Borrega & Martins (UB) Introduction to LATEX Session #4 February 18, 2013 19 / 26

Page 28: 4th presentation of the BiB LaTeX course

Trees

Trees

\Tree [.SX Spec [.X’ X^0 Compl ] ]

Trees are written using bracketed notation.

Terminals do not have to be enclosed in brackets.

Node labels are written just before their opening bracket.

Node labels are preceded by a dot (.).

Superscript (X^0) and subscript (t_i) are supported natively.

Borrega & Martins (UB) Introduction to LATEX Session #4 February 18, 2013 20 / 26

Page 29: 4th presentation of the BiB LaTeX course

Trees

Trees

\Tree [.SX Spec [.X’ X^0 Compl ] ]

Trees are written using bracketed notation.

Terminals do not have to be enclosed in brackets.

Node labels are written just before their opening bracket.

Node labels are preceded by a dot (.).

Superscript (X^0) and subscript (t_i) are supported natively.

Borrega & Martins (UB) Introduction to LATEX Session #4 February 18, 2013 20 / 26

Page 30: 4th presentation of the BiB LaTeX course

Trees

Trees

\Tree [.SX Spec [.X’ X^0 Compl ] ]

Trees are written using bracketed notation.

Terminals do not have to be enclosed in brackets.

Node labels are written just before their opening bracket.

Node labels are preceded by a dot (.).

Superscript (X^0) and subscript (t_i) are supported natively.

Borrega & Martins (UB) Introduction to LATEX Session #4 February 18, 2013 20 / 26

Page 31: 4th presentation of the BiB LaTeX course

Trees

Trees

\Tree [.SX Spec [.X’ X^0 Compl ] ]

Trees are written using bracketed notation.

Terminals do not have to be enclosed in brackets.

Node labels are written just before their opening bracket.

Node labels are preceded by a dot (.).

Superscript (X^0) and subscript (t_i) are supported natively.

Borrega & Martins (UB) Introduction to LATEX Session #4 February 18, 2013 20 / 26

Page 32: 4th presentation of the BiB LaTeX course

Trees

Trees

\Tree [.SX Spec [.X’ X^0 Compl ] ]

Trees are written using bracketed notation.

Terminals do not have to be enclosed in brackets.

Node labels are written just before their opening bracket.

Node labels are preceded by a dot (.).

Superscript (X^0) and subscript (t_i) are supported natively.

Borrega & Martins (UB) Introduction to LATEX Session #4 February 18, 2013 20 / 26

Page 33: 4th presentation of the BiB LaTeX course

Trees

Let’s try this one. . .

SX

SYi X’

X0 SZ

Z0 ti

\Tree [.SX SY_i [.X’ X^0 [.SZ Z^0 t_i ] ] ]

Borrega & Martins (UB) Introduction to LATEX Session #4 February 18, 2013 21 / 26

Page 34: 4th presentation of the BiB LaTeX course

Trees

Let’s try this one. . .

SX

SYi X’

X0 SZ

Z0 ti

\Tree [.SX SY_i [.X’ X^0 [.SZ Z^0 t_i ] ] ]

Borrega & Martins (UB) Introduction to LATEX Session #4 February 18, 2013 21 / 26

Page 35: 4th presentation of the BiB LaTeX course

Trees

More on trees

We can use roofs:

\Tree [.SX X \qroof{Text in the roof}.SY ]

SX

X SY

Text in the roof

Notice how the label follows the \qroof{} command.

Borrega & Martins (UB) Introduction to LATEX Session #4 February 18, 2013 22 / 26

Page 36: 4th presentation of the BiB LaTeX course

Trees

More on trees

Nodes may have up to five children, or just one:

\Tree [.SX [.X’ X ] [ 1 2 3 4 5 ].SY ]

SX

X’

X

SY

1 2 3 4 5

Notice how they are enclosed in square brackets and the label follows.

Borrega & Martins (UB) Introduction to LATEX Session #4 February 18, 2013 23 / 26

Page 37: 4th presentation of the BiB LaTeX course

Trees

More on trees

We can also build trees without labels

\Tree [ This [ is \qroof{an unlabeled tree}. ] ]

This

is

an unlabeled tree

You just have to leave the labels out.

But notice that \qroof still needs to be followed by a dot!

Borrega & Martins (UB) Introduction to LATEX Session #4 February 18, 2013 24 / 26

Page 38: 4th presentation of the BiB LaTeX course

Trees

Our last exercise

CP

Whati C’

didj IP

SD

John and Maryk

I’

tj SV

tk V’

buy ti

Borrega & Martins (UB) Introduction to LATEX Session #4 February 18, 2013 25 / 26

Page 39: 4th presentation of the BiB LaTeX course

Trees

Our last exercise

\Tree [.CP What_i [.C’ did_j [.IP \qroof{John and Mary_k}.SD

[.I’ t_j [.SV t_k [.V’ buy t_i ] ] ] ] ] ]

Borrega & Martins (UB) Introduction to LATEX Session #4 February 18, 2013 26 / 26