7

I want to write an article in Odia language. Some kind people in the TeX chat room helped me. Now I'm using this:

\documentclass[12pt]{amsart}
\usepackage{fontspec}
\setmainfont[
  Renderer=HarfBuzz,Script=Oriya,
  BoldFeatures={RawFeature={axis={wght=600}}},
  BoldFont=*
]{NotoSansOriya-VariableFont_wdth,wght.ttf}
\begin{document}
"ନାଆଁଟି ମୋର କାଳିଆ, କେହି ନାହିଁ ମୋ ଭଳିଆ |"\\
{\bfseries
"ନାଆଁଟି ମୋର କାଳିଆ, କେହି ନାହିଁ ମୋ ଭଳିଆ|"}\\
"My name is Kalia, No one is like me."

$$a^2+b^2=c^2, କ^2+b^୨ =c^2$$
\end{document}

And this gives output To write my article I only need to know how to change the font typeface of English text of entire document.

Though this is not that necessary for my article, But I am curious to see how to

  1. write Odia letters in italics
  2. use Odia letters in math-mode.

I tried but Odia letters doesn't appear in math-mode. In the image see that the letter 'କ' is not appearing in math-mode but the number '୨' appears.

Lastly, Is there any other way to write Odia in LaTeX?

Thank you.

PNDas

8
  • I can't see any odia font with italic, is that used at all really? The script looks so scarily regular is it ever used in slanted form? you could use unicode-math package to add the Odia font for the appropriate unicode range in math Oct 1, 2022 at 9:53
  • @DavidCarlisle, I don't know. I think, I have seen it in school textbooks. I actually don't remember. I was just curious .
    – PNDas
    Oct 1, 2022 at 9:58
  • In MS Word, you can use italic Odia. But tbh, that looks awful.
    – PNDas
    Oct 1, 2022 at 10:03
  • Word will just apply a geometrical transformation to any character (which is what autofakeslant does in the posted answer), but culturally does it make sense, is that used in real tradition in your region? Oct 1, 2022 at 10:16
  • 1
    If those fonts are freely available (or you buy them) and you install in your operating system, you will be able to use them from lualatex. Basically if you are on Windows you can use any font you can use in Word Oct 1, 2022 at 10:42

3 Answers 3

8

You can use different fonts for different scripts so use real italic for Latin and no italic (or fake slant) for Odia

enter image description here

\documentclass[12pt]{amsart}
\usepackage{unicode-math}
\setmainfont{Noto Sans}
\newfontfamily\odia[
  Renderer=HarfBuzz,Script=Oriya,
  BoldFeatures={RawFeature={axis={wght=600}}},
  BoldFont=*
]{NotoSansOriya-VariableFont_wdth,wght.ttf}
\begin{document}
{\odia"ନାଆଁଟି ମୋର କାଳିଆ, କେହି ନାହିଁ ମୋ ଭଳିଆ |"}

{\odia\bfseries
"ନାଆଁଟି ମୋର କାଳିଆ, କେହି ନାହିଁ ମୋ ଭଳିଆ|"}

``My name is Kalia, No one is like me.''

{\itshape ``My name is Kalia, No one is like me.''}

{\bfseries ``My name is Kalia, No one is like me.''}

\[a^2+b^2=c^2, \text{\odia କ}^2+b^{\text{\odia ୨}} =c^2\]

\end{document}

In comments you said you wanted to keep latin modern, so do not change the main font and use thiner Odia fonts as the default weight is too heavy alongside LM

enter image description here

\documentclass[12pt]{amsart}
\usepackage{unicode-math}
%\setmainfont{Noto Sans}
\newfontfamily\odia[
  Renderer=HarfBuzz,Script=Oriya,
  RawFeature={axis={wght=300}},
  BoldFeatures={RawFeature={axis={wght=500}}},
  BoldFont=*
]{NotoSansOriya-VariableFont_wdth,wght.ttf}
\begin{document}
{\odia"ନାଆଁଟି ମୋର କାଳିଆ, କେହି ନାହିଁ ମୋ ଭଳିଆ |"}

{\odia\bfseries
"ନାଆଁଟି ମୋର କାଳିଆ, କେହି ନାହିଁ ମୋ ଭଳିଆ|"}

``My name is Kalia, No one is like me.''

{\itshape ``My name is Kalia, No one is like me.''}

{\bfseries ``My name is Kalia, No one is like me.''}

\[a^2+b^2=c^2, \text{\odia କ}^2+b^{\text{\odia ୨}} =c^2\]

\end{document}
5
  • I used Noto Sans and Noto sans Oriya here but you do not have to use "related" families choose any that you consider to match Oct 1, 2022 at 10:20
  • Thanks for your answer. Actually I wanted to change the typeface of English text. Normally I use Latin modern. Is it possible to change the English text to Latin modern?
    – PNDas
    Oct 1, 2022 at 10:23
  • Latin modern is the default in lualatex, so simply delete the line \setmainfont{Noto Sans} @PNDas Oct 1, 2022 at 10:24
  • Thanks. Sorry, I'm asking so many questions. If I want to change the fonts then do I need to put \setmainfont{name_of_the_font}?
    – PNDas
    Oct 1, 2022 at 10:28
  • @PNDas see updated answer. (fontspec has a manual: texdoc fontspec or learnlatex has examples of this) Oct 1, 2022 at 10:31
