You are on page 1of 35

Introduction to XELATEX

An alternative document preparation system.


Nikolaos Dimos

July 5, 2013

Introduction to XELATEX I

Contents
1

Introduction
1.1 What is LATEX? . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
1.2 Editors . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

1
1
1

Parts of a document

Creating a document
3.1 Sections and paragraphs . . . . . . . . . . . .
3.2 Lists . . . . . . . . . . . . . . . . . . . . . . . .
3.3 Figures . . . . . . . . . . . . . . . . . . . . . .
3.3.1 Simple oating gure . . . . . . . . . .
3.3.2 Floating gure with subgures . . . .
3.4 Tables . . . . . . . . . . . . . . . . . . . . . . .
3.5 Table of contents, gures, listings, and tables. .
3.6 Choosing fonts . . . . . . . . . . . . . . . . . .
3.7 Bibliography, citation and cross-referencing .
3.7.1 Cross-referencing . . . . . . . . . . . .
3.7.2 Bibliography and citation . . . . . . .

.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.

3
4
5
5
5
8
9
11
12
13
13
13

Typesetting Mathematics

14

Example tool setups


5.1 Windows . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
5.1.1 MiKTeX . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

14
14
14

A RootyHelix

15

B Source code of this document

16

Introduction to XELATEX: An alternative document preparation system. by Nikolaos Dimos


is licensed under a Creative Commons Aribution-ShareAlike 3.0 Unported License.

II List of Tables

List of Figures
1
2
3
4
5
6
7

e smallest document! . . . . . . . . . . . .
Output of the sectioning commands. . . . . .
e available ways of creating lists in LATEX. .
Enchanced description environment. . . . .
A simple picture include. . . . . . . . . . . .
Subgure output . . . . . . . . . . . . . . . .
Root helix . . . . . . . . . . . . . . . . . . .

.
.
.
.
.
.
.

.
.
.
.
.
.
.

.
.
.
.
.
.
.

.
.
.
.
.
.
.

.
.
.
.
.
.
.

.
.
.
.
.
.
.

.
.
.
.
.
.
.

.
.
.
.
.
.
.

.
.
.
.
.
.
.

.
.
.
.
.
.
.

.
.
.
.
.
.
.

.
.
.
.
.
.
.

.
.
.
.
.
.
.

.
.
.
.
.
.
.

.
.
.
.
.
.
.

.
.
.
.
.
.
.

.
.
.
.
.
.
.

.
.
.
.
.
.
.

.
.
.
.
.
.
.

2
4
6
7
7
8
15

1
Top Maer . . . . . . . . . . . . . . . . . . . . . . .
2
Showcase of sectioning commands . . . . . . . . . .
3
A simple picture include. . . . . . . . . . . . . . . .
4
Code to generate subgure. . . . . . . . . . . . . . .
5
Code to generate Table. . . . . . . . . . . . . . . . .
6
Code to generate Table of Contents and other lists
7
Font seings . . . . . . . . . . . . . . . . . . . . . .
8
Bibliography seings . . . . . . . . . . . . . . . . .
./latexLecture.tex . . . . . . . . . . . . . . . . . . . . . . .

.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.

3
4
7
9
11
11
12
13
16

A Sample table . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

11

Listings

List of Tables
1

Introduction to XELATEX: An alternative document preparation system. by Nikolaos Dimos


is licensed under a Creative Commons Aribution-ShareAlike 3.0 Unported License.

Introduction to XELATEX 1

1
1.1

Introduction
What is LATEX?

LATEX is a document markup language and a document preparation system. LATEX provides
some macros in order to use the underlying TEX programming language. XELATEX is a newer
version of this language which supports:
Unicode encoding of text. is means that you can write:
English: Hello world!,
Greek: !,
Arabic:
!

and Polytonic Greek:


in the same text without changing the encoding of the document itself.
XELATEX also supports PDF le creation on its own which means that you dont have to
compile your text using other programs in addition to xelatex.
XELATEX also brought support of the usage of TrueType and OpenType fonts that are
installed on your system. is means that you can choose any of the installed fonts to
use them in your document. is works prey much like in every modern document
processing application.

1.2

Editors

Before moving forward to the document authoring part we should note that a TEX and
consequently LATEX and XELATEX document can be wrien in any editor you like. From the
most simple command line editor in UNIX systems with no graphical environment at all, to
the most complex editors available for every OS out there. Some examples of editors would
be:
Simple ones: Although they may oer some code highlighting and indentation, nothing
more is provided. No auto-complete of commands which means that you should know
the commands to type them fully. No shortcuts for compiling, which means that you
should be able to compile your document from a command line.
Other markup languages are HTML, XML, SGML,
Other document preparation systems are the OpenOce.org Writer, LibreOce Writer, Microso Word,
IBM Lotus Word Pro
Macros are short, easy to remember commands that invoke some other commands in order to achieve a
result.

Introduction to XELATEX: An alternative document preparation system. by Nikolaos Dimos


is licensed under a Creative Commons Aribution-ShareAlike 3.0 Unported License.

2 2 Parts of a document
nano
Notepad++
gedit
Middle-class ones: ey oer command auto complete, spell checking options, shortcut
creation, automation of the compilation process.
Texmaker
TeXstudio. If you look at TeXstudio you will see how much it looks alike the
Texmaker. is is because TeXstudio is an extended version of Texmaker which
can add words in the spelling dictionary. To some people this may be weird, and
they would say that this should be in Texmaker in the rst place.
But this is exactly where open-source development comes in. e developers of
Texmaker for some reason they didnt implement this function. Someone else
found Texmaker interesting us a project and also had the background to program
this functionality in. So they took the code and added in their implementation and
created a new piece of soware which is again free and open for anyone to modify.
Kile
TeXnicCenter
WYSIWYG ones: ese oer a similar experience to using more mainstream document
processing applications such as Microso Word, LibreOce Writer, OpenOce Writer,
AbiWord and iWork Pages.
LyX
For a more comprehensive list of editor you can take a look at: Comparison of TEX editors[1].

Parts of a document

e code that is shown in Fig. 1 produces


the smallest and simplest document you can
create. Its the traditional Hello world! example for XELATEX. In the rst line you see
the \documentclass[]{} where we put
the initial characteristics of the document.
Inside the brackets ([]) there is the text
11pt,oneside which means that the default size of the text in the document will be

Code:
1

\ d o c u m e n t c l a s s [ 1 1 pt , o n e s i d e ] { a r t i c l e }

\ b e g i n { document }
H e l lo world !
\ end { document }

Output:
Hello world!
Figure 1: e smallest document!

Introduction to XELATEX: An alternative document preparation system. by Nikolaos Dimos


is licensed under a Creative Commons Aribution-ShareAlike 3.0 Unported License.

Introduction to XELATEX 3
11pt and that the document will be created as
an oneside document. Other document class
options may be draft which spaces the text with bigger inter-line spaces and omits images
by replacing them with a place-holder.
Aer the \documentclass[]{} a document must always have at least the following
begin-end part: \begin{document}\end{document}.Generally, a paern should be visible.
ere are some word preceded by \ and followed by {} these are the commands that are
used by LATEX in order to dene dierent parts of the document.
e part of the code that is between the document class denition and the \begin{document}
is the preamble. In that space you will include any packages that you may use when you create your documents. We will get back to that at a later point. Another part of the document
is the Top Maer which is some commands that you would use to create the title page for
your document. e top maer of this document that you are reading is shown in Listing 1.
You can see that we begin a titlepage and then we add the authors, the title and the date.
ere are also some aesthetic enhancements which will be covered later. ere are some
commands that deal with font sizes (\Huge, \LARGE) and some formaing commands like \\
which inserts a new line, it is equivalent to pressing Enter . But other than that the commands
are prey self-explanatory.
1

11

\ begin { t i t l e p a g e }
\ a u t h o r { Dimos , N i k o l a o s and P o u p a k i s , S t a v r o s }
\ t i t l e { { \ Huge I n t r o d u c t i o n t o \ XeLaTeX { } } \ \
{ \ LARGE An a l t e r n a t i v e document p r e p a r a t i o n s y s t e m . } }
\ date { \ v f i l l \ today }
\ maketitle
\ t h i s p a g e s t y l e { empty }
\ end { t i t l e p a g e }

Listing 1: Top Maer

Creating a document

From the previous examples you should be able now to create a document that says Hello
world! and has a title page. is section will describe what else you need to do in order to
create the rest of the document structure. is section will include instructions to generate:
1. Sections and paragraphs
2. Lists
3. Figures
4. Tables
Introduction to XELATEX: An alternative document preparation system. by Nikolaos Dimos
is licensed under a Creative Commons Aribution-ShareAlike 3.0 Unported License.

4 3 Creating a document
5. Table of contents, Table of Figures
6. Seing the font to be used
7. Adding bibliography

3.1

Sections and paragraphs

e basic structure of the document and the guidance to the reader is given by assigning a
title to bigger or smaller parts of a piece of text. In order to do this LATEX provides some
commands to create the basic sectioning headers.
1

\ p a r t { What a n i c e p a r t ! }
\ c h a p t e r { What a n i c e c h a p t e r ! }
\ section { This i s a s e c t i o n }
\ s u b s e c t i o n {A s u b s e c t i o n then f o l l o w s }
\ s u b s u b s e c t i o n {W00 t ! A S u b s u b s e c t i o n ! }
\ p a r a g r a p h { A p a r a g r a p h now : } No more s u b s u b s u b s u b \ l d o t s s u b s e c t i o n s
\ s u b p a r a g r a p h { But we have : } a S u b p a r a g r a p h !

Listing 2: Showcase of sectioning commands

