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

Friday, June 22, 2012

LaTeX and Graphics Contest

LaTeX-Community has teamed up with Packt Publishing to hold a LaTeX and Graphics contest, where participants can write about anything related to graphics. There are 10 superb contributions, jam-packed with lots of things to take away. Readers can now vote/share/like/blog/comment on the entries, while the judges deliberate over the 2 winners.

My entry is about a technique for efficiently creating visually non-repeating tiled pattern backgrounds, while using only small-sized graphics files, which I’ll cross-post here eventually I suppose, after the contest has ended.

Monday, June 18, 2012

Beamer

Ever since I knew how to use Beamer, I try to use it every wherever I could (including my progress presentation to my supervisor). Been doing that since 2009. But as forgetful as I am, I usually save my .tex file to be recycled for the next presentation. Some of my slides are available online. You know it's written with Beamer when looking at the template so...

Some slides:
here, here and here.. and the rest you can see from my uploads.. not a big thing just usual stuffs.

Sunday, June 3, 2012

More Ways to Typeset CJK

Rather a long time ago, I wrote about how to typeset CJK (Chinese, Japanese and Korean) in pdfLaTeX, using the CJK and ctex packages. However, the font choices are rather limited. With CJK, you have only the wadalab (3 Japanese fonts) and arphic (2 Simplified Chinese fonts, 2 Traditional Chinese fonts) packages and 1 Korean font. If you have access to Windows fonts, the ctex packages further configures 6 Chinese fonts shipped with Windows for use in pdfLaTeX (may also work with dvi output, but I didn’t test).


More Fonts in XƎLaTeX: xeCJK

If you’re willing to use XƎLaTeX, the xeCJK package makes it a breeze to typeset CJK, using any font (TTF or OTF) installed on your operating system. The following uses Chinese fonts typically found on a Mac:

\documentclass{article}
\usepackage{fontspec}
\usepackage{xeCJK}

% Sets font for Roman text.
% There are also \setsansfont, \setmonofont.
% See fontspec documentation.

\setmainfont{Baskerville}

% Traditional Chinese typesetting has no "bold" nor "italic".
% 黑体 ("blackbody") and 楷体 ("regular script") fonts are
% used instead.

\setCJKmainfont[BoldFont=Hei,ItalicFont=Kai]{STSong}
\setCJKsansfont{Hiragino Sans GB}
\setCJKmonofont{STFangsong}


\begin{document}
春眠不觉晓,\emph{处处}闻\textbf{啼鸟}。
\textsf{夜来风雨声,}\texttt{花落知多少?}
\end{document}

The fonts are identified by their names as displayed in your OS' font manager application. Here’s the output:




More Fonts in pdfLaTeX: zhmCJK

If you absolutely need to use pdfLaTeX instead of XƎLaTeX, the new zhmCJK package is useful for introducing more CJK font choices into you documents. It’s not included in MikTeX nor TeXLive, however; so you will have to download it from CTAN and install manually: read the instructions carefully.

The zhmCJK packages make use of the premise that all CJK fonts share the same metrics (note that this is not true for Japanese half-width characters! Use ptex if you have serious needs for Japanese typesetting), and can therefore create the NFSS font definition and actual font mappings dynamically. The consequence is that zhmCJK can use TrueType CJK fonts to generate PDF output with pdfTeX or with the dvipdfmx driver. Here’s an example:

\documentclass{article}
\usepackage{zhmCJK}
\setCJKmainfont[BoldFont=simhei.ttf, ItalicFont=simkai.ttf]{HanNomA.ttf}


\begin{document}
世界,你好!
\end{document}

You will need to pass the file name of the TTF font, which must have no space characters and only ASCII characters. And for LaTeX to find the TTF files, you need to do one of the following:
  • Set OSFONTDIR in texmf.cnf
  • Move or symlink the TTF file in TEXMF/fonts/truetype
  • Move or symlink the TTF file in the same directory as your document.

Monday, May 21, 2012

A New LaTeX User’s Testimonial

Last week I received an e-mail from Bahareh Pahlevanzadeh, a graduate student at Universiti Sains Malaysia, describing her happiness at discovering LaTeX and my usmthesis class/template for writing her thesis.

Your mileage may vary, but I was a bit surprised when she expressed her opinion that

When it comes to getting my writing organised, I found LaTeX, especially with the USMthesis class template, to be actually very user-friendly.

Well I don’t know about you, but I think I can count on one hand the number of times I’ve heard/read in person the words “very user-friendly” being used to describe LaTeX!

You can read more about Bahareh’s experience here.

Saturday, May 12, 2012

Apple's Keynote Beamer Themes for The Poor

If you don't have Keynote in your Mac, or does not even own any Apple's hardware, perhaps considering this theme, click here


Tuesday, April 24, 2012

LaTeX Template Website

Just read from an article here regarding Vel's effort on putting template on a single page. You can check out Vel's initiative from this page.

Tuesday, April 17, 2012

TeX4ht Options

CV Radhakrishnan (CVR) has posted a list of TeX4ht options, the most comprehensive I have seen yet.

TeX4ht is a very powerful piece of software for converting LaTeX to other formats, such as (X)HTML and ODT. Unfortunately, the documentation was never truly complete, and the inner workings of the system can be hard to grasp and understand. The original creator, Eitan Gurari passed on unexpectedly in 2009. CVR and Karl Berry has since taken over the maintenance of TeX4ht.

As a side note, if you have an existing LaTeX document that you need to convert to other formats, TeX4ht is the most robust system that I have come across, i.e. it works with almost any LaTeX packages that are used in your document. (See this link for other LaTeX-to-whatever conversion tools.)

On the other hand, if you’re just starting to write your document from scratch, with a view to exporting to different output formats later, you might be better off using DocBook or pandoc instead. I personally prefer the markdown syntax in pandoc and exporting to LaTeX later for further editing.