Saturday, August 22, 2009

Weather Information on Command Line

Weather information can be obtained at command line using a Python script that retrieves the weather information from Yahoo API found here at GitHub.

For Ankara, the location code is TUXX0003 and I aliased it in ~/.bash_profile as:

alias hava='weather.py TUXX0003 -m c -f 2'

Tuesday, August 18, 2009

Compiling Documents via Both LaTeX and XeLaTeX

To compile files that require XeLaTeX-specific options using LaTeX, use the \ifx\XeTeXversion\undefinedcheck.

\documentclass[a4paper,12pt]{report}

\ifx\XeTeXversion\undefined
\usepackage[utf8]{inputenc}
\else
\usepackage{fontspec}
\usepackage{xunicode}
\usepackage{xltxtra}
\setmainfont[Mapping=tex-text]{Gentium}
\fi

\begin{document}


\ifx\XeTeXversion\undefined
Hello World from LaTeX!
\else
Hello World from XeLaTeX!
\fi


\end{document}

Sunday, August 16, 2009