If you are familiar with LaTeX and interested in writing Bengali documents (or any other Indic documents) using it then you might find this post relevant.
In brief, LaTeX is a type-setting system which is widely used in scientific communities for preparing technical articles.
Here, instead, I will be interested in writing Bengali documents using LaTeX. The first Bengali typesetting system using LaTeX was the well known Bangtex package by Palash B. Pal. Bangtex does produce good quality documents.
However, main inconvenience in using Bangtex package is its input method. One needs to follow a specific transliteration scheme. This suffices if you want to create PS/PDF file at the end. However if you also want to create html pages for the same documents using latex2html then you are out of luck.
Now wouldn’t it be great if you could type your Bengali (or any other Indic) documents using standard Unicode in LaTeX as you would do with any other application?
Here comes the new revolution, XeTeX, a new type-setting system based on a merger of Donald Knuth’s TeX system with Unicode and modern font (OT/AAT) technologies. This means you no longer need to have special metafonts for your language to be present in the system. Instead you can use standard OTF/TTF fonts those are available in your system, for LaTeX as well.
No more talking… here goes the image of output PDF file.

Above document is created using the following latex source file
\documentclass{article}
\usepackage{fontspec}
%
% This file is a sample tex file to illustrate use of
% XeTeX in typesetting Bengali document.
% License: GNU FDL: (C) Golam Mortuza Hossain, 2008
%
%
% Define fonts that you want to use
%
\font\serif=”FreeSerif:script=beng”
\font\serifbb=”FreeSerif:script=beng” at 24pt
\font\deffont=”FreeSerif:script=beng” at 14pt
\font\mukti=”Mukti Narrow Bold:script=beng”
%
% “script=beng” in above lines ensures that appropriate
% complex text rendering engines are used for proper
% rendering of Bengali.
%
\title{\bf\serifbb পাগলা দাশু}
\author{\bf\serif সুকুমার রায়}
\date{}
\begin{document}
\deffont %Default font used for the document
\maketitle
আমাদের স্কুলের যত ছাত্র তাহার মধ্যে এমন কেহই ছিল না, যে পাগলা দাশুকে
না চিনে। যে লোক আর কাহাকেও জানে না, সেও সকলের আগে পাগলা দাশুকে চিনিয়া
লয়। সেবার একজন নূতন দারোয়ান আসিল, একেবারে আনকোরা পাড়াগেঁয়ে লোক, কিন্তু
প্রথম যখন সে পাগলা দাশুর নাম শুনিল, তখনই সে আন্দাজে ঠিক ধরিয়া লইল যে,
এই ব্যক্তিই পাগলা দাশু। কারণ তার মুখের চেহারায়, কথাবার্তায়, চলনে চালনে
বোঝা যাইত যে তাহার মাথায় একটু ‘ছিট’ আছে। তাহার চোখদুটি গোল-গোল,
কানদুটা অনাবশ্যক রকমের বড়, মাথায় এক বস্তা ঝাঁকড়া চুল। চেহারাটা দেখিলেই
মনে হয়—
\vskip 10mm
% Specific font can be used for any part of the document
{\mukti বিঃদ্রঃ এই বাংলা পাতাটি লেখার জন্য XeTeX ব্যবহার করা হয়েছে।}
\end{document}
XeTeX is available as standard component of TeXLive distribution. If you are using latest (K)ubuntu then you can
sudo apt-get install texlive-xetex
to install it. To test above sample tex file you can cut-n-paste to a file say sample.tex then compile it using
xelatex sample.tex
If everthying goes fine then you should get sample.pdf as your output document. In case you need to edit the latex source file, you can use any editor of your choice like kate, gedit or even vim. Of course, you can also use specialized LaTeX editor like kile (KDE Integrated LaTeX Environment) where you can view output document simply in one click!!
Nice work.
For Mac OS X download freefont-ttf-xyz.tar.gz from
http://savannah.nongnu.org/download/freefont/
copy FreeSerif.ttf, FreeSerifBold.ttf, FreeSerifItalic.ttf, FreeSerifBoldItalic.ttf in “Macintosh HD/Library/Fonts/”
done….
details: http://salahuddin66.blogspot.com/2008/12/bengali-in-latex-in-mac-os-x.html
I copied all the fonts to Macintosh HD/Library/Fonts/ and copied Mr. Mortuza’s sample file. I used following command:
$xelatex test.tex
I found following error:
(/usr/local/texlive/2008/texmf-dist/tex/xelatex/fontspec/fontspec.cfg))kpathsea: Invalid fontname `”FreeSerif:script=beng”’, contains ‘?’
! Font \serif=”FreeSerif:script=beng” not loadable: Metric (TFM) file or in
stalled font not found.
\font
l.13 \font
\serifbb=”FreeSerif:script=beng” at 24pt
?
Any suggestion to solve this problem?
See the comment below for a solution to the double quote issue.
How to write Bangla in windows with LaTeX?
Could you please help me?
I have installed XeTeX…But I don’t know how it works
Thanks in advance.
@Tarik Adnan,
You could try some windows integrated latex environment such as Texmaker which claim to support Unicode. BTW, I haven’t tried them myself so I could be wrong.
How to write Bangla in Mac OS 10.4.11, ibook G4 with LaTeX?
Could you please help me?
I have installed XeTeX…But I don’t know how it works
Thanks in advance.
@Abhijit,
If you are using TeXShop (latex editor for Mac) then you can configure your TeXShop to use xelatex by following these instructions
http://scripts.sil.org/cms/scripts/page.php?site_id=nrsi&item_id=xetex_texshop
Best,
XeTex did not work for me also in Mac OS 10.5
But it works fine with “XeLaTeX”
I tried to work with xetex, i couldnt make it working – probably i dont have fonts or something, i dont know how to fix that – it says
(/usr/share/texmf-texlive/tex/xelatex/fontspec/fontspec.cfg))kpathsea: Illegal fontname `”FreeSerif:script=beng”’: contains ‘
! Font \serif=”FreeSerif:script=beng” not loadable: Metric (TFM) file or in
stalled font not found.
can you please help ?
http://salahuddin66.blogspot.com/2008/12/bengali-in-latex-in-mac-os-x.html
First download freefont-ttf-xyz.tar.gz from
http://savannah.nongnu.org/download/freefont/
or
ftp://ftp.gnu.org/pub/gnu/freefont/
which containing
————————-
FreeSerif.ttf
FreeSerifBold.ttf
FreeSerifItalic.ttf
FreeSerifBoldItalic.ttf
Paste these fonts in your “Macintosh HD/Library/Fonts/”
I use ubuntu. I installed those fonts in my system, by copying to ./fonts in home. I am still getting the same errors.
Still thanks a l-o-t for helping. Now I know where the problem is.
weird, i do have those fonts at /usr/share/texmf/fonts/ec/tfm
oops thats /usr/share/texmf/fonts/truetype
sudo apt-get install ttf-bengali-fonts
I think have those fonts installed. Its not working bhaiah!
Thanks to Golam sir, I found the glitch was in the _copied_ double quote!
To make it working in linux i had to change the double quotes and wrote them again, and I had to put {\serif বাংলা লেখা এর মাঝখানে }. And it worked fine.
Thank you SOOOOOOOOOOO much! Now I can write my article in Bangla, and I am feeling so good about it!
আহ, এটাই খুঁজছিলাম। দেখি ইন্সটল করে।
HI all,
Im using TeXnicCenter & MikTex… also I install xelatex. when i am trying to execute the sample.tex file then the following error will occur. What to do now? Please help me.
…………………………
fontspec.cfg loaded.
(“C:\Program Files\MiKTeX 2.7\tex\xelatex\fontspec\fontspec.cfg”))
! Font \serif=^^94FreeSerif:script=beng^^94 not loadable: Metric (TFM) file or
installed font not found.
\font
l.12 \font
\serifbb=^^94FreeSerif:script=beng^^94 at 24pt
Thanks in advance
It seems, you got the double quote sign mixed up. It’s a known issue and seems to happen during copy-n-paste from your browser. Please replace “^^94″ (or whatever you have around the term FreeSerif:script=beng ) by normal double quote sign using your keyboard. See the comments above.
hi Thanks for the information.
recently i was searching for the user friendly an Indian Language typing tool and found “quillpad”. will u tell me how different this from Unicode Bengali in LaTeX..?
I tried installing and working on this. I started with the same errors as Anahata Agantuk, but after everything, I am still getting the following errors, and I am stuck:
fontspec.cfg loaded.
(/usr/share/texmf-texlive/tex/xelatex/fontspec/fontspec.cfg))
! I can’t find file `sample.aux’.
\enddocument …makeatletter \input \jobname .aux
\fi \@dofilelist \ifdim \f…
l.23 \end{document}
Please type another input file name:
(I have to use ctrl+D to get rid of this …. even ctrl+C doesn’t work)
I use Ubuntu 8.10 …. any help will immensely appreciated.
This may sound funny, but I was fiddling around with several settings regarding this problem, and suddenly xelatex started working perfectly …. now I am trying to figure out how it started working!
By the way, sample.tex file’er modhye’i baa bangla’te likhle ki korey? aami shadharon Vim text editor baa Gedit use kori. shekhaane to kono upaay dekhlaam naa eibhaabe likhbaar.
Please see the Bengali input section “Linux with Gnome Desktop” from this link
http://bn.wikipedia.org/wiki/উইকিপেডিয়া:Bangla_script_display_help
Yes, I have solved that problem. I now have Bengali as well as Devnaagari scripts installed on my laptop.
I tried to work with xetex, i couldnt make it working – probably i dont have fonts or something, i dont know how to fix that – it says
(/usr/share/texmf-texlive/tex/xelatex/fontspec/fontspec.cfg))kpathsea: Illegal fontname `”FreeSerif:script=beng”’: contains ‘
! Font \serif=”FreeSerif:script=beng” not loadable: Metric (TFM) file or in
stalled font not found.
can you please help ?
I copied all the fonts to Macintosh HD/Library/Fonts/ and copied Mr. Mortuza’s sample file. I used following command:
$xelatex test.tex
I found following error:
(/usr/local/texlive/2008/texmf-dist/tex/xelatex/fontspec/fontspec.cfg))kpathsea: Invalid fontname `”FreeSerif:script=beng”’, contains ‘?’
! Font \serif=”FreeSerif:script=beng” not loadable: Metric (TFM) file or in
stalled font not found.
\font
l.13 \font
\serifbb=”FreeSerif:script=beng” at 24pt
?
Any suggestion to solve this problem?
অনেক অনেক ধন্যবাদ।
গতবছর অনেক চেষ্টা করে হাল ছেড়ে দিয়েছিলাম। এবার MikTeX 2.7 এর সাথেই XeTeX আছে। তাই TeXMaker কে কিছুটা configure করলেই কাজ হয়।
আর একটা ব্যাপার: http://omicronlab.com/bangla-fonts.html , এখানকার অনেক ফন্টই ভাল কাজ করে। বিশেষ করে Bangla ফন্ট খুবই ভাল কাজ করে।
I have made a tutorial on how to use Bangla in LaTeX in a windows machine.
The file could be found here:
http://sites.google.com/site/kmckbd/latex-editor
Nice work. Wanted to make this work a long time ago. Finally downloaded the MacTeX package and making nice CV in bangla.
Thanks.