using Thai with LaTeX on Mac OS X

Here the thing, while I was writhing my thesis using LaTeX with the template that Dr. Gordon created, I have to write a long research report for my work.
So I have a though of using LaTeX to create that report since I already fond of the way LaTeX writing can help me organize and create beautiful PDF report.

Screen Shot 2014-07-27 at 10.19.03 AM

However, it’s not easy as I thought since I have to write that report in Thai and Thai language is designed to be difficult to use in the digital world. I have to dig around for a couple days in order to use Thai with LaTeX especially on OS X.
Here is how I did it:

1. First we’ll need to install TeX Live, for Mac we need to install MacTex
2. Once you install the MacTex then you’re ready to use international language with LaTeX using XeTeX typesetting engine.
3. Then you’ll need a tool with XeTeX engine to write LaTeX. I recommend Texmaker because it’s free and super powerful.
Screen Shot 2014-07-27 at 10.38.42 AM
4. After installing you will have to set up the typesetting by go to Texmaker > Preferences > Quick Build > XeLaTex + View PDF
5. Finally test your environment by creating new document with this code

\usepackage[top=25mm, bottom=20mm, left=25mm, right=25mm]{geometry}

\XeTeXlinebreaklocale "th"
\XeTeXlinebreakskip = 0pt plus 1pt
\setmainfont{TH SarabunPSK}


\newfontfamily{\thaifont}[Script=thai]{TH SarabunPSK}




ป้า กะ ปู่ กู้อีจู้ ตัวปกติ\\
{\itshape ป้า กะ ปู่ กู้อีจู้ ตัวเอียง} \\
{\bfseries ป้า กะ ปู่ กู้อีจู้ ตัวหนา } \\
{\bfseries\itshape ป้า กะ ปู่ กู้อีจู้ ตัวหนาเอียง} \\

ทดสอบใช้คำสั่ง \LaTeXe{}\\
ป้า กะ ปู่ กู้อีจู้ ไฟฟ้า ปัญญา ตัวปกติ\\
\textbf{ป้า กะ ปู่ กู้อีจู้ ไฟฟ้า ปัญญา ตัวหนา}\\
\textit{ป้า กะ ปู่ กู้อีจู้ ไฟฟ้า ปัญญา ตัวเอียง}\\
\textsl{ป้า กะ ปู่ กู้อีจู้ ไฟฟ้า ปัญญา ตัวเอน}\\
\textbf{\textit{ป้า กะ ปู่ กู้อีจู้ ตัวหนาเอียง}}\\
%%\texttt{ป้า กะ ปู่ กู้อีจู้ ไฟฟ้า ปัญญา ตัวพิมพ์}

xxxx xxxxx xxxxx
xxxx xxxxx xxxxx

%% \backmatter %% ใช้ไม่ได้ หายหมด

%% ยังไม่ดีมาก แต่ก็ได้ ก ข ค
\chapter{ทดสอบภาคผนวก} %% ---------------------
\chapter{ทดสอบภาคผนวกอีกที} %% ---------------------


You should see Thai language is working correctly, if not check if you system has Thai Sarabun font installed? You can download this official Thai font from SIPA

The main point is you’ll need to tell LaTeX to use Thai font
\usepackage{font spec} % To enable non-standard font selections
\setmainfont{TH SarabunPSK} % A font with Thai glyphs
\XeTeXlinebreaklocale ’th_TH’ % Thai-style word-breakings and line-wrappings

Enjoy Thai LaTeXing ^_^

DIY: Jot Pro Stylus clip

Jot Pro in my thought is by far the best stylus for capacitive screen like iPad. I am using it all the time and even bought the iPad case that can carry this Jot Pro. However, the only draw back is the lack of pen clip. It’s difficult to put in your pocket without worrying about losing it. Here is what I did to make DIY clip for Jot Pro.

1. Buy a pen with a big clip (my pen is 25c)

2. Take the clip out and make a cut on the outer ring

3. Done ^__^

photo 1photo 2photo 4photo 3photo 5

How to view .XPS on Mac OS X

XPS format is a Microsoft standard format to use in MS Office. From MS Office you can print any document into XPS format (*.xps). However, I got a difficulty to read this format in Mac. The best way I found out is open with Google Doc. Here is how I did it:

1. Mail the XPS file with Gmail

2. Instead of download the file, choose to view file

3. The file will open with Google Doc and then later you can convert to PDF ^__^

How to install Graphviz on Mountain Lion

Graphviz is open source graph visualization software. Graph visualization is a way of representing structural information as diagrams of abstract graphs and networks. It has important applications in networking, bioinformatics, software engineering, database and web design, machine learning, and in visual interfaces for other technical domains.

However there are some issues between Mountain Lion and X11, Graphviz 2.28 can’t run properly on Mountain Lion. Here is how I make it work.

* Install Homebrew by using this command in Terminal

$ brew install wget

* Then brew Libtool by typing this code in Terminal

$ brew install libtool

* Finally, install Graphviz at (I am using version 2.29 dev snapshot)

* Done now you should be able to run Graphviz on Mountain Lion

Put Linkedin profile on WordPress 3

I have been using a static resume (About me page) on this blog for quite sometime. I also have my CV in Linkedin, which is my main professional resume. Consequently, it’s inconvenient if I need to update my profile, I have to go editing everywhere. Today I’ve found the best solution: “Link my linked in profile into WordPress page”.

This “Linkedin Resume” wordpress plugin is awesome. Once I installed it, I just go to Setting > Linkedin Resume and input my Linkedin public profile. 

Then I just have to put

“[ linkedinresume ] ” (no space between brackret)

on the page that need my profile to appear [see].

From now on, I need to only maintain my profile in Linkedin ^__^


Switch language on Mac with grave accent ( ` )

For Windows users who familiar with switching between language with grave accent ( ` ), using Mac input source switching with Command + Spacebar might be difficult. After a long time of confusing, I finally see the light. I just need the same setting for all devices.

All you need is this piece of software Keyremap4macbook []. After download and install (in System Preferences), you need to map ( ` ) to Command+Space .

That’s all, now I can use ( ` ) to switch language in both Mac and Windows.

Fix contact doesn’t recognize in unlocked iPhone using Gevey sim

My friends just got AT&T iPhones from the US. They couldn’t unlock them via software because  their baseband doesn’t supported. The good new is Gevey Sim can unlock unsupported baseband. My friend went with this solution. It works great but there is a problem of contact doesn’t recognize. iPhone doesn’t show the caller name, just display the caller number. Here is how I fix their iPhone.

1. Go to ” Settings/General/International/Region Format/ ” and select your region

2. Downlosds files ” ”  from here

3. Put this file at ” /private/var/mobile/Library/Preferences/”

4. Restart iPhone

Setting up Thai in XMBC on AppleTV2

After setting up XMBC on ATV2, I felt like I really use full potential of ATV2. The good thing (for me) in this version of XMBC is I can set up Thai Character in Region setting. However I can’t read Thai because XMBC does not include Thai font in its package. Here how to add Thai font:

  • Log on to ATV2
    • I use Cyberduck to access into ATV2
    • It’s already found my ATV2 via Bonjour network
    • username is “root” and password is “alpine”
  • Go to XMBC > Media > font then copy Thai font to this directory

Done, now I can see beautiful Thai font for file list name ^__^