very basic description of how xelatex works

Upload: nikosdimos

Post on 02-Jun-2018

227 views

Category:

Documents


0 download

TRANSCRIPT

  • 8/10/2019 Very basic description of how XeLaTeX works.

    1/35

    Introduction to X ELATEXAn alternative document preparation system.

    Nikolaos Dimos

    July 5, 2013

  • 8/10/2019 Very basic description of how XeLaTeX works.

    2/35

    Introduction to X ELATEXI

    Contents

    1 Introduction 1

    1.1 What is LA

    TEX? . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11.2 Editors . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1

    2 Parts of a document 2

    3 Creating a document 3

    3.1 Sections and paragraphs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4

    3.2 Lists . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5

    3.3 Figures . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5

    3.3.1 Simple floating figure . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5

    3.3.2 Floating figure with subfigures . . . . . . . . . . . . . . . . . . . . . . 8

    3.4 Tables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9

    3.5 Table of contents, figures, listings, and tables. . . . . . . . . . . . . . . . . . . . 11

    3.6 Choosing fonts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12

    3.7 Bibliography, citation and cross-referencing . . . . . . . . . . . . . . . . . . . 13

    3.7.1 Cross-referencing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13

    3.7.2 Bibliography and citation . . . . . . . . . . . . . . . . . . . . . . . . . 13

    4 Typesetting Mathematics 14

    5 Example tool setups 14

    5.1 Windows . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14

    5.1.1 MiKTeX . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14

    A RootyHelix 15

    B Source code of this document 16

    Introduction to X ELATEX: An alternative document preparation system. byNikolaos Dimosis licensed under aCreative Commons Aribution-ShareAlike 3.0 Unported License.

    http://creativecommons.org/licenses/by-sa/3.0/http://www.scribd.com/doc/97184558/Introduction-to-XeLaTeX-An-alternative-document-preparation-system
  • 8/10/2019 Very basic description of how XeLaTeX works.

    3/35

  • 8/10/2019 Very basic description of how XeLaTeX works.

    4/35

    Introduction to X ELATEX1

    1 Introduction

    1.1 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. X ELATEX 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.

    X ELATEX also supports PDF file creation on its own which means that you dont have to

    compile your text using other programs in addition toxelatex.

    X ELATEX 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 touse 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 X ELATEX 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 offer 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 OpenOffice.org Writer, LibreOffice Writer, Microso Word,

    IBM Lotus Word Pro

    Macros are short, easy to remember commands that invoke some other commands in order to achieve aresult.

    Introduction to X ELATEX: An alternative document preparation system. byNikolaos Dimosis licensed under aCreative Commons Aribution-ShareAlike 3.0 Unported License.

    http://creativecommons.org/licenses/by-sa/3.0/http://www.scribd.com/doc/97184558/Introduction-to-XeLaTeX-An-alternative-document-preparation-system
  • 8/10/2019 Very basic description of how XeLaTeX works.

    5/35

    22 Parts of a document

    nano

    Notepad++

    gedit

    Middle-class ones: ey offer 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 first 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 offer a similar experience to using more mainstream documentprocessing applications such as Microso Word, LibreOffice Writer, OpenOffice Writer,

    AbiWord and iWork Pages.

    LyX

    For a more comprehensive list of editor you can take a look at: Comparison of TEX edi-

    tors[1].

    2 Parts of a document

    Code:

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

    3 \b e g i n{ document }

    H e l l o w o rl d !

    5 \en d{ document }

    Output:

    Hello world!

    Figure 1: e smallest document!

    e code that is shown in Fig. 1 produces

    the smallest and simplest document you can

    create. Its the traditional Hello world! ex-

    ample for X ELATEX. In the first 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 de-fault size of the text in the document will be

    Introduction to X ELATEX: An alternative document preparation system. byNikolaos Dimosis licensed under aCreative Commons Aribution-ShareAlike 3.0 Unported License.

    http://creativecommons.org/licenses/by-sa/3.0/http://www.scribd.com/doc/97184558/Introduction-to-XeLaTeX-An-alternative-document-preparation-systemhttp://en.wikipedia.org/wiki/Comparison_of_TeX_editorshttp://en.wikipedia.org/wiki/Comparison_of_TeX_editorshttp://www.lyx.org/http://www.texniccenter.org/http://kile.sourceforge.net/http://texstudio.sourceforge.net/http://www.xm1math.net/texmaker/http://projects.gnome.org/gedit/http://notepad-plus-plus.org/http://www.nano-editor.org/
  • 8/10/2019 Very basic description of how XeLaTeX works.

    6/35

    Introduction to X ELATEX3

    11ptand that the document will be created as

    anoneside document. Other document class

    options may be draftwhich 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-endpart: \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 define different parts of the document.

    epart of the code that is between the document classdefinition and the \begin{document}

    is thepreamble. In that space you will include any packages that you may use when you cre-

    ate 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 titlepageand 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 \b e g i n{ t i t l e p a g e }

    3 \a u t h o r{ D im os , N i k o l a o s a nd P o u pa 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 \ X eL aT eX { } } \ \

    5 { \ LARGE An a l t e r n a t i v e d oc um en t p r e p a r a t i o n s y st e m . } }

    7 \d a t e { \ v f i l l \ t od a y}

    \ m a k e t i t l e

    9 \ t h i s p a g e s t y l e { empty }

    11 \en d{ t i t l e p a g e }

    Listing 1: Top Maer

    3 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 X ELATEX: An alternative document preparation system. byNikolaos Dimosis licensed under aCreative Commons Aribution-ShareAlike 3.0 Unported License.

    http://creativecommons.org/licenses/by-sa/3.0/http://www.scribd.com/doc/97184558/Introduction-to-XeLaTeX-An-alternative-document-preparation-system
  • 8/10/2019 Very basic description of how XeLaTeX works.

    7/35

    43 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 { W hat a n i c e p a r t ! }

    \ c h a p t e r { W hat a n i c e c h a p t e r ! }

    3 \ s e c t i o n{ T hi s i s a s e c t io n }

    \ s u b s e c t i o n { A s u b s e c t i o n t h en f o l l o w s }

    5 \ s u b s u b s e c t i o n {W0 0 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 m or e 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

    7 \ s u b p a r a g r a p h { B u t we h a v e : } 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,\chaptercan only be used in books and reports. So in order

    to be able to use \chapter, you should have defined in thedocument classthe document as

    either abookor areportlike this: \documentclass[]{book}. Figure 2 shows the output

    of the code quoted in Listing 2. Each sectioning command takes as input some text that isthen used appropriately to name the part/chapter/section/.

    Introduction to X ELATEX: An alternative document preparation system. byNikolaos Dimosis licensed under aCreative Commons Aribution-ShareAlike 3.0 Unported License.

    http://creativecommons.org/licenses/by-sa/3.0/http://www.scribd.com/doc/97184558/Introduction-to-XeLaTeX-An-alternative-document-preparation-system
  • 8/10/2019 Very basic description of how XeLaTeX works.

    8/35

    Introduction to X ELATEX5

    3.2 Lists

    Another commonly used feature in texts, especially in academia, are the lists. Lists are used

    in order to define some key aspects of a problem and make a clear approach on them whichcan be revisited at any time offering 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 define if you want a bullet style

    list (itemize), a numbered list (enumerate), or a list with your defined descriptions (description).

    An aesthetic improvement to thedescriptionstyle 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 figures. One way to put pictures

    in a document is as a wrapped object with the picture floating 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 floating figure

    Another way, and the most common one, is to include pictures as floating objects. Floating

    objects can be set to always float a the top or the boom of the page, or the can be explicitly

    set to float at the current position that they are defined. Generally LATEX will try to position

    floats in a way that they dont create large blank spaces in the text so that it wont disrupt the

    reading. But floating seings can also be defined 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 floats on the top

    of the page regardless of where you include them in the text. is creates a concrete way ofdelivering 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 floats, 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 find condensed informationin a structured way which is easy to grasp.

    Introduction to X ELATEX: An alternative document preparation system. byNikolaos Dimosis licensed under aCreative Commons Aribution-ShareAlike 3.0 Unported License.

    http://creativecommons.org/licenses/by-sa/3.0/http://www.scribd.com/doc/97184558/Introduction-to-XeLaTeX-An-alternative-document-preparation-system
  • 8/10/2019 Very basic description of how XeLaTeX works.

    9/35

    63 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 itemizeenviron-

    ment

    1st item

    1st nested item

    2nd item

    2nd nested item

    (b) Output:e itemize envi-

    ronment\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 enumerateenvi-

    ronment

    1. 1st item

    (a) 1st nested item

    2. 2nd item

    (a) 2nd nested item

    (d) Output:e itemize envi-

    ronment\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 descriptionenvi-

    ronment

    1. 1st item

    (a) 1st nested item

    2. 2nd item

    (a) 2nd nested item

    (f) Output:e itemize envi-

    ronment

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

    Introduction to X ELATEX: An alternative document preparation system. byNikolaos Dimosis licensed under aCreative Commons Aribution-ShareAlike 3.0 Unported License.

    http://creativecommons.org/licenses/by-sa/3.0/http://www.scribd.com/doc/97184558/Introduction-to-XeLaTeX-An-alternative-document-preparation-system
  • 8/10/2019 Very basic description of how XeLaTeX works.

    10/35

    Introduction to X ELATEX7

    1 \b e g i n{ d e s c r i p t i o n }

    \i t e m [ F i r s t ] \ h f i l l \ \

    3 T he f i r s t i t e m\i t e m [ Se c on d ] \ h f i l l \ \

    5 T he s e c o nd i t e m

    \i t e m [ T h i r d ] \ h f i l l \ \

    7 The t h i r d e t c \ l d o t s

    \en d{ d e s c r i p t i o n }

    (a) Input

    First

    e first item

    Second

    e second item

    ird

    e third etc

    (b) Output

    Figure 4: An aesthetic enchancement of thedescriptionenvironment.

    Figure 5: A simple picture include.

    \b e g i n{ f i g u r e } [ h t b p ]

    2 \ c e n t e r i n g

    \ r e s i z e b o x { 0 . 5 \ t e x t w i d t h } { ! } {4 \ i n c l u d e g r a p h i c s { . / i m a g e s / 0 2 0 6 1 2 4 . jpg }

    }

    6 \c a p t i o n {A s i mp l e p i c t u r e i n c l u de . } \ 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 }

    \en d{ 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 floating figure environ-ment. Between those two lines the appropriate code to create the figure should be

    entered.

    e main parts of a figure 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 forthis picture in order to be cross-referenced later anywhere in the document.

    Introduction to X ELATEX: An alternative document preparation system. byNikolaos Dimosis licensed under aCreative Commons Aribution-ShareAlike 3.0 Unported License.

    http://creativecommons.org/licenses/by-sa/3.0/http://www.scribd.com/doc/97184558/Introduction-to-XeLaTeX-An-alternative-document-preparation-system
  • 8/10/2019 Very basic description of how XeLaTeX works.

    11/35

    83 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 com-

    mand generally works like \resizebox{width}{height}{image to beresized}. You should notice that in the field where we should have put theheight 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 figure with subfigures

    In order to create a group of figures like the one shown in Fig. 6 you would have to use the

    code that is shown in Listing 4. But before writing the subfigure code you should include

    in the preamble of your document the packagesubfig. In order to include this package youshould use the command\usepackage{subfig}.

    In order to create such a figure with one or more subfigures you have to create a figure

    environment like we do in Listing 4, Line 1. e you have to create two subfigureenvironments

    (\begin{subfigure}\end{subfigure}) inside which you will include the images like you

    would normally do as if you were to include a single floating image. You are also able to assign

    captionsand labelsto the subfigures so you can refer directly to them from the document.

    (a)e first picture (b)e second picture

    Figure 6: A caption that is about all the pictures in the figure. Lorem ipsum dolor sit amet,

    consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore

    magna aliqua.

    Introduction to X ELATEX: An alternative document preparation system. byNikolaos Dimosis licensed under aCreative Commons Aribution-ShareAlike 3.0 Unported License.

    http://creativecommons.org/licenses/by-sa/3.0/http://www.scribd.com/doc/97184558/Introduction-to-XeLaTeX-An-alternative-document-preparation-system
  • 8/10/2019 Very basic description of how XeLaTeX works.

    12/35

    Introduction to X ELATEX9

    1 \b e g i n{ f i g u r e } [ h t b p ]

    \ c e n t e r i n g

    3 \b e g i n{ s u b f ig ur e } [ t ] { 0 . 3 \ t e x t w i d t h}

    \ c e n t e r i n g

    5 \ r e s i z e b o x { 1 \ t e x t w i d t h } { ! } {\ i n c l u d e g r a p h i c s { . / i m a g e s / 0 2 0 6 1 2 4 . jpg }

    7 }

    \ c a p t i o n{ T he f i r s t p i c t u r e }

    9 \ l a b e l { f i g : f i r s t P i c I n S u b f i g }

    \en d{ s u b f i g u r e } %

    11 \quad % ad d d e s i r e d s p a c i n g b e tw e en i m ag e s , e . g . ~ , \ q ua d , \ q qu ad e t c .

    % ( o r a b la nk l i n e t o f o r ce t he s u bf i g ur e o nt o a new l i n e )

    13 \b e g i n{ s u b f ig ur e } [ t ] { 0 . 3 \ t e x t w i d t h}

    \ c e n t e r i n g

    15 \ r e s i z e b o x { \ t e x t w i d t h } { ! } {

    \ i n c l u d e g r a p h i c s { . / i m a g e s / 0 2 0 6 1 2 4 . jpg }17 }

    \ c a p t i o n{ T he s e c o nd p i c t u r e }

    19 \ l a b e l { f i g : s e c o n d P i c I n S u b f i g }\en d{ s u b f i g u r e }

    21 \c a p t i o n[ S u b f ig u r e o u tp u t ] { A c a p t i o n t h a t i s a bo ut a l l t h e p i c t u r e s i n t h e

    f i g u r e . Lorem i ps um d o l o r s i t amet , c o n s e c t e tu r a d i p i s i c i n g e l i t , s ed

    23 do e i u sm od t e m po r 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 m agna a l i q u a . }

    \ l a b e l { f i g : s u b f i g D e m o n s t r a t i o n }

    25 \en d{ f i g u r e }

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

    3.4 Tables

    Another way to present data except from importing figures is creating tables. In Listing 5 you

    can see the code that generates Table 1. You can see that thetableenvironment is similar to

    thefigure. We begin atableenvironment and then inside we insert the following commands:

    We see again the\centeringcommand which is used to center the table in the page.

    Aer that we see an environment in which we will define the table. etabular en-

    vironment. You can see that we again\begin\end the tabularenvironment as any

    other environment.

    e tabular environment has some arguments though,{|r|l|}. ese arguments de-

    fine the number of columns and the looks of them.

    Having two leers inside the brackets{} means that the table will be a two col-

    umn 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 X ELATEX: An alternative document preparation system. byNikolaos Dimosis licensed under aCreative Commons Aribution-ShareAlike 3.0 Unported License.

    http://creativecommons.org/licenses/by-sa/3.0/http://www.scribd.com/doc/97184558/Introduction-to-XeLaTeX-An-alternative-document-preparation-system
  • 8/10/2019 Very basic description of how XeLaTeX works.

    13/35

    103 Creating a document

    e last observation has to do with the text alignment inside each cell. the leerr

    and l that are shown inside the brackets denote that the text in the cells of the first

    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 wouldalign the text in the center.

    Aer the table definition we have the definitions of every line. At the first line we see

    the command\hlinewhich is the command that creates the horizontal borders of the

    cells in the table.

    en we have a normal line. e data in the first column will be7C0and in the second

    hexadecimalthe 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{startingcolumn-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 find 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 Excelor a similar program and use a specific extension for that program in order to generate

    copy-pasteable LATEX code. Such extension for Excel is theexcel2latexwhich can be

    foundhere.

    ere are also other extensions for other popular products that are used to produce

    tabular data like OpenOffice.org Calc, R, MATLAB. Links to them can be foundhere.

    CTAN archive forexcel2latex: http://www.ctan.org/tex-archive/support/excel2latex/Wikibooks site: http://en.wikibooks.org/wiki/LaTeX/Tables

    Introduction to X ELATEX: An alternative document preparation system. byNikolaos Dimosis licensed under aCreative Commons Aribution-ShareAlike 3.0 Unported License.

    http://creativecommons.org/licenses/by-sa/3.0/http://www.scribd.com/doc/97184558/Introduction-to-XeLaTeX-An-alternative-document-preparation-systemhttp://en.wikibooks.org/wiki/LaTeX/Tableshttp://www.ctan.org/tex-archive/support/excel2latex/http://en.wikibooks.org/wiki/LaTeX/Tableshttp://www.ctan.org/tex-archive/support/excel2latex/
  • 8/10/2019 Very basic description of how XeLaTeX works.

    14/35

    Introduction to X ELATEX11

    1 \b e g i n{ t a b l e } [ h t bp ]

    \ c e n t e r i n g

    3 \b e g i n{ ta b ul a r } { | r | l | }

    \h l i n e

    5 7 C0 & h e x a d e c i m al \ \3 70 0 & o c t a l \ \

    7 \ c l i n e{ 22 }1 1 1 11 0 0 00 0 0 & b i n a r y \ \

    9 \h l i n e \ h l i n e

    1 9 84 & d e c i ma l \ \

    11 \h l i n e

    $ \ f r a c { \ s q r t [ 3 ] { 8 * x + 2 } } { 3 * x + 5 } $ & m at h \ \

    13 \h l i n e

    \en d{ t a b u l a r }

    15 \ c a p t i o n {A S am pl e t a b l e }

    \ l a b e l { ta b : s a m pl e Ta b l e }

    17 \en d{ t a b l e }

    Listing 5: e code to generate Table 1

    7C0 hexadecimal

    3700 octal

    11111000000 binary

    1984 decimal38x+23x+5 math

    Table 1: A Sample table

    3.5 Table of contents, figures, listings, and tables.

    If you have followed the previous examples to create Sections, subsections, figures, tables

    creating a Table of Contents or a List of figures 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{ pa ge } { 1 }

    \pagenumbering{ Roman }

    3

    \ t a b l e o f c o n t e n t s

    5

    \newpage

    7 \ l i s t o f f i g u r e s

    \v s p a c e { 1 . 5 cm }

    9 \ l s t l i s t o f l i s t i n g s

    \v s p a c e { 1 . 5 cm }

    11 \ l i s t o f t a b l e s

    13 \newpage

    \s e t c o u n t e r{ pa ge } { 1 }

    15 \pagenumbering{ a r a b i c }

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

    Introduction to X ELATEX: An alternative document preparation system. byNikolaos Dimosis licensed under aCreative Commons Aribution-ShareAlike 3.0 Unported License.

    http://creativecommons.org/licenses/by-sa/3.0/http://www.scribd.com/doc/97184558/Introduction-to-XeLaTeX-An-alternative-document-preparation-system
  • 8/10/2019 Very basic description of how XeLaTeX works.

    15/35

    123 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 cre-

    ate the respective lists. e rest of the code that you see in Listing 6 are there only for for-

    maing reasons.

    e first 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\newpagecommand 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 finishes 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 commandsin the preamble.

    1 \use p a ck a g e{ f o n t s p e c }

    \ s e t m a i n f o n t { L i nu x L i b e r t i n e O }

    3 \ 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 first declare that you will be using thefontspecpackage.

    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: , fi, ffi, , , Qea,Qea,f,fi,p.

    e segment of the .tex file that is between the \documentclassand the\begin{document}

    Introduction to X ELATEX: An alternative document preparation system. byNikolaos Dimosis licensed under aCreative Commons Aribution-ShareAlike 3.0 Unported License.

    http://creativecommons.org/licenses/by-sa/3.0/http://www.scribd.com/doc/97184558/Introduction-to-XeLaTeX-An-alternative-document-preparation-system
  • 8/10/2019 Very basic description of how XeLaTeX works.

    16/35

    Introduction to X ELATEX13

    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 List-ings. 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 la-

    bel that we will use to refer to this element later. For a figure the label would look like

    \label{fig:aDiscriptiveLabel}. You can see that we prepend the label withfig:. You

    can also prepend labels for tables withtab:. 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 figure 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 figure you should type the wordFigureandthen\label{fig:myFigure}.

    3.7.2 Bibliography and citation

    1 \use p a ck a g e[ r oun d , a uth o r ye a r , m e rge , s or t ] { n a tb ib }

    \ b i b l i o g r a p h y s t y l e{ agsm }

    3

    \ b i b l i o g r a p h y { n am e_ 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 first line is loading the package natbibwhich is used to format the

    citations that you put in the text. Here for example the options used will format the citations

    according to theharvardstyle. So it will use:

    roundbrackets = parentheses

    authoryearform

    it willmergecontinuous citations and separate them with ;

    it willsortthe citations alphabetically.

    On the second line the bibliography style is declared. In this occasion we are using agsm

    which is aharvardstyle. 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 file that you have the bibliography in. you

    should save the bibliography file in the same folder as you save the .tex file of your document.

    A good way to creating and managing your bibliography file is JabRef. [3]

    JabRef: http://jabref.sourceforge.net/

    Introduction to X ELATEX: An alternative document preparation system. byNikolaos Dimosis licensed under aCreative Commons Aribution-ShareAlike 3.0 Unported License.

    http://creativecommons.org/licenses/by-sa/3.0/http://www.scribd.com/doc/97184558/Introduction-to-XeLaTeX-An-alternative-document-preparation-systemhttp://jabref.sourceforge.net/http://jabref.sourceforge.net/
  • 8/10/2019 Very basic description of how XeLaTeX works.

    17/35

    145 Example tool setups

    4 Typesetting Mathematics

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

    e first way is to create an inline equation like this 38x+23x+5 using the following code:

    $\frac{\sqrt[3]{8*x+2}}{3*x+5}$

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

    3

    8 x+ 23 x+ 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

    8 x+ 23 x+ 5 )(1

    e code that produces the Equation )1( is:

    \b e g i n{ e q u a t i o n } \ l a b e l { eq : t e s t }

    2 \ f r a c { \ s q r t [ 3 ] { 8 * x + 2 } } { 3 * x + 5}

    \en d{ e q u a t i o n }

    In order to use the equationenvironment you should load the package amsmathin the

    preamble of your document. is can be done with the following command:\usepackage{amsmath}

    5 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 first thing you need to download is a TEX/LATEX distribution which will provide the tools

    to compile the .tex files into .pdf or some other printable form. For Windows there is a

    distribution named MiKTeX which can be found athp://miktex.org/. Go to the downloads

    page and download the installer for your version of Windows. e name of the file 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 whenyou use your LATEX set-up.

    Introduction to X ELATEX: An alternative document preparation system. byNikolaos Dimosis licensed under aCreative Commons Aribution-ShareAlike 3.0 Unported License.

    http://creativecommons.org/licenses/by-sa/3.0/http://www.scribd.com/doc/97184558/Introduction-to-XeLaTeX-An-alternative-document-preparation-systemhttp://docs.miktex.org/2.9/manual/ch02s02.htmlhttp://miktex.org/
  • 8/10/2019 Very basic description of how XeLaTeX works.

    18/35

    http://creativecommons.org/licenses/by-sa/3.0/http://www.scribd.com/doc/97184558/Introduction-to-XeLaTeX-An-alternative-document-preparation-system
  • 8/10/2019 Very basic description of how XeLaTeX works.

    19/35

    16B Source code of this document

    B Source code of this document

    1 %%is work is licensed under the Creative Commons AributionShareAlike

    %%3.0 Unported License . To view a copy of this license , visit3 %%hp ://creativecommons.org/ licenses /bysa/3.0/ or send a leer to:

    %%

    5 %%Creative Commons

    %%444 Castro Street

    7 %%Suite 900

    %%Mountain View

    9 %%California , 94041

    %%USA

    11

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

    15 %Font seings

    \usepaage{ xltxtra }

    17 \usepaage{xunicode}

    \usepaage{fontspec}

    19 \ defaultfontfeatures { Ligatures =TeX}

    \ setmainfont{Linux Libertine O}

    21

    %%Include various packages

    23

    %A package that you need in order provide more extensive

    25 %math functionality in your document e.g. add numbered equations

    \usepaage{amsmath}

    27

    %A package that shrinks the margins of the page.

    29

    \usepaage{fullpage}

    31 %A package to create fancy headers and footers

    \usepaage{fancyhdr}

    33 \ setlength {\ headheight}{20pt}

    35 %Set the pagestyle to fancy

    \ pagestyle {fancy}

    37

    %Clear the header style

    39 \fancyhead{}

    41 %Set the new header style

    \fancyhead[LE] {\textbf{\ thepage} \textbf{\nouppercase\lemark}\vspace{1cm}}43 \fancyhead[RO] {\ textbf{ Introduction to \XeLaTeX{}} \textbf{\thepage}\vspace{1cm}}

    \renewcommand{\headrulewidth}{0pt}% remove lines as well}

    45

    %Set the footer style

    47 \ fancyfoot[ C ]{\ includegraphics [ scale =.7]{./ images/bysa.pdf}\\\begin{ scriptsize }

    49 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 }.\\

    51 \end{ scriptsize }}

    53 %A package to create wrapped figures in the text .

    \usepaage{wrapfig}

    55

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

    Introduction to X ELATEX: An alternative document preparation system. byNikolaos Dimosis licensed under aCreative Commons Aribution-ShareAlike 3.0 Unported License.

    http://creativecommons.org/licenses/by-sa/3.0/http://www.scribd.com/doc/97184558/Introduction-to-XeLaTeX-An-alternative-document-preparation-system
  • 8/10/2019 Very basic description of how XeLaTeX works.

    20/35

  • 8/10/2019 Very basic description of how XeLaTeX works.

    21/35

    18B Source code of this document

    117 \newfontfamily\greekfont{ Old Standard}

    \newfontfamily\ arabicfont { Scheherazade Graphite Alpha}

    119 \newfontfamily\monofont{Linux Biolinum O}

    121%Set the default options for the code listings in this document.

    123 \ lstset {language=[LaTeX]TeX,

    basicstyle =\ scriptsize ,

    125 numbers=le,

    numberstyle=\tiny\ color{gray },

    127 stepnumber=2,

    numbersep=15pt,

    129 stringstyle =\ ttfamily,

    columns=fixed,

    131 rulecolor =\ color{ black },

    commentstyle=\color{dkgreen},

    133 captionpos=b,

    tabsize =3}

    135

    %Sets the bibliography style .

    137 \ bibliographystyle{ ieeetr }

    139 %Set the line spacing.

    \ linespread{1.15}

    141

    \begin{document}

    143

    \begin{ titlepage }

    145

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

    147 \ title {{\HugeIntroduction to \XeLaTeX {}}\\

    {\ LARGEAn alternative document preparation system .}}

    149

    \date {\ vfill \ today}

    151 \ maketitle

    \thispagestyle{empty}

    153

    \end{ titlepage }

    155 \ setcounter {page }{1}

    \pagenumbering{Roman}

    157 \ label {toc}

    \ tableofcontents

    159 \newpage

    \ label { lists }

    161 \ listoffigures

    \vspace {1.5cm}163 \ lstlistoflistings

    \vspace {1.5cm}

    165 \ listoables

    \newpage

    167

    169 \ setcounter {page }{1}

    \pagenumbering{arabic}

    171 \ 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 OpenOffice.org Writer, LibreOffice Writer,Microso Word,

    Introduction to X ELATEX: An alternative document preparation system. byNikolaos Dimosis licensed under aCreative Commons Aribution-ShareAlike 3.0 Unported License.

    http://creativecommons.org/licenses/by-sa/3.0/http://www.scribd.com/doc/97184558/Introduction-to-XeLaTeX-An-alternative-document-preparation-system
  • 8/10/2019 Very basic description of how XeLaTeX works.

    22/35

    Introduction to X ELATEX19

    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:

    177 \begin{ itemize }

    \item Unicode encoding of text . is means that you can write:179 \begin{ itemize}

    \item \ textbf{ English :} Hello world!,

    181 \item \ textbf{Greek:} \ textgreek{ !},

    \item \ textbf{Arabic:} \begin{ flushright }\ textarabic [ locale=mashriq]{ !}

    183 \end{ flushright }

    \item and \ textbf{ Polytonic Greek:} \ textgreek[ variant=poly]{

    \ ldots }

    185 in the same text without changing the encoding of the document itself .

    \end{itemize }

    187

    \item \XeLaTeX{} also supports PDF file creation on it s own which means that you dont have to compile your text using other

    programs in addition to \emph{xelatex}.

    189 \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 everymodern document processing application .

    \end{itemize}

    191

    \ subsection { Editors }

    193 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 nographical environment at all , to the most complex editors available for every OS out there . Some examples of editors

    would be:

    \begin{ itemize }

    195 \item \ textbf{Simple ones :} Although they may offer 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}

    197 \item \ href { hp :// www.nanoeditor.org/}{nano}\item \ href { hp :// notepadplusplus.org/}{Notepad++}

    199 \item \ href{ hp :// projects .gnome.org/gedit /}{ gedit }

    \end{itemize }

    201 \item \ textbf{Middleclass ones:} ey offer command auto complete, spell checking options , shortcut creation , automation ofthe compilation process .

    \begin{ itemize}

    203 \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

    first place .

    205

    But this is exactly where opensource development comes in. e developers of Texmaker for some reason they didn timplement 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.

    207 \item \ href { hp :// kile .sourceforge. net /}{ Kile}

    \item \ href{ hp :// www.texniccenter.org/}{ TeXnicCenter}

    209 \end{itemize }

    \item \ textbf{WYSIWYG ones:} ese offer a similar experience to using more mainstream document processing applications such

    as Microso Word, LibreOffice Writer, OpenOffice Writer, AbiWord and iWork Pages.

    211 \begin{ itemize}

    \item \ href{ hp :// www.lyx.org/}{LyX}

    213 \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 X ELATEX: An alternative document preparation system. byNikolaos Dimosis licensed under aCreative Commons Aribution-ShareAlike 3.0 Unported License.

    http://creativecommons.org/licenses/by-sa/3.0/http://www.scribd.com/doc/97184558/Introduction-to-XeLaTeX-An-alternative-document-preparation-system
  • 8/10/2019 Very basic description of how XeLaTeX works.

    23/35

    20B Source code of this document

    217

    \ section { Parts of a document}

    219

    221

    223 \begin{wrapfigure }{ r }{0.5\ textwidth}

    \ capstart

    225 \centering

    \vspace{5pt}227 \ textbf{Code:}

    \ lstset {numbersep=3pt}

    229 \begin{ lstlisting }

    \documentclass[11pt,oneside]{ article }

    231

    \begin{document}

    233 Hello world!

    \end{document}

    235 \end{ lstlisting }\ textbf{Output:}

    237 \begin{quote}

    Hello world!

    239 \end{quote}

    \vspace{5pt}241 \caption {e smallest document!}\label { fig :smallDocument}

    \end{wrapfigure}

    243

    e code that is shown in Fig. \ ref{ fig :smallDocument} produces the smallest and simplest document you can create . It s the

    traditional Hello world! example for \XeLaTeX{}. In the first 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{11pt, 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 interline 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 paernshould 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 define different parts of the document.

    247

    e part of the code that is between the \emph{document class} definition 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 someaesthetic 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 selfexplanatory.251

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

    253 \begin{minipage }{\ textwidth}

    \begin{ lstlisting }

    255 \begin{ titlepage }

    257 \author{Dimos, Nikolaos and Poupakis, Stavros }

    \ title {{\HugeIntroduction to \XeLaTeX {}}\\

    259 {\ LARGEAn alternative document preparation system .}}

    261 \date {\ vfill \ today}\ maketitle

    Introduction to X ELATEX: An alternative document preparation system. byNikolaos Dimosis licensed under aCreative Commons Aribution-ShareAlike 3.0 Unported License.

    http://creativecommons.org/licenses/by-sa/3.0/http://www.scribd.com/doc/97184558/Introduction-to-XeLaTeX-An-alternative-document-preparation-system
  • 8/10/2019 Very basic description of how XeLaTeX works.

    24/35

    Introduction to X ELATEX21

    263 \thispagestyle{empty}

    265 \end{ titlepage }

    \end{ lstlisting }

    267 \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}

    273 \item Sections and paragraphs

    \item Lists

    275 \item Figures

    \item Tables

    277 \item Table of contents , Table of Figures

    \item Seing the font to be used

    279 \item Adding bibliography\end{enumerate}

    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

    \begin{minipage }{\ textwidth}

    287 \ lstset {caption={Showcase of sectioning commands}, label={ lst :sectioningCommandsInput}}

    \begin{ lstlisting }

    289 \ part {What a nice part !}

    \ chapter {What a nice chapter !}

    291 \ section {is is a section }

    \ subsection{ A subsection then follows}

    293 \ subsubsection {W00t! A Subsubsection !}

    \paragraph{A paragraph now:} No more subsubsubsub\ldots subsections

    295 \subparagraph{But we have:} a Subparagraph!

    \end{ lstlisting }

    297 \end{minipage}

    299

    \begin{ figure }[ htbp]

    301 \ capstart

    \centering

    303 \ includegraphics [ scale =.5]{./ images/ sectioning . pdf}

    \caption {Output of the sectioning commands.}\label{ fig :sectioningCommandsOutput}

    305 \end{figure }

    307 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 defined 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

    { fig : 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 define some key

    aspects of a problem and make a clear approach on them which can be revisited at any time offering very good user

    experience \ footnote {User experience in the terms of; a user who gets back to a list of items will seek to find

    condensed information in a structured way which is easy to grasp .}.

    311

    \begin{ figure }[ htbp]

    Introduction to X ELATEX: An alternative document preparation system. byNikolaos Dimosis licensed under aCreative Commons Aribution-ShareAlike 3.0 Unported License.

    http://creativecommons.org/licenses/by-sa/3.0/http://www.scribd.com/doc/97184558/Introduction-to-XeLaTeX-An-alternative-document-preparation-system
  • 8/10/2019 Very basic description of how XeLaTeX works.

    25/35

    22B Source code of this document

    313 \centering

    \begin{ subfigure }[b ]{0.3\textwidth}

    315 \centering

    \begin{verbatim}

    317 \begin{ itemize}\ item 1st item

    319 \begin{ itemize }

    \item 1st nested item

    321 \end{itemize}

    \ item 2nd item

    323 \begin{ itemize }

    \item 2nd nested item

    325 \end{itemize}

    \end{itemize }

    327 \end{verbatim}

    \caption {\textbf{Input :} e \emph{itemize} environment}

    329 \ label { fig : itemizeEnvInput}

    \end{subfigure} %

    331 \quad %add desired spacing between images, e . g. ~, \quad, \qquad etc.%(or a blank line to force the subfigure onto a new line )

    333 \begin{ subfigure }[b ]{0.3\textwidth}

    \centering

    335 \begin{ itemize }

    \item 1st item

    337 \begin{ itemize}

    \item 1st nested item

    339 \end{itemize }

    \item 2nd item

    341 \begin{ itemize}

    \item 2nd nested item

    343 \end{itemize }

    \end{itemize}

    345 \caption {\textbf{Output:}e \emph{itemize} environment}

    \ label { fig :itemizeEnvOutput}

    347 \end{subfigure}

    \\ \hrule%add desired spacing between images, e . g. ~, \quad, \qquad etc.

    349 %(or a blank line to force the subfigure onto a new line )

    \begin{ subfigure }[b ]{0.3\textwidth}

    351 \centering

    \begin{verbatim}

    353 \begin{enumerate}

    \item 1st item

    355 \begin{enumerate}

    \ item 1st nested item

    357 \end{enumerate}

    \item 2nd item359 \begin{enumerate}

    \ item 2nd nested item

    361 \end{enumerate}

    \end{enumerate}

    363 \end{verbatim}

    \caption {\textbf{Input :} e \emph{enumerate} environment}

    365 \ label { fig : enumEnvInput}

    \end{subfigure}

    367 \qquad\qquad

    \begin{ subfigure }[b ]{0.3\textwidth}

    369 \centering

    \begin{enumerate}

    371 \item 1st item

    \begin{enumerate}373 \item 1st nested item

    Introduction to X ELATEX: An alternative document preparation system. byNikolaos Dimosis licensed under aCreative Commons Aribution-ShareAlike 3.0 Unported License.

    http://creativecommons.org/licenses/by-sa/3.0/http://www.scribd.com/doc/97184558/Introduction-to-XeLaTeX-An-alternative-document-preparation-system
  • 8/10/2019 Very basic description of how XeLaTeX works.

    26/35

    Introduction to X ELATEX23

    \end{enumerate}

    375 \item 2nd item

    \begin{enumerate}

    377 \item 2nd nested item

    \end{enumerate}379 \end{enumerate}

    \caption {\textbf{Output:}e \emph{itemize} environment}

    381 \ label { fig :enumeEnvOutput}

    \end{subfigure}

    383 \\ \hrule%add desired spacing between images, e . g. ~, \quad, \qquad etc.

    %(or a blank line to force the subfigure onto a new line )

    385 \begin{ subfigure }[b ]{0.3\textwidth}

    \centering

    387 \begin{verbatim}

    \begin{enumerate}

    389 \item 1st item

    \begin{enumerate}

    391 \ item 1st nested item

    \end{enumerate}393 \item 2nd item

    \begin{enumerate}

    395 \ item 2nd nested item

    \end{enumerate}

    397 \end{enumerate}

    \end{verbatim}

    399 \caption {\textbf{Input :} e \emph{description} environment}

    \ label { fig :descEnvInput}

    401 \end{subfigure}

    \qquad\qquad

    403 \begin{ subfigure }[b ]{0.3\textwidth}

    \centering

    405 \begin{enumerate}

    \item 1st item

    407 \begin{enumerate}

    \item 1st nested item

    409 \end{enumerate}

    \item 2nd item

    411 \begin{enumerate}

    \item 2nd nested item

    413 \end{enumerate}

    \end{enumerate}

    415 \caption {\textbf{Output:}e \emph{itemize} environment}

    \ label { fig :descEnvOutput}

    417 \end{subfigure}

    \caption {e available ways of creating lists in \LaTeX{}.}\ label { fig : listEnv }

    419 \end{figure }

    421 In Fig. \ ref{ fig : listEnv } you can see the code that is required (\ref{ fig :itemizeEnvInput }, \ ref{ fig : enumEnvInput}, \ ref{ fig :

    descEnvInput}) in order to produce the respective list style (\ref{ fig :itemizeEnvOutput}, \ ref{ fig : enumeEnvOutput}, \ref

    { fig :descEnvOutput}). e basic concept is that you only need to define if you want a bullet style list (\ emph{itemize})

    , a numbered list (\ emph{enumerate}), or a list with your defined 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{ fig :aesthEnchDesc}.

    \begin{ figure }

    423 \centering

    \begin{ subfigure }[b ]{0.4\linewidth}

    425 \ centering

    \ lstset {caption ={}, label ={}}

    427 \begin{ lstlisting }

    \begin{ description }429 \item[ First ] \ hfill \\

    Introduction to X ELATEX: An alternative document preparation system. byNikolaos Dimosis licensed under aCreative Commons Aribution-ShareAlike 3.0 Unported License.

    http://creativecommons.org/licenses/by-sa/3.0/http://www.scribd.com/doc/97184558/Introduction-to-XeLaTeX-An-alternative-document-preparation-system
  • 8/10/2019 Very basic description of how XeLaTeX works.

    27/35

    24B Source code of this document

    e first item

    431 \item[Second] \ hfill \\

    e second item

    433 \item[ird] \ hfill \\

    e third etc \ ldots435 \end{ description }

    \end{ lstlisting }

    437 \caption {\textbf{Input }}

    \ label { fig :enchancedDescInput}

    439 \end{subfigure} %

    \qquad %add desired spacing between images, e . g. ~, \quad, \qquad etc.

    441 %(or a blank line to force the subfigure onto a new line)

    \begin{ subfigure }[b ]{0.4\linewidth}

    443 \ centering

    \begin{ description }

    445 \item[ First ] \ hfill \\

    e first item

    447 \item[Second] \ hfill \\

    e second item449 \item[ird] \ hfill \\

    e third etc \ ldots

    451 \end{ description }

    \caption {\textbf{Output}}

    453 \ label { fig :enchancedDescOutput}

    \end{subfigure}

    455 \caption[Enchanced description environment.]{An aesthetic enchancement of the \emph{description} environment.}\label { fig :

    aesthEnchDesc}

    \end{figure }

    457

    \ subsection{ Figures}

    459

    Another very common thing in documents is the inclusion of figures . One way to put pictures in a document is as a wrapped

    object with the picture floating 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

    \ subsubsection{Simple floating figure }

    463 Another way, and the most common one, is to include pictures as floating objects . Floating objects can be set to always float

    a the top or the boom of the page, or the can be explicitly set to float at the current position that they are

    defined. Generally \ LaTeX{} will try to position floats in a way that they dont create large blank spaces in the text

    so that it wont disrupt the reading . But floating seings can also be defined 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 floats 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 floats , 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{ figure }[ htbp]

    \ capstart

    469 \centering

    \ resizebox {0.3\textwidth }{!}{

    471 \ includegraphics {./ images/0206124.jpg}}

    473 \caption {A simple picture include .}\ label { fig : simplePictureInclude }

    \end{figure }

    475

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

    Introduction to X ELATEX: An alternative document preparation system. byNikolaos Dimosis licensed under aCreative Commons Aribution-ShareAlike 3.0 Unported License.

    http://creativecommons.org/licenses/by-sa/3.0/http://www.scribd.com/doc/97184558/Introduction-to-XeLaTeX-An-alternative-document-preparation-system
  • 8/10/2019 Very basic description of how XeLaTeX works.

    28/35

  • 8/10/2019 Very basic description of how XeLaTeX works.

    29/35

    26B Source code of this document

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

    523 \ centering

    \ resizebox {1\textwidth }{!}{

    525 \ includegraphics {./ images/0206124.jpg}

    }527 \caption {e first picture }

    \ label { fig : firstPicInSubfig }

    529 \end{subfigure} %

    \quad %add desired spacing between images, e . g. ~, \quad, \qquad etc.

    531 %(or a blank line to force the subfigure onto a new line )

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

    533 \ centering

    \ resizebox {\textwidth }{!}{

    535 \ includegraphics {./ images/0206124.jpg}}

    537 \caption {e second picture }

    \ label { fig : secondPicInSubfig }

    539 \end{subfigure}

    \caption[Subfigure output]{A caption that is about all the pictures in the figure . Lorem ipsum dolor sit amet, consecteturadipisicing elit , sed do eiusmod tempor incididunt ut labore et dolore magna aliqua .}\ label { fig :subfigDemonstration}

    541 \end{figure }

    543 \begin{minipage }{\ textwidth}

    \ lstset { caption ={[Code to generate subfigure .]e code to generate the subfigure shown in Fig. \ ref{ fig :subfigDemonstration

    }}, label ={ lst : subfigDemonstrationCode}}

    545 \begin{ lstlisting }

    \begin{ figure }[ htbp]

    547 \centering

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

    549 \centering

    \ resizebox {1\textwidth }{!}{

    551 \ includegraphics {./ images/020612

    4.jpg}

    }

    553 \caption {e first picture }

    \ label { fig : firstPicInSubfig }

    555 \end{subfigure} %

    \quad%add desired spacing between images, e .g . ~, \quad, \qquad etc.

    557 %(or a blank line to force the subfigure onto a new line )

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

    559 \centering

    \ resizebox {\textwidth }{!}{

    561 \ includegraphics {./ images/0206124.jpg}}

    563 \caption {e second picture }

    \ label { fig : secondPicInSubfig }

    565 \end{subfigure}\caption[Subfigure output]{ A caption that is about all the pictures in the

    567 figure . Lorem ipsum dolor sit amet, consectetur adipisicing elit , sed

    do eiusmod tempor incididunt ut labore et dolore magna aliqua.}

    569 \ label { fig : subfigDemonstration}

    \end{figure }

    571 \end{ lstlisting }

    \end{minipage}

    573

    \ subsection{ Tables }

    575

    Another way to present data except from importing figures 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{figure}. 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 X ELATEX: An alternative document preparation system. byNikolaos Dimosis licensed under aCreative Commons Aribution-ShareAlike 3.0 Unported License.

    http://creativecommons.org/licenses/by-sa/3.0/http://www.scribd.com/doc/97184558/Introduction-to-XeLaTeX-An-alternative-document-preparation-system
  • 8/10/2019 Very basic description of how XeLaTeX works.

    30/35

    Introduction to X ELATEX27

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

    579 \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 define 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.

    581 \item e tabular environment has some arguments though, \texttt {\{| r | l |\}}. ese arguments define the number of columnsand the looks of them.

    \begin{ itemize } %\itemsep1pt \ parskip1pt \parsep1pt

    583 \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.

    585 \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 first 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}

    587 \item Aer the table definition we have the definitions of every line . At the first 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 first 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.

    589 \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 incell . 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 find 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

    specific extension for that program in order to generate copy

    pasteable \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 {CTANarchive for \emph{excel2latex }: \ url { hp :// www.ctan.org/texarchive/support/excel2latex /}}.

    595 ere are also other extensions for other popular products that are used to produce tabular data like OpenOffice.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}

    597 \begin{minipage }{\ textwidth}

    599 \ lstset {caption={[Code to generate Table .]e code to generate Table \ ref{ tab :sampleTable }}, label ={ lst :sampleTableCode}}

    \begin{ lstlisting }

    601 \begin{ table }[htbp]

    \centering

    603 \begin{ tabular }{| r| l |}\ hline

    605 7C0 & hexadecimal \\

    3700 & octal \\

    607 \ cline {22}11111000000 & binary \\

    609 \ hline \ hline

    1984 & decimal \\

    611 \ hline

    $\ frac{\sqrt[3]{8* x +2}}{3* x+5}$ & math\\

    613 \ hline

    \end{ tabular }

    615 \caption {A Sample table }

    \ label { tab: sampleTable}

    617 \end{table }\end{ lstlisting }

    Introduction to X ELATEX: An alternative document preparation system. byNikolaos Dimosis licensed under aCreative Commons Aribution-ShareAlike 3.0 Unported License.

    http://creativecommons.org/licenses/by-sa/3.0/http://www.scribd.com/doc/97184558/Introduction-to-XeLaTeX-An-alternative-document-preparation-system
  • 8/10/2019 Very basic description of how XeLaTeX works.

    31/35

    28B Source code of this document

    619 \end{minipage}

    621 \begin{ table }[htbp]

    \centering

    623 \begin{ tabular }{| r| l |}\hline7C0 & hexadecimal \\

    625 3700 & octal \\ \ cline {22}11111000000 & binary \\

    627 \ hline \ hline

    1984 & decimal \\

    629 \ hline

    $\ frac{\sqrt[3]{8* x +2}}{3* x+5}$ & math\\

    631 \ hline

    \end{ tabular }

    633 \caption {A Sample table }

    \ label { tab: sampleTable}

    635 \end{table }

    637

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

    641 If you have followed the previous examples to create Sections , subsections , figures , tables creating a Table of Contents or

    a List of figures 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 \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 }}

    645 \begin{ lstlisting }

    \ setcounter {page }{1}

    647 \pagenumbering{Roman}

    649 \ tableofcontents

    651 \newpage

    \ listoffigures

    653 \vspace {1.5cm}

    \ lstlistoflistings

    655 \vspace {1.5cm}

    \ listoables

    657

    \newpage

    659 \ setcounter {page }{1}

    \pagenumbering{arabic}661 \end{ lstlisting }

    \end{minipage}

    663

    In the code quoted in Listing \ ref{ lst : tocLists } you can see the commands \texttt {\textbaslash { tableofcontents }}, \texttt {\

    textbaslash { listoffigures }}, \texttt {\ textbaslash { lstlistoflistings }}, 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 .

    665 \begin{ itemize }

    \item e first 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 .

    667 \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 X ELATEX: An alternative document preparation system. byNikolaos Dimosis licensed under aCreative Commons Aribution-ShareAlike 3.0 Unported License.

    http://creativecommons.org/licenses/by-sa/3.0/http://www.scribd.com/doc/97184558/Introduction-to-XeLaTeX-An-alternative-document-preparation-system
  • 8/10/2019 Very basic description of how XeLaTeX works.

    32/35

    Introduction to X ELATEX29

    \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.5cm.

    669 \item e listing finishes 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 file that is between the \ texttt {\ textbaslash {} documentclass} and the \texttt {\ textbaslash{} begin\{

    document \}}}.

    675

    \begin{minipage }{\ textwidth}

    677 \ lstset {caption={[Font seings ]Code to set the font to be used .}, label ={ lst : fontSeings }}

    \begin{ lstlisting }

    679 \usepaage{fontspec}

    \ setmainfont{Linux Libertine O}

    681 \ defaultfontfeatures { Ligatures =TeX}

    \end{ lstlisting }683 \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 \begin{ itemize }

    \item You first declare that you will be using the \emph{fontspec} package.

    689 \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 : , fi , ffi ,

    , , Qea, \emph{Qea}, \emph{f }, \emph{fi } , \emph{p}.

    691 \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 figure the label would look like \texttt {\ textbaslash{} label \{ fig : aDiscriptiveLabel \}}. You can see that

    we prepend the label with \texttt{ fig :}. 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 figure 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 figure you should type the word \emph{Figure} and then \texttt {\ textbaslash{} label \{ fig

    : myFigure \}}.697

    \ subsubsection { Bibliography and citation }

    699 \begin{minipage }{\ textwidth}

    \ lstset { caption ={[Bibliography seings ] Seings for bibliography .}, label ={ lst : bibSeings }}

    701 \begin{ lstlisting }

    \usepaage[round,authoryear,merge,sort ]{ natbib }

    703 \ bibliographystyle{agsm}

    705 \bibliography{name_of_the_bibliography_ file }

    \end{ lstlisting }

    707 \end{minipage}

    709 Listing \ ref{ lst : bibSeings } shows the required commands to create the bibliography and be able to create citations in the

    text . e first line is loading the package \texttt{ natbib} which is used to format the citations that you put in thetext . Here for example the options used will format the citations according to the \texttt {harvard} style . So it will

    Introduction to X ELATEX: An alternative document preparation system. byNikolaos Dimosis licensed under aCreative Commons Aribution-ShareAlike 3.0 Unported License.

    http://creativecommons.org/licenses/by-sa/3.0/http://www.scribd.com/doc/97184558/Introduction-to-XeLaTeX-An-alternative-document-preparation-system
  • 8/10/2019 Very basic description of how XeLaTeX works.

    33/35

    30B Source code of this document

    use:

    \begin{ itemize }

    711 \item \texttt {round} brackets = parentheses

    \item \texttt {authoryear} form

    713 \item it will \ texttt{merge} continuous citations and separate them with ;\item it will \ texttt{ sort } the citations alphabetically .

    715 \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 file that you have the bibliography in . you should save the bibliography file

    in the same folder as you save the . tex file of your document. A good way to creating and managing your bibliography

    file 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:723 \begin{ itemize }

    \item e first way is to create an inline equation like this $\ frac{\sqrt [3]{8* x +2}}{3* x+5}$ using the following code:

    725 \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

    727 \[

    \ frac{\sqrt[3]{8* x +2}}{3* x+5}

    729 \]

    using the following code:\ texttt {\ textbaslash {}[\ textbaslash{} frac \{\ textbaslash {} sqrt [3]\{8* x +2\}\}\{3* x +5\}\

    textbaslash {}]}

    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

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

    735 \ frac{\sqrt[3]{8* x +2}}{3* x+5}

    \end{equation}

    737 e code that produces the Equation \ eqref {eq: test } is :

    \ lstset { caption ={}, label ={}}

    739 \begin{ lstlisting }

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

    741 \ frac{\sqrt[3]{8* x +2}}{3* x+5}

    \end{equation}

    743 \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 first thing you need to download is a \TeX {}/\ LaTeX{} distribution which will provide the tools to compile the . tex

    files 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 file you are about to download should look like : Basic MiKTeX 2.9.xxxx Installer 757

    Introduction to X ELATEX: An alternative document preparation system. byNikolaos Dimosis licensed under aCreative Commons Aribution-ShareAlike 3.0 Unported License.

    http://creativecommons.org/licenses/by-sa/3.0/http://www.scribd.com/doc/97184558/Introduction-to-XeLaTeX-An-alternative-document-preparation-system
  • 8/10/2019 Very basic description of how XeLaTeX works.

    34/35

    Introduction to X ELATEX31

    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

    \ section {RootyHelix}

    765 Figure \ ref{ fig : rootyHelix} demonstrates the power of \TeX{} in generating more than text ! e image shown in this figure 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 file .

    \begin{ figure }[h!]

    767 \ capstart

    \centering

    769 \ resizebox {0.8\textwidth }{!}{

    \ includegraphics {./ includes /rootyHelix. pdf}

    771 }

    \caption {Root helix }\label { fig :rootyHelix}

    773 \end{figure }

    775 \newpage

    \ section {Source code of this document}

    777

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

    779 \ lstinputlisting {./ latexLecture . tex}

    781 \newpage

    783 \ nocite {Lamport1986Adps}\ nocite {Kew2011Tts}

    785 \ nocite {Wikipedia2012CoTeWTFE}\ nocite {Wikibooks2012L

    WTFTP}

    787 \bibliography{ latexLecture }

    \end{document}

    Introduction to X ELATEX: An alternative document preparation system. byNikolaos Dimosis licensed under aCreative Commons Aribution-ShareAlike 3.0 Unported License.

    http://creativecommons.org/licenses/by-sa/3.0/http://www.scribd.com/doc/97184558/Introduction-to-XeLaTeX-An-alternative-document-preparation-system
  • 8/10/2019 Very basic description of how XeLaTeX works.

    35/35

    32References

    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.

    http://scripts.sil.org/xetexhttp://www.latex-project.org/http://www.latex-project.org/http://en.wikibooks.org/w/index.php?title=LaTeXhttp://en.wikibooks.org/w/index.php?title=LaTeXhttp://en.wikipedia.org/w/index.php?title=Comparison_of_TeX_editorshttp://en.wikipedia.org/w/index.php?title=Comparison_of_TeX_editors