No problem. Thank you. I use the Malayalam package, type in Latin script , save as *.mm file, raun it through the mal preprocessor to generate a tex file. Using polyglossia to type in Malayalam is difficult as I haven't got a good keyboard. The available ones that know of are extremely poor and type in the terrible new script. Solution: is there a possibility to generate the numbers using a style file? I don't know how to write one.
1 Answers
The babel and polyglossia packages both support Malayalam. You will need to compile your documents with either XeLaTeX or a version of LuaLaTeX from 2020 or later.
As a nice bonus, you can type in the Malayalam script the same way you normally do, and use any fonts you could use in your word processor. You will also get hyphenation patterns for your language.
Updated Answer
Based on your comments, you wanted to use the Rachana font and Malayalam numbering. Although the localized string for “Contents” appears to be set correctly by default, at least so far as I can tell, I demonstrate how to set it with \renewcommand\malayalamcontentsname.
\tracinglostchars = 2 % Print a warning to the console if a glyph is missing.
\documentclass{article}
\usepackage[paperwidth=10cm]{geometry} % To format a MWE on TeX.SX
\usepackage[english, bidi=default, layout=sectioning.counters]{babel}
\usepackage{fontspec}
\babelprovide[import,maparabic,main]{malayalam}
\defaultfontfeatures{Scale=MatchLowercase}
\babelfont{rm}
[Scale=1.0, Ligatures={Common,Rare,TeX}]{Linux Libertine O}
\babelfont{sf}
[Ligatures={Common, Rare, TeX}]{Linux Biolinum O}
\babelfont[malayalam]{rm}
{Rachana}
\newcommand\textmalayalam[1]{\foreignlanguage{malayalam}{#1}}
\newenvironment{malayalam}%
{\begin{otherlanguage}{malayalam}}%
{\end{otherlanguage}}
\newcommand\textenglish[1]{\foreignlanguage{english}{#1}}
\newenvironment{english}%
{\begin{otherlanguage}{english}}%
{\end{otherlanguage}}
\renewcommand\malayalamcontentsname{ഉള്ളടക്കം}
\begin{document}
\tableofcontents
\section{മലയാളം}
\begin{english}
This text is Romanized.
\end{english}
\end{document}
Thia works with LuaLaTeX from TeX Live 2020 or XeLaTeX from TeX Live 2019 (and might work with luahbtex from 2019), but as of June 2020, there’s a bug in TeX Live 2020 that breaks this MWE with XeLaTeX. Javier Bezos suggested the following workaround for now: \babelprovide[import,maparabic,main,typography/prehyphenchar=]{malayalam}
As a quick patch without using babel or polyglossia, you could define a Malayalam font and replace “Contents” with:
\usepackage{fontspec}
\newfontfamily\malayalamfont{Rachana}[Scale=MatchLowercase, Script=Malayalam]
\renewcommand\contentsname{{\malayalamfont ഉള്ളടക്കം}}
Original Answer
\tracinglostchars = 2 % Print a warning to the console if a glyph is missing.
\documentclass{article}
\usepackage[paperwidth=10cm]{geometry} % To format a MWE on TeX.SX
\usepackage{babel}
\usepackage{fontspec}
\babelprovide[import,main]{malayalam}
\defaultfontfeatures{Scale=MatchLowercase}
\babelfont{rm}
{Noto Serif}
\babelfont{sf}
{Noto Sans}
\babelfont{tt}
{Noto Sans Mono}
\babelfont[malayalam]{rm}
{Noto Serif Malayalam}
\babelfont[malayalam]{sf}
{Noto Sans Malayalam}
\begin{document}
\tableofcontents
\section{മലയാളം}
\end{document}
In the current version of babel, \babeltags{malayalam = malayalam} ought to define the \textmalayalam command and malayalam environment more simply.
I apologize for any errors in the document, since I don’t speak Malayalam.
If you prefer, polyglossia has supported Malayalam since version 1.2. You can add compatibility with the most common polyglossia commands in babel using:
\newcommand\textmalayalam[1]{\foreignlanguage{malayalam}{#1}}
\newenvironment{malayalam}{\begin{otherlanguage}{malayalam}}{\end{otherlanguage}}
- 44,045


The question would be is there any other solution such as redefining the command
– Srinath May 28 '20 at 20:04\arabic. You can also use, e.g.,\malayalamdigits{42}or\malayalamcounter{page}. – Davislor May 31 '20 at 17:42polyglossia(which are shorter, and also makes it more convenient to migrate betweenbabelandpolyglossiaif you need to). If you use the first template, most references should use Malayalam numbering. You might need to change counters that usealphorroman, or write\malayalamdigitshere or there. – Davislor Jun 01 '20 at 16:55I got an error ! Package babel Error: You haven't specified a language option.
what could be wrong? I used your code without changing anything.
– Srinath Jun 02 '20 at 22:52\babelfontin the current version of TeX Live. I’ll see if I can isolate it. Not sure yet whether it’s afontspecor ababelbug. Thanks. You might try removing the\babelprovide[input]{english}line and changing to\usepackage[english,bidi=default,layout=sectioning]{babel}instead. Or, as a workaround, compiling withluahbtexorlualatexfrom 2020 instead. – Davislor Jun 02 '20 at 23:49were you mentioning another code?
– Srinath Jun 03 '20 at 11:07\babelfontand XeTeX in TeX Live 2020, but it definitely works with the latest version of LuaLaTeX. – Davislor Jun 03 '20 at 15:43I get the following error
! Package babel Error: There is no ini file for the requested language (babel) (). Perhaps you misspelled it or your installation (babel) is not complete..
– Srinath Jun 04 '20 at 20:50\babelprovide[import,maparabic,main,typography/prehyphenchar=]{malayalam}. But it seems a problem infontspec. – Javier Bezos Jun 06 '20 at 11:38malalayampackage. I can help withbabel. – Javier Bezos Jun 19 '20 at 08:32Compose + k + a + aas ക andCompose + k + a + ias കൈ. I don’t know how well that works for you. And then you can type in Malayalam like you can typeCompose + -to get ± andCompose - -to get —. – Davislor Jun 20 '20 at 15:05