5

As to the text fonts, here is an example with babel showing how to switch the font with the script (and the hyphenation rules, too). Actually, this example can serve as a model for other Indic languages, including Assamese, Gujarati, Hindi, Kannada, Malayalam, Tamil, etc. I presume you actually want a danda instead of a vertical bar, so I’ve replaced it. I’ve added some explanations as comments.

Note, however, you will find always ambiguous situations requiring explicit markup, as the quotes reveal in this example. No universal rules can be settled and depends largely on the document.


\documentclass[a4paper]{article}

\usepackage{babel}

% In versions >=3.79 the preferred name is odia. In previous versions
% use oriya. Although languages are usually passed as options to babel,
% in this case I’ll use \babelprovide to activate a useful transform,
% which prevents a break before a danda if preceded by a space.

\babelprovide[
  import, main,
  % mapdigits, % Optional: replace Arabic digits by Odia ones
  transforms = danda.nobreak]{odia}

% Tell babel to switch the font and hyphenation when a char
% of the script for English (ie, the Latin script) is found.

\babelprovide[onchar = ids fonts]{english}

% By default, digits and puntuation are considered part of the Latin
% script. Very likely that’s wrong and have to be fixed in babel, but
% fortunately there is a workaround:

\babelcharproperty{`\!}[`\@]{locale}{odia}
\babelcharproperty{`\[}[`\`]{locale}{odia}
\babelcharproperty{`\{}[`\}]{locale}{odia}

% Set the main roman font, for the main language. 'Script' and
% 'Language' are set by babel. You may find a nasty and somewhat
% misleading warning about language and/or script not found raised by
% fontspec - just ignore it (it will be concealed altogether in babel
% 3.81):

\babelfont{rm}
  [Renderer=HarfBuzz,
   BoldFeatures={RawFeature={axis={wght=600}}},
   BoldFont=*
  ]{NotoSansOriya-VariableFont_wdth,wght.ttf}

% Set the font for english:

\babelfont[english]{rm}{Latin Modern Roman}

\begin{document}

ନାଆଁଟି ମୋର କାଳିଆ, କେହି ନାହିଁ ମୋ ଭଳିଆ ।

``My name is Kalia, No one is like me.'' 

\textit{``My name is Kalia, No one is like me.''}

\textbf{``My name is Kalia, No one is like me.''}

\textbf{ନାଆଁଟି ମୋର କାଳିଆ, କେହି ନାହିଁ ମୋ ଭଳିଆ ।}

\end{document}

Odia

4

Welcome to TeX.SX! The font you choose does not come with italics, so you may want to choose a font that actually provides italic letters (given that such a typographic feature even exists in this script). It may not be too appealing typographically, but if you still want to stick with NotoSans Oriya, you can use the AutoFakeSlant option provided by fontspec which will fake italics by slanting the glyphs.

As for the use in math mode, you may want to wrap the letters in a \text macro which will typeset the non-italic style of the relevant glyph.

\documentclass[12pt]{amsart}
\usepackage{fontspec}
\setmainfont[
  Renderer=HarfBuzz,
  Script=Oriya,
  BoldFeatures={RawFeature={axis={wght=600}}},
  BoldFont=*,
  AutoFakeSlant=0.2
]{NotoSansOriya-VariableFont_wdth,wght.ttf}

\begin{document}
``ନାଆଁଟି ମୋର କାଳିଆ, କେହି ନାହିଁ ମୋ ଭଳିଆ |''

{\bfseries
``ନାଆଁଟି ମୋର କାଳିଆ, କେହି ନାହିଁ ମୋ ଭଳିଆ|''}

``My name is Kalia, No one is like me.''

{\itshape
``ନାଆଁଟି ମୋର କାଳିଆ, କେହି ନାହିଁ ମୋ ଭଳିଆ|''}

\[a^2+b^2=c^2, \text{କ}^2+b^\text{୨} =c^2\]
\end{document}

enter image description here

8
  • Thanks. What about changing the fonts of English letters?
    – PNDas
    Oct 1, 2022 at 9:59
  • 1
    Maybe have a look at this question regarding how to set up NotoSans for math mode. However, I fear that you cannot use the variable font in math mode. Oct 1, 2022 at 10:10
  • I was talking about the font of English text of whole document. Usually I use latin modern package. But this cancels fontspec.
    – PNDas
    Oct 1, 2022 at 10:14
  • @PNDas So, you mean you only want NotoSans Oriya for the Oriya glyphs? Oct 1, 2022 at 10:21
  • Yes, Exactly. \\\\\
    – PNDas
    Oct 1, 2022 at 10:29

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .