Sie sind auf Seite 1von 10

Perusing LATEXfor the first time

M.H. Kamarul Azman,


Universiti Kuala Lumpur
mhaziq@unikl.edu.my
2016-07-25
Word y u do dis!!!

Anonymous
Abstract

I believe that Im not alone when I say that you and I relate to the quote
mentioned above. Using Microsoft Word has its own set of advantages.
Being a quasi-WYSIWYG and quasi-robust word processor, it isnt a sur-
prise that it has users from a wide spectrum of profession. From a simple
jot to an intricate graphical document (although I doubt the latter), it
has been proven that Word is capable for the task at hand.

There is a philosophical term known as determinism. The essence of it


is that a specific set of inputs and conditions shall always give a single,
unique output. In other words, it is always possible for anyone to know
what a cause to an event is.

Word, as far as I have the experience using it (which is to say, not a


lot), does not display a deterministic behaviour. We all have that time
when we forgot to add a figure, or a table. Maybe a caption, or a page
number. Whatever. We proceed to add whats missing, and everything
messes up. The finely-placed drawings move to the other page, the graph
that was beautifully set at page 5 ends up in page 3, and whatnot.

Another argument is that maybe Word hides much of the details behind
the scene, which is alright to me. But its definitely not fun when things
like the above happen. One could already imagine writing a very long
report (which I also have done with Word) and have it wrecked in less
than a minute, and not be able to figure out what it is thats causing the
problem!

Asides from all that, sectioning and page numbering is also a pain in
Word. There are absolutely no words (unintentional pun) to describe the
feeling when trying to get a page index to change into what we want.

So I have decided to try an alternative method of word processing that


is a bit more deterministic. And what better way than to represent it in
a form of objects and properties (i.e. a code). Then again, I am a casual
programmer, so I believe this is a more intuitive way of writing.
Contents
1 Introduction 1
1.1 First words . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1
1.1.1 Additional infos . . . . . . . . . . . . . . . . . . . . . . . 1
1.2 First words . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1

2 Playing with the basics 2


2.1 Equations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2
2.1.1 Matrices . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2
2.2 Graphics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4
2.2.1 A note on {} . . . . . . . . . . . . . . . . . . . . . . . . . 4
2.3 Citations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4
2.4 Tables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4

List of Figures
1 A graphical representation of the Equation 1 . . . . . . . . . . . 4

List of Tables
1 A partially recreated table from [1] . . . . . . . . . . . . . . . . . 5

i
1 Introduction
1.1 First words
P0 Hello, World! This is a first document written in LaTeX. Oh sorry, LATEX.

P1 Always start your document, with a \documentclass{} command, whatever


it may be!

1.1.1 Additional infos


P2 As you can see there isnt much in here. There are lots though at the top
of the source file. Check it out.

P3 Breaking a line in the .tex document does not cause the final compiled
paragraph to split. To do this, we need to add a \paragraph{} command, like
this.
A \\inserts a newline but not indents.

SP1 Using a subparagraph command (\subparagraph{}), we can do this.


There are no more indentations though after this one.

1.2 First words


P4 Can we return to the previous section like this?

P5 I guess not.

1
2 Playing with the basics
This second page has a different numbering than previously. Well, used to.

Dont know yet what happens when this is done. OK maybe it is not possible
to start an environment out of the blue like that. Ignore this paragraph.

2.1 Equations
One reason why I begin to write in (or use) LATEX, is because of the support
for mathematical equations. Of course, not everyone use LATEXfor maths or
other scientific publications.

We can write an equation using the equation (or amsmaths equation* if we


dont want the numbering) environment. For example:
p
(yi xi )T (yi xi )
D(i) = (1)
kyi k

D0
D1

D = D2

..
.
Di1
R
We can also do inlines, using $(formula)$. f g(x) = IR
f ( )g(t )d is an
example.

2.1.1 Matrices
There seem to be many ways to represent a block matrix. We can use square
parentheses to enclose a matrix environment, or use a bmatrix environment.
At this point I dont know if there is a standardized methodology for that, or
if there is a standardized implementation of LATEXfor that matter (bearing in
mind that were using MiKTEX). My best guess is, whatever floats the boat.

2
1 2 3 n
2 3 4 2n
A= . .. .. .. ..
.. . . . .
n 2n 3n n2


1 2 3 n
2 3 4 2n

B= . .. .. .. ..

.. . . . .


n 2n 3n n2


1 2 3 n
2 3 4 2n
C = .

. .. .. ..
.. .. . . .
n 2n 3n n2

1
2 3 n
2 3 4 2n
D = .

.. .. .. ..
.. . . . .

n 2n 3n n2

1
2 3 n
2 3 4 2n
E = .

.. .. .. ..
.. . . . .

n 2n 3n n2

1 2 3 n
2 3 4 2n
F = .

.. .. .. ..
.. . . . .
n 2n 3n n2

Equation 2: Assortment of matrices1

1 This caption is possible because I created a new float with an aliased counter. It generates

a warning though.

3
2.2 Graphics
To any word processor or tool for word processing, figures are no stranger.
Think graphs and pictures from external sources. Lets try to add one here.

Figure 1: A graphical representation of the Equation 1

2.2.1 A note on {}
It seems to me that the curly brackets can be used to encapsulate a syntaxical
element. This is seemingly useful for very long and complex equations, but also
for other uses involving a long chain of commands. In short, any command word
can be followed by the curly brackets to delimit it, especially when we want to
use punctuations in a sentence.

2.3 Citations
We can cite using the \cite{} command. For example, Equation 1 is extracted
from [1]. The bibliography is available at the end of the document.

The bibliography mechanism in LATEXis kind of confusing to understand2 at


first, but to summarize, we use BiBTEXfor simple bibliographical management.
Other frameworks are available for more complicated stuff, like BiBLATEX, Biber
(almost, almost), Natbib, etc.

This is another citation example is by using BiBLATEX BiBTEX. Referring to


[2], we can see that the referenced document is clearly an IEEE standard.

2.4 Tables
One of the things I liked in Word is its powerful tabling tool. I have to give it
to them, they didnt mess that one up. They only probably messed the object
placement up. Probably.
2 OMG this is nervewrecking!!!

4
LATEX, like C or any other programming language, can draw tables3 for us.
Just use the table and tabular environment.

Table 1: A partially recreated table from [1]


Referencea Signal Type Metrics
Ng et al. VCG Plane of maximum projected area
Ng et al. VCG Plane of best fit
Castells et al. VCG Trend-simplicity-distance

Kahn et al. ECG Coherence


a Really? Probably only when using minipage

3 Difficult as . . . Im not saying it here. And by the way no footnotes from inside the table

environment.

5
References
[1] K. A. Muhammad Haziq, Methods and tools for atrial
flutter loop analysis to support pre-interventional classification: a review,
presented at the UniKL Postgraduate Symposium, Kuala Lumpur, 2015.
[2] IEEE Standard for Local and Metropolitan Area Networks: Overview and
Architecture, IEEE Standard 802, 2001

Das könnte Ihnen auch gefallen