Download as pdf or txt
Download as pdf or txt
You are on page 1of 57

LATEX: More Than Just Academic Papers and Theses

(first presented at mosc2011)


nmN

LianTze Lim (Ph.D.) (liantze@gmail.com)


http://liantze.penguinattack.org

cbna (Yes, you can reuse this deck ©)

Illustration by Duane Bibby


LATEX: More Than Just Academic Papers and Theses

Contents

1 What are TEX, LATEX and Friends?

2 Document Types

3 Special Material

4 Wrapping Up

LianTze Lim (Ph.D.) | cbna 2 / 57


LATEX: More Than Just Academic Papers and Theses | What are TEX, LATEX and Friends?

Contents

1 What are TEX, LATEX and Friends?

2 Document Types

3 Special Material

4 Wrapping Up

LianTze Lim (Ph.D.) | cbna 3 / 57


LATEX: More Than Just Academic Papers and Theses | What are TEX, LATEX and Friends?

PHD Comics by Jorge Cham


LianTze Lim (Ph.D.) | cbna 4 / 57
LATEX: More Than Just Academic Papers and Theses | What are TEX, LATEX and Friends?

Ever Worried about These?


Is my literature survey strong enough?
My bibliography/citation formatting got inconsistent.
My citation and bibliography aren’t synchronised!
My math equations don’t display/print correctly.
Should this discussion go under this section or that?
What formatting did I use for my subsection headings again?
Didn’t I set that heading to bold and italic 5 minutes ago?
My section/figure/page numbering’s gone all wrong!
Does this subsection go together with this section?
Oops, I forgot to update the TOC.
What results should I put in this table?
My figure jumped off the page again!
The application crashed!
MY FILE GOT CORRUPTED‼!
LianTze Lim (Ph.D.) | cbna 5 / 57
LATEX: More Than Just Academic Papers and Theses | What are TEX, LATEX and Friends?

What are TEX and LATEX, and Friends?

TEX From Greek τχ


ASCII TeX, /tEx/, /tEk/
A computer typesetting system created by Donald Knuth
for ‘the creation of beautiful books’
LATEX ASCII LaTeX, /"leItEx/, /"leItEk/, /"lA:tEx/, /"lA:tEk/
A document preparation system by Leslie Lamport
Binaries ε-TEX: additional primitives to TEX
pdfTEX: additional PDF-related primitives
XeTEX: native UTF-8 input; can access system fonts
LuaTEX: includes the Lua scripting engine
Friends BibTEX, MakeIndex, METAFONT, METAPOST, . . .
http://www.ctan.org/what_is_tex.html

LianTze Lim (Ph.D.) | cbna 6 / 57


Donald Knuth (1938–)
American computer
scientist, mathematician,
and professor emeritus at
Stanford University
Author of the multi-volume
work The Art of Computer
Programming
“Father of the analysis of
algorithms”

“Science is what we understand well enough to explain to a computer.


Art is everything else we do.”
“If you optimize everything, you will always be unhappy.”
Leslie Lamport (1941–)
American computer scientist
Laid the foundations of the
theory of distributed systems

“A distributed system is
one in which the failure
of a computer you didn’t
even know existed can
render your own computer
unusable.”
LATEX: More Than Just Academic Papers and Theses | What are TEX, LATEX and Friends?

Why?
From http://www.ctan.org/what_is_tex.html

Output Quality Freedom


It has the best output. It’s free.
It knows typesetting. It runs anywhere.

Superior Engineering Popularity


It’s fast. It’s the standard (in
It’s stable. academia and science).
It’s not rigid (extensible).
Plain text input.
Many output types.

LianTze Lim (Ph.D.) | cbna 9 / 57


LATEX: More Than Just Academic Papers and Theses | What are TEX, LATEX and Friends?

Typesetting and Word Processing


Apples and Oranges

Word processors
Replacement of mechanical typewriters
Word, OpenOffice, AbiWord, . . .
Typesetting and Desktop publishing
For publication and printing
InDesign, QuarkXPress, Scribus. . .

LianTze Lim (Ph.D.) | cbna 10 / 57


LATEX: More Than Just Academic Papers and Theses | What are TEX, LATEX and Friends?

Scalability

impossible to do

effort and time consumption

Word®

LATEX

document complexity and size

