在环境中使用不同的字体

在环境中使用不同的字体

我想定义一个“示例”环境,在章节内编号,并且该环境还使用与其余文本不同的字体。我知道如何创建环境,但我不知道如何让环境使用 Libertinus 字体。

到目前为止,我的定义如下:

\newcounter{example}
\counterwithin{example}{chapter}
\newenvironment{argument}[1][\unskip]{%
\par
\noindent
\def\temp{#1}\ifx\temp\empty
\textbf{Example~\theexample:}
\else
\textbf{Example~\theexample (#1):}
\fi
\noindent}
{\vspace*{2em}}

相关内容