我需要放置一些文本,并突出显示第一行,以及其他随机功能。verbatimbox
似乎是合适的候选人。该文档是多语言文档,使用多语种。
以下是代码:
\documentclass{beamer}
%\mode<presentsation>
%{\usetheme{metropolis}} %<--- this changes the Mono font
% and \newfontfamily\englishfonttt{...}
% does not help. \setmonofont{...} must be used
% when needed (for verbatim e.g.)
\usepackage{polyglossia,verbatimbox,fontsize,ifthen}
\newfontfamily\devanagarifontsf[Script=Devanagari]{NotoSansDevanagari}
\newfontfamily\devanagarifonttt[Script=Devanagari]{NotoSansDevanagari}
\setmainlanguage{sanskrit}
\setmainfont[Script=Devanagari]{NotoSansDevanagari}
\setotherlanguages{english}
\newfontfamily\englishfontsf{NotoSans}
\newfontfamily\englishfonttt{NotoSansMono}[%
UprightFont=*Regular,
BoldFont=*Bold]
\newcommand{\eng}[1]{\textenglish{#1}}
\newcommand{\engs}[1]{\scriptsizerrr{\textenglish{#1}}}
\newenvironment{engsenv}{%
\setmonofont{NotoSansMono}
\begin{english}
}{%
\end{english}
}
\begin{document}
\begin{frame}[fragile]
\newcommand*\ifline[3]{%
\ifthenelse{\value{VerbboxLineNo} = #1}{#2}{#3}}
\newcommand*\highlight{\textbf}
\newcommand\nohighlight{\arabic{VerbboxLineNo}:\hspace{1ex}}
\newcommand{\devanagarinumeral}[1]{%
\devanagaridigits{\number\csname c@#1\endcsname}}
\begin{verbbox}[\devanagarinumeral{VerbboxLineNo}:\hspace{1mm}]
अ
आ
इ
\end{verbbox}
\theverbbox % works
\begin{engsenv}
\begin{verbbox}[\arabic{VerbboxLineNo}:\hspace{1mm}]
abc
def
ghi
\end{verbbox}
\end{engsenv}
\theverbbox % works
\begin{engsenv}
\begin{verbbox}[\ifline{1}{\highlight}{}]
jkl
mno
pqr
\end{verbbox}
\end{engsenv}
\theverbbox % does not work
\begin{engsenv}
\begin{myverbbox}{\hibox}[\arabic{VerbboxLineNo}:\hspace{1mm}]
stu
vwx
yza
\end{verbbox}
\end{engsenv}
\theverbbox % doe not works
\end{frame}
\end{document}