Scalability of LATEX and Microsoft Word® against document size and complexity
(redrawn from Marko Pinteric’s original at http://www.pinteric.com/miktex.html)

LianTze Lim (Ph.D.) | cbna 11 / 57


LATEX: More Than Just Academic Papers and Theses | What are TEX, LATEX and Friends?

Professional Typesetting Quality Output

Typesetting quality and legibility


good kerning hinting and correct ligatures
inter-word, line and paragraph spacing
context-sensitive hyphenation

Table fiery fluffy Table fiery fluffy


This paper outlines an approach to produce a prototype WordNet system This paper outlines an approach to produce a prototype WordNet system
for Malay semi-automatically, by using bilingual dictionary data and re- for Malay semi-automatically, by using bilingual dictionary data and
sources provided by the original English WordNet system. Senses from resources provided by the original English WordNet system. Senses from
an English-Malay bilingual dictionary were first aligned to English Word- an English-Malay bilingual dictionary were first aligned to English
Net senses, and a set of Malay synsets were then derived. Semantic rela- WordNet senses, and a set of Malay synsets were then derived. Semantic
tions between the English WordNet synsets were extracted and re-applied relations between the English WordNet synsets were extracted and re-
to the Malay synsets, using the aligned synsets as a guide. A small Malay applied to the Malay synsets, using the aligned synsets as a guide. A small
WordNet prototype with 12429 noun synsets and 5805 verb synsets was Malay WordNet prototype with 12429 noun synsets and 5805 verb synsets
thus produced. This prototype is a first step towards building a full-fledged was thus produced. This prototype is a first step towards building a full-
Malay WordNet.
fledged Malay WordNet.

Correct mathematical typesetting (spacing etc)


∞  
t−b
Z
1
Wψ (f )(a, b) = √ f (t)ψ dt
a −∞ a

LianTze Lim (Ph.D.) | cbna 12 / 57


LATEX: More Than Just Academic Papers and Theses | What are TEX, LATEX and Friends?

Where Would I Want to Use LATEX?

Beautiful typographic output (OK not everyone cares that much. . . )


Documents with complex structures
Lots of mathematics (or other specific needs)
When publishers require them
Batch processing of data into reports, etc.
Back-end of other applications

LianTze Lim (Ph.D.) | cbna 13 / 57


LATEX: More Than Just Academic Papers and Theses | What are TEX, LATEX and Friends?

This is not a Word Processors vs LATEX debate.

It’s a ‘teaser’ preview of an alternative tool.


Some word processors also provide mechanisms to handle same routine
tasks (with varying degrees of ease, consistency and stability)
Use the best tool for the task at hand.
You are the best judge to decide for yourself.

LianTze Lim (Ph.D.) | cbna 14 / 57


LATEX: More Than Just Academic Papers and Theses | What are TEX, LATEX and Friends?

How Do I Use It?

1 Write a plain text LATEX file (.tex)


2 Run it through pdflatex or xelatex → PDF output
(or latex + dvips + ps2pdf for DVI + PS + PDF)
3 Run bibtex and/or makeindex to process bibliographies, indices
4 Re-run pdflatex to resolve references and pointers

LianTze Lim (Ph.D.) | cbna 15 / 57


LATEX: More Than Just Academic Papers and Theses | What are TEX, LATEX and Friends?

Example .tex File


\documentclass[a4paper,11pt]{article} An Introductory Paper
\author{Lim Lian Tze}
\title{An Introductory Paper} Lim Lian Tze
\date{\today} June 7, 2011
\usepackage[english]{babel}
Contents
\begin{document} 1 Introduction 1
\maketitle
2 State of the Art 1
\tableofcontents 2.1 Document Formats . . . . . . . . . . . . . . . . . . . . . . . . 1

pdflatex Abstract
\begin{abstract} This paper introduces. . .

This paper introduces\ldots


1 Introduction
\end{abstract}
We consider. . .

\section{Introduction}
2 State of the Art
We consider\ldots
We look at. . .

\section{State of the Art} 2.1 Document Formats


We look at\ldots There are many. . .

\subsection{Document Formats}
There are many\ldots
\end{document} 1

LianTze Lim (Ph.D.) | cbna 16 / 57


LATEX: More Than Just Academic Papers and Theses | What are TEX, LATEX and Friends?

Where Do I Get It?

Online Overleaf (www.overleaf.com)

Windows MikTEX, TEXLive


Un*x, GNU/Linux TEXLive
Mac OS X MacTEX (based on TEXLive)
Installation Use your OS’ package manager
(or download manually)
Editors vi, emacs, Texmaker, TeXworks, Texstudio, TeXshop. . .
LAT EX Packages Use MikTEX or TEXLive’s package manager

Documentation (Online) http://texdoc.net/pkg/<packagename>


(TEXLive) $ texdoc <package name>
(MikTEX) $ mthelp <package name>

LianTze Lim (Ph.D.) | cbna 17 / 57


LATEX: More Than Just Academic Papers and Theses | What are TEX, LATEX and Friends?

Easy to Learn, Hard to Master

Customising may not be straightforward (vs word processors)


Intentionally so: Style guidelines should be followed strictly
Publisher/organisation provides document class or style files
Use these to take care of formatting and styling, focus on the content

LianTze Lim (Ph.D.) | cbna 18 / 57


LATEX: More Than Just Academic Papers and Theses | What are TEX, LATEX and Friends?

Too hard, only for engineers/mathematicians?

I once guided a student in the


humanities to learn authoring Chinese
LATEX documents entirely through e-mail
Recently a 75-year-old user transitioned
to LATEX on Overleaf to write a book
(with indices, end notes, cross
references)
Professor in Finance at Trinity College
transitioned to LATEX successfully
(https://www.overleaf.com/blog/299)
Prof Brian Lucey, Trinity
Linguists, psychologists, biostatistics College, Dublin
(integrating with R), legal profession. . .

LianTze Lim (Ph.D.) | cbna 19 / 57


Nano Ninjas – a group of 7th- and 8th-graders from Portland, OR

Collaboratively wrote an engineering notebook with 300+ pages in LATEX as part


of their FIRST Tech Challenge win (https://www.overleaf.com/read/hkxzqcncngyv)
LATEX: More Than Just Academic Papers and Theses | What are TEX, LATEX and Friends?

So, What Can LATEX Do?

LianTze Lim (Ph.D.) | cbna 21 / 57


LATEX: More Than Just Academic Papers and Theses | Document Types

Contents

1 What are TEX, LATEX and Friends?

2 Document Types

3 Special Material

4 Wrapping Up

LianTze Lim (Ph.D.) | cbna 22 / 57


LATEX: More Than Just Academic Papers and Theses | Document Types

Basic Types

Books Chapter 1

Heading on level 0 (chapter)

Hello, here is some text without a meaning. This text should show, how a
printed text will look like at this place. If you read this text, you will get no
A Wonderful Read information. Really? Is there no information? Is there a difference between

\documentclass{book} A. Dummy
this text and some nonsense like »Huardest gefburn«. Kjift – Never mind!
A blind text like this gives you information about the selected font, how the
letters are written and the impression of the look. This text should contain
all letters of the alphabet and it should be written in of the original language.
There is no need for a special contents, but the length of words should match
3rd June 2011 to the language.

\author{...} 1.1 Heading on level 1 (section)


Hello, here is some text without a meaning. This text should show, how a
printed text will look like at this place. If you read this text, you will get no
information. Really? Is there no information? Is there a difference between
this text and some nonsense like »Huardest gefburn«. Kjift – Never mind!

\title{...} A blind text like this gives you information about the selected font, how the
letters are written and the impression of the look. This text should contain
all letters of the alphabet and it should be written in of the original language.
There is no need for a special contents, but the length of words should match
to the language.

1.1.1 Heading on level 2 (subsection)


Hello, here is some text without a meaning. This text should show, how a
printed text will look like at this place. If you read this text, you will get no
information. Really? Is there no information? Is there a difference between

\begin{document}
\maketitle
4 CHAPTER 1. HEADING ON LEVEL 0 (CHAPTER) 1.2. LISTS 5

\chapter{...} this text and some nonsense like »Huardest gefburn«. Kjift – Never mind!
A blind text like this gives you information about the selected font, how the
letters are written and the impression of the look. This text should contain
Example for list (4*itemize)

• First item in a list


all letters of the alphabet and it should be written in of the original language.
There is no need for a special contents, but the length of words should match – First item in a list
to the language. ∗ First item in a list

\section{...} Heading on level 3 (subsubsection)


Hello, here is some text without a meaning. This text should show, how a
printed text will look like at this place. If you read this text, you will get no
· First item in a list
· Second item in a list
∗ Second item in a list

information. Really? Is there no information? Is there a difference between – Second item in a list
this text and some nonsense like »Huardest gefburn«. Kjift – Never mind!

... A blind text like this gives you information about the selected font, how the • Second item in a list
letters are written and the impression of the look. This text should contain
all letters of the alphabet and it should be written in of the original language.
There is no need for a special contents, but the length of words should match
1.2.2 Example for list (enumerate)
to the language. 1. First item in a list

Heading on level 4 (paragraph) Hello, here is some text without a 2. Second item in a list

\subsection{...} meaning. This text should show, how a printed text will look like at this
place. If you read this text, you will get no information. Really? Is there
no information? Is there a difference between this text and some nonsense
like »Huardest gefburn«. Kjift – Never mind! A blind text like this gives
you information about the selected font, how the letters are written and the
3. Third item in a list

4. Fourth item in a list

impression of the look. This text should contain all letters of the alphabet 5. Fifth item in a list
and it should be written in of the original language. There is no need for a

\end{document} special contents, but the length of words should match to the language.

1.2 Lists
Example for list (4*enumerate)

1. First item in a list

1.2.1 Example for list (itemize) (a) First item in a list


i. First item in a list
• First item in a list
A. First item in a list
• Second item in a list B. Second item in a list
• Third item in a list ii. Second item in a list

• Fourth item in a list (b) Second item in a list

• Fifth item in a list 2. Second item in a list

LianTze Lim (Ph.D.) | cbna 23 / 57


LATEX: More Than Just Academic Papers and Theses | Document Types

Basic Types (cont’d)


A blind text like this gives you information about the selected font, how the
letters are written and the impression of the look. This text should contain
all letters of the alphabet and it should be written in of the original language.
A Wonderful Read There is no need for a special contents, but the length of words should match

Articles
to the language.

A. Dummy Heading on level 4 (paragraph) Hello, here is some text without a


meaning. This text should show, how a printed text will look like at this
3rd June 2011 place. If you read this text, you will get no information. Really? Is there
no information? Is there a difference between this text and some nonsense
like »Huardest gefburn«. Kjift – Never mind! A blind text like this gives
1 Heading on level 1 (section) you information about the selected font, how the letters are written and the
impression of the look. This text should contain all letters of the alphabet
Hello, here is some text without a meaning. This text should show, how a and it should be written in of the original language. There is no need for a
printed text will look like at this place. If you read this text, you will get no special contents, but the length of words should match to the language.
information. Really? Is there no information? Is there a difference between
this text and some nonsense like »Huardest gefburn«. Kjift – Never mind!
A blind text like this gives you information about the selected font, how the 2 Lists
letters are written and the impression of the look. This text should contain

\documentclass{article} all letters of the alphabet and it should be written in of the original language.
There is no need for a special contents, but the length of words should match
to the language.
2.1 Example for list (itemize)
• First item in a list
• Second item in a list
1.1 Heading on level 2 (subsection) • Third item in a list
Hello, here is some text without a meaning. This text should show, how a • Fourth item in a list

\author{...} printed text will look like at this place. If you read this text, you will get no
information. Really? Is there no information? Is there a difference between
this text and some nonsense like »Huardest gefburn«. Kjift – Never mind!
A blind text like this gives you information about the selected font, how the
letters are written and the impression of the look. This text should contain
• Fifth item in a list

2.1.1 Example for list (4*itemize)


• First item in a list
all letters of the alphabet and it should be written in of the original language.
There is no need for a special contents, but the length of words should match – First item in a list

\title{...} to the language.

1.1.1 Heading on level 3 (subsubsection)


Hello, here is some text without a meaning. This text should show, how a
∗ First item in a list
· First item in a list
· Second item in a list
∗ Second item in a list
printed text will look like at this place. If you read this text, you will get no
– Second item in a list
information. Really? Is there no information? Is there a difference between
this text and some nonsense like »Huardest gefburn«. Kjift – Never mind! • Second item in a list

1 2

\begin{document}
\maketitle
2.2 Example for list (enumerate) Second item in a list
1. First item in a list Second item in a list

\section{...} 2. Second item in a list

3. Third item in a list


Second item in a list

Second item in a list

4. Fourth item in a list

5. Fifth item in a list

... 2.2.1 Example for list (4*enumerate)


1. First item in a list

(a) First item in a list


i. First item in a list

\subsection{...} A. First item in a list


B. Second item in a list
ii. Second item in a list
(b) Second item in a list

2. Second item in a list

\end{document} 2.3 Example for list (description)


First item in a list

Second item in a list

Third item in a list

Fourth item in a list

Fifth item in a list

2.3.1 Example for list (4*description)


First item in a list

First item in a list


First item in a list
First item in a list

3 4

LianTze Lim (Ph.D.) | cbna 24 / 57


LATEX: More Than Just Academic Papers and Theses | Document Types

Journal and Conference Proceedings Articles

IEEE ACM LLNCS


\documentclass{IEEEtran} \documentclass{sig-alternate} \documentclass{llncs}

A Wonderful Read A Wonderful Read


A. Dummy
A. Dummy A Wonderful Read
Abstract—Hello, here is some text without a meaning. 1) Heading on level 3 (subsubsection): Hello, A. Dummy
This text should show, how a printed text will look like here is some text without a meaning. This text
at this place. If you read this text, you will get no should show, how a printed text will look like No Institute Given
information. Really? Is there no information? Is there
at this place. If you read this text, you will get
a difference between this text and some nonsense like
no information. Really? Is there no information? ABSTRACT show, how a printed text will look like at this place. If you read
»Huardest gefburn«. Kjift – Never mind! A blind text like this text, you will get no information. Really? Is there no infor-
this gives you information about the selected font, how the Is there a difference between this text and some Hello, here is some text without a meaning. This text should show,
mation? Is there a difference between this text and some nonsense Abstract Hello, here is some text without a meaning. This text should
how a printed text will look like at this place. If you read this
letters are written and the impression of the look. This text nonsense like »Huardest gefburn«. Kjift – Never text, you will get no information. Really? Is there no informa- like »Huardest gefburn«. Kjift – Never mind! A blind text like this show, how a printed text will look like at this place. If you read this text,
should contain all letters of the alphabet and it should be you will get no information. Really? Is there no information? Is there a
mind! A blind text like this gives you information tion? Is there a difference between this text and some nonsense gives you information about the selected font, how the letters are
written in of the original language. There is no need for written and the impression of the look. This text should contain difference between this text and some nonsense like »Huardest gefburn«.
about the selected font, how the letters are written like »Huardest gefburn«. Kjift – Never mind! A blind text like this
all letters of the alphabet and it should be written in of the original Kjift – Never mind! A blind text like this gives you information about
a special contents, but the length of words should match gives you information about the selected font, how the letters are
and the impression of the look. This text should language. There is no need for a special contents, but the length of the selected font, how the letters are written and the impression of the
to the language. written and the impression of the look. This text should contain
contain all letters of the alphabet and it should be all letters of the alphabet and it should be written in of the original words should match to the language. look. This text should contain all letters of the alphabet and it should
be written in of the original language. There is no need for a special
written in of the original language. There is no need language. There is no need for a special contents, but the length of
words should match to the language. Heading on level 4 (paragraph). contents, but the length of words should match to the language.
I. H EADING ON LEVEL 1 ( SECTION ) for a special contents, but the length of words should Hello, here is some text without a meaning. This text should
match to the language. show, how a printed text will look like at this place. If you read
Hello, here is some text without a meaning. This 1. Heading on level 1 (SECTION) this text, you will get no information. Really? Is there no infor-
a) Heading on level 4 (paragraph): Hello, Hello, here is some text without a meaning. This text should mation? Is there a difference between this text and some nonsense
text should show, how a printed text will look like here is some text without a meaning. This text show, how a printed text will look like at this place. If you read like »Huardest gefburn«. Kjift – Never mind! A blind text like this
at this place. If you read this text, you will get should show, how a printed text will look like this text, you will get no information. Really? Is there no infor- gives you information about the selected font, how the letters are
1 Heading on level 1 (section)
no information. Really? Is there no information? mation? Is there a difference between this text and some nonsense written and the impression of the look. This text should contain
at this place. If you read this text, you will get
Is there a difference between this text and some
like »Huardest gefburn«. Kjift – Never mind! A blind text like this all letters of the alphabet and it should be written in of the original Hello, here is some text without a meaning. This text should show,
no information. Really? Is there no information? gives you information about the selected font, how the letters are language. There is no need for a special contents, but the length of
nonsense like »Huardest gefburn«. Kjift – Never Is there a difference between this text and some written and the impression of the look. This text should contain words should match to the language.
how a printed text will look like at this place. If you read this text,
mind! A blind text like this gives you information nonsense like »Huardest gefburn«. Kjift – Never all letters of the alphabet and it should be written in of the original you will get no information. Really? Is there no information? Is there
language. There is no need for a special contents, but the length of a difference between this text and some nonsense like »Huardest
about the selected font, how the letters are written mind! A blind text like this gives you information words should match to the language.
2. Lists
and the impression of the look. This text should about the selected font, how the letters are written gefburn«. Kjift – Never mind! A blind text like this gives you infor-
1.1 Heading on level 2 (subsection) 2.1 Example for list (itemize) mation about the selected font, how the letters are written and the
contain all letters of the alphabet and it should be and the impression of the look. This text should
Hello, here is some text without a meaning. This text should impression of the look. This text should contain all letters of the al-
written in of the original language. There is no need contain all letters of the alphabet and it should be show, how a printed text will look like at this place. If you read • First item in a list
for a special contents, but the length of words should written in of the original language. There is no need this text, you will get no information. Really? Is there no infor- phabet and it should be written in of the original language. There is
• Second item in a list
match to the language. for a special contents, but the length of words should mation? Is there a difference between this text and some nonsense no need for a special contents, but the length of words should match
like »Huardest gefburn«. Kjift – Never mind! A blind text like this • Third item in a list
match to the language. gives you information about the selected font, how the letters are
to the language.
written and the impression of the look. This text should contain • Fourth item in a list
A. Heading on level 2 (subsection) all letters of the alphabet and it should be written in of the original
II. L ISTS language. There is no need for a special contents, but the length of • Fifth item in a list 1.1 Heading on level 2 (subsection)
Hello, here is some text without a meaning. This words should match to the language.
text should show, how a printed text will look like A. Example for list (itemize) 2.1.1 Example for list (4*itemize) Hello, here is some text without a meaning. This text should show,
at this place. If you read this text, you will get 1.1.1 Heading on level 3 (subsubsection) how a printed text will look like at this place. If you read this text,
• First item in a list
Hello, here is some text without a meaning. This text should • First item in a list
no information. Really? Is there no information? • Second item in a list you will get no information. Really? Is there no information? Is there
Is there a difference between this text and some • Third item in a list – First item in a list
a difference between this text and some nonsense like »Huardest
nonsense like »Huardest gefburn«. Kjift – Never • Fourth item in a list ∗ First item in a list
gefburn«. Kjift – Never mind! A blind text like this gives you infor-
Permission to make digital or hard copies of all or part of this work for · First item in a list
mind! A blind text like this gives you information • Fifth item in a list personal or classroom use is granted without fee provided that copies are mation about the selected font, how the letters are written and the
about the selected font, how the letters are written not made or distributed for profit or commercial advantage and that copies · Second item in a list
1) Example for list (4*itemize): bear this notice and the full citation on the first page. To copy otherwise, to ∗ Second item in a list
and the impression of the look. This text should republish, to post on servers or to redistribute to lists, requires prior specific
• First item in a list – Second item in a list
contain all letters of the alphabet and it should be permission and/or a fee.

