reutenauer / polyglossia

An alternative to Babel for XeLaTeX and LuaLaTeX
http://www.ctan.org/pkg/polyglossia
MIT License
187 stars 52 forks source link

\newfontfamily\<lang>fonttt with non-main language #580

Closed itt533 closed 1 year ago

itt533 commented 1 year ago

here is my mwe:

\documentclass{beamer} \mode { \usetheme{metropolis} }

\usepackage{polyglossia} \newfontfamily\devanagarifontsf[Script=Devanagari]{NotoSansDevanagari} \newfontfamily\devanagarifonttt[Script=Devanagari]{NotoSansDevanagari}

\setotherlanguages{english} \newfontfamily\englishfontsf{NotoSans} \newfontfamily\englishfonttt{NotoSansMono}

\setmainlanguage{sanskrit} \setmainfont[Script=Devanagari]{NotoSansDevanagari}

\begin{document} \begin{frame}[fragile]{अ} % in the main language, mono font is set by % \newfontfamily\devanagarifonttt[Script=Devanagari]{NotoSansDevanagari} % and verbatim works \begin{verbatim} <-- verbatim uses by default the mono font अ आ इ ई \end{verbatim}

% in the second language, mono font is set by % \newfontfamily\englishfonttt{NotoSansMono} % but changing to the secong language environment with % \begin{english} is done setting the mono font as defined with the above command

\begin{english} % additional command \setmonofont is needed % \setmonofont{NotoSansMono} \begin{verbatim} ṭśṣḍñ % <--- fails if additional command \setmonofont is not used \end{verbatim} \end{english} \end{frame} \end{document}

The environment should be able to switch all three fonts serif, sans, and mono when given by the user.

jspitz commented 1 year ago

Should be fixed in master. Please test and report back if you can.

jspitz commented 1 year ago

Polyglossia 1.61 is on its way to CTAN.