40
\documentclass{barticle}
\title{EkiT pRbn/dh} \author{Ajana elkhk} \date{pNNicesh {oi}bshakh, 1413}
\begin{document}
\bng
\maketitle
\section{pRthm pirec/chd}
rbiin/dRnaethr EkiT kibtar shuru inec ed{O}ya Hl.
\begin{verse}
kt Ajanaer jana{I}el tuim \\ kt gher idel ThNNa{I}. \\
duurek kirel inkT bn/dhu,\\ prek kirel bha{I}....

\end{verse}
\end{document}
Moriambar
  • 11,466

9 Answers9

27

Although it's not completely clear what your question is asking, I would recommend using XeLaTeX and the polyglossia package for Bengali. This way you just enter your Bengali text in regular form.

I used the Akaash font from here: Free Bangla Fonts. Since I don't speak Bengali, I translated a short text from English using Google Translate. My apologies if it did an awful translation.

% !TEX TS-program = XeLaTeX

\documentclass[10pt]{article}
\usepackage{polyglossia}
\setmainlanguage[numerals=Devanagari]{bengali}
\setotherlanguage{english}
\newfontfamily\englishfont[Scale=MatchLowercase]{Linux Biolinum O}
\newfontfamily\bengalifont[Script=Bengali]{Akaash}
\begin{document}
\tableofcontents

\section{ভূমিকা}
এটি একটি ইংরেজি লেখা ছোট অধ্যায় যে বাঙ্গালী এ \textenglish{Google Translate} দ্বারা অনুবাদ করা হয়েছে. এটা খুব স্পষ্ট নয় যদি সঠিক অনুবাদ বা না কিন্তু ক্রিয়াটি ফন্ট দেখাতে যথেষ্ট হওয়া উচিত.
\end{document}

output of code

As the example shows, and as mentioned in the comments, this does not make all numerals Bengali. For a solution to this problem, see:

Alan Munn
  • 218,180
24

The problem with polyglossa is that its support for Bangla (or Bengali) is quite limited. This prompted me to write a new package latexbangla, which extends the former's functionalities and addresses most of the Bangla related typesetting issues. It also provides full support for common commands and environments, automatic transition from Bangla to English (and vice versa), and a patch to fix unproportionate whitespace error in popular Bangla fonts. With latexbangla, you can simply type usual LaTeX syntax and expect everything to behave as it should.

Sample code: (from package documentation)

\documentclass{article}
\usepackage[banglamainfont=Kalpurush, 
            banglattfont=Siyam Rupali
           ]{latexbangla}
\begin{document}
পিথাগোরাস(Pythagoras)-এর উপপাদ্যটি হল, \textit{সমকোণী ত্রিভুজের অতিভুজের উপর অঙ্কিত  
বর্গক্ষেত্রের ক্ষেত্রফল অপর দুই বাহুর উপর অঙ্কিত বর্গক্ষেত্রের ক্ষেত্রফলের সমষ্টির সমান।}
অর্থাৎ কোন সমকোণী ত্রিভুজের অতিভুজ $c$ এবং অপর দুই বাহু $a$ এবং $b$ হলে,
\[c^2=a^2+b^2\]
লক্ষ্য করুন, এখন পর্যন্ত টেক্সট প্রদর্শনের জন্য \textbf{কালপুরুষ} ফন্ট ব্যবহৃত হয়েছে।\\
\texttt{এবার, টেলিটাইপ(Teletype) টেক্সট প্রদর্শনের জন্য \textbf{সিয়াম রূপালী} 
ফন্ট ব্যবহৃত হল।}\\
পুনরায় টেক্সট প্রদর্শনের জন্য \textbf{কালপুরুষ} ফন্ট ব্যবহৃত হচ্ছে।
\end{document}

enter image description here

UPD: There is number breaking problem with new polyglossia and LaTeXbangla.

Way to fix that pointed here. This problem is mainly because of polyglossia bug. Which was fixed later on. But LaTeXbangla wasn't updated.

8

As of 2020, LuaLaTeX (with the HarfBuzz renderer) is able to display Bengali. The babel package also supports it. The following template (based on the accepted answer) runs on LuaLaTeX in TeX Live 2020.

\documentclass{article}
\tracinglostchars=2
\usepackage[bidi=basic,layout=sectioning]{babel}
\usepackage{fontspec}