Figure 2: Output of the sectioning commands.


e basic sectioning commands are shown in Listing 2. Not all of them can be used in any
type of document. For example, \chapter can only be used in books and reports. So in order
to be able to use \chapter, you should have dened in the document class the document as
either a book or a report like this: \documentclass[]{book}. Figure 2 shows the output
of the code quoted in Listing 2. Each sectioning command takes as input some text that is
then used appropriately to name the part/chapter/section/.
Introduction to XELATEX: An alternative document preparation system. by Nikolaos Dimos
is licensed under a Creative Commons Aribution-ShareAlike 3.0 Unported License.

Introduction to XELATEX 5

3.2

Lists

Another commonly used feature in texts, especially in academia, are the lists. Lists are used
in order to dene some key aspects of a problem and make a clear approach on them which
can be revisited at any time oering very good user experience.
In Fig. 3 you can see the code that is required (3a, 3c, 3e) in order to produce the respective
list style (3b, 3d, 3f). e basic concept is that you only need to dene if you want a bullet style
list (itemize), a numbered list (enumerate), or a list with your dened descriptions (description).
An aesthetic improvement to the description style list would be to indent the text that follows
the description. is could look like the example in Fig. 4.

3.3

Figures

Another very common thing in documents is the inclusion of gures. One way to put pictures
in a document is as a wrapped object with the picture oating on one side of the text and the
text wrapped around it. is is good only for small pictures that will not take over more than
50% of the pages width in order to appear in a readable resolution.

3.3.1

Simple oating gure

Another way, and the most common one, is to include pictures as oating objects. Floating
objects can be set to always oat a the top or the boom of the page, or the can be explicitly
set to oat at the current position that they are dened. Generally LATEX will try to position
oats in a way that they dont create large blank spaces in the text so that it wont disrupt the
reading. But oating seings can also be dened by other institutions. For example various
journals will have their own template that the authors should follow. For example, if you
write a paper for an IEEE conference, IEEEs template will always put your oats on the top
of the page regardless of where you include them in the text. is creates a concrete way of
delivering papers for IEEE conferences and everyone aending them will expect them to be
in that way. Using LATEX and a template of the journal you want your publication to look alike
you just create the document as you would with any other template and this makes sure that
the oats, among the other components of the document, will be placed appropriately.
In order to be able to include images and other graphics you have to include the graphicx
package at the preamble of your document. is can be done using the following command:
\usepackage{graphicx}.
User experience in the terms of; a user who gets back to a list of items will seek to nd condensed information
in a structured way which is easy to grasp.

Introduction to XELATEX: An alternative document preparation system. by Nikolaos Dimos


is licensed under a Creative Commons Aribution-ShareAlike 3.0 Unported License.

6 3 Creating a document
\begin{itemize}
\item 1st item
\begin{itemize}
\item 1st nested item
\end{itemize}
\item 2nd item
\begin{itemize}
\item 2nd nested item
\end{itemize}
\end{itemize}
(a) Input: e itemize environment

\begin{enumerate}
\item 1st item
\begin{enumerate}
\item 1st nested item
\end{enumerate}
\item 2nd item
\begin{enumerate}
\item 2nd nested item
\end{enumerate}
\end{enumerate}
(c) Input: e enumerate environment

\begin{enumerate}
\item 1st item
\begin{enumerate}
\item 1st nested item
\end{enumerate}
\item 2nd item
\begin{enumerate}
\item 2nd nested item
\end{enumerate}
\end{enumerate}
(e) Input: e description environment

1st item
1st nested item
2nd item
2nd nested item
(b) Output:e itemize environment

1. 1st item
(a) 1st nested item
2. 2nd item
(a) 2nd nested item
(d) Output:e itemize environment

1. 1st item
(a) 1st nested item
2. 2nd item
(a) 2nd nested item
(f) Output:e itemize environment

Figure 3: e available ways of creating lists in LATEX.

Introduction to XELATEX: An alternative document preparation system. by Nikolaos Dimos


is licensed under a Creative Commons Aribution-ShareAlike 3.0 Unported License.

Introduction to XELATEX 7
First
e rst item
1

\ begin { d e s c r i p t i o n }
\ item [ F i r s t ] \ h f i l l \ \
The f i r s t i t e m
\ i t e m [ Second ] \ h f i l l \ \
The s e c o n d i t e m
\ item [ Third ] \ h f i l l \ \
The t h i r d e t c \ l d o t s
\ end { d e s c r i p t i o n }

(a) Input

Second
e second item
ird
e third etc
(b) Output

Figure 4: An aesthetic enchancement of the description environment.

Figure 5: A simple picture include.

\ begin { f i g u r e } [ htbp ]
\ centering
\ resizebox { 0 . 5 \ textwidth } { ! } {
\ i n c l u d e g r a p h i c s { . / images /020612 4. jpg }
}
\ caption {A simple p i c t u r e i n c l u d e . } \ l a b e l { f i g : s i m p l e P i c t u r e I n c l u d e }
\ end { f i g u r e }

Listing 3: A simple picture include.


In Listing 3 you can see the code that is required to insert an image in a document. e
image that is inserted using that code snippet is shown in 5. In the code we see the following
commands:
\begin{figure}\end{figure}: With this you create a new oating gure environment. Between those two lines the appropriate code to create the gure should be
entered.
e main parts of a gure are:
e \includegraphics{} command which is the command that actually brings
the picture in the document.
e \caption{} command which sets the caption to be shown under the picture.
and the \label{}, which always follows \caption{}, which creates a label for
this picture in order to be cross-referenced later anywhere in the document.
Introduction to XELATEX: An alternative document preparation system. by Nikolaos Dimos
is licensed under a Creative Commons Aribution-ShareAlike 3.0 Unported License.

8 3 Creating a document
ere are also some other commands here that help with the placement of the picture
so that it wont go out of limits.

\centering is used to make whatever is inside the \begin{figure}\end{figure}


to be horizontally aligned to the center of the page.
\resizebox{0.5\textwidth}{!}{\includegraphics{}} is used to resize the
image to the a width equivalent to the 50% of the texts width. e resizebox command generally works like \resizebox{width}{height}{image to be
resized}. You should notice that in the eld where we should have put the
height we just have ! this is done so that resizebox will scale the picture only by
width retaining the aspect ratio of the image.

3.3.2

Floating gure with subgures

In order to create a group of gures like the one shown in Fig. 6 you would have to use the
code that is shown in Listing 4. But before writing the subgure code you should include
in the preamble of your document the package subg. In order to include this package you
should use the command \usepackage{subfig}.
In order to create such a gure with one or more subgures you have to create a gure
environment like we do in Listing 4, Line 1. e you have to create two subgure environments
(\begin{subfigure}\end{subfigure}) inside which you will include the images like you
would normally do as if you were to include a single oating image. You are also able to assign
captions and labels to the subgures so you can refer directly to them from the document.

(a) e rst picture

(b) e second picture

Figure 6: A caption that is about all the pictures in the gure. Lorem ipsum dolor sit amet,
consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore
magna aliqua.

Introduction to XELATEX: An alternative document preparation system. by Nikolaos Dimos


is licensed under a Creative Commons Aribution-ShareAlike 3.0 Unported License.

Introduction to XELATEX 9
\ begin { f i g u r e } [ htbp ]
\ centering
\ begin { s u b f i g u r e } [ t ] { 0 . 3 \ textwidth }
\ centering
\ resizebox { 1 \ textwidth } { ! } {
\ i n c l u d e g r a p h i c s { . / images /020612 4. jpg }
}
\ c a p t i o n { The f i r s t p i c t u r e }
\ label { fig : firstPicInSubfig }
\ end { s u b f i g u r e } %
\ quad %add d e s i r e d s p a c i n g between images , e . g . ~ , \ quad , \ qquad e t c .
% ( o r a b l a n k l i n e t o f o r c e t h e s u b f i g u r e o n t o a new l i n e )
\ begin { s u b f i g u r e } [ t ] { 0 . 3 \ textwidth }
\ centering
\ resizebox { \ textwidth } { ! } {
\ i n c l u d e g r a p h i c s { . / images /020612 4. jpg }
}
\ c a p t i o n { The s e c o n d p i c t u r e }
\ label { fig : secondPicInSubfig }
\ end { s u b f i g u r e }
\ caption [ Subfigure output ] {A caption t h a t i s about a l l the p i c t u r e s in the
f i g u r e . Lorem ipsum d o l o r s i t amet , c o n s e c t e t u r a d i p i s i c i n g e l i t , s e d
do eiusmod tempor i n c i d i d u n t u t l a b o r e e t d o l o r e magna a l i q u a . }
\ label { f i g : subfigDemonstration }
\ end { f i g u r e }

11

13

15

17

19

21

23

25

Listing 4: e code to generate the subgure shown in Fig. 6

3.4

Tables

Another way to present data except from importing gures is creating tables. In Listing 5 you
can see the code that generates Table 1. You can see that the table environment is similar to
the gure. We begin a table environment and then inside we insert the following commands:
We see again the \centering command which is used to center the table in the page.
Aer that we see an environment in which we will dene the table. e tabular environment. You can see that we again \begin\end the tabular environment as any
other environment.
e tabular environment has some arguments though, {|r|l|}. ese arguments dene the number of columns and the looks of them.
Having two leers inside the brackets {} means that the table will be a two column table.
e vertical lines | that you see inside the brackets denote where vertical borders
of the columns will show up. In this occasion we will have vertical borders drawn
before and aer every column.
e commands in this example are only a small subset of those that can be used when creating a table.

Introduction to XELATEX: An alternative document preparation system. by Nikolaos Dimos


