\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.
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.