1

Check this code:

\documentclass[crop]{standalone}
% \documentclass{article}
\usepackage{fontspec}
\newfontfamily\s[Script=Devanagari]{Noto Serif Devanagari} % Or any other Devanagari font
\usepackage[Devanagari,Latin]{ucharclasses}
\setTransitionTo{Devanagari}{\s}
\setTransitionFrom{Devanagari}{\rmfamily}
\setTransitionsForDevanagari{\s}{\rmfamily}

\begin{document}
English देवनागरी English देवनागरी   ॥१॥ % last character is not appearing.
\end{document}

This is yielding this output. enter image description here. Where this punction sign (॥) double danda is not appearing after devanagari digit 1 at the end. How to handle this?

1
  • You get Missing character: There is no ॥ (U+0965) in font [lmroman10-regular]:mapping=tex-text;! so it's switched back to latin too early Nov 14, 2023 at 10:26

1 Answer 1

2

enter image description here

I find it's often easier to use the character class commands directly rather than via the ucharclasses interface, but anyway for reasons that are not clear it is switching to the roman font before the character so you get

Missing character: There is no ॥ (U+0965) in font
     [lmroman10-regular]:mapping=tex-text;!

The commented out \showthe confirms the ॥ is class 3 which the log shows is

\DevanagariDanDaClass=\XeTeXcharclass3

So I just added another line to assert that the Devanagari font should be used for this class (it ought to be covered by the Devanagari meta class, but clearly that's not worked).

\documentclass[crop]{standalone}
% \documentclass{article}
\usepackage{fontspec}
\newfontfamily\s[Script=Devanagari]{Noto Serif Devanagari} % Or any other Devanagari font
\usepackage[Devanagari,Latin]{ucharclasses}
\setTransitionTo{Devanagari}{\s}
\setTransitionFrom{Devanagari}{\rmfamily}
\setTransitionsForDevanagari{\s}{\rmfamily}
\setTransitionTo{DevanagariDanDa}{\s}%<<<< added

%\showthe\XeTeXcharclass"0965
%\showthe\XeTeXcharclass`१
%\showthe\XeTeXcharclass`॥
\begin{document}
English देवनागरी English देवनागरी   ॥१॥ % last character is not appearing.
\end{document}

You must log in to answer this question.

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