0

This question is in continuation with my earlier question. I am not sure whether this fits in my previous question. Therefore, I am asking a new question.

The MWE is as follows:

\usepackage{polyglossia}
\usepackage{lipsum}
\usepackage{fontspec}
%%%%%%%%%%%%%%%%%%%%%%%
\setdefaultlanguage{english}
\setotherlanguage{sanskrit}
\newfontfamily{\pst}[Script=Devanagari]{Lohit Devanagari} 
%%%%%%%%%%%%%%%%%%%%%%%
\begin{document}
\chapter[\pst{अर्जुन विषाद योग} -- Arjuna viṣāda yoga]{\pst{अर्जुन विषाद योग} \\ Arjuna viṣāda yoga}
%\chapter[Arjuna viṣāda yoga -- \pst{अर्जुन विषाद योग}]{Arjuna viṣāda yoga \\ \pst{अर्जुन विषाद योग}}
\lipsum[1-10]
\end{document}
%%%%%%%%%%%%%%%%%%%%%%% 

Screenshot of the chapter title:

Screenshot of the header:

When the the argument of chapter command in the MWE is slightly modified to have the Latin characters in the first line followed by the Devanagari characters, everything is alright (as shown below).

Screenshot of the modified title:

Screenshot of the modified header:

But I want the Devanagari to be followed by the Latin Characters both in the chapter title and the header.

How can this be achieved? Can someone help me out?

5
  • 1
    \pst is a font switch. It doesn't take an argument. Move the brace before the command: {\pst अर्जुन विषाद योग} Commented Mar 17, 2021 at 11:31
  • Another tip for multi-lingual documents: add \tracinglostchars=2 near the top of your preamble. You’ll get a warning message when the current font is missing a glyph you requested (which usually means you selected a different language than you’re typing in).
    – Davislor
    Commented Mar 17, 2021 at 15:10
  • You could also use onchar=ids fonts with babel in LuaLaTeX, or ucharclasses in XeLaTeX, to automatically detect the language you’re typing in and select the correct font family.
    – Davislor
    Commented Mar 17, 2021 at 15:11
  • @UlrikeFischer Thanks!! Such a simple yet serious misktake. Thanks again!
    – vrgovinda
    Commented Mar 18, 2021 at 7:30
  • @Davislor I'll try it out.
    – vrgovinda
    Commented Mar 18, 2021 at 17:04

1 Answer 1

2

@ulrike Fischer's comment is the answer.

\pst is a font switch. It doesn't take an argument. Move the brace before the command: {\pst अर्जुन विषाद योग}

You must log in to answer this question.

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