# How to get bengali font script as output written within verbatim package?

\documentclass{article}
\usepackage{verbatim}
\begin{document}

\begin{verbatim}
$\alpha=\beta$
Here is my text.
এখানে আমার টেক্সট ।

\end{verbatim}

\end{document}


This gives the following output :

$\alpha=\beta$
Here is my text.


But want the following output :

$\alpha=\beta$
Here is my text.
এখানে আমার টেক্সট ।


Is there any way to do so ?

• I have used 'India Bengali ' font. – Soumitra Sen Apr 2 '13 at 2:31
• Welcome to TeX.SE. Please consider augmenting your code snippet to form a full MWE (minimum working example). That way, it'll become clear (i) whether you're using pdfLaTeX, XeLaTeX, or LuaLaTeX, and (ii) how you're loading the font India Bengali. Thanks. – Mico Apr 2 '13 at 2:36
• I am using pdfLaTeX. To load follow the step(in Ubuntu10.04) System => Preferences => Keyboard =>Layouts =>Add =>By language =>In the 'language:' box select 'Bengali '(or any other language you like) => In the 'variants:' box select the required option as you like => Add => Close. – Soumitra Sen Apr 2 '13 at 2:41
• Is there any alternative way to get this output? – Soumitra Sen Apr 2 '13 at 2:56

From the question, it's not really clear how you are loading a specialist font, if at all. What is certain is that pdfLaTeX is not a good choice for working work Bengali input or similar in verbatim mode. I would strongly recommend either XeLaTeX or LuaLaTeX plus the fontspec package, in the form

\documentclass{article}
\usepackage{fontspec}
\setmainfont{<name>} % which supports Bengali
\setmonofont{<name>} % which supports Bengali
\usepackage{verbatim}
\begin{document}

\begin{verbatim}
$\alpha=\beta$
Here is my text.
এখানে আমার টেক্সট ।

\end{verbatim}

\end{document}


The font name you gave is rather generic, which prevents me checking, but an issue you will face is glyph coverage. I've no idea if there is a font which supports Bengali and provides monospaced output: you may have to modify your verbatim to use a proportional font. To help further, we'll need a link to the exact font in use.

I have written a package latexbangla to specifically address Bangla related typesetting issues. It fully supports Bangla text in verbatim environment and modifies the banglattfont to make it mono-spaced.

Sample code:

\documentclass{article}
\usepackage[banglamainfont=Kalpurush,
banglattfont=Siyam Rupali
]{latexbangla}
\usepackage{verbatim}

\begin{document}
\begin{verbatim}
\textbf{ফার্মার লিটল থিওরেম(Fermat's Little Theorem):} $p$ একটি মৌলিক সংখ্যা
এবং $n$ একটি পূর্ণসংখ্যা হলে,
$n^p\equiv n\pmod{n}$
এখানে, বাংলা টেলিটাইপ(Teletype)টেক্সট প্রদর্শনে সিয়াম রূপালি ফন্ট ব্যবহৃত হয়েছে।
\end{verbatim}
কিন্তু মূল ডকুমেন্টে বাংলা টেক্সট প্রদর্শনে কালপুরুষ ফন্ট ব্যবহৃত হয়েছে।
\end{document}