written in of the original language. There is no need – First item in a list MOSC 2011, July 3–5, 2011, Penang, Malaysia.
• Second item in a list
Copyright 2011 ACM 123-4-56789-012-3/11/0007 ...$10.00.
for a special contents, but the length of words should ∗ First item in a list
match to the language. · First item in a list

LianTze Lim (Ph.D.) | cbna 25 / 57


LATEX: More Than Just Academic Papers and Theses | Document Types

Some Goodies

Quick language-switching with babel


Automatic generation of cross-referencing labels:
\section{Introduction}\label{sec:intro}
... We saw in section \ref{sec:intro}...
Automatic generation of lists:
\tableofcontents, \listoffigures, \listoftables
Automatic generation of bibliographies and indices:
\cite{Knuth:1976}...\bibliography{references.bib}
...the Linux kernel\index{Linux!kernel}... \printindex
Fully hyperlinked PDF with bookmarks: \usepackage{hyperref}
Inclusion of selected pages from other PDFs
(while inserting new page headers/footers!)
\usepackage{pdfpages}
\includepdf[pages={1,3-5,8},pagecommand=\thispagestyle{plain}]{file.pdf}

LianTze Lim (Ph.D.) | cbna 26 / 57


LATEX: More Than Just Academic Papers and Theses | Document Types

Multilingual LATEX
감사합니다
ध यवाद
Ευχαριστώ

