기본 글꼴이 있는 환경, 다른 텍스트는 \textsf

기본 글꼴이 있는 환경, 다른 텍스트는 \textsf

문서의 글꼴을 에서 생성한 글꼴로 설정하고 싶지만 \textsf{}정의 및 정리와 같은 환경에서는 기본 글꼴을 유지하고 싶습니다. 선언하려는 나의 시도

\documentclass[a4paper,12pt]{book} 
\usepackage{amsthm}
\renewcommand{\familydefault}{\sfdefault}
\newtheorem{defi}{Definition}[chapter]
\newtheoremstyle{defi}% name
{3pt}% Space above
{3pt}% Space below
{crm}% Body font
{}% Indent amount
{\itshape}% Theorem head font
{:}% Punctuation after theorem head
{.5em}% Space after theorem head
{}% Theorem head spec (can be left empty, meaning ‘normal’)

\begin{document}

\begin{defi} Text with default font. \end{defi}

Text in sans-serif font.

\end{document}

하지만 글꼴이 모든 텍스트에 대해 산세리프로 정의되어 있으므로 작동하지 않습니다. 위에서 말씀드린 바디폰트가 맞는지 궁금합니다. 누군가 힌트를 줄 수 있다면 감사하겠습니다. 내 문서를 조판하는 데 이 산세리프 글꼴을 사용하지 말라고 조언받았습니다. 그래서 몇 가지 제안을 하고 싶습니다. 미리 감사드립니다!

답변1

적어도 몇 가지 문제가 있습니다.

  • 글꼴 \rmfamily은 가 아니라 로 지정되어야 합니다 cmr.

  • 명령문 앞에 새 스타일을 호출해야 합니다 \newtheorem.

이 시도:

% My standard header for TeX.SX answers:
\documentclass[a4paper]{article} % To avoid confusion, let us explicitly 
                                 % declare the paper format.

\usepackage[T1]{fontenc}         % Not always necessary, but recommended.
% End of standard header.  What follows pertains to the problem at hand.

\usepackage{amsmath,amsthm}

\renewcommand{\familydefault}{\sfdefault}

\newtheoremstyle{defi}% name
    {3pt}% Space above
    {3pt}% Space below
    {\rmfamily}% Body font
    {}% Indent amount
    {\rmfamily\itshape}% Theorem head font
    {:}% Punctuation after theorem head
    {.5em}% Space after theorem head
    {}% Theorem head spec (can be left empty, meaning "normal")

\theoremstyle{defi}
\newtheorem{defi}{Definition}[section] % not "chapter" because I'm using the 
                                       % "article" document class



\begin{document}

\section{A title}

Some text before the first definition: this text should be in ``sans-serif''.

\begin{defi}
    This is a definition, and it should be in \verb|\rmfamily| (that is, 
    \emph{with} serifs).
\end{defi}

Some text after the definition, again in \verb|\sffamily|.

\end{document}

결과가 단지 잘못된 타이포그래피인지 직접 확인할 수 있습니다.

코드 출력

실제로 기사(또는 더 나쁘게는 보고서: 장을 사용하고 있었죠?)를 산세리프 글꼴로 조판하는 것 자체가 이미 의심스럽습니다. 하지만 설정하려면이내에그런 문서, 세리프가 있는 정의…

관련 정보