is licensed under a Creative Commons Aribution-ShareAlike 3.0 Unported License.

10 3

Creating a document
e last observation has to do with the text alignment inside each cell. the leer r
and l that are shown inside the brackets denote that the text in the cells of the rst
column will be aligned to the right side and the text in the second column will be
aligned to the le side of the column. Another option is the leer c which would
align the text in the center.

Aer the table denition we have the denitions of every line. At the rst line we see
the command \hline which is the command that creates the horizontal borders of the
cells in the table.

en we have a normal line. e data in the rst column will be 7C0 and in the second
hexadecimal the start of a new column is denoted using the & sign. At the end of each
line you have to put \\ in order to create a new line.

In order to create more new lines you just repeat the above. In the case, that you want
the horizontal border of a line to appear only under/over some cells and not the whole
line you can use \cline{-}. In the example that we present here \cline{2-2}
means that the line will appear only in cell. Cline is used like this \cline{starting
column-ending column}.
Tables can get really complicated and have many multicolumn or multirow cells appear
in their structure. Creating such tables gets out of the scope of this document. If you
want to nd more details about designing more complicated tables you should start by
looking at [2] under the section Tables.
Another way to easily get tables into a LATEX document is to create the table in Excel
or a similar program and use a specic extension for that program in order to generate
copy-pasteable LATEX code. Such extension for Excel is the excel2latex which can be
found here.
ere are also other extensions for other popular products that are used to produce
tabular data like OpenOce.org Calc, R, MATLAB. Links to them can be found here.

CTAN archive for excel2latex: http://www.ctan.org/tex-archive/support/excel2latex/


Wikibooks site: http://en.wikibooks.org/wiki/LaTeX/Tables

Introduction to XELATEX: An alternative document preparation system. by Nikolaos Dimos


is licensed under a Creative Commons Aribution-ShareAlike 3.0 Unported License.

Introduction to XELATEX 11
1

11

13

15

17

\ begin { t a b l e } [ htbp ]
\ centering
\ begin { t a b u l a r } { | r | l | }
\ hline
7C0 & h e x a d e c i m a l \ \
3700 & o c t a l \ \
\ c l i n e {2 2}
11111000000 & binary \ \
\ hline \ hline
1984 & decimal \ \
\ hline
$ \ f r a c { \ s q r t [ 3 ] { 8 * x + 2 } } { 3 * x + 5 } $ & math \ \
\ hline
\ end { t a b u l a r }
\ c a p t i o n { A Sample t a b l e }
\ l a b e l { tab : sampleTable }
\ end { t a b l e }

Listing 5: e code to generate Table 1


7C0 hexadecimal
3700 octal
11111000000 binary

1984 decimal
math

8x+2
3x+5

Table 1: A Sample table

3.5

Table of contents, gures, listings, and tables.

If you have followed the previous examples to create Sections, subsections, gures, tables
creating a Table of Contents or a List of gures is the easiest thing that you can do. Listing
6 contains the code that is used to create the Table of contents and the rest of the Lists of
this document that are shown on pages and .
1

\ s e t c o u n t e r { page } { 1 }
\ pagenumbering { Roman }

\ tableofcontents
5

11

13

15

\ newpage
\ listoffigures
\ v s p a c e { 1 . 5 cm }
\ lstlistoflistings
\ v s p a c e { 1 . 5 cm }
\ listoftables
\ newpage
\ s e t c o u n t e r { page } { 1 }
\ pagenumbering { a r a b i c }

Listing 6: Code to generate Table of Contents, List of Figures, and other lists.

Introduction to XELATEX: An alternative document preparation system. by Nikolaos Dimos


is licensed under a Creative Commons Aribution-ShareAlike 3.0 Unported License.

12 3

Creating a document

In the code quoted in Listing 6 you can see the commands \tableofcontents, \listoffigures,
\lstlistoflistings, and \listoftables. ese are the only commands necessary to create the respective lists. e rest of the code that you see in Listing 6 are there only for formaing reasons.
e rst two lines with the commands \setcounter{page}{1} and \setcounter{Roman}
are used in order to format the page numbering style and set the starting page number.
For these pages we have choosen the page numbering style to be in Roman numbers (I,
II, III, ) and the numbering to start from I.
we have also used the \newpage command in order to create a new page aer the Table
of Contents where we would put the rest of the lists.
e \{vspace}{1.5cm} command is used to create some black vertical space. In this
occasion we are creating some blank vertical space between the lists of 1.5cm.
e listing nishes with the same commands that it started which are now used to reset
the page number to 1 and the style to Arabic (1, 2, 3, )

3.6

Choosing fonts

In order to choose the font which your document will use you have to put some commands
in the preamble.
1

\ usepackage { f o n t s p e c }
\ s e t m a i n f o n t { Linux L i b e r t i n e O}
\ d e f a u l t f o n t f e a t u r e s { L i g a t u r e s =TeX }

Listing 7: Code to set the font to be used.


In Listing 7 you can see the code that is used to set the default font for the text. In order to
do this you have to insert the three lines that are shown on Listing 7 in the preamble of your
document.
You rst declare that you will be using the fontspec package.
en you have to select the main font using the \setmainfont{} command. In that
command you will put in the place of the the name of the font that you want to use.
For this document you can see that we are using a font named Linux Libertine O.
e last command is issued in order to create ligatures for common groups of leers.
Some of those are: , , , , , Qea, Qea, f, , p.
e segment of the .tex le that is between the \documentclass and the \begin{document}

Introduction to XELATEX: An alternative document preparation system. by Nikolaos Dimos


is licensed under a Creative Commons Aribution-ShareAlike 3.0 Unported License.

Introduction to XELATEX 13

3.7

Bibliography, citation and cross-referencing

3.7.1

Cross-referencing

You have seen throughout this text that we have been referring to Figures, Tables, and Listings. is is done by using the labels that we set up when we insert those elements. When
we insert an image we create a label using \label{}. In the place of we put the label that we will use to refer to this element later. For a gure the label would look like
\label{fig:aDiscriptiveLabel}. You can see that we prepend the label with fig:. You
can also prepend labels for tables with tab:. is is so that you can distinguish the labels at
a later point. Because at some point your document may have many labels set up. In order
to refer to a gure you will have to use the \ref{} command by replacing the with the
label that you want to refer to. Be careful though, this only gets the number of the element
you are referring. So, if you want to refer to a gure you should type the word Figure and
then \label{fig:myFigure}.
3.7.2
1

Bibliography and citation

\ u s e p a c k a g e [ round , a u t h o r y e a r , merge , s o r t ] { n a t b i b }
\ b i b l i o g r a p h y s t y l e { agsm }

\ b i b l i o g r a p h y { name_ o f _ t h e _ b i b l i o g r a p h y _ f i l e }

Listing 8: Seings for bibliography.


Listing 8 shows the required commands to create the bibliography and be able to create
citations in the text. e rst line is loading the package natbib which is used to format the
citations that you put in the text. Here for example the options used will format the citations
according to the harvard style. So it will use:
round brackets = parentheses
authoryear form
it will merge continuous citations and separate them with ;
it will sort the citations alphabetically.
On the second line the bibliography style is declared. In this occasion we are using agsm
which is a harvard style. is command should also be in the preamble. It is beer to group
those two commands and keep them together in the preamble.
e last command is going to actually load the le that you have the bibliography in. you
should save the bibliography le in the same folder as you save the .tex le of your document.
A good way to creating and managing your bibliography le is JabRef. [3]
JabRef: http://jabref.sourceforge.net/

Introduction to XELATEX: An alternative document preparation system. by Nikolaos Dimos


is licensed under a Creative Commons Aribution-ShareAlike 3.0 Unported License.

14 5

Example tool setups

Typesetting Mathematics

ere are three ways to insert an equation in a document:


e rst way is to create an inline equation like this
$\frac{\sqrt[3]{8*x+2}}{3*x+5}$

3
8x+2
3x+5

using the following code:

e second way is to create an unnumbered equation like the following one