\babelprovide[import,main]{bengali} \babelprovide[onchar=fonts ids]{english} \defaultfontfeatures{Scale=MatchLowercase, Ligatures=TeX, Renderer=HarfBuzz}

%% These fonts are abailable at: https://www.google.com/get/noto/ \babelfont{rm} [Ligatures=Common,Scale=1.0,Language=Default]{Noto Serif} \babelfont{sf} [Language=Default]{Noto Sans} \babelfont{tt} [Language=Default]{Noto Sans Mono} \babelfont[bengali]{rm} [Language=Default]{Noto Serif Bengali} \babelfont[bengali]{sf} [Language=Default]{Noto Sans Bengali} \babelfont[bengali]{tt} [Language=Default]{Noto Sans Bengali UI}

\babeltags{english=english} \babeltags{bengali=bengali}

\begin{document} \section{ভূমিকা} এটি একটি ইংরেজি লেখা ছোট অধ্যায় যে বাঙ্গালী এ Google Translate দ্বারা অনুবাদ করা হয়েছে. এটা খুব স্পষ্ট নয় যদি সঠিক অনুবাদ বা না কিন্তু ক্রিয়াটি ফন্ট দেখাতে যথেষ্ট হওয়া উচিত. \end{document}

Noto Fonts sample

This sample automatically switches from the Bengali font to the English font whenever you switch to the Latin script, so “Google Translate” appears in Noto Serif, rather than Noto Serif Bengali. If you remove the onchar=fonts ids option, you can still switch between them with \textenglish, \begin{english}, etc.

You can change the numbering of pages, chapters, equations and so on to Bengali by adding the maparabic option to \babelprovide, and can also redefine other counters such as alph and Alph.

You can also use your fonts of choice. The Language=Default font features are not strictly necessary. I included them to suppress some harmless warning messages.

Davislor
  • 44,045
6

Nothing is impossible

\documentclass{report}
\usepackage{fontspec}
\setmainfont{[Kalpurush.ttf]}
\newfontface{\en}{[Chapaza Italic.ttf]} %%this is optional, if you want to use a secondary font. Any english font is supported

\begin{document} 
\chapter{আমি বাংলায় গান গাই। }
এখন খুব সহজে বাংলা ফন্ট ব্যবহার করুন\\ 
{\en fontspec} প্যাকেজ এবং {\en XeLatex} ইঞ্জিন এর সাহায্যে।\\

{\Large বড়ো অক্ষর}\\
\rule{6cm}{1pt}\\
{\en\ Hope this will help you a lot}
\end{document}

working very well, just download Kalpurush.ttf font and past it into the project folder. remember that the font name need to be accurate. Now change your latex compile engine to XeLatex instead of PdfLatex. Kalpurus.ttf download link: Click

Ravi
  • 653
  • 6
  • 14
  • Welcome to TeX.SX! You can highlight code in your post using back-ticks. To highlight code-blocks, either indent them by four spaces or use the {} on the gui. –  Jan 04 '18 at 14:16
  • Can you please add a link where the font can be downloaded from? – egreg Jan 04 '18 at 14:39
  • 1
    How is this different from the other answers (apart from the fonts chosen)? – Alan Munn Jan 04 '18 at 22:29
  • choosing a font is the main thing while you are using bangla. You have used Akaash.ttf and that is not good in arranging the bangla alphabets – Ravi Jan 05 '18 at 05:59
  • 1
    @ravi Then you should explain why in your answer. I have no stake in this issue, but if you want to help other Bangla users your answer should explain why this is a better approach. Also, the other answer uses the same main font as your example, but also suggests the banglalatex package. Do you have problems with that package too? – Alan Munn Jan 05 '18 at 16:02
  • I have tried a lot to use latexbangla package but it is not working for me. may be there was some mistake from me. because i am not an expert in latex. – Ravi Jan 05 '18 at 19:57
  • Hi Ravi, if you still have the issue, you can send an email to the address provided in latexbangla.com, and I'll be happy to look into it. :) – Adib Hasan Apr 21 '18 at 11:27
4

enter image description here

\documentclass[12pt]{article}
\usepackage{fontspec}
%\setmainfont[]{kalpurush.ttf} % u can use only one font 
\setmainfont[
BoldFont=kalpurush.ttf,
ItalicFont=kalpurush.ttf,
BoldItalicFont=kalpurush.ttf
]{kalpurush.ttf}

