Featured Post

We've moved to tex.my!

It’s been great writing on Blogger.com, but we’ve decided to move to a new platform, thanks to some valuable help from a great, great friend...

Thursday, October 29, 2009

Setting page size and margins

There's quite a bit of interest in the .tex code behind the Grid Computing Cluster report, but I think posting the raw code in its entirety would be a bit too overwhelming to quickly glean useful tips from it. (Also to avoid getting into any issues with my university... etc...)

So instead, I'll be doing a series of short posts on how I achieved certain effects and book design, starting with this one. It's probably faster for people to "zero-in" on what they need. ;-) Posts in this series will be tagged "book design". But before you implement your next major book project with LaTeX, do check with your printing company about the printing process used. If you'll be using on-demand laser printing, everything should go fine since the RGB colour model of your PDF should be adequate. However, if you're going with offset printing, your printing company will most likely prefer CMYK colour model to be used instead, and I haven't quite figured out how to tweak that perfectly with (pdf)LaTeX. In our case, only the book cover was printed with offset printing, and the effect was acceptable — so that ended well...

IMPORTANT DISCLAIMER: I am NOT a graphics designer, so my choice of colours/illustrations/etc probably sucks. Don't shoot me. :-)

Now there are multiple ways to achieve the same effect in LaTeX (that's FOSS for you). For this report, I've decided to use the memoir document class, which incorporates the functionalities of many other packages. (Do take some time to browse or search through the excellent manual with texdoc or mthelp.)

The flowfram package looks like a very interesting solution for designing dynamic layout, but I didn't find out about it until too late into my own project. Do find some time to look at it yourself. If you want to go with the standard document classes (report, book) or the koma-script classes, I'll indicate what extra packages you'll need where relevant.

In this first post we'll just look at how (custom) page sizes and margins can be specified. Basically my page design is:

  • Stock paper size is 303mm x 216mm. The stock paper is the raw original paper that a commercial printer will print the page on, which will be trimmed down to the page size
  • Page size is A4 i.e. 297mm x 210mm.
  • The printer advised us to leave a good 10mm from the page edges around any printed text.
  • I decided the main typeblock will be 20mm from the top, bottom and spine (inner) edge of the page, and 15mm from the outer edge.
  • Also, the running header should occupy the height of a line of text, 7mm from the top edge of the typeblock. Whereas the baseline of the running footer is 7mm from the bottom edge of the typeblock.

These are not necessarily good measurements for an aesthetically-pleasing book design, but more because I was trying to strike a balance between aesthetics and to fit everything in (Lesson: Get in touch with the printing company early to check with their printing specifications per minimum page margins, etc!)

These can be implemented using commands from the memoir class. (The notion of 'stock', although a common concept in publishing and printing industries, is only available in memoir, not in the standard document classes.)

\documentclass[twoside]{memoir}

%% The stock paper size
\setstocksize{303mm}{216mm}

%% The 'real' page size
\settrimmedsize{297mm}{210mm}{*}

%% The stock paper will be trimmed 3mm from the
%% top edge and 3mm from the left edge

\settrims{3mm}{3mm}

%% Spine and trim page margins from main typeblock
\setlrmarginsandblock{20mm}{15mm}{*}

%% Top and bottom page margins from main typeblock
\setulmarginsandblock{20mm}{20mm}{*}

%% Header occupies height of a single line;
%% Bottom edge of footer is 7mm from bottom edge
%% of typeblock

\setheadfoot{\baselineskip}{7mm}

%% Bottom edge of header is 7mm from top edge of
%% typeblock

\setlength\headsep{7mm}

%% Apply and enforce layout
\checkandfixthelayout


In my case, due to some later issues with colouring the 3mm bleeding edges too (as per our printing company's request), I decided to make the trimmed page size the same as my stock size and increased the page margins instead:

\documentclass[twoside]{memoir}

%% Custom stock paper and page size
\setstocksize{303mm}{216mm}
\settrimmedsize{\stockheight}{\stockwidth}{*}

%% Adjust margins accordingly to achieve
%% same previous layout

\setlrmarginsandblock{23mm}{18mm}{*}
\setulmarginsandblock{23mm}{23mm}{*}

\setheadfoot{\baselineskip}{7mm}
\setlength\headsep{7mm}

\checkandfixthelayout


If you just need to print on exactly A4-sized paper, you can forget about setting the stock and trimmed size explicitly and just do

\documentclass[a4paper,twoside]{memoir}

\setlrmarginsandblock...
\setulmarginsandblock...
...
\checkandfixthelayout


One last thing: if you're not using the memoir class, you can still change the page margins via a high-level interface with the geometry package:

\documentclass{article}
\usepackage{geometry}
\geometry{
   paperwidth=216mm, paperheight=303mm,
   left=23mm,  %% or inner=23mm
   right=18mm, %% or outer=18mm
   top=23mm, bottom=23mm,
   headheight=\baselineskip,
   headsep=7mm,
   footskip=7mm
}



Again, if you're just going to print on A4 (or letter) paper, you can just do
\usepackage[a4paper]{geometry}
\geometry{
   left=20mm,  %% or inner=20mm
   right=15mm, %% or outer=15mm
   top=20mm, bottom=20mm,
   headheight=\baselineskip,
   headsep=7mm,
   footskip=7mm
}


i.e. just pass the a4paper option to the geometry package; there's then no need to set the paper height and width explicitly.

Wednesday, October 28, 2009

Unfolding vim-latex fold

I don't know about you guys but I found it is very annoying to have my sections and subsections to be folded in vim/gvim , since somehow I mistakenly put "i" since I want to change to insert mode to unfold (although it should be :za) .

So now, the cruelest method is by

:set foldlevel = 5

usually I put 10 heh.

(since section,subsection and subsubsection may =3 .. so play safe with above that level).

But so far I did not managed to get it work by putting in in $HOME/.vimrc . Any hints?

Monday, October 26, 2009

My first presentation with LaTeX

I spent my precious nites doing these stuffs. Everything went well except I didn't compiled my *.tex twice so that my Tikz arrows drawn perfectly.

Next 6th Nov I'll be going to present another talk.. I hope I can avoid such problem again.

Tex Source
My Presentation Slides [HTML]
My Slides [PDF, 70 slides since I did some overlays]

You can refer my .tex file and do whatever changes that you want... but I'll be happy if you tell me where will you present your talk using my so called *masterpiece* :D

By the way, I converted those Beamer PDFs using external command, that is gs

I tweak some recommendations here

So, what I did was;

gs -dNOPAUSE -g1024x768 -r205 -sDEVICE=pngalpha -sOutputFile=./temp/slide_%02d.png -dBATCH beamer-foss-my-09.pdf cd temp/new/

//02d since this will correctly numbers your slides sequence from 00,01,10,11.. otherwise it will assume 1,11,10 is within the same order(as you can see, in the link that I gave before it doesn't stated that... so "man gs" did helped :)

for i in *.png; do convert -resize 600 $i temp/new/$i ; done

//you need to install ImageMagick package to do this.. "convert" command will resize the initially generated PNG from gs to smaller size. I did tried to set smaller size in gs command but seems it just bring partial of the slides into smaller pieces...

igal2 -r *.png -xy 300 -w 4
//this will create HTML galleries, initially the tool named "igal"




Some components of my *.tex file were adapted from texample.net ...

Tuesday, October 20, 2009

Following Curutari




I spent nites on beamer (with yesterday's nite mistakenly "rsync"ed my new .tex with the old one.. badly need my own SVN repo, sigh) . I seems to like "beamerthemestree" so much.

KDE Beamer Themes

FOSS.my is this Friday, and even though I can't attend, perhaps there are some presenters who'd be interested to use Beamer to prepare their presentations, and perhaps using KDE themes: you can download the theme packages (.sty and .png files) from that link there. Once downloaded, put them in your TEXMF tree (~/texmf/tex/latex on TeXLive and MikTeX, ~/Library/texmf/tex/latex on MacTeX), and refresh it (use the MikTeX control panel; or run texhash if you're using TeXLive. If using MacTeX, you won't need to manually run texhash or anything).

By the way, you'll find templates for OOImpress and KPresenter via that link, too.

To use the Oxygen-style theme:

\documentclass{beamer}
\usetheme{oxygen}

\begin{document}
\begin{frame}
...
\end{frame}
...
\end{document}


Sample output:






To use the Air theme and the output:

\documentclass{beamer}
\usetheme{air}
...








There's also a PNG image which can be used as background for presentations at the link above (desenho.png). To use this with the default beamer theme, do:

\documentclass{beamer}
\setbeamertemplate{background}{\includegraphics[width=\paperwidth,height=\paperheight]{desenho}}
...






Happy LaTeXing!

Sunday, October 18, 2009

Background images

I'm sure every LaTeX user tried this code at least once to add a "background image" on a page:

\includegraphics[width=\pagewidth,height=\textwidth]{wallpaper_filename}

But the included graphics, even though it looks the right size, would refuse to budge beyond the page margins, leaving a white border all round it. And you'd probably have problem placing any text at all on the graphics, thus defeating the purpose of a "background" image.

The wallpaper package offers an easy way to add background images or wallpapers in LaTeX, including tiling. The following commands are available:

  • \CenterWallPaper{<scaling>}{<filename>} where <scaling> is a value between 0 and 1, for specifying the fraction of paper width or height. The aspect ratio of the graphics will not be changed, i.e. you won't get a "stretched" wallpaper as you would with your desktop wallpapers.
  • \ULCornerWallPaper{<scaling>}{<filename>}
  • \LLCornerWallPaper{<scaling>}{<filename>}
  • \URCornerWallPaper{<scaling>}{<filename>}
  • \LRCornerWallPaper{<scaling>}{<filename>}
The above four commands take the same arguments as \CenterWallPaper, but puts the image at the Upper Left, Lower Left, Upper Right and Lower Right corners of the page respectively.

For tiling wallpapers, there are:
  • \TileWallPaper{<width>}{<height>}{<filename>}, where you can specify (in pt, cm, in...) the width and height of the included image.
  • \TileSquareWallPaper{<number>}{<filename>}, where the included image would be re-shaped as a square, and <number> is the number of "image tiles" that will fill up the width of the paper.
Note that all the commands above will apply the background images on every page after the command is issued. To clear the wallpaper, use \ClearWallPaper.

Also, for each command \XXXWallPaper command above, there is a \ThisXXXWallPaper command that takes the same arguments but would apply the background image on only the current page.

You can now run wild with your imagination to design letterheads, chapter headings, covers, etc. Have fun!

Saturday, October 17, 2009

Latex beamer and blocks

Block

\begin{frame}
\frametitle{Portable Object (PO) files}

\begin{block}{Nature}

\begin{itemize}

\item It's a raw, untranslated file

\item Created automatically using gettext package

\item Ready to be translated

\end{itemize}

\end{block}

\end{frame}


produce this :




Alertblock

\begin{frame}
\subsection{gettext}
\frametitle{gettext}
\begin{alertblock}{gettext in short}
\begin{itemize}
\item Part of GNU packages
\item Enables internationalization of software
\item Enables the creation of Portable Object (PO) file
\end{itemize}
\end{alertblock}
\begin{center}
\alert{\emph{Portable Object?}}
\end{center}
\end{frame}
produce this :




Exampleblock
\begin{frame}
\frametitle{Machine Object (MO) files}

\begin{exampleblock}{Description}

\begin{itemize}

\item \alert {Compiled file}, derived from PO

\item It's a binary, thus \emph{machine readable}

\end{itemize}

\end{exampleblock}

\end{frame}

produce this:



Good luck !

Tuesday, October 13, 2009

Name that symbol!

If you wanted to insert some symbol in a word processing application, you'd probably open up a character palette or symbol map, and browse through various fonts (wingdings, dingbats...) to find that elusive symbol.

In LaTeX, the Comprehensive LaTeX Symbol List has just about every symbol imaginable in LaTeX, from mathematical operators and symbols (including Greek letters), the Euro symbol, wingdings, dingbats, blah blah blah. The list is accessible as a PDF on your local installation via the commands texdoc comprehensive on TeXLive, or mthelp --view comprehensive on MikTeX.

However, browsing through the list is still rather tedious, even if the document has a good index to make searching a leeeeeetle bit easier. Detexify is a free online tool that greatly simplifies the hunt for a LaTeX symbols. You sketch your symbol with the mouse, and detexify tries to classify it and returns the appropriate LaTeX package and command required for rendering it.



Here's an example of a "null" symbol. The 2nd symbol in the list is the one I'm looking for, so I'm going to include the lines

\usepackage{amssymb} ... $... \varnothing ... $
in my .tex file.



Here's another example of a maths symbol.



Wingdings and dingbats work, too. In fact, I haven't even finished drawing the envelope, and detexify has already showed me \Letter from the marvosym package.

Drawing diagram; the cryptic way

Well, this is not-so-latex stuffs, but I just want to share with you guys...

I managed to tried out 3 applications:

Let's see for Tikz;

%modified from texample.net
\documentclass{article}
\usepackage{tikz}
\usetikzlibrary{mindmap,trees}
\usepackage{verbatim}

\begin{document}
\pagestyle{empty}

\begin{tikzpicture}
\path[mindmap,concept color=red!50!black,text=white]
node[concept] {Hidup}
[clockwise from=0]
child[concept color=green!60!blue]
{
node[concept] {Pertimbangan}
[clockwise from=90]
child { node[concept] {cari duit} }
child { node[concept] {buat amal ibadat} }
child { node[concept] {belajar sungguh-sungguh} }
child { node[concept] {bina keluarga bahagia} }
}
child[concept color=orange] {
node[concept] {research}
[clockwise from=-30]
child { node[concept] {jurnal} }
child { node[concept] {artikel} }
};
\end{tikzpicture}\end{document}

will produce

then how about ditaa;

Raw source snapshot:


will produce:


and finally graphviz;

Source, the "dot" file:

digraph process{
node [color=blue,fontcolor=black,font=helvetica,]
nodesep=1.5
A[label="Machine Object (MO)"]
B[label="Portable Object (PO)"]

C[label="developer"]
D[label="translator"]
E[label="tools"]
F[label="POedit"]
G[label="kbabel"]

C->B[label="prepares PO",style=dashed]
C->A[label="compiles MO",style=dashed]
C->B->D [label="send PO files/i18n",fontcolor=red]
D->B->C[label="return translated files/l10n",fontcolor=green ]
D->E[label="translate using",fontcolor=blue,style=dashed]
E->F
E->G
}
returns;



Monday, October 12, 2009

TeXample aggregator

I sent our feed to TeXample community aggregator. As you can see at the right pane of our website, we start to receive significant numbers of traffic from EU

Saturday, October 10, 2009

True or False: LaTeX can produce only boring, drab-looking stuff

I was asked to compile and produce a report for a research project to be published, with instructions to make it "look professional", something like this report here.

I was too stupid to learn how to use PageMaker, Illustrator or FreeHand properly in a short time, so I jumped at LaTeX as  my tool. Well after all, the glossaries (or acronym) package kept the acronyms and abbreviations consistent, and biblatex (a new, experimental package that offers much more flexible citation and bibliography features) meant easy inclusion of list of publications anywhere in the report and without having to manually format the entries. The tikz package provides drawing capabilities which I used liberally all over the page designs. Heck, even adding a barcode for the ISBN was effortless with ean13isbn.

I reckon a few eyebrows were raised, and indeed the printing company expressed surprise when told that our PDF was prepared with LaTeX ("You mean LaTeX can produce colour stuff?")

Without going into too much details on all the packages I used, here are some excerpt pages from the final product, designed and typeset by yours truly. While I'm certainly not a graphics designer by any means, and really professional layout designs is much more easily achievable with other applications mentioned earlier (if you know how to use them properly), I'm pretty happy with the end result. But never, ever let it be said that LaTeX is capable of producing drab, boring, black-and-white scholarly articles only again!






Friday, October 9, 2009

Google Scholar Supports BibTeX


It is a good news, doesn't it?


Google Scholar also supports export to End Note (RIS, perhaps?)

For mine above, it gonna be like this

@article{zabidi2003open,
title={{Open Source Software Localization Project}},
author={Zabidi, M.N.A.},
year={2003}
}

Who's who behind this blog

Well, just to introduce you people behind this blog:

and how about you who stumbled to this page? Support us by spreading the word of LaTeX :-)

Accessing Package Documentations

LaTeX package authors are awesome, not only because they develop and maintain so many goodies for the convenience of other LaTeX users (especially those of us who aren't that well-versed with TeX), but also because they fully document the usage of their packages. (Well most of them anyway.)

How do you access these documentations and manuals, though? Do you google (or search on CTAN) and download the manuals every time you want to look up the details of user commands in, say, the glossaries package? Occasionally, though, you may find that the manuals you just downloaded are the wrong versions for the package files installed on your system.

Chances are that the documentations are already installed on your system, when you first installed those packages. They're usually located in $TEXMF/doc/tex/latex, or $TEXMF/doc/bibtex for BibTeX-related packages.

There's an easier way to look up a package's documentation than manually navigating the TEXMF trees, though. In TeXLive (that's probably what you have if you're on a *nix or Mac system), type

$ texdoc glossaries (or whatever package you're interested in)

at the shell prompt. Voíla! The documentation for the glossaries package would open automatically for your perusal.

If the file that appears seem like an example file demonstrating a package's functionalities and not the documentation proper, try

$ texdoc --list glossaries


instead. You'll be presented with an interactive list from which you can select the file you want to open.

MikTeX users on Windows can use the command

mthelp glossaries

at the command prompt or from the "Start → Run" dialog instead. A browser window would open, listing possible documentation files associated with the package name you supplied. Click on a link to view the file you're interested in. And if you trust the system enough to hit upon the "main" documentation file at the first try, use

mthelp --view glossaries

instead.

Menyimpan TeX fail sebagai Office readable

Bagi mereka yang menginginkan fail *.tex mereka boleh dibaca oleh pemprosesan kata seperti OpenOffice dan MS Word, tiada jalan mudah yang saya temui. Namun demikian, saya cuba berkongsi kaedah yang saya anggap less hassle berbanding dengan pengubahan langsung.

Caranya ialah;

*.tex ----> *.html ----> OpenOffice format ---> *.doc

Kita senaraikan dulu tools yang digunakan selain cara yang saya sebutkan:

dan lain-lainnya yang mungkin tidak saya sebutkan di sini.

Buat masa ini, saya selesa dengan tth, disebabkan conversion yang saya buat menggunakan tools ini tidak memerlukan tuning yang banyak.

tth -e2 akan menghasilkan satu fail HTML yang mengandungi kandungan fail .tex tadi. Anda boleh rujuk manual tth untuk mengetahui opsyen yang digunakan.

Selepas ubah ke HTML, import dokumen HTML tadi menggunakan OpenOffice.org, dan Save As sebagai *.doc . Mungkin anda perlu betulkan sedikit sebanyak indentation, tetapi sebahagian besar teks, dan citation yang dihasilkan oleh BibTeX tetap boleh digunapakai

Using .eps Graphics Files with PDF output

Oops — I forgot to thank the blog owner najmi for inviting me to be an author! How unbecoming of me! *grovel* Thanks again! :-)


For quite some time now, the graphicx package would automatically sort out which file types to use whenever it encounters \includegraphics{some_file}, where the extension of some_file is not specified.

That is to say, if you are generating to a .dvi, the system would look for some_file.eps. If you are generating to a .pdf, it looks for some_file.{pdf|jpg|png}.

But what if you want a .pdf and you work with .pdf, .jpg and .png graphic files, but suddenly you received a .eps graphics from your collaborator? (This actually happened to a lecturer at my university.)

Well, you could always convert it manually to a .pdf yourself with GhostScript or GIMP, of course. But now the process can be automated if you're using MikTeX 2.8 or TeXLive 2009, as highlighted by Rob Hyndman.

In MikTeX 2.8, use the epstopdf package together with graphicx, like so:

\documentclass{article}\usepackage{graphicx,epstopdf}\begin{document}\includegraphics[width=\textwidth]{some_file}\end{document}


If all you have is some_file.eps, it will be automatically converted to a some_file-eps-converted-to.pdf during the first time the LaTeX document is compiled and included in the final document output.

If you're using TeXLive 2009, you don't even have to load epstopdf explicitly, but I say include it anyway, for portability's sake.

Thursday, October 8, 2009

Real Time (Almost) Preview For Latex

I was wondering whether I will be able to preview things that I wrote Latex with almost real time. Well, somehow there are, but actually what it did was background compiling (I believe so, looking at the log written).

Unfortunately these tools are only available in Emacs (or fortunately, it is time for you to learn!).

These tools are:

Both tools are available in Ubuntu Linux. Auctex can be invoked in Emacsw32 (windows), while Whizzytex can be done, but I believe it is difficult.

Whizzytex works by invoking M-x and later whizztex-mode (that is, Meta (Escape/Alt button) and x plus the external command. You may simply list them all by Tab button), and this only need to be done once. It will directly fire up ADVI viewer. Every change that you did will be rendered right away... so perhaps you want to put it side by side with your editor.



Auctex in the other hands works by invoking C-c C-p C-d ;


For now I can't get the Arabic characters work.. maybe need some more manual reading.

All these tools need some editing in your $HOME/.emacs , which means it will not just work straight away.

Jawi support for Latex

Latex also supports Arab characters, and not only that it also supports Jawi (Malay flavors of Arabic characters). Called Arabtex, it was developed by Prof. Klaus Lagally at the University of Stuggart.

For the character mapping on how to make the Jawi characters appear on screen, you can refer here

Say we have the following

%specifying class
\documentclass{article}

%calling arabtex package.. you may need to install texlive-lang-arab

\usepackage{arabtex}
\begin{document}

%initializing Jawi char map
\setmalay

%since Jawi does not need vocalization
\novocalize
\huge

%I leave it blank, except date for header
\title{ <>}
\author{}
\date{<2009>}
\maketitle
%This is Jawi mode
\\

%Now let's see for Arab
\setarab
\fullvocalize

%This will enable transliteration, automatically!
\transtrue
\arabtrue
%Right to Left text will be append
\begin {RLtext}

al-salAm `alaykum\\
bismi al-ll_ahi al-rra.hm_ani al-rra.hImi
\end{RLtext}
\end{document}

Now let's see the output!

Asas-asas LaTeX

Pertama-tama, saya ingin mengucapkan terima kasih, kerana memberi peluang saya menambah artikel didalam blog ini.

Saya sarankan pembaca yang ingin mencuba LaTeX, supaya membaca dokumentasi penggunaan LaTeX ini terlebih dahulu.

The Not So Short Introduction to LATEX2ε


Ianya mengandungi asas-asas pengunaan LaTeX bersama-sama contoh ringkas.

Terdapat beberapa lagi dokumentasi tunjuk ajar di Internet, dan harap pembaca dapat menafaatkannya.


Terima kasih.

Tables in LaTeX (crash course)

When you start to use Latex seriously to write your paper, thesis, documentation, book or what not. You will eventually find the need to display tables for various reason. Presentation of your tables is somewhat important, to convey the right ideas and to help people understand what you are trying to tell them.

However, displaying tables in LaTeX can be a little bit of a challenge. But, when you get a hang of it. It should be relatively easy and you can display nice and clean tables. Here is a short tutorial for you to get started.

Suppose for the sake of example, you want to display a table below in LaTeX.

StudentMidTermFinalsTotal
Ali433373.0
Abu202343.0

And here’s is how your tex code should look like.

\begin{table}
\centering
\begin{tabular}{|l|c|c|r|}
\hline
Student & Midterm & Finals & Total \\ \hline
Ali & 43 & 33 & 73.0 \\ \hline
Abu & 20 & 23 & 43.0 \\ \hline
\end{tabular}
\caption{Example for student grades.}
\label{fig:sampleStud}
\end{table}

For most part of the code above, the LaTeX code is self-explanatory. But I'll give you a short guide anyways.

The {|l|c|c|r|} means that there are four columns. The first column is left aligned, the second and third column is centered and the fourth column is right aligned. Between each of the columns, there should be a line. This is represented by the pipe character. Try removing one of the pipes and see how it will affect your table. Experimenting with the code above is the first few ways for you to start making good looking tables on your own.

Now, about \hline. As you might guess, the \hline stands for horizontal line. The first \hline is used to insert a line at the top of the table. Each line represents a row. The \hline after that represent the next few horizontal lines in each row. Try removing one of the \hline and see how it will affect your table.

The ampersands marking "&" is to show separations of the column. You can really mess up the tables by getting rid of the ambersand sign.

Finally, the \\ means line break; or in this case, row break. You have to do this for each row to indicate that you are done with one row, and ready to work on the other.

Hope this helps.

Wednesday, October 7, 2009

Carta Alir TeX dan LaTeX

Sebelum ini apabila saya melihat cekupan screen (screenshot) yang ditunjukkan oleh bro Root, saya tidak faham kenapa perlu bersusah payah menggunakan LaTeX, sedangkan pemprosesan kata seperti MS Word dan OpenOffice lebih mudah digunapakai.

Kalau ditanya kenapa saya guna Latex :

1- Auto numbering untuk heading, section dan subsection, gambar rajah, diagram, table dan sebagainya. Jadi tak perlu pening kepala nak trace diagram ni nombor berapa, dan kalau masuk diagram baru semua nak kena check balik. Saya tak pasti word processor ada sokong ke tidak ciri-ciri (feature) ini

2- Untuk citation pun dengan mudah kita boleh beralih format, katalah IEEE ke APA dan sebagainya, dengan sokongan BibTeX. Seperti yang saya sebut di dalam posting lain, contohnya untuk IEEE, sistem penomboran citation itu dilakukan secara automatik, seperti yang dilakukan oleh EndNote, satu perisian pengurusan citation (komersial, tapi universiti-universiti ada yang beli. Contohnya USM punya EndNote boleh download di laman web mereka oleh pelajar USM)

3- Layout dan font yang menarik (by default!)

4- Sokongan teks Arab/Jawi dengan menggunakan ArabTeX (dibangunkan oleh seorang profesor di Jerman)

Untuk memahami bagaimana proses penulisan fail Latex (dengan extension *.tex) sehinggalah kepada format PostScript (*.ps) dan akhirnya PDF (*.pdf), rujuk carta alir berikut:


Tuesday, October 6, 2009

Editor Lateks

Sebenarnya saya ingin memulakan tutorial di sini sedikit demi sedikit dengan aliran yang sekata, tetapi disebabkan saya hanya boleh menulis sekiranya idea datang, maka saya akan letakkan "cloud tag" di tepi supaya pembaca boleh memilih untuk memilih mana-mana tajuk yang diinginkan.

Untuk menulis fail Latex, secara asasnya, kita boleh menggunakan mana-mana penyunting teks seperti NotePad, WordPad dan lain-lain. Tetapi, penyunting yang dipilih seboleh-bolehnya perlu memenuhi kriteria berikut:

-mempunyai sokongan syntax highlighting
-tidak memerlukan anda compile setiap kali melakukan perubahan
-mempunyai auto completion (tetapi kadang-kadang saya rasakan agak mengganggu proses penulisan)

Antara penyunting Latex mengikut platform sistem operasi:

Linux:
-Kile (berasaskan KDE)
-TexMaker
-Emacs
-VI

Windows:
-WinEdt
-LEd
-TexMaker
-EmacsW32 (Emacs untuk Windows)
-GVIM

Macintosh:
-TexShop

Monday, October 5, 2009

Komen dari Bro Root (Bahathir)

sumber

Alhamduilillah, walaupun dalam bentuk 'paksaan', sekaran anda sudah jelas kenapa LaTeX masih lagi bertahan sejak 3 dekad lalu hingga ke hari ini. Tujuan asal LaTeX dicipta bagi memudahkan ahli akademik untuk mencetak bahan terbitan yang bekualiti. Bayangkanlah, pada 30 tahun dulu, mana ada perisian pemeroses kata WYSIWYG, tapi mereka dapat juga terbitkan artikel, journal dan buku ilmiah dengan formula-formula matematik yang amat cantik sekali.

Itulah yang dikehendaki oleh Prof. Dr. Donald Knuth, seorang pakar sains komputer, yang tidak berpuas hati kerana artikel yang dicetak oleh syarikat percetakkanya tidak tepat dari apa yang sepatutnya. Bidang sains dan matematik amat memerlukan kejituan, kerana tersalah simbol, operasi and angkubah dalam fugnsi formula dapat memberi makna yang jauh berbeza dari yang dikehendaki. Ya, TeX dicipta oleh PAKAR sains komputer untuk pakar-pakar lain. Jadi tidak hairanlah kita lihat ramai Prof-prof, Dr. Dr. di universiti diluar negara khasnya, tahu guna TeX atau LaTeX ini.:)


Saya pernah memperkenalkan TeX kepada rakan-rakan dalam forum tempatan, kerana saya rasa ianya sangat berguna, walaupun untuk kerja-kerja dokumentasi biasa. GNU Emacs hanyalah alat/tool, dan bukanlah maksud saya untuk promo GNU Emacs sangat. Tak kisahlah anda nak guna penyunting apa pun untuk menyunting fail TeX ini. Terdapat pelbagai 'plugin' untuk GNU Emacs yang amat berguna dan mempercepatkan kerja suntingan, anda saya syorkan AUCTeX, seperti saudara kita sarankan diatas tadi.

Untuk preview, sekarang saya lebih gemar bayangkan 'preview' didalam minda saya, tanpa perlu sebarang pertolongan visual. Untuk permulaannya, tool untuk preview boleh digunakan bagi memudahkan kerja dan penggunaan TeX ini. Anda boleh buka tetingkap xdvi dan 'resize'kan kepada saiz yang membolehkan anda melhat skrin penyunting serentak. Anda 'compile' fail TeX dan xdvi akan mengemaskini paparan secara otomatik. Tak perlu apa-apa plugin pun. Kacang kan.:)

Baguslah, saudara sudah mula berjinak-jinak dengan TeX dan jadilahnya sebaga sahabat karib anda.

Semoga sama-sama mendapat menafaat dan selamat maju jaya.

Yang benar,
root.

Latex Beamer untuk "presentation"

Kebiasaannya kita menggunakan Microsoft Power Point, atau OpenOfficeImpress, dan mungkin juga KOffice.



Latex juga mempunyai pakej presentation iaitu Beamer.

Ia boleh dicapai di sini

Bagi pengguna Ubuntu semudah apt-get install latex-beamer dan boleh gunakannya sekarang!

Kelebihannya ialah apabila kita telah selesai menulis katakan laporan di dalam format latex, hanya beberapa tune up yang perlu dilakukan untuk membolehkan fail latex tersebut dialihkan ke frame Latex beamer tersebut

Pengenalan Latex

Saya telah lama terdengar mengenai Latex, terutamanya dari bro Root/Bahathir yang selalu mengesyorkan Latex untuk tujuan penulisan (dan kadang-kadang advokasi Emacs), tetapi saya belum tergerak untuk menggunakannya.

Selain itu, Dr Azzudin yang mendapat ijazah kedoktoran di Poland, rakan di pejabat saya turut mengatakan yang beliau menggunakan LaTeX untuk membuat kertas soalannya, apabila saya menanyakan kepada beliau bagaimana menulis notasi matematik pada kertas soalan yang ditulisnya.

Sehinggalah pada suatu hari, saya diminta oleh seorang editor syarikat di Amerika untuk menghantar satu bab dalam buku mereka yang akan diterbitkan bagi dinilai.

Pada mulanya saya hanya menggunakan cara konvensyional, di mana saya menggunakan pemprosesan kata seperti MS Word / Open Office. Tetapi apabila saya mula ke tahap menambahbaik sorotan kesusasteraan saya (literature review), saya mula menghadapi masalah untuk membetulkan citation dan sebagainya. Sebagai contoh, jika menggunakan citation jenis IEEETrans, seelok-eloknya susunan rujukan pada perenggan pertama adalah mengikut jujukan 1,2... sehingga akhir. Saya pernah melihat kertas persidangan yang memulakan citation dengan nombor entah keberapa, yang menunjukkan penulis tidak menggunakan tools untuk memperbetulkan catatan citationnya.

Rakat sepejabat saya, joey mengesyorkan BibTeX, yang dicipta untuk digunakan bersama LaTeX. Yang demikian menyebabkan saya "terpaksa" belajar LaTeX, alhamdulillah dalam masa kurang dari seminggu saya berjaya memindahkan tulisan saya ke dalam format LaTeX.

BibTeX memudahkan kerja saya di mana saya boleh memilih format citation seperti APA, IEEETrans, dan sebagainya dengan mudah.


Selamat Datang

Ini adalah ucaptama saya ...