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, June 16, 2011

Upcoming Book Review

Perhaps it’s all the publicity work by the good people behind MOSC 2011 (thank you!), during the last week or two I’ve definitely been getting more LaTeX enquiries (thanks to all of you too!).

So much so that I was very kindly offered by Packt to review a recent book on LaTeX by Stefan Kottwitz!

(The publisher, Packt, specialises in books on open source projects and pays royalties to the projects it publishes about. I’m rather impressed by that.)


I’ve read about the publication of the book on other blogs and forums and my interest was already piqued; not least because Stefan is a very frequent and helpful contributor on TeX.SE.

Well, I have a book to read and a review to write. Stay tuned!

Monday, June 6, 2011

University of Malaya Thesis Class

I have developed a LaTeX class and template for writing an UM (University of Malaya) thesis, complying with the IGS Universiti Malaya IGS Guide to the Preparation of Research Reports, Disertations & Theses, for a friend pursuing her PhD there.

The LaTeX class and template files is available at http://liantze.penguinattack.org/latextypesetting.html#umalayathesis. Hopefully this will be helpful to UM students!

Saturday, May 28, 2011

Talk at MOSC2011

My proposed talk on LaTeX has just been accepted by the organisers of MOSC2011.

Now I need to actually write the slides!

Anyway, I plan to speak on “LaTeX: More Than Just Academic Papers and Theses”. It won’t be a tutorial, rather I plan to give teasers of what LaTeX is capable of beyond the usual journal or conference articles.

This will also be my first time attending an OSS conference. I do rather feel queasy at the thought of being intimidated by crusty h4x0rs. :-)

UPDATE: The organisers have posted my speaker’s profile.

Friday, April 22, 2011

Making Leaflets with LaTeX

Just for fun, I thought I’d make some leaflets to accompany my poster presentation during a recent conference. It would be nice if I could reuse materials from my paper and poster, so I sought for a LaTeX solution, and that solution was the leaflet document class. It automatically sets up a layout for 6 small pages on 2 normal-sized paper pages, so that you can print the output PDF out on double pages, then fold it up into a real, er, leaflet.

Here are the thumbnails of my leaflet, and here are the source code. Notice the little mark (highlighted by the red circle) on the second page to guide you in folding the leaflet. Just make sure that you set your PDF viewer to “Do not scale pages” when printing the PDF.


Saturday, April 16, 2011

Using Relative Units in TikZ Drawings

I used to happily create TikZ drawings with pt units, let’s say in a paper using the IEEE style:

\documentclass{IEEEtran}
\usepackage{tikz}
\uaetikzlibrary{positioning}

\begin{document}
\begin{tikzpicture}
\node[text width=60pt] (mor){Morphological Analysis};
\node[text width=35pt,right=12pt of mor] (syn) {Syntactic Analysis};
\draw[-latex] (mor) -- (syn);
\end{tikzpicture}
\end{document}

The output looks good enough, although I did have to try several times getting the text widths right:


But often times I’d want to reuse my TikZ code in other documents, e.g. a Beamer presentation, or my thesis in which I must use Times 11pt. But when I happily copied over my Tikz snippet over, I get:

\documentclass{beamer}
...
\begin{tikzpicture}
...
\end{tikzpicture}
...

\documentclass[11pt]{memoir}
\usepackage{mathptmx}
...
\begin{tikzpicture}
...
\end{tikzpicture}
...

Ouch, it looks like I need to figure out the different text width values in pts by trial and error, for each document I want to include my picture in!

Or do I?

The real issue here is that pt is an absolute unit (1pt = 1/72 inch), so my TikZ node’s text width stays the same while the font metrics is different in each document. Using relative units, like em or ex, would make my life a lot easier.

Let me explain: 1em is the height of the current typeface in the current size, and is a little bit wider than a capital ‘M’. This means the length/width 1em depends on the active font family and size.

And as a rough estimate, a capital ‘M’ is twice as long as a lowercase letter. ‘Morphological’ has 1 ‘M’ and 12 lower case letters, but 3 of these are ‘thin’ letters (‘l’ and ‘i’), so I’d go with 6em rather then 7. Similarly, I’d try 4em for ‘Syntactic Analysis’.

Let’s see the results, using the same TikZ code in all three versions (IEEE paper, beamer and typical thesis):

\documentclass{IEEEtran}
\usepackage{tikz}
\usetikzlibrary{positioning}

\begin{document}
\begin{tikzpicture}
\tikzset{every node/.style={draw,align=center}}
\node[text width=6em] (mor){Morphological Analysis};
\node[text width=4em,right=1em of mor] (syn) {Syntactic Analysis};
\draw[-latex] (mor) -- (syn);
\end{tikzpicture}
\end{frame}
\end{document}

\documentclass{beamer}
...
\begin{tikzpicture}
\...
\end{tikzpicture}
...

\documentclass[11pt]{memoir}
\usepackage{mathptmx}
...
\begin{tikzpicture}
...
\end{tikzpicture}
...

There! The text widths would vary relative to the current font families and sizes in use, so I won’t have to fiddle around with pt values for every new document I want to incorporate my existing TikZ code.

Sunday, March 20, 2011

Creating Academic Posters (and Printing Them)

I presented a poster paper at CICLing 2011 in Tokyo (that was the end of February so I wasn’t there during the earthquake, but it seems the organising committee members are all alright, thank heavens) and I naturally created my poster with LaTeX. Here’s a thumbnail of my poster:


I created this A0-sized poster (source code the TikZ drawings and CJK characters are externalised as PDF graphics and the bibliography embedded, so it should be compilable on most LaTeX installations without extra packages) with the beamerposter package, mainly by modifying Rob Hyndman’s style file. (There are other packages for creating posters in LaTeX, see this link for an overview.)

You can download my .sty and a simple sample poster .tex files here. I’ve put the colour themes (ComingClean in the left thumbnail, ConspiciousCreep on the right, inspired by this and this respectively) in their own separate .sty files. ConspiciousCreep is probably not so suitable for an academic poster… but perhaps it could be useful for a not-so-serious occasion.


Note that the sample poster is A1-sized; change the poster size in the .tex file as you require. I also defined a \footimage command that can be used to put whatever material you want in the bottom right hand corner. (I included photos of the authors in my poster not because of vanity, but because the organisers asked us to do so, so that it’d be easier for participants to locate the relevant authors.)

I brought my A0-sized PDF along to a printing shop who happily printed it out on one glorious giant A0-sized synthetic paper material. However, if you have trouble finding a printing shop who can print out these big sizes, you can use the pdfposter utility (available on all major GNU/Linux distros) to process your PDF into smaller-sized tiles. For example, if the input LLTposter-sample.pdf is A1-sized, then

pdfposter -s1 -ma4 LLTposter-sample.pdf a4tiles.pdf

will take the input file LLTposter-sample.pdf, split it into 8 A4 pages and save them in a4tiles.pdf. You can then print out the A4 pages and assemble them back into an A1-sized poster at the conference venue. (-s1 means no resizing of the original poster size, hence A1 as the result.) Enjoy!