Showing posts with label LaTeX. Show all posts
Showing posts with label LaTeX. Show all posts

Wednesday, February 22, 2017

A LaTeX Report Template for Myanmar Language Using XeTeX

This is a template for LaTeX report in Myanmar language using XeLaTeX. It is available at

https://github.com/yan9a/LaTeX_Myanmar_Language.

To properly render Myanmar fonts using LaTeX, it is necessary to use TeX typesetting engines that support Unicode such as XeTeX. Simple examples for testing XeTex can be found in an older post Myanmar (Burmese) Language with XeTeX and LuaTeX.

Thursday, July 19, 2012

Myanmar (Burmese) Language with XeTeX and LuaTeX

To properly render Myanmar fonts using LaTeX, it is necessary to use TeX typesetting engines that support Unicode such as XeTeX and LuaTeX. You should make sure that your TeX Live or MiKTeX version is up to date and XeTeX and LuaTeX are bundled with them. To build TeX files conveniently, you can define user command in editors such as TeXmaker or TeXstudio. In TeXstudio, click Configure TeXstudio... command in the Options menu. Then, go to Commands and copy the command for the PdfLaTeX.
After that, go to User menu and click User Commands -> Edit User Commands and click green plus sign. Paste the command that you have copied and replace pdflatex with xelatex for XeTeX. Follow the same procedure and use lualatex for LuaTeX.
The following example TeX file, Z1.tex, works with both xelatex and lualatex.
\documentclass{article}
\usepackage{fontspec}
\setmainfont{Zawgyi-One}
\begin{document}
ျမန္မာစာ
\end{document}
Another example for lualatex that includes lua script is luaZ1.tex. I have tested laulatex with Zawgyi-One, Padauk, Myanmar3, and Myanmar MN. And I found that only Zawgyi-One works with current version (LuaTeX, Version beta-0.70.1-2011082320).
XeTeX can render Zawgyi-One and Padauk on all platforms, and Myanmar MN on Mac OS X. Although there is no problem for Zawgyi-One, Unicode fonts such as Padauk require renderer to be defined. In the following example, Renderer=Graphite defines Graphite as the renderer. For Myanmar MN font, the renderer should be explicitly defined as Renderer=AAT. See example XeFontspec.tex as shown below.
Another way to define renderer instead of using \fontspec[Renderer=Graphite]{Padauk} is \font\1="Padauk/GR" \1 , where /GR is to explicitly use the Graphite font renderer. Other possible options are /AAT to explicitly use the ATSUI renderer (Mac OS X only) and /ICU to explicitly use the ICU OpenType renderer. However, defining renderer does not works for xelatex versions on my Windows XP and Ubuntu Linux. Fortunately, I found a way at Calmhill's blog that uses \fontspec[Script=Myanmar]{Padauk} to make Padauk works on them. An example is XePadauk.tex.
An example for Myanmar MN is XeMyanmarMN.tex. Currently, according to my tests, Myanmar3 does not work on all platforms.

Updated post: A LaTeX Report Template for Myanmar Language Using XeTeX

Friday, June 8, 2012

LaTeX Bibliography with TeXstudio

TeXstudio (formerly TexMakerX, http://texstudio.sourceforge.net/) is an integrated environment for writing LaTeX documents. When you get a paper, there is normally the citation for that paper in BibTeX style. You can save the BibTeX entry for each paper in a BibTeX database file that has .bib file extension. In TeXstudio, it is also easy to create a BibTeX entry yourself. For example, create a new BibTeX database file, Ref1.bib and click bibliography menu. Thereafter, you can choose the command for your paper type. Both the required fields and optional fields will be inserted. If you want to clear the optional fields, you can click the clean command. The easiest way is to use BibTeX insert dialog ... as shown in the following figure.




When the new BibTeX entry dialog appears, you can fill the fields you want and click OK. When you filled the author names, they must be separated by the word and. Create a new TeX file, e.g. TestBibTex.tex, and you can use the database as follows. In this example the popular style, ieeetr, is used so that the references will be numbered in order of appearance. The database file, Ref1.bib, that you created is included using \bibliography{Ref1}.





Normally, you need to run LaTeX several times as shown in the following steps to produce the proper output. (you need to have MiKTeX or TeX Live software installed in your computer.) If you use pdflatex, run
Step 1. pdflatex
Step 2. bibtex
Step 3. pdflatex
Step 4. pdflatex
as shown in the following figure. Another good thing about TeXstudio is that you just need to press 'F1' for Quick Build only one time and it will carry out everything to produce the final pdf output. If you want author-year style citation, you can use \usepackage{natbib} as shown in the following figure.



The example files can be downloaded in the following links.
TestBibTex.tex
TestNatbib.tex
Ref1.bib
Using a software for management is more convenient and JabRef Reference Manager is a good one.
Ref: http://en.wikibooks.org/wiki/LaTeX/Bibliography_Management