Terima kasih 谢谢 Danke


Grazie
qatlho’ Obrigado
Спасибо
Thank you நன்றி
ขอบคุณ
Gracias Xin cảm ơn
9C 4#5$Ì
ありがとう ‫ﺷﻜﺮا‬ Merçi

Go raibh maith agaibh


Tapadh leibh
ཐུགས་རྗེ་ཆེ་།

XELATEX, LuaLATEX Unicode input


LATEX Various packages (sometimes with transcriptions: nan^ri, salAm)

LianTze Lim (Ph.D.) | cbna 27 / 57


LATEX: More Than Just Academic Papers and Theses | Document Types

University Theses

Universiti Sains Malaysia \documentclass{usmthesis}


TABLE OF CONTENTS
REFERENCES
CHAPTER 1
Acknowledgements. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ii

WRITING YOUR THESIS WITH LATEX Table of Contents . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . iii INTRODUCTION: SAMPLES OF BASIC LATEX
COMMANDS Changsheng, X., Wang, J., Lu, L. and Zhang, Y. (2008). A novel framework for
List of Tables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . v semantic annotation and personalized retrieval of sports video, Multimedia, IEEE
Transactions on 10(3): 421–436.
List of Figures . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . vi
D’Orazio, T., Leo, M., Spagnolo, P., Mazzeo, P. L., Mosca, N., Nitti, M. and Distante,
List of Plates . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . vii A. (2009). An investigation into the feasibility of real-time soccer offside detec-
Hello and welcome, fellow Universiti Sains Malaysia (USM) research postgrad! The
tion from a multiple camera system, IEEE TRANSACTIONS ON CIRCUITS AND
List of Abbreviations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . viii SYSTEMS FOR VIDEO TECHNOLOGY 19(12): 1804–1818.
usmthesis package and template files were written in the hope that they may help
by List of Symbols . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ix D’Orazio, T., Leo, M., Spagnolo, P., Nitti, M., Mosca, N. and Distante, A. (2009).
you prepare your research thesis using LATEX, based on the Institut Pengajian Siswazah
A visual system for real time detection of goal events during soccer matches,
Abstrak . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . x
Computer Vision and Image Understanding 113(5): 622–632. Computer Vision
(IPS) requirements (IPS, 2007). Please note that this version is based on the new
Abstract . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xi Based Analysis in Sport Environments.
URL: http://www.sciencedirect.com/science/article/B6WCX-4S50K9H-
guidelines, in force 17 Dec 2007 onwards. (Song, Cai, Lyu and Cai, 2002)
1/2/fe82b213b3ec28e07aef15882eb37538
CHAPTER 1 – INTRODUCTION: SAMPLES OF BASIC LATEX
IPS (2007). A Guide to the Preparation, Submission and Examination of Theses, In-
COMMANDS
LIM LIAN TZE LATEX is powerful and produces beautiful documents. However, there is definitely stitute of Graduate Studies, Universiti Sains Malaysia, Penang, Malaysia.
1.1 Some Simple Command Usages . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1
a learning curve to it – one that is worth the effort. If you find any errors in these Lim, L. T. (2009). LATEX: Beautiful typesetting, [Online]. [Accessed January 22, 2011].
1.2 Special Characters . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3 Available from World Wide Web: http://liantze.googlepages.com/latextypesetting.
templates or documents, or have any suggestions or feedback, do e-mail me about it
1.3 Useful Resources . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4 Mittelbach, F., Goossens, M., Braams, J., Carlisle, D. and Rowley, C. (2004). The
(liantze@gmail.com). The author cannot always guarantee prompt response, how- LATEX Companion, Addison-Wesley Series on Tools and Techniques for Computer
Typesetting, 2nd edn, Addison-Wesley, Boston, MA, USA.
CHAPTER 2 – CITATIONS AND BIBLIOGRAPHY ever. ©
Oetiker, T., Partl, H., Hyna, I. and Schlegl, E. (2006). The Not So Short Introduction
Thesis submitted in fulfilment of the requirements 2.1 The *.bib File . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5
to LATEX 2ε , 4.2 edn.
for the degree of MiKTEX, my recommended LATEX distribution for Windows, is available on the Roberts, A. (2005). Getting to grips with LATEX, [Online]. [Accessed January 22,
2.2 Citations using the natbib package . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6
Master of Science CSPC’07 CD. A step-by-step installation walkthrough is available at (Lim, 2009).
2011]. Available from World Wide Web: http://www.andy-roberts.net/misc/latex/
2.2.1 Author-Year System . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6 index.html.

2.2.2 Numeric System. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7 Song, J. Q., Cai, M., Lyu, M. R. and Cai, S. J. (2002). A new approach for line
recognition in large-size images using hough transform, Proceedings of the 16th
1.1 Some Simple Command Usages International Conference on Pattern Recognition., Vol. 1, pp. 33–36.
CHAPTER 3 – FIGURES, TABLES, EQUATIONS, ALGORITHMS, ETC
There are plenty of free LATEX tutorials online, some of which are listed in the bibli-
3.1 Inserting Figures . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9
December 2007 ographies or available at http://e-office.cs.usm.my. This sample thesis includes some
3.2 Inserting Plates . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12

