
문서 전체에서 텍스트가 나타날 때마다 기본 글꼴로 사용자 정의 TTF(News Gothic)를 사용하고 수학에는 CMU Bright를 사용할 수 있기를 원합니다. 하지만 \text
수학 모드 내부에서는 New Gothic을 사용해야 합니다. 그러나 News Gothic을 기본 글꼴로 사용하려고 하면 아래 이미지에서 볼 수 있는 수학 글꼴로 CMU가 설정 해제됩니다. sin
와 마찬가지로 News Gothic으로 작성되지만 ABC
및 x
은 e^{-x}
CMU Bright 대신 Computer Modern에 있습니다.
다음은 샘플 문서입니다. xelatex로 컴파일되었지만 luatex 전용 솔루션도 괜찮습니다. 나는 pdflatex가 이와 같은 글꼴을 처리할 수 없다고 생각하지만, 나는 틀리고 싶습니다. 작동하는 모든 솔루션이 허용됩니다.
\documentclass{article}
\usepackage{mathtools}
\usepackage{fontspec,unicode-math}
\usepackage{cmbright}
\usepackage[T1]{fontenc}
\setmainfont[
Path = /Applications/Microsoft PowerPoint.app/Contents/Resources/DFonts/,
Extension = .ttf,
BoldFont = News Gothic MT Bold,
ItalicFont = News Gothic MT Italic,
BoldItalicFont = News Gothic MT Bold Italic
]
{News Gothic MT}
\setsansfont[
Path = /Applications/Microsoft PowerPoint.app/Contents/Resources/DFonts/,
Extension = .ttf,
BoldFont = News Gothic MT Bold,
ItalicFont = News Gothic MT Italic,
BoldItalicFont = News Gothic MT Bold Italic
]
{News Gothic MT}
\begin{document}
\begin{center}
This is math:
\begin{align*}
\int_{-\infty}^\infty \frac{\sin(x)e^{-x}}{x}\quad\textbf{\textit{ABC}}
\end{align*}
\end{center}
\end{document}
결과:
을 제거하면 \setmainfont
Computer sin
Modern도 됩니다. 을 제거하면 \setsansfont
본문 글꼴과 ABC
둘 다 CMU Bright가 됩니다(그러나 sin
News Gothic은 유지됩니다). 하지만 다음과 같은 결과가 나올 조합을 알 수 없습니다.
- 본문글꼴 = 뉴스고딕
sin
= News Gothic(선택 사항입니다. CMU Bright도 괜찮습니다)\text
수학 모드 = 뉴스 고딕- 수학 모드의 숫자, 변수 등 = CMU Bright
답변1
레거시 수학 글꼴을 사용하고 싶으므로 unicode-math
. 물론 fontenc
T1 인코딩으로 로드하지 마세요.
\documentclass{article}
\usepackage{mathtools}
\usepackage{fontspec}
\usepackage{cmbright}
%\usepackage[T1]{fontenc}% <--- don't
\setmainfont{News Gothic MT}[
Path = /Applications/Microsoft PowerPoint.app/Contents/Resources/DFonts/,
Extension = .ttf,
ItalicFont = * Italic,
BoldFont = * Bold,
BoldItalicFont = * Bold Italic,
]
\setsansfont{News Gothic MT}[
Path = /Applications/Microsoft PowerPoint.app/Contents/Resources/DFonts/,
Extension = .ttf,
ItalicFont = * Italic,
BoldFont = * Bold,
BoldItalicFont = * Bold Italic,
]
\begin{document}
This is math:
\begin{equation*}
\int_{-\infty}^\infty \frac{\sin(x)e^{-x}}{x}\quad\textbf{\textit{ABC}}+123
\end{equation*}
\end{document}
약간 다른 서문을 사용하여 News Gothic에서 운영자 이름을 얻을 수 있습니다.
\documentclass{article}
\usepackage{mathtools}
\usepackage{fontspec}
\usepackage{cmbright}
\setmainfont{News Gothic MT}[
Path = /Applications/Microsoft PowerPoint.app/Contents/Resources/DFonts/,
Extension = .ttf,
ItalicFont = * Italic,
BoldFont = * Bold,
BoldItalicFont = * Bold Italic,
NFSSFamily = ngmt,
]
\setsansfont{News Gothic MT}[
Path = /Applications/Microsoft PowerPoint.app/Contents/Resources/DFonts/,
Extension = .ttf,
ItalicFont = * Italic,
BoldFont = * Bold,
BoldItalicFont = * Bold Italic,
]
\DeclareSymbolFont{operators}{TU}{ngmt}{m}{n}
\SetSymbolFont{operators}{bold}{TU}{ngmt}{b}{n}
\DeclareSymbolFont{cmbroperators}{OT1}{cmbr}{m}{n}
\makeatletter
\AtBeginDocument{\DeclareMathSymbol{\std@equal}{\mathrel}{cmbroperators}{`=}}
\makeatother
\begin{document}
\show\Relbar
This is math:
\begin{equation*}
\int_{-\infty}^\infty \frac{\sin(x)e^{-x}}{x}\quad\textbf{\textit{ABC}}+123
\end{equation*}
$\Longrightarrow\longrightarrow$
\end{document}