3
8x+2
3x+5
using the following code:\[\frac{\sqrt[3]{8*x+2}}{3*x+5}\]
And as a numbered equation like the one below, which can also be referenced in the
document as Equation )1(.

3
8x+2
3x+5
e code that produces the Equation )1( is:
2

)(1

\ b e g i n { e q u a t i o n } \ l a b e l { eq : t e s t }
\ frac { \ sqrt [ 3 ] { 8 * x + 2 } } { 3 * x +5}
\ end { e q u a t i o n }

In order to use the equation environment you should load the package amsmath in the
preamble of your document. is can be done with the following command: \usepackage{amsmath}

Example tool setups

is section will present an example setup that could be used so that you can start generating
and editing documents using LATEX.

5.1

Windows

5.1.1

MiKTeX

e rst thing you need to download is a TEX/LATEX distribution which will provide the tools
to compile the .tex les into .pdf or some other printable form. For Windows there is a
distribution named MiKTeX which can be found at hp://miktex.org/. Go to the downloads
page and download the installer for your version of Windows. e name of the le you are
about to download should look like: Basic MiKTeX 2.9.xxxx Installer
Detailed instructions on how to make a basic installation of MiKTeX can be found here:
hp://docs.miktex.org/2.9/manual/ch02s02.html.
ere are two things to watch out for that will make your life easier at later points when
you use your LATEX set-up.
Introduction to XELATEX: An alternative document preparation system. by Nikolaos Dimos
is licensed under a Creative Commons Aribution-ShareAlike 3.0 Unported License.

Introduction to XELATEX 15

RootyHelix

Figure 7 demonstrates the power of TEX in generating more than text! e image shown in
this gure is created using only LATEX commands and when you zoom in and out you get more
details contrary to what would happen if you just included a .jpg le.

73

72

29

76

26

27

28

25 24

23

32

79

80

33

81

83

84

61

37

56

20

86

87

17

11
13
12

14

52

15

51

50

40

41
42 43

45
44

46

47

48

54

53

16

38
85

55

19

18

10

58

57

2
.

39

59

22

36

82

35

62

60

34

21

31

78

66 65
64
63

30

77

67

68

70

74

75

71

69

49

Figure 7: Root helix

Introduction to XELATEX: An alternative document preparation system. by Nikolaos Dimos


is licensed under a Creative Commons Aribution-ShareAlike 3.0 Unported License.

16 B

B
1

Source code of this document

Source code of this document

%%is work is licensed under the Creative Commons AributionShareAlike


%%3.0 Unported License . To view a copy of this license , visit
%%hp :// creativecommons.org/ licenses /bysa/3.0/ or send a leer to :
%%
%%Creative Commons
%%444 Castro Street
%%Suite 900
%%Mountain View
%%California , 94041
%%USA

11

13

\documentclass[a4paper,12pt,twoside , nal ]{ article }

15

%Font seings
\usepaage{ xltxtra }
\usepaage{xunicode}
\usepaage{fontspec}
\ defaultfontfeatures { Ligatures =TeX}
\ setmainfont {Linux Libertine O}

17

19

21

%%Include various packages


23

25

%A package that you need in order provide more extensive


%math functionality in your document e.g. add numbered equations
\usepaage{amsmath}

27

29

31

33

35

%A package that shrinks the margins of the page.


\usepaage{fullpage }
%A package to create fancy headers and footers
\usepaage{fancyhdr}
\ setlength {\ headheight}{20pt }
%Set the pagestyle to fancy
\ pagestyle {fancy}

37

39

41

43

%Clear the header style


\fancyhead{}
%Set the new header style
\fancyhead[LE] {\ textbf {\ thepage} \textbf{\nouppercase\lemark}\vspace{1cm}}
\fancyhead[RO] {\ textbf { Introduction to \XeLaTeX{}} \textbf{\thepage}\vspace{1cm}}
\renewcommand{\headrulewidth}{0pt} % remove lines as well }

45

47

49

51

53

%Set the footer style


\ fancyfoot [C ]{\ includegraphics [ scale =.7]{./ images/bysa.pdf }\\
\begin{ scriptsize }
Introduction to \XeLaTeX{}: An alternative document preparation system. by \ href { hp :// www.scribd.com/doc/97184558/
IntroductiontoXeLaTeXAnalternativedocumentpreparationsystem}{Nikolaos Dimos} \\
is licensed under a \ href { hp :// creativecommons.org/ licenses /bysa /3.0/}{ Creative Commons AributionShareAlike 3.0
Unported License }.\\
\end{ scriptsize }}
%A package to create wrapped gures in the text .
\usepaage{wrapg}

55

%A package required in order to include graphics in the text .

Introduction to XELATEX: An alternative document preparation system. by Nikolaos Dimos


is licensed under a Creative Commons Aribution-ShareAlike 3.0 Unported License.

Introduction to XELATEX 17
57

\usepaage{graphicx}

59

%A package that provides some more logos like \XeLaTeX{}


\usepaage{metalogo}

61

63

65

67

69

71

73

75

77

79

81

83

%A package that provides small images that represent keyboard buons