\title{বাংলা আমার মায়ের ভাষা} \author{বিপুল } \date{শনিবার ২১শে ভাদ্র ১৪২৭ বঙ্গাব্দ}

\begin{document} \maketitle কিভাবে সহজে ঝামেলামুক্তভাবে বাংলা লিখবেন? \begin{enumerate} \item প্রথমে https://www.overleaf.com তে যান, একাউন্ট খুলুন, এবং প্রজেক্ট তৈরি করুন। \item আপনার পছন্দের বাংলা ফন্ট ডাউনলোড করুন, আমি কালপুরুষ ব্যবহার করেছি। \item ফন্টটি ওভারলিফে আপলোড করুন \item usepackage{fontpec} এবং setmainfront(kalpurush.ttf) সেট করা হয়েছে। \item এখন পছন্দ মতো বাংলা লিখুন। \item আপনি চাইলে বোল্ড, ইটালিক বা অন্য স্টাইলের জন্য ভিন্ন ভিন্ন ফন্ট ব্যবহার করতে পারেন। \item শুভকামনা রইলো। \end{enumerate}

bim
  • 180
  • I want to use Kalpurush font only for Bengali text, and the default English font elsewhere. How to achieve that in Overleaf? – Preetom Saha Arko Nov 19 '20 at 15:08
  • you can do something like this `\usepackage{polyglossia} \setdefaultlanguage{english} \setotherlanguages{hindi,sanskrit,bengali}

    \usepackage{fontspec} \setmainfont{Times New Roman} \newfontfamily{\devanagarifont}[Script=Devanagari]{Lohit Devanagari.ttf} \newfontfamily{\bengalifont}[Script=Bengali]{kalpurush.ttf}`

    – bim Apr 04 '22 at 17:55
3

enter image description here

enter image description here

  1. Download kalpurush.ttf (or other bangla font) and upload to overleaf project folder of and project folder for offline latex. Link: https://archive.org/download/kalpurush/kalpurush.ttf

  2. Download latexbangla.sty file and upload to overleaf project folder (offline latex may not need to do stp2 because latexbangla.sty is already installed for texlive full) http://mirrors.ctan.org/language/bengali/latexbangla/latexbangla.sty

  3. Edit latexbangla.sty . Line no (nearly 40 ) edit Kalpurush to kalpurush.ttf ( \def\@@Kalpurush{Kalpurush} to \def\@@Kalpurush{kalpurush.ttf} ) This will use our kalpurush.ttf instead of system font.

Try my code. (Its not mine it is taken from different source Like:

bold and italic not working in Bangla font

LaTeXbangla package is not working in Overleaf

and other sources and combine that worked. So, I share it. --Credit )


N.B : go to overleaf menu and make compiler XeLaTeX


% !TEX TS-program = XeLaTeX

\documentclass[10pt]{article} \usepackage{polyglossia} \usepackage{fontenc} % feature=1 will make some fearute availabel like proof , problem etc avilable % That will be useful \usepackage[banglamainfont=kalpurush.ttf, banglattfont=kalpurush.ttf, feature=1 ]{latexbangla}

% This will make Date, section and subsection and so on to bnagali number numbers
% if you dont want to convert it to bangali then comment it \setdefaultlanguage[numerals=Bengali, changecounternumbering=true]{bengali}

\title{বাংলা \LaTeX } \author{অতনু} \date{\today} \begin{document} \maketitle \tableofcontents \section{পিথাগোরাস(Pythagoras)}

\textbf{সমকোণী ত্রিভুজের অতিভুজের উপর অঙ্কিত বর্গক্ষেত্রের ক্ষেত্রফল অপর দুই বাহুর উপর অঙ্কিত বর্গক্ষেত্রের ক্ষেত্রফলের সমষ্টির সমান।}

\subsection{বর্ণনা}

পিথাগোরাস(Pythagoras)-এর উপপাদ্যটি হল, \textit{সমকোণী ত্রিভুজের অতিভুজের উপর অঙ্কিত
বর্গক্ষেত্রের ক্ষেত্রফল অপর দুই বাহুর উপর অঙ্কিত বর্গক্ষেত্রের ক্ষেত্রফলের সমষ্টির সমান।} অর্থাৎ কোন সমকোণী ত্রিভুজের অতিভুজ $c$ এবং অপর দুই বাহু $a$ এবং $b$ হলে, [c^2=a^2+b^2]

