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!






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.

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

Student MidTerm Finals Total
Ali 43 33 73.0
Abu 20 23 43.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.