Computer Modern을 굵은 글꼴로 유지

Computer Modern을 굵은 글꼴로 유지

저는 Gentium을 메인 글꼴로 사용하고 싶습니다. \usepackage{Gentium} 명령을 사용하면 됩니다. 하지만 저는 "Computer Modern"을 굵은 글꼴로 만들고 싶습니다. 그것을 수행하는 방법에 대한 아이디어가 있습니까?

답변1

Gentium패키지 는 없지만 gentium; 패키지 이름에 대문자를 사용하면 대소문자를 구분하지 않는 파일 시스템(Windows)에서 작동할 수 있지만 다음과 같이 파일 이식성이 제한됩니다.\usepackage{Gentium} GNU/Linux 또는 Mac OS X 시스템에서는 작동하지 않으므로 파일 이식성이 제한됩니다.

간단한 해결책은 패치를 적용 \bfseries하고 \mdseries현재 글꼴 모음을 확인하고, 기본값( gentium)인 경우 CM으로 전환하는 것입니다 \bfseries. 반대로 글꼴 모음이 CM인 경우 다음으로 전환하세요.gentium .

예제에 표시된 것처럼 다른 글꼴 모음은 영향을 받지 않습니다.

그러나 이 예에서는 Computer Moder Roman Bold가 시각적으로 Gentium과 호환되지 않음을 보여주므로 이 작업을 수행하지 않는 것이 좋습니다. Adventor와 Cursor는 여기서 단지 예로서 사용되었으며 Gentium과 함께 사용된다는 주장은 없습니다.

일반적인 인쇄 규칙에 따라 일반 문서에서는 세리프 글꼴 모음을 하나만 사용해야 합니다.

\documentclass{article}
\usepackage{gentium}
\usepackage{tgadventor}
\usepackage{tgcursor}
\usepackage{xpatch,pdftexcmds}

\xpatchcmd{\bfseries}
  {\selectfont}
  {\checkfamily{\familydefault}{cmr}\selectfont}
  {}{}
\xpatchcmd{\mdseries}
  {\selectfont}
  {\checkfamily{cmr}{\familydefault}\selectfont}
  {}{}

\makeatletter
\newcommand{\checkfamily}[2]{%
  \ifnum\pdf@strcmp{\f@family}{#1}=\z@
    \fontfamily{#2}%
  \fi
}
\makeatother

\begin{document}
Some text in Gentium and \textbf{some in CM {\mdseries (this is Gentium)} and back to CM}

\sffamily
Some text in Adventor and \textbf{some in bf {\mdseries (this is md)} and back to bf}

\ttfamily
Some text in Cursor and \textbf{some in bf {\mdseries (this is md)} and back to bf}

\end{document}

여기에 이미지 설명을 입력하세요

글꼴 충돌을 더 잘 보여주는 확대 보기

여기에 이미지 설명을 입력하세요

더 길고 더 강력한 솔루션에는 .fdGentium용 파일을 수정하는 것이 포함됩니다.

XeLaTeX 또는 LuaLaTeX를 사용하면 더 쉽게 얻을 수 있습니다.

\usepackage{fontspec}

\setmainfont{Gentium}[
  BoldFont={Latin Modern Roman 10 Bold}
]
\setsansfont{TeX Gyre Adventor}
\setmonofont{TeX Gyre Cursor}

크기를 좀 더 조정해야 합니다.

관련 정보