\usepaage{keystroke}
%A package that is used to creat hyperlinks for all the citations , crossreferences and URLs in the text
\usepaage{hyperxmp}
\usepaage{hyperref}
\hypersetup{
colorlinks =true ,
% false : boxed links ; true : colored links
linkcolor =black ,
% color of internal links
citecolor =black ,
% color of links to bibliography
urlcolor =blue
% color of external links
}
\hypersetup{
pditle ={%
Introduction to XeLaTeX: An alternative document preparation system .},
pdfauthor={Nikolaos Dimos},
pdfcopyright={is work is licensed under a Creative Commons AributionNonCommercialShareAlike 3.0 Unported License.},
pdicenseurl ={ hp :// creativecommons.org/ licenses /byncsa/3.0/},
pdfsubject ={ introduction to XeLaTeX},
pdeywords={introduction , Document, typeseing , bibliography , typography, beginners , latex , tex , How to, xelatex , word
alternative },
pdang={en}
}

85

87

89

91

%A package which in conjunction with the \ capstart command points at the top of an
%image when you click its refernce instead of pointing at its caption
\usepaage[all ]{ hypcap}
%A package that formats what the captions will look like .
\usepaage[format=hang, labelfont =bf ]{ caption }

93

95

97

%A package that provides captions for the subgures .


\usepaage{subcaption}
%A package that gives you the ability to dene colors .
\usepaage{color }

99

101

103

\ denecolor {gray }{ rgb }{0.5,0.5,0.5}


\ denecolor {dkgreen}{rgb }{0,0.6,0}
%A package to provide code listings
\usepaage{ listings }

105

107

%%A package that gets XMP metadata to the pdf le that is generated
%\usepackage{xmpincl}
%\includexmp {./ includes /metadata}

109

111

113

%A package that provides the ability to write in multiple languages in a text .


\usepaage{ polyglossia }
\setmainlanguage{ english }
\ setotherlanguage {greek}
\ setotherlanguage { arabic }

115

%Set the fonts for the other languages.

Introduction to XELATEX: An alternative document preparation system. by Nikolaos Dimos


is licensed under a Creative Commons Aribution-ShareAlike 3.0 Unported License.

18 B
117

119

Source code of this document

\newfontfamily\greekfont {Old Standard}


\newfontfamily\ arabicfont {Scheherazade Graphite Alpha}
\newfontfamily\monofont{Linux Biolinum O}

121

123

125

127

129

131

133

%Set the default options for the code listings in this document.
\ lstset {language=[LaTeX]TeX,
basicstyle =\ scriptsize ,
numbers=le,
numberstyle=\tiny\ color {gray },
stepnumber=2,
numbersep=15pt,
stringstyle =\ ttfamily ,
columns=xed,
rulecolor =\ color { black },
commentstyle=\color{dkgreen },
captionpos=b,
tabsize =3}

135

137

139

%Sets the bibliography style .


\ bibliographystyle { ieeetr }
%Set the line spacing .
\ linespread {1.15}

141

\begin{document}
143

\begin{ titlepage }
145

147

\author {\ vspace{1cm} Nikolaos Dimos}


\ title {{\ Huge Introduction to \XeLaTeX {}}\\
{\ LARGE An alternative document preparation system .}}

149

151

\date {\ vll \today}


\ maketitle
\ thispagestyle {empty}

153

155

157

159

161

163

165

\end{ titlepage }
\ setcounter {page }{1}
\pagenumbering{Roman}
\ label { toc }
\ tableofcontents
\newpage
\ label { lists }
\ listogures
\vspace {1.5 cm}
\ lstlistoistings
\vspace {1.5 cm}
\ listoables
\newpage

167

169

171

\ setcounter {page }{1}


\pagenumbering{arabic}
\ section { Introduction }
\ subsection {What is \LaTeX{}?}

173

175

\LaTeX{} is a document markup language\footnote{Other markup languages are HTML, XML, SGML,\ldots} and a document
preparation system\footnote{Other document preparation systems are the OpenOce.org Writer , LibreOce Writer ,
Microso Word,

Introduction to XELATEX: An alternative document preparation system. by Nikolaos Dimos


is licensed under a Creative Commons Aribution-ShareAlike 3.0 Unported License.

Introduction to XELATEX 19

177

179

181

183

185

IBM Lotus Word Pro}. \LaTeX{} provides some macros\footnote{Macros are short , easy to remember commands that invoke some
other commands in order to achieve a result .} in order to use the underlying \TeX{} programming language. \XeLaTeX{} is a
newer version of this language which supports:
\begin{ itemize }
\item Unicode encoding of text . is means that you can write :
\begin{ itemize }
\item \ textbf { English :} Hello world !,
\item \ textbf {Greek:} \ textgreek { !},
\item \ textbf {Arabic :} \begin{ ushright }\ textarabic [ locale =mashriq
]{
!}
\end{ ushright }
\item and \ textbf { Polytonic Greek:} \ textgreek [ variant =poly]{

\ ldots }
in the same text without changing the encoding of the document itself .
\end{itemize }

187

189

\item \XeLaTeX{} also supports PDF le creation on it s own which means that you dont have to compile your text using other
programs in addition to \emph{xelatex }.
\item \XeLaTeX{} also brought support of the usage of TrueType and OpenType fonts that are installed on your system. is
means that you can choose any of the installed fonts to use them in your document. is works prey much like in every
modern document processing application .
\end{itemize }

191

193

195

197

199

201

203

\ subsection { Editors }
Before moving forward to the document authoring part we should note that a \TeX{} and consequently \LaTeX{} and \XeLaTeX
{} document can be wrien in any editor you like. From the most simple command line editor in UNIX systems with no
graphical environment at all , to the most complex editors available for every OS out there . Some examples of editors
would be:
\begin{ itemize }
\item \ textbf {Simple ones :} Although they may oer some code highlighting and indentation , nothing more is provided . No auto
complete of commands which means that you should know the commands to type them fully. No shortcuts for compiling,
which means that you should be able to compile your document from a command line.
\begin{ itemize }
\item \ href { hp :// www.nanoeditor.org/}{nano}
\item \ href { hp :// notepadplusplus.org/}{Notepad++}
\item \ href { hp :// projects . gnome.org/gedit /}{ gedit }
\end{itemize }
\item \ textbf {Middleclass ones :} ey oer command auto complete, spell checking options , shortcut creation , automation of
the compilation process .
\begin{ itemize }
\item \ href { hp :// www.xm1math.net/texmaker/}{Texmaker}
\item \ href { hp :// texstudio . sourceforge . net /}{ TeXstudio }. If you look at TeXstudio you will see how much it looks
alike the Texmaker. is is because TeXstudio is an extended version of Texmaker which can add words in the
spelling dictionary . To some people this may be weird, and they would say that this should be in Texmaker in the
rst place .

205

207

209

211

213

But this is exactly where opensource development comes in. e developers of Texmaker for some reason they didn t
implement this function . Someone else found Texmaker interesting us a project and also had the background to
program this functionality in . So they took the code and added in their implementation and created a new piece of
soware which is again free and open for anyone to modify.
\item \ href { hp :// kile . sourceforge . net /}{ Kile }
\item \ href { hp :// www.texniccenter.org /}{ TeXnicCenter}
\end{itemize }
\item \ textbf {WYSIWYG ones:} ese oer a similar experience to using more mainstream document processing applications such
as Microso Word, LibreOce Writer , OpenOce Writer , AbiWord and iWork Pages.
\begin{ itemize }
\item \ href { hp :// www.lyx.org/}{LyX}
\end{itemize }
\end{itemize }

215

For a more comprehensive list of editor you can take a look at : \ href { hp :// en.wikipedia . org/wiki/Comparison_of_TeX_editors
}{Comparison of \TeX{} editors }\ cite {Wikipedia2012CoTeWTFE}.

Introduction to XELATEX: An alternative document preparation system. by Nikolaos Dimos


is licensed under a Creative Commons Aribution-ShareAlike 3.0 Unported License.

20 B

Source code of this document

217

\ section { Parts of a document}


219

221

223

225

227

229

\begin{wrapgure }{ r }{0.5\ textwidth}


\ capstart
\ centering
\vspace{5pt}
\ textbf {Code:}
\ lstset {numbersep=3pt}
\begin{ lstlisting }
\documentclass[11pt,oneside ]{ article }

231

233

235

237

239

241

\begin{document}
Hello world!
\end{document}
\end{ lstlisting }
\ textbf {Output:}
\begin{quote}
Hello world!
\end{quote}
\vspace{5pt}
\caption{e smallest document!}\ label { g : smallDocument}
\end{wrapgure}

243

e code that is shown in Fig . \ ref { g : smallDocument} produces the smallest and simplest document you can create . It s the
traditional Hello world! example for \XeLaTeX{}. In the rst line you see the \ texttt {\ textbaslash {} documentclass[\
ldots ]\{\ ldots \}} where we put the initial characteristics of the document. Inside the brackets ([\ ldots ]) there is the
text \ texttt {11 pt , oneside } which means that the default size of the text in the document will be \emph{11pt} and that
the document will be created as an \emph{oneside document}. Other document class options may be \ texttt { dra } which
spaces the text with bigger inter line spaces and omits images by replacing them with a placeholder.
245

Aer the \ texttt {\ textbaslash {} documentclass[\ ldots ]\{\ ldots \}} a document must always have at least the following \emph{
beginend} part: \ texttt {\ textbaslash {} begin \{ document\}\ ldots \ textbaslash {} end\{document \}}. Generally , a paern
should be visible . ere are some word preceded by \ textbaslash and followed by \{\ ldots \} these are the
commands that are used by \LaTeX{} in order to dene dierent parts of the document.
247

e part of the code that is between the \emph{document class} denition and the \ texttt {\ textbaslash {} begin \{ document\}}
is the \emph{preamble}. In that space you will include any packages that you may use when you create your documents. We
will get back to that at a later point . Another part of the document is the \ emph{Top Maer} which is some commands
that you would use to create the title page for your document. e top maer of this document that you are reading is
shown in Listing \ ref { lst : topMaer }.
249

You can see that we begin a \emph{titlepage } and then we add the authors , the title and the date . ere are also some
aesthetic enhancements which will be covered later . ere are some commands that deal with font sizes (\ textbaslash {}
Huge, \ textbaslash {} LARGE) and some formaing commands like \textbaslash {}\ textbaslash {} which inserts a new line
, it is equivalent to pressing \Enter . But other than that the commands are prey self explanatory.
251

253

255

257

259

261

\ lstset { caption={Top Maer }, label = lst : topMaer}


\begin{minipage }{\ textwidth}
\begin{ lstlisting }
\begin{ titlepage }
\author{Dimos, Nikolaos and Poupakis, Stavros }
\ title {{\ Huge Introduction to \XeLaTeX {}}\\
{\ LARGE An alternative document preparation system .}}
\date {\ vll \today}
\ maketitle

Introduction to XELATEX: An alternative document preparation system. by Nikolaos Dimos


is licensed under a Creative Commons Aribution-ShareAlike 3.0 Unported License.

Introduction to XELATEX 21
263

\ thispagestyle {empty}

267

\end{ titlepage }
\end{ lstlisting }
\end{minipage}

269

\ section { Creating a document}

271

From the previous examples you should be able now to create a document that says \emph{Hello world!} and has a title page.
is section will describe what else you need to do in order to create the rest of the document structure . is section
will include instructions to generate :
\begin{enumerate}
\item Sections and paragraphs
\item Lists
\item Figures
\item Tables
\item Table of contents , Table of Figures
\item Seing the font to be used
\item Adding bibliography
\end{enumerate}

265

273

275

277

279

281

\ subsection { Sections and paragraphs}


283

e basic structure of the document and the guidance to the reader is given by assigning a title to bigger or smaller parts
of a piece of text . In order to do this \LaTeX{} provides some commands to create the basic sectioning headers .
285

287

289

291

293

295

297

\begin{minipage }{\ textwidth}


\ lstset { caption={Showcase of sectioning commands}, label={ lst : sectioningCommandsInput}}
\begin{ lstlisting }
\ part {What a nice part !}
\ chapter {What a nice chapter !}
\ section { is is a section }
\ subsection {A subsection then follows }
\ subsubsection {W00t! A Subsubsection !}
\paragraph{A paragraph now:} No more subsubsubsub\ldots subsections
\subparagraph{But we have:} a Subparagraph!
\end{ lstlisting }
\end{minipage}

299

301

303

305

307

\begin{ gure }[ htbp]


\ capstart
\ centering
\ includegraphics [ scale =.5]{./ images/ sectioning . pdf}
\caption{Output of the sectioning commands.}\label{ g : sectioningCommandsOutput}
\end{ gure }
e basic sectioning commands are shown in Listing \ ref { lst : sectioningCommandsInput}. Not all of them can be used in any type
of document. For example, \ texttt {\ textbaslash {} chapter } can only be used in books and reports . So in order to be
able to use \ texttt {\ textbaslash {} chapter }, you should have dened in the \emph{document class} the document as
either a \emph{book} or a \emph{report} like this : \ texttt {\ textbaslash {} documentclass[\ ldots ]\{ book \}}. Figure \ ref
{ g : sectioningCommandsOutput} shows the output of the code quoted in Listing \ ref { lst : sectioningCommandsInput}. Each
sectioning command takes as input some text that is then used appropriately to name the part / chapter / section /\ ldots .
\ subsection { Lists }

309

Another commonly used feature in texts , especially in academia, are the lists . Lists are used in order to dene some key
aspects of a problem and make a clear approach on them which can be revisited at any time oering very good user
experience \ footnote{User experience in the terms of ; a user who gets back to a list of items will seek to nd
condensed information in a structured way which is easy to grasp .}.
311

\begin{ gure }[ htbp]

Introduction to XELATEX: An alternative document preparation system. by Nikolaos Dimos


is licensed under a Creative Commons Aribution-ShareAlike 3.0 Unported License.

22 B
313

315

317

319

321

323

325

327

329

331

333

335

337

339

341

343

345

347

349

351

353

355

357

359

361

363

365

367

369

371

373

Source code of this document

\ centering
\begin{ subgure }[ b ]{0.3\ textwidth}
\ centering
\begin{verbatim}
\begin{ itemize }
\item 1st item
\begin{ itemize }
\item 1st nested item
\end{itemize }
\item 2nd item
\begin{ itemize }
\item 2nd nested item
\end{itemize }
\end{itemize }
\end{verbatim}
\caption {\ textbf { Input :} e \emph{itemize} environment}
\ label { g : itemizeEnvInput}
\end{ subgure }%
\quad %add desired spacing between images, e . g. ~, \quad, \qquad etc .
%(or a blank line to force the subgure onto a new line )
\begin{ subgure }[ b ]{0.3\ textwidth}
\ centering
\begin{ itemize }
\item 1st item
\begin{ itemize }
\item 1st nested item
\end{itemize }
\item 2nd item
\begin{ itemize }
\item 2nd nested item
\end{itemize }
\end{itemize }
\caption {\ textbf {Output:}e \emph{itemize} environment}
\ label { g : itemizeEnvOutput}
\end{ subgure }
\\ \hrule%add desired spacing between images, e . g. ~, \quad, \qquad etc .
%(or a blank line to force the subgure onto a new line )
\begin{ subgure }[ b ]{0.3\ textwidth}
\ centering
\begin{verbatim}
\begin{enumerate}
\item 1st item
\begin{enumerate}
\item 1st nested item
\end{enumerate}
\item 2nd item
\begin{enumerate}
\item 2nd nested item
\end{enumerate}
\end{enumerate}
\end{verbatim}
\caption {\ textbf { Input :} e \emph{enumerate} environment}
\ label { g : enumEnvInput}
\end{ subgure }
\qquad\qquad
\begin{ subgure }[ b ]{0.3\ textwidth}
\ centering
\begin{enumerate}
\item 1st item
\begin{enumerate}
\item 1st nested item

Introduction to XELATEX: An alternative document preparation system. by Nikolaos Dimos


is licensed under a Creative Commons Aribution-ShareAlike 3.0 Unported License.

Introduction to XELATEX 23
375

377

379

381

383

385

387

389

391

393

395

397

399

401

403

405

407

409

411

413

415

417

419

421

423

425

427

429

\end{enumerate}
\item 2nd item
\begin{enumerate}
\item 2nd nested item
\end{enumerate}
\end{enumerate}
\caption {\ textbf {Output:}e \emph{itemize} environment}
\ label { g : enumeEnvOutput}
\end{ subgure }
\\ \hrule%add desired spacing between images, e . g. ~, \quad, \qquad etc .
%(or a blank line to force the subgure onto a new line )
\begin{ subgure }[ b ]{0.3\ textwidth}
\ centering
\begin{verbatim}
\begin{enumerate}
\item 1st item
\begin{enumerate}
\item 1st nested item
\end{enumerate}
\item 2nd item
\begin{enumerate}
\item 2nd nested item
\end{enumerate}
\end{enumerate}
\end{verbatim}
\caption {\ textbf { Input :} e \emph{description} environment}
\ label { g : descEnvInput}
\end{ subgure }
\qquad\qquad
\begin{ subgure }[ b ]{0.3\ textwidth}
\ centering
\begin{enumerate}
\item 1st item
\begin{enumerate}
\item 1st nested item
\end{enumerate}
\item 2nd item
\begin{enumerate}
\item 2nd nested item
\end{enumerate}
\end{enumerate}
\caption {\ textbf {Output:}e \emph{itemize} environment}
\ label { g : descEnvOutput}
\end{ subgure }
\caption{e available ways of creating lists in \LaTeX {}.}\ label { g : listEnv }
\end{ gure }
In Fig . \ ref { g : listEnv } you can see the code that is required (\ ref { g : itemizeEnvInput }, \ ref { g : enumEnvInput}, \ ref { g :
descEnvInput}) in order to produce the respective list style (\ ref { g : itemizeEnvOutput}, \ ref { g : enumeEnvOutput}, \ref
{ g : descEnvOutput}). e basic concept is that you only need to dene if you want a bullet style list (\ emph{itemize})
, a numbered list (\ emph{enumerate}), or a list with your dened descriptions (\ emph{description }) . An aesthetic
improvement to the \emph{description} style list would be to indent the text that follows the description . is could
look like the example in Fig . \ ref { g : aesthEnchDesc}.
\begin{ gure }
\ centering
\begin{ subgure }[ b ]{0.4\ linewidth}
\ centering
\ lstset { caption ={}, label ={}}
\begin{ lstlisting }
\begin{ description }
\item[ First ] \ hll \\

Introduction to XELATEX: An alternative document preparation system. by Nikolaos Dimos


is licensed under a Creative Commons Aribution-ShareAlike 3.0 Unported License.

24 B
431

433

435

437

439

441

443

445

447

449

451

453

455

Source code of this document

e rst item
\item[Second] \ hll \\
e second item
\item[ird] \ hll \\
e third etc \ ldots
\end{ description }
\end{ lstlisting }
\caption {\ textbf { Input }}
\ label { g : enchancedDescInput}
\end{ subgure }%
\qquad %add desired spacing between images, e . g. ~, \quad, \qquad etc .
%(or a blank line to force the subgure onto a new line )
\begin{ subgure }[ b ]{0.4\ linewidth}
\ centering
\begin{ description }
\item[ First ] \ hll \\
e rst item
\item[Second] \ hll \\
e second item
\item[ird] \ hll \\
e third etc \ ldots
\end{ description }
\caption {\ textbf {Output}}
\ label { g : enchancedDescOutput}
\end{ subgure }
\caption[Enchanced description environment.]{An aesthetic enchancement of the \emph{description} environment .}\ label { g :
aesthEnchDesc}
\end{ gure }

457

\ subsection { Figures }
459

Another very common thing in documents is the inclusion of gures . One way to put pictures in a document is as a wrapped
object with the picture oating on one side of the text and the text wrapped around it . is is good only for small
pictures that will not take over more than 50\% of the pages width in order to appear in a readable resolution .
461

463

\ subsubsection {Simple oating gure }


Another way, and the most common one, is to include pictures as oating objects . Floating objects can be set to always oat
a the top or the boom of the page, or the can be explicitly set to oat at the current position that they are
dened . Generally \LaTeX{} will try to position oats in a way that they dont create large blank spaces in the text
so that it wont disrupt the reading . But oating seings can also be dened by other institutions . For example
various journals will have their own template that the authors should follow . For example, if you write a paper for an
IEEE conference , IEEEs template will always put your oats on the top of the page regardless of where you include
them in the text . is creates a concrete way of delivering papers for IEEE conferences and everyone aending them will
expect them to be in that way. Using \LaTeX{} and a template of the journal you want your publication to look alike
you just create the document as you would with any other template and this makes sure that the oats , among the other
components of the document, will be placed appropriately .

465

In order to be able to include images and other graphics you have to include the \emph{graphicx} package at the preamble of
your document. is can be done using the following command: \texttt {\ textbaslash {} usepackage\{graphicx \}}.

467

\begin{ gure }[ htbp]


\ capstart
\ centering
\ resizebox {0.3\ textwidth }{!}{
\ includegraphics {./ images/0206124.jpg}
}
\caption{A simple picture include .}\ label { g : simplePictureInclude }
\end{ gure }

469

471

473

475

477

\begin{minipage }{\ textwidth}


\ lstset { caption={A simple picture include .}, label ={ lst : simplePictureIncludeCode }}

Introduction to XELATEX: An alternative document preparation system. by Nikolaos Dimos


is licensed under a Creative Commons Aribution-ShareAlike 3.0 Unported License.

Introduction to XELATEX 25
479

481

483

485

487

\begin{ lstlisting }
\begin{ gure }[ htbp]
\ centering
\ resizebox {0.5\ textwidth }{!}{
\ includegraphics {./ images/0206124.jpg}
}
\caption{A simple picture include .}\ label { g : simplePictureInclude }
\end{ gure }
\end{ lstlisting }
\end{minipage}

489

491

493

495

497

499

501

503

505

507

509

In Listing \ ref { lst : simplePictureIncludeCode } you can see the code that is required to insert an image in a document. e
image that is inserted using that code snippet is shown in \ ref { g : simplePictureInclude }. In the code we see the
following commands:
\begin{ itemize }
\item \ texttt {\ textbaslash {} begin \{ gure \}\ ldots \ textbaslash {} end\{ gure \}}: With this you create a new oating gure
environment. Between those two lines the appropriate code to create the gure should be entered .
\item e main parts of a gure are :
\begin{ itemize }
\item e \ texttt {\ textbaslash {} includegraphics \{\ ldots \}} command which is the command that actually brings the
picture in the document.
\item e \ texttt {\ textbaslash {} caption \{\ ldots \}} command which sets the caption to be shown under the picture .
\item and the \ texttt {\ textbaslash {} label \{\ ldots \}}, which always follows \ texttt {\ textbaslash {} caption \{\ ldots
\}}, which creates a label for this picture in order to be crossreferenced later anywhere in the document.
\end{itemize }
\item ere are also some other commands here that help with the placement of the picture so that it wont go out of limits .
\begin{ itemize }
\item \ texttt {\ textbaslash {} centering } is used to make whatever is inside the \ texttt {\ textbaslash {} begin \{ gure
\}\ ldots \ textbaslash {} end\{ gure \}} to be horizontally aligned to the center of the page.
\item \ texttt {%
\ textbaslash {} resizebox %
\{0.5 %
\ textbaslash {} textwidth%
\} %
\{!\}\{\ textbaslash {} includegraphics \{\ ldots \}\}} is used to resize the image to the a width equivalent to the 50\%
of the text s width. e resizebox command generally works like \ text {\ textbackslash {} resizebox \{$\ langle $width
$\rangle $\}\{$\ langle $height $\ rangle $\}\{$\ langle $image to be resized $\ rangle $\}}. You should notice that in the
eld where we should have put the height we just have ! this is done so that resizebox will scale the picture
only by width retaining the aspect ratio of the image.
\end{itemize }
\end{itemize }

511

\ subsubsection { Floating gure with subgures }


513

In order to create a group of gures like the one shown in Fig . \ ref { g : subgDemonstration} you would have to use the code
that is shown in Listing \ ref { lst : subgDemonstrationCode}. But before writing the subgure code you should include in
the preamble of your document the package \emph{subg }. In order to include this package you should use the command \
texttt {\ textbaslash {} usepackage\{ subg \}}.
515

517

In order to create such a gure with one or more subgures you have to create a \emph{gure} environment like we do in
Listing \ ref { lst : subgDemonstrationCode}, Line 1. e you have to create two \emph{subgure} environments (\ texttt {\
textbaslash {} begin \{ subgure \}\ ldots \ textbaslash {} end\{ subgure \}}) inside which you will include the images like
you would normally do as if you were to include a single oating image. You are also able to assign \emph{captions}
and \emph{labels} to the subgures so you can refer directly to them from the document.

519

521

\begin{ gure }[ htbp]


\ centering

Introduction to XELATEX: An alternative document preparation system. by Nikolaos Dimos


is licensed under a Creative Commons Aribution-ShareAlike 3.0 Unported License.

26 B
523

525

527

529

531

533

535

537

539

541

543

545

547

549

551

553

555

557

559

561

563

565

567

569

571

Source code of this document

\begin{ subgure }[ t ]{0.3\ textwidth}


\ centering
\ resizebox {1\ textwidth }{!}{
\ includegraphics {./ images/0206124.jpg}
}
\caption{e rst picture }
\ label { g : rstPicInSubg }
\end{ subgure }%
\quad %add desired spacing between images, e . g. ~, \quad, \qquad etc .
%(or a blank line to force the subgure onto a new line )
\begin{ subgure }[ t ]{0.3\ textwidth}
\ centering
\ resizebox {\ textwidth }{!}{
\ includegraphics {./ images/0206124.jpg}
}
\caption{e second picture }
\ label { g : secondPicInSubg }
\end{ subgure }
\caption[ Subgure output ]{ A caption that is about all the pictures in the gure . Lorem ipsum dolor sit amet, consectetur
adipisicing elit , sed do eiusmod tempor incididunt ut labore et dolore magna aliqua .}\ label { g : subgDemonstration}
\end{ gure }
\begin{minipage }{\ textwidth}
\ lstset { caption ={[Code to generate subgure .] e code to generate the subgure shown in Fig . \ ref { g : subgDemonstration
}}, label ={ lst : subgDemonstrationCode}}
\begin{ lstlisting }
\begin{ gure }[ htbp]
\ centering
\begin{ subgure }[ t ]{0.3\ textwidth}
\ centering
\ resizebox {1\ textwidth }{!}{
\ includegraphics {./ images/0206124.jpg}
}
\caption{e rst picture }
\ label { g : rstPicInSubg }
\end{ subgure }%
\quad %add desired spacing between images, e . g. ~, \quad, \qquad etc .
%(or a blank line to force the subgure onto a new line )
\begin{ subgure }[ t ]{0.3\ textwidth}
\ centering
\ resizebox {\ textwidth }{!}{
\ includegraphics {./ images/0206124.jpg}
}
\caption{e second picture }
\ label { g : secondPicInSubg }
\end{ subgure }
\caption[ Subgure output ]{ A caption that is about all the pictures in the
gure . Lorem ipsum dolor sit amet, consectetur adipisicing elit , sed
do eiusmod tempor incididunt ut labore et dolore magna aliqua .}
\ label { g : subgDemonstration}
\end{ gure }
\end{ lstlisting }
\end{minipage}

573

\ subsection { Tables }
575

Another way to present data except from importing gures is creating tables . In Listing \ ref { lst : sampleTableCode} you can
see the code that generates Table \ ref { tab : sampleTable }. You can see that the \emph{table} environment is similar to the
\emph{gure }. We begin a \emph{table} environment and then inside we insert the following commands\footnote{e
commands in this example are only a small subset of those that can be used when creating a table .}:
577

Introduction to XELATEX: An alternative document preparation system. by Nikolaos Dimos


is licensed under a Creative Commons Aribution-ShareAlike 3.0 Unported License.

Introduction to XELATEX 27
579

581

583

585

587

589

\begin{ itemize } %\itemsep1pt \ parskip0pt \parsep0pt


\item We see again the \ texttt {\ textbaslash {} centering } command which is used to center the table in the page.
\item Aer that we see an environment in which we will dene the table . e \emph{tabular} environment. You can see that we
again \ texttt {\ textbaslash {} begin\ ldots \ textbaslash {} end} the \emph{tabular} environment as any other environment.
\item e tabular environment has some arguments though, \ texttt {\{| r | l |\}}. ese arguments dene the number of columns
and the looks of them.
\begin{ itemize } %\itemsep1pt \ parskip1pt \parsep1pt
\item Having two leers inside the brackets \ texttt {\{\ ldots \}} means that the table will be a two column table .
\item e vertical lines | that you see inside the brackets denote where vertical borders of the columns will show up. In
this occasion we will have vertical borders drawn before and aer every column.
\item e last observation has to do with the text alignment inside each cell . the leer \ texttt { r } and \ texttt { l } that are
shown inside the brackets denote that the text in the cells of the rst column will be aligned to the right side and
the text in the second column will be aligned to the le side of the column. Another option is the leer \ texttt {c}
which would align the text in the center .
\end{itemize }
\item Aer the table denition we have the denitions of every line . At the rst line we see the command \texttt {\
textbaslash {} hline } which is the command that creates the horizontal borders of the cells in the table .
\item en we have a normal line . e data in the rst column will be \ texttt {7C0} and in the second \ texttt {hexadecimal}
the start of a new column is denoted using the \ texttt {\&} sign . At the end of each line you have to put \ texttt {\
textbaslash {}\ textbaslash {}} in order to create a new line .
\item In order to create more new lines you just repeat the above. In the case , that you want the horizontal border of a line
to appear only under/over some cells and not the whole line you can use \ texttt {\ textbaslash {} cline \{\ ldots\ldots
\}}. In the example that we present here \ texttt {\ textbaslash {} cline \{22\}} means that the line will appear only in
cell . Cline is used like this \ texttt {\ textbaslash {} cline \{$\ langle$ starting column$\rangle$$\langle$ending column$\
rangle $\}}.

591

Tables can get really complicated and have many multicolumn or multirow cells appear in their structure . Creating such tables
gets out of the scope of this document. If you want to nd more details about designing more complicated tables you
should start by looking at \ cite {Wikibooks2012LWTFTP} under the section Tables.

593

Another way to easily get tables into a \LaTeX{} document is to create the table in Excel or a similar program and use a
specic extension for that program in order to generate copypasteable \LaTeX{} code. Such extension for Excel is the
\emph{excel2latex } which can be found \ href { hp :// www.ctan.org/texarchive/support/excel2 latex /}{ here }\ footnote{CTAN
archive for \emph{excel2latex }: \ url { hp :// www.ctan.org/texarchive/support/excel2 latex /}}.

595

ere are also other extensions for other popular products that are used to produce tabular data like OpenOce.org Calc , R,
MATLAB. Links to them can be found \ href { hp :// en.wikibooks.org/wiki/LaTeX/Tables}{ here }\ footnote{Wikibooks site : \ url
{ hp :// en.wikibooks.org/wiki/LaTeX/Tables }}.
\end{itemize }
\begin{minipage }{\ textwidth}

597

599

601

603

605

607

609

611

613

615

617

\ lstset { caption ={[Code to generate Table .] e code to generate Table \ ref { tab : sampleTable }}, label ={ lst : sampleTableCode}}
\begin{ lstlisting }
\begin{ table }[ htbp]
\ centering
\begin{ tabular }{| r | l |}
\ hline
7C0 & hexadecimal \\
3700 & octal \\
\ cline {22}
11111000000 & binary \\
\ hline \ hline
1984 & decimal \\
\ hline
$\ frac {\ sqrt [3]{8* x +2}}{3* x+5}$ & math\\
\ hline
\end{ tabular }
\caption{A Sample table }
\ label { tab : sampleTable}
\end{ table }
\end{ lstlisting }

Introduction to XELATEX: An alternative document preparation system. by Nikolaos Dimos


is licensed under a Creative Commons Aribution-ShareAlike 3.0 Unported License.

28 B

Source code of this document

619

\end{minipage}

621

\begin{ table }[ htbp]


\ centering
\begin{ tabular }{| r | l |}\ hline
7C0 & hexadecimal \\
3700 & octal \\ \ cline {22}
11111000000 & binary \\
\ hline \ hline
1984 & decimal \\
\ hline
$\ frac {\ sqrt [3]{8* x +2}}{3* x+5}$ & math\\
\ hline
\end{ tabular }
\caption{A Sample table }
\ label { tab : sampleTable}
\end{ table }

623

625

627

629

631

633

635

637

639

\ subsection { Table of contents , gures , listings , and tables .}

641

If you have followed the previous examples to create Sections , subsections , gures , tables creating a Table of Contents or
a List of gures is the easiest thing that you can do. Listing \ ref { lst : tocLists } contains the code that is used to
create the Table of contents and the rest of the Lists of this document that are shown on pages \ ref { toc } and \ ref {
lists }.

643

647

\begin{minipage }{\ textwidth}


\ lstset { caption ={[Code to generate Table of Contents and other lists ]Code to generate Table of Contents , List of Figures ,
and other lists .}, label ={ lst : tocLists }}
\begin{ lstlisting }
\ setcounter {page }{1}
\pagenumbering{Roman}

649

\ tableofcontents

651

\newpage
\ listogures
\vspace {1.5 cm}
\ lstlistoistings
\vspace {1.5 cm}
\ listoables

645

653

655

657

659

661

\newpage
\ setcounter {page }{1}
\pagenumbering{arabic}
\end{ lstlisting }
\end{minipage}

663

665

667

In the code quoted in Listing \ ref { lst : tocLists } you can see the commands \texttt {\ textbaslash { tableofcontents }}, \ texttt {\
textbaslash { listogures }}, \ texttt {\ textbaslash { lstlistoistings }}, and \ texttt {\ textbaslash { listoables }}.
ese are the only commands necessary to create the respective lists . e rest of the code that you see in Listing \ ref {
lst : tocLists } are there only for formaing reasons .
\begin{ itemize }
\item e rst two lines with the commands \texttt {\ textbaslash {} setcounter \{ page \}\{1\}} and \ texttt {\ textbaslash {}
setcounter \{ Roman\}} are used in order to format the page numbering style and set the starting page number. For these
pages we have choosen the page numbering style to be in Roman numbers (I, II , III , \ ldots ) and the numbering to start
from I .
\item we have also used the \ texttt {\ textbaslash {newpage}} command in order to create a new page aer the Table of
Contents where we would put the rest of the lists .

Introduction to XELATEX: An alternative document preparation system. by Nikolaos Dimos


is licensed under a Creative Commons Aribution-ShareAlike 3.0 Unported License.

Introduction to XELATEX 29

669

\item e \ texttt {\ textbaslash {}\{ vspace \}\{1.5 cm\}} command is used to create some black \emph{vertical space }. In this
occasion we are creating some blank vertical space between the lists of 1.5 cm.
\item e listing nishes with the same commands that it started which are now used to reset the page number to 1 and the
style to Arabic (1, 2, 3, \ ldots )
\end{itemize }

671

\ subsection {Choosing fonts }


673

In order to choose the font which your document will use you have to put some commands in the preamble\footnote{e segment
of the . tex le that is between the \ texttt {\ textbaslash {} documentclass} and the \ texttt {\ textbaslash {} begin \{
document \}}}.
675

677

679

681

683

\begin{minipage }{\ textwidth}


\ lstset { caption ={[Font seings ]Code to set the font to be used .}, label ={ lst : fontSeings }}
\begin{ lstlisting }
\usepaage{fontspec}
\ setmainfont {Linux Libertine O}
\ defaultfontfeatures { Ligatures =TeX}
\end{ lstlisting }
\end{minipage}

685

In Listing \ ref { lst : fontSeings } you can see the code that is used to set the default font for the text . In order to do this
you have to insert the three lines that are shown on Listing \ ref { lst : fontSeings } in the preamble of your document.

687

691

\begin{ itemize }
\item You rst declare that you will be using the \emph{fontspec} package.
\item en you have to select the main font using the \ texttt {\ textbaslash {} setmainfont \{\ ldots \}} command. In that
command you will put in the place of the \ ldots the name of the font that you want to use . For this document you can
see that we are using a font named Linux Libertine O.
\item e last command is issued in order to create ligatures for common groups of leers . Some of those are : , , ,
, , Qea, \emph{Qea}, \emph{f}, \emph{ }, \emph{p}.
\end{itemize }

693

\ subsection { Bibliography , citation and crossreferencing}

695

\ subsubsection {Crossreferencing}
You have seen throughout this text that we have been referring to Figures , Tables , and Listings . is is done by using the
labels that we set up when we insert those elements. When we insert an image we create a label using \ texttt {\
textbaslash {} label \{\ ldots \}}. In the place of \ ldots we put the label that we will use to refer to this element
later . For a gure the label would look like \ texttt {\ textbaslash {} label \{ g : aDiscriptiveLabel \}}. You can see that
we prepend the label with \ texttt { g :}. You can also prepend labels for tables with \ texttt { tab :}. is is so that you
can distinguish the labels at a later point . Because at some point your document may have many labels set up. In order
to refer to a gure you will have to use the \ texttt {\ textbaslash {} ref \{\ ldots \}} command by replacing the \ ldots
with the label that you want to refer to . Be careful though, this only gets the number of the element you are referring .
So, if you want to refer to a gure you should type the word \emph{Figure} and then \ texttt {\ textbaslash {} label \{ g
: myFigure \}}.

689

697

699

701

703

705

707

709

\ subsubsection { Bibliography and citation }


\begin{minipage }{\ textwidth}
\ lstset { caption ={[ Bibliography seings ] Seings for bibliography .}, label ={ lst : bibSeings }}
\begin{ lstlisting }
\usepaage[round,authoryear,merge,sort ]{ natbib }
\ bibliographystyle {agsm}
\bibliography{name_of_the_bibliography_ le }
\end{ lstlisting }
\end{minipage}
Listing \ ref { lst : bibSeings } shows the required commands to create the bibliography and be able to create citations in the
text . e rst line is loading the package \ texttt { natbib } which is used to format the citations that you put in the
text . Here for example the options used will format the citations according to the \ texttt {harvard} style . So it will

Introduction to XELATEX: An alternative document preparation system. by Nikolaos Dimos


is licensed under a Creative Commons Aribution-ShareAlike 3.0 Unported License.

30 B

711

713

715

Source code of this document

use:
\begin{ itemize }
\item \ texttt {round} brackets = parentheses
\item \ texttt {authoryear} form
\item it will \ texttt {merge} continuous citations and separate them with ;
\item it will \ texttt { sort } the citations alphabetically .
\end{itemize }

717

On the second line the bibliography style is declared . In this occasion we are using \ texttt {agsm} which is a \ texttt {harvard
} style . is command should also be in the preamble. It is beer to group those two commands and keep them together in
the preamble.

719

e last command is going to actually load the le that you have the bibliography in . you should save the bibliography le
in the same folder as you save the . tex le of your document. A good way to creating and managing your bibliography
le is \ href { hp :// jabref . sourceforge . net /}{ JabRef }\ footnote{ JabRef : \ url { hp :// jabref . sourceforge . net /}}. \ cite {
smith2005 virtual }

721

\ section { Typeseing Mathematics}


ere are three ways to insert an equation in a document:
\begin{ itemize }
\item e rst way is to create an inline equation like this $\ frac {\ sqrt [3]{8* x +2}}{3* x+5}$ using the following code:
\ texttt {\$\ textbaslash {} frac \{\ textbaslash {} sqrt [3]\{8* x +2\}\}\{3* x +5\}\$}
\item e second way is to create an unnumbered equation like the following one
\[
\ frac {\ sqrt [3]{8* x +2}}{3* x+5}
\]
using the following code :\ texttt {\ textbaslash {}[\ textbaslash {} frac \{\ textbaslash {} sqrt [3]\{8* x +2\}\}\{3* x +5\}\
textbaslash {}]}

723

725

727

729

731

\item And as a numbered equation like the one below, which can also be referenced in the document as Equation \ eqref {eq: test
}.
733

735

737

739

741

743

\begin{equation }\ label {eq: test }


\ frac {\ sqrt [3]{8* x +2}}{3* x+5}
\end{equation}
e code that produces the Equation \ eqref {eq: test } is :
\ lstset { caption ={}, label ={}}
\begin{ lstlisting }
\begin{equation }\ label {eq: test }
\ frac {\ sqrt [3]{8* x +2}}{3* x+5}
\end{equation}
\end{ lstlisting }
\end{itemize }

745

In order to use the \emph{equation} environment you should load the package \emph{amsmath} in the preamble of your document.
is can be done with the following command: \texttt {\ textbaslash {} usepackage\{amsmath\}}
747

\ section {Example tool setups }


749

is section will present an example setup that could be used so that you can start generating and editing documents using \
LaTeX{}.
751

\ subsection {Windows}
753

\ subsubsection {MiKTeX}
755

e rst thing you need to download is a \TeX {}/\ LaTeX{} distribution which will provide the tools to compile the . tex
les into . pdf or some other printable form. For Windows there is a distribution named MiKTeX which can be found at \
href { hp :// miktex.org /}{ hp :// miktex.org /}. Go to the downloads page and download the installer for your version of
Windows. e name of the le you are about to download should look like : Basic MiKTeX 2.9.xxxx Installer
757

Introduction to XELATEX: An alternative document preparation system. by Nikolaos Dimos


is licensed under a Creative Commons Aribution-ShareAlike 3.0 Unported License.

Introduction to XELATEX 31
Detailed instructions on how to make a basic installation of MiKTeX can be found here: \ href { hp :// docs.miktex.org /2.9/
manual/ch02s02.html}{ hp :// docs.miktex.org /2.9/ manual/ch02s02.html }.
759

ere are two things to watch out for that will make your life easier at later points when you use your \LaTeX{} setup.
761

\appendix
763

765

767

769

771

773

775

\ section {RootyHelix}
Figure \ ref { g : rootyHelix } demonstrates the power of \TeX{} in generating more than text ! e image shown in this gure is
created using only \LaTeX{} commands and when you zoom in and out you get more details contrary to what would happen if
you just included a . jpg le .
\begin{ gure }[ h!]
\ capstart
\ centering
\ resizebox {0.8\ textwidth }{!}{
\ includegraphics {./ includes / rootyHelix . pdf}
}
\caption{Root helix }\ label { g : rootyHelix }
\end{ gure }
\newpage
\ section {Source code of this document}

777

779

\ lstset { breaklines =true , columns= exible , caption ={}, label ={}}


\ lstinputlisting {./ latexLecture . tex }

781

\newpage

783

\ nocite {Lamport1986Adps}
\ nocite {Kew2011Tts}
\ nocite {Wikipedia2012CoTeWTFE}
\ nocite {Wikibooks2012LWTFTP}
\bibliography{ latexLecture }
\end{document}

785

787

Introduction to XELATEX: An alternative document preparation system. by Nikolaos Dimos


is licensed under a Creative Commons Aribution-ShareAlike 3.0 Unported License.

32 References

References
[1] Wikipedia, Comparison of TeX editors Wikipedia, e Free Encyclopedia. http://
en.wikipedia.org/w/index.php?title=Comparison_of_TeX_editors, 2012.
[2] Wikibooks, LaTeX Wikibooks, e Free Textbook Project. http://en.wikibooks.
org/w/index.php?title=LaTeX, 2012.
[3] J. Smith and R. Nair, Virtual machines: versatile platforms for systems and processes. Morgan
Kaufmann, 2005.
[4] L. Lamport, Latex A document preparation system. http://www.latex-project.
org/, 1986.
[5] J. Kew, e xetex typeseing system. http://scripts.sil.org/xetex, April 2011.

Introduction to XELATEX: An alternative document preparation system. by Nikolaos Dimos


is licensed under a Creative Commons Aribution-ShareAlike 3.0 Unported License.

You might also like