3.3 Inserting Tables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12 examples to do some common tasks. We start with some examples for lists (both bul-

iii 1 24

LianTze Lim (Ph.D.) | cbna 28 / 57


LATEX: More Than Just Academic Papers and Theses | Document Types

Highly Configurable Documents


memoir and KOMA-Script Classes

Sectional headings
Running headers and footers
Good font, colour and illustration choices
http://latex-my.blogspot.com/search/label/bookdesign

Image: A simple network. Illustration by ©Svilen Mushkatov (http://www.sxc.hu/profile/svilen001). Grid@USM

PWN

Grid Computing Cluster


Analyser

PWN PWN
Analyser Analyser
PWN
Analyser

Remote Host

The Development and Integration of


Remote Host
Lexicon Lexicon Lexicon
Dispenser Dispenser Dispenser

Grid Services and Applications CONTENTS


Remote Host

Lexicon
Dispenser

Project Overview Sense-Tagger

Introduction 2
PWN
Grid@USM: Developing & Integrating Grid Applications & Services 4 Syntactic Lexicon Analyser
Remote Host

Parser Dispenser SLB on utmkblex


Project Milestones 7

Grid@USM
Project Expenditures 8
Figure 3: Blexisma2 agents are deployed on USM Campus Grid nodes using the Globus job submission toolkit.

2008/09 Report
Sub-Projects
Setting up USM Campus Grid 10
AP Chan Huah Yong, Ang Sin Keat, Tan Chin Min, Kheoh Hooi Leng, Cheng Wai Khuen, M. Muzzammil bin Mohd Salahudin
Dynamic Replica Management in Data Grid Environment 14
AP Chan Huah Yong, Aloysius Indrayanto and Muhammad Muzzammil bin Mohd Salahudin
Using Grid Technology to Create a Render-Farm for Blender 3D Animation 18
AP Phua Kia Ken and Zafri Muhammad
Grid-enabled Blexisma2 23

Grid@USM:
AP Tang Enya Kong, Lim Lian Tze, Ye Hong Hoe and Dr Didier Schwab
B2B Standards Component Modeling 27
Dr Vincent Khoo Kay Teong, Ting Tin Tin, Rinki Yadav, Johnson Foong and Kor Chan Hock
An Automated Java Testing Tool on the Grid 31

DEVELOPING & INTEGRATING


(a) Diferent meanings of star in context (b) Different meanings of school in context
Dr Kamal Zuhairi Zamli, Dr Nor Ashidi Mat Isa, Mohammed Issam Younis and Saidatul Khatimah binti Said
iNet-Grid 35 Figure 4: SLB data generated by Blexisma2 agents used to determine most probable meanings of ambiguous lexical

GRID APPLICATIONS & SERVICES


Prof. Sureswaran Ramadass, AP Rahmat Budiarto, AP Chan Huah Yong and Dr Ahmed M. Manasrah item. A Web interface to the Sense-Tagger is available at http://utmkblex.usmgrid.myren.net.my:8080/Blexisma2Servlets/
Grid Application to Wave Front Propagation and Containment of Vector Borne Diseases 40 CVSenseTagger.
Prof. Koh Hock Lye, Dr Teh Su Yean and Tan Kah Bee

interested to improve its design to On the performance issues, we with Ontology-based Conceptual
Project Activities a multilingual setting, where more may attempt several solutions for the Vectors. In Proceedings of the 5th In-
Organised Events 46 complicated cross-lingual phenomena SLB bottleneck problem mentioned ternational Workshop on Natural Lan-
will have to be considered. We also earlier: guage Processing and Cognitive Sci-
Other Events 48 hope to improve the agent commu- ence (NLPCS’08). Barcelona, Spain;
Publications 50 USM’S R&D SUSTAINABILITY for attaining and subsequently sus- Grid computing is by its na- nication mechanisms to reduce la- • hardware (RAM) upgrades, pp. 153–158.
taining RU status is the creation ture highly distributed geographically, tency. Apart from creating more • further optimisation of PostgreSQL

Edited by Bahari Belaton and Lim Lian Tze


To attain the level of excellence as a of highly conducive research envi- consists of highly specialised equip- server settings,
agents that implement different learn- Schwab, D. & Lim, L. T. (2008). Blex-
research university (RU), USM in re- ronment and infrastructure. Grid ment (storage, grid engines and man- • database connection pooling,
ing algorithms and heuristics, we are isma2: a Distributed Agent Frame-
cent years has seriously engaged her- computing is an example of such agement tools), as well as expensive. • load balancing,
Platform for Information & Communication Technology Research self in various efforts to formulate infrastructure, aiming at providing It is as such an ideal example of com-
also planning agents responsible for
other NLP tasks such as deep parsing, • parallelising queries.
work for Constructing a Semantic
Lexical Database based on Con-
and chart her future research and excellent research facilities by en- mon, core computational resources
Universiti Sains Malaysia development (R&D) directions. The suring good computational horse- to be created and pooled among as-
detecting named entities, etc. In other
words, we hope to have agents of var-
ceptual Vectors. In Proceedings
of the International Conference on
pinnacle of these efforts was trans- power to support high impact do- piring researchers who require high ious responsibilities so that they can Distributed Frameworks & Applica-
lated into a 2 year strategic plan “USM mains in the bio-sciences, physical performance resources. be ‘mixed-and-matched’ to construct PROJECT PUBLICATIONS tions 2008 (DFmA 2008). Penang,
Research-Intensive University 2007– sciences, information and communi- new NLP applications, such as those Malaysia; pp. 102–110.
2009”. cation technology (ICT), Environment Lim, L. T. & Schwab, D. (2008). Lim-
Equally important, USM needs a fo- mentioned in the introduction. ri
its of Lexical Semantic Relatedness @

G
d
Note: The abbreviations Prof. and AP are used for Professor and Associate Professor respectively throughout this book. One of the crucial input elements sciences, Education, Arts and others. cused, holistic and dedicated effort S

M
U
4 26 GRID-ENABLED BLEXISMA2

LianTze Lim (Ph.D.) | cbna 29 / 57


LATEX: More Than Just Academic Papers and Theses | Document Types

Presentation Slides

This presentation was made with LATEX!


Many possible classes: powerdot, beamer
Intro

\documentclass{beamer}
\usetheme{Warsaw} A First Presentation

Lim Lian Tze


\author ...
June 3, 2011

\begin{document}
\titleframe
Lim Lian Tze A First Presentation

Intro

Some Background
\section{Intro}

\begin{frame}
\frametitle{Some Background} Once upon a time
There were programmers
...
\end{frame}
\end{document}
Lim Lian Tze A First Presentation

LianTze Lim (Ph.D.) | cbna 30 / 57


LATEX: More Than Just Academic Papers and Theses | Document Types

Oversized Posters
Many possible solutions:
sciposter, flowfram, beamerposter, tikzposter
Low-Cost Construction of a
Multilingual Lexicon from Bilingual Lists
Introduction Adding a New Language
◮ Bilingual MRDs are good resources for building ◮ (Example: Malay–English–Chinese + French)
multilingual lexicons, but heterogeneous structures ◮ Construct also French–English–Malay triples
◮ Lowest common denominator: list of ◮ Add French members to existing M-E-C clusters with
source language item→ target language item(s) common English & Malay members
◮ Proposal: Multilingual lexicon construction using only
simple bilingual lists bengkeng

\documentclass{beamer} One-time Inverse Consultation [1]


fierce

ferocious
garang + (cruel, ferocious, garang)
(féroce, fierce, garang)
ö
◮ Generates a bilingual lexicon for new language pair

Ð→
\usepackage[orientation=portrait, from existing bilingual lists
◮ JP–EN, EN–MS, MS–EN lexicons ⇒ JP–MS féroce
bengkeng cruel

,→ size=a0]{beamerposter} Japanese

p
English
mark
seal
Malay
tanda
anjing laut
fierce garang

stamp tera ferocious ö

\usetheme{...} imprint
gauge
Precision of 100 Random Translation Sets

\author ... % Meta-information score(‘tera’) = 2 ×


|E1 ∩ E2|
|E1| + |E2|
∴p↔ ‘tera’ is most likely valid
=2×
2
3+4
= 0.57 0.85
α = 0.0
α = 0.2
α = 0.8

Precision
0.8

0.75
Merging Translation Triples into Sets
0.7
◮ (Example: Malay–English–Chinese) β

\begin{document} ◮ Retain OTIC ‘middle’ language links


◮ For each ‘head’ language LI, discard triples with score
0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8
◮ Precision generally around 0.70–0.82; max 0.86
< αX or score2 < β X, where X = max score of all

\begin{frame} triples containing that LI


(garang, ö) 0.143
(garang, ÑS ) 0.048
F1 and Rand Index of Selected Translation Sets
◮ Evaluating accuracy of sets with polysemous ‘middle’
(garang, ferocious, ö) language members, e.g. ‘plant’, ‘target’
(garang, bold, ÑS)

... % Poster contents goes here (garang, fierce, ö)

(garang, ÀÈ) 0.125


(garang, —S ) 0.048
(garang, bold, —S)
Test
word
‘bank’
Rand Index
min max
0.417 0.611
min
F1

0.588
max
0.632
Best accuracy when
α
0.6
β
0.4
(garang, jazzy, ÀÈ)

\end{frame} (garang, 'Æ) 0.111


(garang, bold, 'Æ)

‘plant’
‘target’
‘letter’
0.818 0.927
0.821 1.000
0.709 0.818
0.809
0.902
0.724
0.913
1.000
0.792
0.6
0.4
0.8
0.2
0.2
0.2

\end{document} ◮ Merge all triples with common bilingual pairs


bengkeng
Discussion and Conclusion
◮ Low thresholds (α, β ): more coverage; low precision
(garang, ferocious, ö)
(garang, fierce, ö) Ð→
fierce
garang ◮ High thresholds: good precision; low coverage
(bengkeng, fierce, ö)
ferocious ◮ α = 0.6, β = 0.2 gives good trade-off between
ö
coverage, precision and recall
◮ Results are encouraging for such simple input data!
References ◮ Future plan: Integrate lexicon
[1] F. Bond and K. Ogura. “Combining linguistic resources to create a into an MT system
machine-tractable Japanese–Malay dictionary”. In: Language with WSD
Resources and Evaluation 42 (2008), pp. 127–136.

Lian Tze Lim Bali Ranaivo-Malançon Enya Kong Tang


liantze@gmail.com {ranaivo,enyakong}@mmu.edu.my
NLP-SIG, Faculty of Information Technology, Multimedia University, Malaysia

LianTze Lim (Ph.D.) | cbna 31 / 57


LATEX: More Than Just Academic Papers and Theses | Document Types

Leaflets
leaflet: arrange contents into 6 pages on a foldable double-sided sheet
Discussion References Low-Cost Construction of a
▸ Low thresholds (α, β): more coverage; low precision [1] F. Bond and K. Ogura. “Combining linguistic resources to
Multilingual Lexicon from
▸ High thresholds: good precision; low coverage create a machine-tractable Japanese–Malay dictionary”. In:
▸ α ≈ 0.6, β ≈ 0.2 gives good trade-off between coverage, Language Resources and Evaluation 42 (2008), pp. 127–136.
Bilingual Lists
precision and recall [2] P. Vossen. “EuroWordNet: A Multilingual Database of
▸ Results are encouraging for such simple input data! Autonomous and Language-specific Wordnets Connected via
Especially suitable for under-resourced language pairs an Inter-Lingual-Index”. In: Special Issue on Multilingual Lian Tze Lim
▸ Future plan: Integrate multilingual lexicon into an MT Databases, International Journal of Linguistics 17.2 (2004).
Bali Ranaivo-Malançon
system with WSD and user interaction features [3] D. Tufiş, D. Cristeau, and S. Stamou. “BalkaNet: Aims, Enya Kong Tang
Methods, Results and Perspectives – A General Overview”.
Related Work In: Romanian Journal of Information Science and Technology
Special Issue 7.1 (2004), pp. 9–43. NLP-SIG, Faculty of Information Technology
▸ Many multilingual lexicon projects [2, 3]) aligned with Multimedia University, Malaysia
[4] C. Fellbaum, ed. WordNet: An Electronic Lexical Database.
Princeton WordNet [4]
⊳ Overly fine sense distinctions in Princeton WordNet
Language, Speech, and Communication. Cambridge,

▸ Pan Lexicon [5]: compute context vectors of words from


Massachusetts: MIT Press, 1998.
[5] M. Sammer and S. Soderland. “Building a Introduction
monolingual corpora of different languages, then
sense-distinguished multilingual lexicon from monolingual
▸ Bilingual MRDs are good resources for building
grouping into translation sets by matching context corpora and bilingual lexicons”. In: Proceedings of Machine
vectors via bilingual lexicons
⊳ Sense distinctions derived from corpus evidence
Translation Summit XI. Copenhagen, Denmark, 2007, multilingual lexicons
pp. 399–406. ▸ But MRDs have heterogeneous contents and structures
⊳ Produces many translation sets that contain
[6] K. Markó, S. Schulz, and U. Hahn. “Multilingual Lexical ⊳ Not all contain rich information (gloss, domain)
semantically related but not synonymous words, Acquisition by Bootstrapping Cognate Seed Lexicons”. In: (Especially so for under-resourced languages)
⊳ Different structures (sense granularity, distinctions)
e.g. ‘shoot’ and ‘bullet’ (lower precision)
⊳ 44 % precision based on evaluators’ opinions (75 % if
Proceedings of the International Conference on Recent
Advances in Natural Language Processing (RANLP) 2005. ▸ Lowest common denominator: list of source language
item → target language item(s)
inter-evaluator agreement is not required) Borovets, Bulgaria, 2005.
⊳ Does not handle multi-word expressions
▸ Construct multilingual lexicon using only bilingual lists

\documentclass[foldmark,a4paper] ▸ Markó, Schulz and Hahn [6] use cognate mappings to


derive new translation pairs, validate by processing
parallel corpora (medical domain)
⊳ Complex terms indexed on the level of sub-words
[7] M. Lafourcade. “Automatically Populating Acception Lexical
Database through Bilingual Dictionaries and Conceptual
Vectors”. In: Proceedings of PAPILLON-2002. Tokyo, Japan,
Aug. 2002.
One-time Inverse Consultation [1]
▸ Generates a bilingual lexicon for a new language pair
[8] C. Boitet, M. Mangeot, and G. Sérasset. “The PAPILLON
e.g. ‘pseudo⊕hypo⊕para⊕thyroid⊕ism’ from existing bilingual lists

{leaflet} ⊳ 46 % accuracy for each language pair ▸ Given bilingual lexicons L 1 –L 2 , L 2 –L 3 , L 3 –L 2 , generate
project: Cooperatively Building a Multilingual Lexical
Database to Derive Open Source Dictionaries & Lexicons”.
⊳ Requires large aligned thesaurus corpora (easier to In: Proceedings of the 2nd Workshop on NLP and XML bilingual lexicon L 1 –L 3
acquire for specialised domains?) (NLPXML’02). Taipei, Taiwan, 2002, pp. 1–3. ▸ Example: JP–EN, EN–MS, MS–EN lexicons ⇒ JP–MS
⊳ Cognate-based approach not applicable for language Japanese English Malay
pairs that are not closely related

\author ... % Meta-information


mark tanda
▸ Lafourcade [7]: compute contextual vectors for Contact p seal anjing laut
translation pairs based on gloss text and associated class stamp tera
labels from semantic hierarchy; compare vectors from Lian Tze Lim liantze@gmail.com
Bali Ranaivo-Malançon ranaivo@mmu.edu.my imprint
different bilingual lexicons to detect synonymy gauge
⊳ Resource requirements not available for all language Enya Kong Tang enyakong@mmu.edu.my
∣E1 ∩ E2 ∣
score(‘tera’) = 2 × =2× = 0.57
pairs, costly task of assigning class labels 2
∣E1 ∣ + ∣E2 ∣ 3+4
NLP-SIG, Faculty of Information Technology
Multimedia University, Cyberjaya, Malaysia.
http://fit.mmu.edu.my/sig/nlp/ ∴p↔ ‘tera’ is more likely to be valid

\begin{document}
\maketitle Merging Translation Triples into Sets
▸ Retain OTIC ‘middle’ language links
▸ For each ‘head’ language LI, filter only triples whose
Algorithm 1: Generating trilingual translation chains
forall the lexical items w h ∈ L 1 do
Wm ← translations of w h in L 2
Precision of 100 Random Translation Sets

0.85
α = 0.0
α = 0.2
α = 0.8
forall the w m ∈ Wm do
score exceed thresholds (See Algorithm 1)
▸ Merge all triples with common bilingual pairs

Precision
0.8
W t ← translations of w m in L 3

\section ... ▸ Malay–English–Chinese example:


ms–en Kamus Inggeris–Melayu untuk Penterjemah
en–zh XDict zh–en CC-CEDICT
forall the w t ∈ W t do
Output a translation triple (w h , w m , w t )
Wm r ← translations of w t in L 2
0.75

0.7

score(w h , w m , w t ) ←
β
0 0.2 0.4 0.6 0.8
∣common words in w m r ∈ Wm r and w|
(garang, ö ) 0.143

... % Leaflet contents


(garang, Ñ S) 0.048
∑ ▸ Precision increases with threshold parameters α and β
∣words in w m r ∈ Wm r ∣
(garang, ferocious, ö)
(garang, bold, ÑS)
(garang, fierce, ö) w∈Wm
▸ Precision generally around 0.70–0.82; max 0.86
▸ Most false positives are not ranked at top of the list
end
∑w∈Wm score(w h , w, w t )
(garang, — S) 0.048
▸ Many errors caused by incorrect POS assignments
(garang, À È) 0.125
(garang, bold, —S) score(w h , w t ) ← 2 ×
(garang, jazzy, ÀÈ) ∣Wm ∣ + ∣Wm r ∣

\end{document} (garang, ' Æ) 0.111


(garang, bold, 'Æ)
⋮ end
X ← maxw t ∈Wt score(w h , w t )
forall the distinct translation pairs (w h , w t ) do
if score(w h , w t ) ≥ αX or (score(w h , w t ))2 ≥ βX
F1 and Rand Index of Selected Translation Sets
▸ False positives will frequently arise when ‘middle’
language members are polysemous, e.g. ‘plant’, ‘target’
bengkeng then ▸ Evaluate accuracy of selected sets with polysemous
(garang, ferocious, ö) Place w h ∈ L 1 , w m ∈ L 2 , w t ∈ L 3 from all triples
Ð→
fierce ‘middle’ language members
(garang, fierce, ö) garang (w h , w ... , w t ) into same translation set
Record score(w h , w t ) and score(w h , w m , w t ) Precision =
(bengkeng, fierce, ö) TP
TP + FP
ferocious ö
else
Discard all triples (w h , w ... , w t ) Recall =
TP
Adding More Languages // The sets are now grouped by TP + FN
(w h , w t ) 2 × Precision × Recall
▸ Construct L 1 –L 2 –L 4 triples F1 =
▸ Add L 4 members to existing L 1 –L 2 –L 3 clusters with end Precision + Recall
TP + TN
RI =
common L 1 & L 2 members end
▸ Example: Malay–English–Chinese + French, using end TP + FP + FN + TN
‘ready-made’ triples from FeM Merge all sets containing triples with same (w h , w m )
Merge all sets containing triples with same (w m , w t )
bengkeng
Test Rand Index F1 Best accuracy when
fierce (cruel, ferocious, garang) word min max min max α β
garang + (féroce, fierce, garang)
Algorithm 2: Adding L k+1 to multilingual lexicon L of ‘bank’ 0.417 0.611 0.588 0.632 0.6 0.4
{L 1 , L 2 , . . . , L k }
ferocious ö ‘plant’ 0.818 0.927 0.809 0.913 0.6 0.2
Ð→

T ← translation triples of L k+1 , L m , L n generated by


‘target’ 0.821 1.000 0.902 1.000 0.4 0.2
Algorithm 1 where L m , L n ∈ {L 1 , L 2 , . . . , L k }
‘letter’ 0.709 0.818 0.724 0.792 0.8 0.2

forall the (w L m , w L n , w L k+1 ) ∈ T do


féroce
bengkeng cruel ▸ F1 and RI increases with α and β
Add w L k+1 to all entries in L that contains both w L m and
▸ But may decrease when they are too high and reject
fierce garang wLn
valid members (false negatives)
end
ferocious ö

LianTze Lim (Ph.D.) | cbna 32 / 57


LATEX: More Than Just Academic Papers and Theses | Document Types

Fillable PDF Forms

\usepackage{hyperref}
... % various settings skipped
\TextField{Name:}\\
\TextField{Affiliation:}\\
\ChoiceMenu[radio=true]
{Are you a:}{Student, Academic}\\
Interest:
\CheckBox{Security}
\CheckBox{Systems}
\CheckBox{User space}\\
\TextField[multiline=true]
{Comments:}\\

LianTze Lim (Ph.D.) | cbna 33 / 57


LATEX: More Than Just Academic Papers and Theses | Document Types

Fillable PDF Forms (cont’d)

Use with caution!


poppler-based viewers (evince, xpdf, okular)
Problem displaying and saving radio/check boxes correctly
Saved forms can’t be opened by other viewers
Adobe Reader
Cannot save filled form as PDF unless Acrobat is installed
Only as field-and-value text file
Can provide “Submit” button for submission to a URL
Or print hard copy of filled form!
PDF XChange Viewer
Best freeware for filling and saving LATEX-created forms
Windows only
Not OSS

LianTze Lim (Ph.D.) | cbna 34 / 57


LATEX: More Than Just Academic Papers and Theses | Document Types

Flash Cards

\documentclass[avery5388,frame]
{flashcards}
\cardfrontstyle{headings}
\cardfrontfoot{Linux} Security

A digital representation of information that


\begin{document} identifies you and is issued by Cas, which are
Certificate
often a trusted third party (TTP).
\begin{flashcard}[Security]
{Certificate} Linux

... Security

\end{flashcard} Access to an object is restricted based on the


sensitivity of the object (defined by the label
MAC (Mandatory Access that is assigned), and granted through
Control) authorization (Clearance) to access that level of
\begin{flashcard}[Security] data.

{MAC ...} Linux

...
\end{flashcard}
\end{document}

LianTze Lim (Ph.D.) | cbna 35 / 57


LATEX: More Than Just Academic Papers and Theses | Document Types

Examination Paper

\documentclass{exam}
...
\begin{questions}\printanswers
1. What is Paul McCartney’s middle name? (5)
\question[5]
A. John B. Paul C. Ringo D. James
What is Paul McCartney's middle name?
\begin{oneparchoices} 2. What was the Beatles’ first single in 1962? (10)
\choice John \CorrectChoice Paul
\choice Ringo \choice James Solution: Love Me Do
\end{oneparchoices}
3. (a) What was George’s inspiration for ‘While (5)
\question[10] What was the Beatles' first My Guitar Gently Weeps’?
,→ single in 1962?
\begin{solution}Love Me Do\end{solution} Solution: He opened a random book
and saw the words “gently weep”.

\question
(b) Who guest-performed for the song and why? (5)
\begin{parts}
\part[5] What was George's inspiration for Solution: Eric Clapton; he wanted a
,→ `While My Guitar Gently Weeps'? spiffy guitar solo.
\begin{solution}
He opened a random book and saw the words
,→ ` `gently weep''.
\end{solution}
...
\end{questions}

LianTze Lim (Ph.D.) | cbna 36 / 57


LATEX: More Than Just Academic Papers and Theses | Special Material

Contents

1 What are TEX, LATEX and Friends?

2 Document Types

3 Special Material

4 Wrapping Up

LianTze Lim (Ph.D.) | cbna 37 / 57


LATEX: More Than Just Academic Papers and Theses | Special Material

Mathematics

(1) relates the golden ratio and the Fibonacci


√ series.
1
Recall that the golden ratio, ϕ = 2 (1 + 5).

X (−1)n+1
ϕ=1+ (1)
n=1
Fn Fn+1

\eqref{eq:gratio} relates the golden ratio and the Fibonacci series.


Recall that the golden ratio, $\phi = \frac{1}{2} (1 + \sqrt{5})$.

\begin{equation}\label{eq:gratio}
\phi = 1 + \sum^{\infty} _{n=1}
\frac{ (-1)^{n+1} }{ F_n F_{n+1} }
\end{equation}

LianTze Lim (Ph.D.) | cbna 38 / 57


LATEX: More Than Just Academic Papers and Theses | Special Material

Chemical Equations and Molecules

H
O
– –
+2 OH +2 OH
Zn2+ −
−−
) −−
−−
−*
+
− Zn(OH)2 ↓ −
−−
) −−
−−− [Zn(OH)4 ]
−* 2–
H C C
+2 H amphoteres Hydroxid +2H + Hydroxozikat
H
H

\usepackage[version=3]{mhchem} % sufficient for chemical equations


\usepackage{chemfig} % for 2-D molecule drawings
...
\ce{Zn^2+ <=>[\ce{+ 2OH-}][\ce{+ 2H+}]
$\underset{\text{amphoteres Hydroxid}}{\ce{Zn(OH)2 v}}$
<=> C[+2OH-][{+ 2H+}]
$\underset{\text{Hydroxozikat}}{\cf{[Zn(OH)4]^2-}}$ }

\chemfig{H-C(-[2]H)(-[6]H)-C(-[7]H)=[1]O}

LianTze Lim (Ph.D.) | cbna 39 / 57


LATEX: More Than Just Academic Papers and Theses | Special Material

Linguistics

S
(1) %*Wen liebt seine Mutter?
Whom loves his mother NP VP
‘Who does his mother
Pron V NP

\usepackage{linguex,qtree}
He kicked Det N
...
\ex the ball
\begingl
\gla \%*Wen liebt seine Mutter?//
\glb Whom loves his mother// \usepackage{qtree}
\glc `Who does his mother love?'// ...
\endgl \Tree [ .S [.NP [.Pron He ] ] [.VP
\xe ,→ [.V kicked ] [.NP [.Det the ] [.
,→ N ball ] ] ] ]

LianTze Lim (Ph.D.) | cbna 40 / 57


LATEX: More Than Just Academic Papers and Theses | Special Material

Program Listings
\usepackage{listings,xcolor}
...
\begin{lstlisting}
[language=C,columns=fullflexible,
basicstyle=\ttfamily, #include <stdio.h>
keywordstyle=\bfseries\color{red},
commentstyle=\sffamily\color{green}, /∗
stringstyle=\rmfamily\color{orange}] | Prints "hello world"
#include <stdio.h> ∗/
/* int main(void)
| Prints "hello world" {
*/ printf("hello,␣world\n");
int main(void)
return 0;
{
}
printf("hello, world\n");
return 0;
}
\end{lstlisting}

LianTze Lim (Ph.D.) | cbna 41 / 57


LATEX: More Than Just Academic Papers and Theses | Special Material

Network Protocols

\usepackage{bytefield} 0 7 8 15
... 
\begin{bytefield}{16}
Tag Mask 
Header
\bitheader{0,7,8,15} \\
Source Destination 
\begin{rightwordgroup}{Header}
\bitbox{4}{Tag} & \bitbox{12}{Mask} \\
\bitbox{8}{Source} &
\bitbox{8}{Destination} Data
\end{rightwordgroup} \\
\wordbox{3}{Data}
\end{bytefield}

LianTze Lim (Ph.D.) | cbna 42 / 57


LATEX: More Than Just Academic Papers and Theses | Special Material

Life Sciences
first case (see text)

AQP1.PRO TLGLLLSCQISILRAVMYIIAQCVGAIVASAIL 112
AQP2.PRO TVACLVGCHVSFLRAAFYVAAQLLGAVAGAAIL 104
AQP3.PRO TFAMCFLAREPWIKLPIYTLAQTLGAFLGAGIV 112
AQP4.PRO TVAMVCTRKISIAKSVFYITAQCLGAIIGAGIL 133
AQP5.PRO TLALLIGNQISLLRAVFYVAAQLVGAIAGAGIL 105

second case (see text)

\usepackage{texshade} % for nucleotide and peptide alignments


...
\begin{texshade}{AQPpro.MSF.txt}
\shadingmode{similar}
\threshold[80]{50}
\setends{1}{80..112}
\hideconsensus
\feature{top}{1}{93..93}{fill:$\downarrow$}{first case (see text)}
\feature{bottom}{1}{98..98}{fill:$\uparrow$}{second case (see text)}
\end{texshade}

LianTze Lim (Ph.D.) | cbna 43 / 57


LATEX: More Than Just Academic Papers and Theses | Special Material

Circuits and SI Units


10 Ω
A
vx
3.45 × 104 V2 lm3 F−1
S
20 Ω 5Ω 5 vx 40 km/h, 85 km/h and 103 km/h
B

\usepackage{siunitx}
\usepackage[siunitx]{circuitikz}
...
\begin{circuitikz}
\draw (0,0) node[anchor=east] {B}
to[short, o-*] (1,0) to[R=20<\ohm>, *-*] (1,2)
to[R=10<\ohm>, v=$v_x$] (3,2) -- (4,2)
to[ cI=$\frac{\si{\siemens}}{5} v_x$, *-*] (4,0) -- (3,0)
to[R=5<\ohm>, *-*] (3,2)
(3,0) -- (1,0) (1,2) to[short, -o] (0,2) node[anchor=east]{A}
;\end{circuitikz}

\SI{3.45d4}{\square\volt\cubic\lumen\per\farad}
\SIlist[per-mode=symbol]{40;85;103}{\kilo\metre\per\hour}

LianTze Lim (Ph.D.) | cbna 44 / 57


LATEX: More Than Just Academic Papers and Theses | Special Material

Meh, What Good is That? Can’t Use it Anywhere Else.

Actually, you can.

\usepackage[active,tightpage]{preview}
\PreviewEnvironment{texshade}
...
\begin{texshade}
...
\end{texshade}

Run pdflatex → cropped PDF containing only contents of texshade


ImageMagick: convert -depth 150 texshade.pdf texshade.png
Multiple environments → multi-page PDF and multiple PNGs

LianTze Lim (Ph.D.) | cbna 45 / 57


LATEX: More Than Just Academic Papers and Theses | Special Material

Bar Codes
ISBN 978-3-86541-114-3

L E 2 8 H S 9 Z

9 781860 742712 9 783865 411143

\usepackage{auto-pst-pdf} % Needed if running pdflatex; must use option -shell-escape


\usepackage{pstricks,pst-barcode}
...
\begin{pspicture}
\psbarcode{MECARD:N:Malaysia Open Source Conference...}{eclevel=L}{qrcode}
\psbarcode{9781860742712}{includetext guardwhitespace}{ean13}
\psbarcode{978-3-86541-114}{includetext guardwhitespace}{isbn}
\psbarcode{LE28HS9Z}{includetext}{royalmail}
\psbarcode{^453^178^121^239}{columns=2 rows=10}{pdf417}
\end{pspicture}

LianTze Lim (Ph.D.) | cbna 46 / 57


LATEX: More Than Just Academic Papers and Theses | Special Material

Graph Plots
L2
10−1 Lmax
10−2

10−3

10−4

10−5

101 102 103 104


Dof

\usepackage{pgfplots}
...
\begin{tikzpicture}
\begin{loglogaxis}[xlabel=Dof]
\addplot table[x=dof,y=L2]{datafile.dat}; \addlegendentry{$L_2$};
\addplot table[x=dof,y=Lmax]{datafile.dat}; \addlegendentry{$L_\text{max}$};
\end{loglogaxis}
\end{tikzpicture}

LianTze Lim (Ph.D.) | cbna 47 / 57


LATEX: More Than Just Academic Papers and Theses | Special Material

Spreadsheets
(Seriously, use a proper spreadsheet application for complex stuff.)

Year ending Mar 31 2009 2008 2007


Revenue 14580.20 11900.40 8290.30
Cost of sales 6740.20 5650.10 4524.20
Gross profit 7840.00 6250.30 3766.10

\STautoround*{2}
\begin{spreadtab}{{tabular}{l rrr}}
@Year ending Mar 31 & @2009 & @2008 & @2007\\ \hline
@Revenue & 14580.2 & 11900.4 & 8290.3\\
@Cost of sales & 6740.2 & 5650.1 & 4524.2\\ \cline{2-4}
@\emph{Gross profit} & \STcopy{>}{b2-b3} & &\\ \cline{2-4}
\end{spreadtab}

LianTze Lim (Ph.D.) | cbna 48 / 57


LATEX: More Than Just Academic Papers and Theses | Special Material

Gantt Charts
2010 2011
Preliminary Project 100% complete
Objective 1
Task A
Task B
Objective 2
Task A
Task B

\usepackage{pgfgantt}
...
\begin{ganttchart}[...settings...]{1}{16}
\gantttitle{2010}{4} \gantttitle{2011}{12} \\
\ganttbar[progress=100]{Preliminary Project}{1}{4} \\
\ganttgroup{Objective 1}{5}{16} \\
\ganttbar[progress=4, name=T1A]{Task A}{5}{10} \\
\ganttlinkedbar[progress=0]{Task B}{11}{16} \\
...
\end{ganttchart}

LianTze Lim (Ph.D.) | cbna 49 / 57


LATEX: More Than Just Academic Papers and Theses | Special Material

‘Smart Diagrams’

Assess
Renew

Implement
Plan Planning Cycle Renew

Plan

Implement

Assess

\usepackage{smartdiagram} \usepackage{smartdiagram}
\smartdiagram[bubble diagram]{ \smartdiagram
Planning Cycle,Assess,Plan, [priority descriptive diagram]{
Implement,Renew} Assess,Plan,Implement,Renew}

LianTze Lim (Ph.D.) | cbna 50 / 57


LATEX: More Than Just Academic Papers and Theses | Special Material

Chess games

1 e4 e5 2 Nf3 Nc6 3 Bb5 a6

\usepackage[skaknew]%
8
rZblkans
{skak,chessboard}
7
ZpopZpop
...
6
pZnZ0Z0Z
\newgame 5
ZBZ0o0Z0
\mainline{1. e4 e5 2. Nf3 Nc6 3.
,→Bb5 a6}
4
0Z0ZPZ0Z
\chessboard[smallboard]
3
Z0Z0ZNZ0
2
POPO0OPO
1
SNAQJ0ZR
a b c d e f g h

LianTze Lim (Ph.D.) | cbna 51 / 57


LATEX: More Than Just Academic Papers and Theses | Special Material

Crossword Puzzles
1

2 3 4
Across: 1 unit of measure Down: 1 η 3 unit of meas-
5 2 ∗ 5 sectioning unit ure 4 nonproportional font

\usepackage{cwpuzzle} \Clue{2}{AST}{\(\ast\)}
... \Clue{5}{PART}{sectioning unit}
\begin{Puzzle}{5}{3} \end{PuzzleClues}
|* |* |[1]E|X |* |. \begin{PuzzleClues}{
|[2]A|[3]S|T |* |[4]T|. \textbf{Down:} }
|* |[5]P|A |R |T |. \Clue{1}{ETA}{\(\eta\)}
\end{Puzzle} \Clue{3}{SP}{unit of measure}
\begin{PuzzleClues}{ \Clue{4}{TT}{nonproportional font}
\textbf{Across:} } \end{PuzzleClues}
\Clue{1}{EX}{unit of measure}

LianTze Lim (Ph.D.) | cbna 52 / 57


LATEX: More Than Just Academic Papers and Theses | Special Material

Song Books with Guitar Tabs

C G Am F
Country road, take me home, to the place I belong.

C G F C
West Virginia, mountain momma, take me home, country road.

\usepackage{gchords,guitar}
...
\begin{guitar}
\newcommand{\CMaj}{\chord{t}{n,p3,p2,n,p1,n}{C}}
\newcommand{\Amin}...
Country [\CMaj]road, take me [\GMaj]home, ...
\end{guitar}

LianTze Lim (Ph.D.) | cbna 53 / 57


LATEX: More Than Just Academic Papers and Theses | Wrapping Up

Contents

1 What are TEX, LATEX and Friends?

2 Document Types

3 Special Material

4 Wrapping Up

LianTze Lim (Ph.D.) | cbna 54 / 57


LATEX: More Than Just Academic Papers and Theses | Wrapping Up

Summary

LATEX
a document preparation system
professional quality typesetting output
Output artefacts
Academic: papers, theses, books
Dedicated document types
Domain-specific material
Usage scenario
Direct authoring
Automatic generation (via scripts etc)
As back-end of other applications

LianTze Lim (Ph.D.) | cbna 55 / 57


LATEX: More Than Just Academic Papers and Theses | Wrapping Up

감사합니다
ध यवाद
Ευχαριστώ

Terima kasih 谢谢 Danke


Grazie
qatlho’ Obrigado
Спасибо
Thank you நன்றி
ขอบคุณ
Gracias Xin cảm ơn
9C 4#5$Ì
ありがとう ‫ﺷﻜﺮا‬ Merçi

Go raibh maith agaibh


Tapadh leibh
ཐུགས་རྗེ་ཆེ་།

Questions? liantze@gmail.com, support@overleaf.com


http://tex.stackexchange.com

LianTze Lim (Ph.D.) | cbna 56 / 57


LATEX: More Than Just Academic Papers and Theses | Wrapping Up

Want to download this deck?

LianTze Lim (Ph.D.) | cbna 57 / 57

You might also like