লক্ষ্য করুন, এখন পর্যন্ত টেক্সট প্রদর্শনের জন্য \textbf{কালপুরুষ} ফন্ট ব্যবহৃত হয়েছে।\ \texttt{এবার, টেলিটাইপ(Teletype) টেক্সট প্রদর্শনের জন্য \textbf{সিয়াম রূপালী} ফন্ট ব্যবহৃত হল।}\ পুনরায় টেক্সট প্রদর্শনের জন্য \textbf{কালপুরুষ} ফন্ট ব্যবহৃত হচ্ছে।

\begin{proof} $p|n$ হলে, ${n,2n,\ldots,(p-1)n}$ \end{proof}

\begin{problem} $a$ এবং $n$ হলে দেখাও যে $a^{\phi(n)} \equiv 1\pmod n$ \end{problem}

\subsubsection{লিস্ট} \begin{enumerate} \item প্রথমে https://www.overleaf.com তে যান, একাউন্ট খুলুন, এবং প্রজেক্ট তৈরি করুন। \item আপনার পছন্দের বাংলা ফন্ট ডাউনলোড করুন, আমি কালপুরুষ ব্যবহার করেছি। \item ফন্টটি ওভারলিফে আপলোড করুন \item usepackage{fontpec} এবং setmainfront(kalpurush.ttf) সেট করা হয়েছে। \item এখন পছন্দ মতো বাংলা লিখুন। \item আপনি চাইলে বোল্ড, ইটালিক বা অন্য স্টাইলের জন্য ভিন্ন ভিন্ন ফন্ট ব্যবহার করতে পারেন। \item শুভকামনা রইলো। \end{enumerate}

\end{document}

1

I specifically needed a solution that could be compiled with pdflatex on Overleaf. Unfortunately, many of the modern packages require XeLaTeX or LuaLaTeX.

For this, you can use pdflatex_bengali based on the bangtex package.

Quickstart Guide

  • Put the mf folder along with all its contents in the same directory as your LaTeX source code.
  • Put the bangla_commands.tex file in the same directory as your LaTeX source code.
  • Put \input{bangla_commands} in the preamble of your LaTeX source code
  • When you write বাংলা enclose it within the \bng command like this {\bng baNNGla \*l*ikhun} which should output বাংলা লিখুন
  • The \bng command can be replaced by commands specifying other sizes, and this is outlined in the demo.tex and demo.pdf files.
  • A simple example document is shown below
\documentclass{article}

\title{Bengali Test} \author{{\lbng Airt/r *gh*eaSh}}

\input{bangla_commands}

\begin{document}

\maketitle

\section{Example}

{\bng baNNGla *l*ikhun}

\end{document}

Aritra
  • 111
0

I'm using overleaf for Bangla writing. There is no installation and it's easy. Follow my instruction.

  • 4
    Please do not link to remote ressources for this as the remote content from your GitHub repository might not be available in the future. Instead please add a copy of the instructions to your answer here. – epR8GaYuh Jul 26 '19 at 08:41
0

Download any Bengali Unicode font from here and add it to the directory where your .tex file resides.

I downloaded the Kalpurush font.

Then add two commands like this before the \begin{document} command.

\usepackage{fontspec}    
\newfontfamily\ben{kalpurush.ttf}

(Use the name of the ttf file you downloaded)

Now you can write Bengali text anywhere like this:

{\ben কম্পিউটার বিজ্ঞান} 

Don't forget to put everything inside curly braces like I did above. Compile using XeLaTeX.

I have done this in Overleaf and it is working perfectly.

  • 1
    Two downvotes without as much as a comment pointing out the issues with a new contributor's answer are just so disheartening to see. If you are going to downvote something, please at least leave a comment mentioning how the poster can improve their answer. – Aritra Jun 29 '22 at 20:10
  • Thanks for the solution. – Saprativa Bhattacharjee Sep 16 '22 at 19:14
  • This is a very simple solution if it’s enough for your document. It does have the disadvantages that it only works on xeLaTeX with certain fonts; you could make this work more reliably by adding Script=, Language= and Rnderer= font options. It also doesn’t provide bold, italic, sans-serif or monospace. I’m not sure whether there are hyphenation patterns for Bangla, but that wouldn’t be enabled either. – Davislor Apr 25 '23 at 11:09