如何为环境选择字体?

如何为环境选择字体?

我使用\usepackage{fouriernc}。现在,我想chancery为定理环境选择字体。我该如何为某个环境(例如定理环境)选择字体?

\documentclass{book}
\usepackage{amsmath,amsthm}
\usepackage{fouriernc}
\newtheorem{theorem}{Theorem}
\usepackage{lipsum}
\begin{document}
\chapter{These Real Numbers}
\lipsum[1-2]
\begin{theorem}
\fontfamily{qzc}\selectfont\large
This is a theorem Pythagore
$$a^2 + b^2 = c^2.$$
\end{theorem}
\end{document}

我怎样才能输入之前的 \fontfamily{qzc}\selectfont\large内容 ?\newtheorem{theorem}{Theorem}\begin{document}

答案1

您可以通过以下方式选择 Chancery 字体:

\fontfamily{qzc}\selectfont

将其包含到\begingroup...\endgroup序列中,保存本地更改

\documentclass{book}
\usepackage{amsmath,amsthm}
\usepackage{fouriernc}
\newtheorem{theorem}{Theorem}
\usepackage{lipsum}
\newtheoremstyle{Special}%
  {3pt}%      ⟨Space above⟩
  {3pt}%      ⟨Space below⟩
  {\large\fontfamily{qzc}\selectfont}%⟨Body font⟩
  {}%         ⟨Indent amount⟩1
  {\itshape\bfseries}% ⟨Theorem head font⟩
  {:}%        ⟨Punctuation after theorem head⟩
  {.5em}%     ⟨Space after theorem head⟩2
  {}%         ⟨Theorem head spec (can be left empty, meaning ‘normal’)⟩
\theoremstyle{Special}
\newtheorem{Theorem}{Special}

\begin{document}
\chapter{These Real Numbers}
\lipsum[1-2]
\begin{Theorem}
This is a theorem Pythagore
$$a^2 + b^2 = c^2.$$
\end{Theorem}
\end{document}

相关内容