.png)
나는 전자기학을 다루는 모든 사람을 위해 LaTeX의 고전적인 문제를 해결하려고 노력하고 있습니다.그리피스의 script-r 표기법 정의. 이번에는 그가 그의 책에서 사용하는 실제 Kaufmann 글꼴을 사용하여 이 작업을 수행하고 싶고 이미 파일을 얻었습니다. LuaLaTeX에서는 글꼴을 "자유롭게" 사용하기 쉽지만, 코드가 내가 사용하는 다른 패키지와 잘 작동하도록 이를 사용하는 수학 기호를 정의하고 싶습니다.physics
.
읽고 나서이 답변일반적인 script-r 문제에 관한 게시물에서, 명령어를 통해 script-r 표기법을 구현하려고 했는데 \DeclareMathSymbol
거기에 Kaufmann 글꼴을 어떻게 사용하는지 이해할 수 없습니다.
간단히 말해서 , 두 개의 .ttf
글꼴 파일이 있고 . Kaufmann 글꼴을 사용하여 같은 명령이 굵은 버전을 반환하도록 수학 기호를 정의하는 데 어떻게 사용할 수 있습니까 ?Kaufmann-Regular.ttf
Kaufmann-Bold.ttf
\rcurs
\mathbf{\rcurs}
답변1
수학 알파벳과 연산자는 세트를 형성하므로 혼합 및 일치를 수행하려면 일반적으로 다양한 종류의 낮은 수준의 조정이 필요합니다.
하지만 심볼을 가져오는 방법에는 다양한 방법이 있습니다.
(1)
가장 간단한 방법은 Griffiths처럼 글리프를 이미지\PDF로 포함하고 필요할 때 크기를 조정하는 것입니다.
암호:
\documentclass{report}
\usepackage{graphicx}
\def\rcurs{{\mbox{$\resizebox{.16in}{.08in}{\includegraphics{ScriptR}}$}}}
\def\brcurs{{\mbox{$\resizebox{.16in}{.08in}{\includegraphics{BoldR}}$}}}
\def\hrcurs{{\mbox{$\hat \brcurs$}}}
\begin{document}
Here's a sample:
$\resizebox{.16in}{.08in}{\includegraphics{BoldR}}$
Can I put it into a line of type? $\resizebox{.21in}{.11in}{\includegraphics{BoldR}}$
How about using the macro: \brcurs.
How about using the macro: \rcurs?
How about using the macro: \hrcurs?
What if it's in an equation?
\begin{equation}
{\bf E} = {1\over 4\pi\epsilon_0}\int {\rho\over \rcurs^2}{\hrcurs}\,d\tau.
\end{equation}
\end{document}
그리피스 zip 파일 보기http://academic.reed.edu/physics/faculty/griffiths/script_r.zip, 을 통해스크립트-r 기호
(2)
\math...
다음으로 가장 간단한 방법은 함수(여기서는 ) 중 하나를 사용하는 것입니다 \mathord
.\Umathchardef를 사용하여 XeTeX에서 다양한 크기의 수학 기호 정의~을 통해LuaTeX: 수학 모드에서 다른 글꼴의 단일 기호 사용
그 목록은 다음과 같습니다.
(texdoc 소스2e)
MWE
\documentclass{report}
\usepackage{xcolor}
\usepackage{unicode-math}
\setmathfont{Asana-Math}
\newfontfamily{\miama}{Miama}[Colour=red,
Scale=1.3,
Path=C:/Users/.../tl/texlive/2020/texmf-dist/fonts/opentype/public/miama/,
Extension=.otf,
UprightFont=*,
]
\DeclareRobustCommand\mysym{%
\mathord{\text{\normalfont\miama r}}%
}
%\def\rcurs{{\mbox{$\resizebox{.16in}{.08in}{\includegraphics{ScriptR}}$}}}
%\def\brcurs{{\mbox{$\resizebox{.16in}{.08in}{\includegraphics{BoldR}}$}}}
%\def\hrcurs{{\mbox{$\hat \brcurs$}}}
\def\hrcurs{{\mbox{$\hat\mbfscrr$}}}
\begin{document}
\fbox{Asana-Math: $\mbfscrr, \mscrr $}
Here's a sample:
$\mbfscrr$
Can I put it into a line of type? $\mbfscrr$
How about using the macro: \hrcurs?
What if it's in an equation?
\begin{equation}
\symbf{E} = {1\over 4\mitpi\mitepsilon_0}\int {\mitrho\over \mscrr^2}{\hat\mbfscrr}\,d\mittau.
\end{equation}
\renewcommand\mbfscrr{{\mysym}}
\def\hrcurs{{\mbox{$\hat\mbfscrr$}}}
\bigskip
\fbox{Miama: $\mysym$}
Here's a sample:
$\mysym$
Can I put it into a line of type? $\mysym$
How about using the macro: \hrcurs?
What if it's in an equation?
\begin{equation}
\symbf{E} = {1\over 4\mitpi\mitepsilon_0}\int {\mitrho\over \mscrr^2}{\hat\mbfscrr}\,d\mittau.
\end{equation}
\end{document}
(2a)
액센트 조정을 올바르게 하려면 커닝 등이 필요합니다. 여기서 수학이 아닌 다른 글꼴을 사용하면 해당 문제를 피할 수 있습니다.
MWE
\documentclass{report}
\usepackage{xcolor}
\usepackage{unicode-math}
\setmathfont{Asana-Math}
\newfontfamily{\gfs}{GFSBodoni}[Colour=red,
Scale=1.3,
Path=C:/Users/.../tl/texlive/2020/texmf-dist/fonts/opentype/public/gfsbodoni/,
Extension=.otf,
UprightFont=*,
ItalicFont=GFSBodoniIt,
BoldFont=GFSBodoniBold,
BoldItalicFont=GFSBodoniBoldIt,
]
\DeclareRobustCommand\mysymbi{%
\mathord{\text{\normalfont\gfs\bfseries\itshape r}}%
}
\DeclareRobustCommand\mysym{%
\mathord{\text{\normalfont\gfs\itshape r}}%
}
\def\hrcurs{{\mbox{$\hat\mbfscrr$}}}
\begin{document}
\fbox{Asana-Math: $\mbfscrr, \mscrr $}
Here's a sample:
$\mbfscrr$
Can I put it into a line of type? $\mbfscrr$
How about using the macro: \hrcurs?
What if it's in an equation?
\begin{equation}
\symbf{E} = {1\over 4\mitpi\mitepsilon_0}\int {\mitrho\over \mscrr^2}{\hat\mbfscrr}\,d\mittau.
\end{equation}
\renewcommand\mbfscrr{{\mysymbi}}
\def\hrcurs{{\mbox{$\hat\mbfscrr$}}}
\bigskip
\fbox{GFS Bodoni: $\mysymbi, \mysym$}
Here's a sample:
$\mysym$
Can I put it into a line of type? $\mysym$
How about using the macro: \hrcurs?
What if it's in an equation?
\begin{equation}
\symbf{E} = {1\over 4\mitpi\mitepsilon_0}\int {\mitrho\over \mysym^2}{\hat\mbfscrr}\,d\mittau.
\end{equation}
\end{document}
(삼)
다음으로 unicode-math
패키지의 range=
글꼴 옵션을 사용하여 매핑합니다.
유니코드 수학 글꼴에서 매핑:
MWE
\documentclass{report}
\usepackage{xcolor}
\usepackage{unicode-math}
\setmathfont{Asana-Math}
\def\hrcurs{{\mbox{$\hat\mbfscrr$}}}
\begin{document}
\fbox{Asana-Math: $\mbfscrr,\mscrr$}
Here's a sample:
$\mbfscrr$
Can I put it into a line of type? $\mbfscrr$
How about using the macro: \hrcurs?
What if it's in an equation?
\begin{equation}
\symbf{E} = {1\over 4\mitpi\mitepsilon_0}\int {\mitrho\over \mscrr^2}{\hat\mbfscrr}\,d\mittau.
\end{equation}
\setmathfont{TexGyreSchola-Math}[range={\mbfscrr,\mscrr},Colour=red]
\bigskip
\fbox{TexGyreSchola-Math: $\mbfscrr,\mscrr$}
Here's a sample:
$\mbfscrr$
Can I put it into a line of type? $\mbfscrr$
How about using the macro: \hrcurs?
What if it's in an equation?
\begin{equation}
\symbf{E} = {1\over 4\mitpi\mitepsilon_0}\int {\mitrho\over \mscrr^2}{\hat\mbfscrr}\,d\mittau.
\end{equation}
\end{document}
(4)
\DeclareMathSymbol
레거시 글꼴 기술을 사용합니다. ttf\otf 글꼴은 패키지를 통해 NFSS 별칭을 할당하고 fontspec
(따라서 xelatex 또는 lualatex를 컴파일러로 사용) 연결된 질문에 따라 여러 단계를 거쳐 사용할 수 있습니다.
옵션은 입니다 NFSSFamily=
.
예제 QTFloraline
에서는 글꼴(tex 배포판에서)을 사용합니다. 일반 글꼴과 굵은 글꼴이 있습니다. 대신 kaufmann 파일을 대체하십시오.
MWE
\documentclass{article}
\usepackage{xcolor}
\usepackage{unicode-math}
\setmathfont{Asana-Math}
\newfontface\ffontc{QTFloraline}[
Extension=.otf,
UprightFont=*,
BoldFont=*-Bold,
NFSSFamily=floraline,
]
\usepackage{bm}
\DeclareFontFamily{U}{floraline}{}
\DeclareFontShape{U}{floraline}{m}{n}{<-> QTFloraline}{}
\DeclareFontShape{U}{floraline}{b}{n}{<-> QTFloraline-Bold}{}
\DeclareSymbolFont{myfloraline}{U}{floraline}{m}{n}
\SetSymbolFont{myfloraline}{bold}{U}{floraline}{b}{n}
\DeclareMathSymbol{\rcurs}{\mathalpha}{myfloraline}{`\r}
\DeclareBoldMathCommand{\brcurs}{\rcurs}
\newcommand*\hrcurs{\hat{\brcurs}}
\begin{document}
\[
\mathbf{E}(\mathbf{r}) = \frac{1}{4 \pi \epsilon_0} \int\limits_{\mathcal{V}} \frac{\rho(\mathbf{r}')}{\rcurs^2} \hrcurs d \tau'
\]
Using \texttt{unicode-math} macros:
\[
\symbfup{E}(\symbfup{r}) = \frac{1}{4 \mitpi \mitepsilon_0} \int\limits_{\symcal{V}} \frac{\mitrho(\symbfup{r}')}{\rcurs^2} \hrcurs d \mittau'
\]
\end{document}
(5)
하나 또는 두 개의 기호에 대해서는 이 \mathord{}
방법이 더 쉽고 전체 수학 알파벳을 사용하지도 않습니다.
결과적으로 는 unicode-math
두 개의 매크로 \mbfscrr
와 를 정의합니다 \mscrr
. 이것들은 를 renewcommand
통해 재정의( )할 수 있습니다 \mathord
. 그게 바로 그것입니다.
코드는 변경할 내용의 단계를 단계별로 설명하고 각 결과를 설명하며 QTChanceryType
글꼴을 사용하여 최종 단계에 도달합니다.
MWE
\documentclass{report}
\usepackage{xcolor}
\usepackage{unicode-math}
\setmathfont{Asana-Math}
\newfontface\bodb{BOD_BLAR.TTF}[Colour=red]
\newfontface\ffontbreg{QTChanceryType.otf}
\newfontface\ffontbbold{QTChanceryType-Bold.otf}
\DeclareRobustCommand\xmbfscrr{%
\mathord{\text{\normalfont\bodb A}}%
}
\DeclareRobustCommand\myscrr{%
\mathord{\text{\normalfont\ffontbreg r}}%
}
\DeclareRobustCommand\mybfscrr{%
\mathord{\text{\normalfont\ffontbbold r}}%
}
\begin{document}
%======================: 0: base
\fbox{Asana-Math: $\mbfscrr,\mscrr$}
\begin{equation}
\symbfup{E} = {\frac{1}{4\mitpi\mitepsilon_0}}\int {\frac{\mitrho}{\mscrr^2}}{\hat\mbfscrr}\,d\mittau.
\end{equation}
%======================: 1: A
\renewcommand{\mbfscrr}{A}
\bigskip
\begin{equation}
\symbfup{E} = {\frac{1}{4\mitpi\mitepsilon_0}}\int {\frac{\mitrho}{\mscrr^2}}{\hat\mbfscrr}\,d\mittau.
\end{equation}
%======================: 2: A from another font
\renewcommand{\mbfscrr}{{\xmbfscrr}}
\bigskip
\begin{equation}
\symbfup{E} = {\frac{1}{4\mitpi\mitepsilon_0}}\int {\frac{\mitrho}{\mscrr^2}}{\hat\mbfscrr}\,d\mittau.
\end{equation}
%======================: 3: r and bold r, from another font
\renewcommand{\mbfscrr}{{\mybfscrr}}
\renewcommand{\mscrr}{{\myscrr}}
\bigskip
\begin{equation}
\symbfup{E} = {\frac{1}{4\mitpi\mitepsilon_0}}\int {\frac{\mitrho}{\mscrr^2}}{\hat\mbfscrr}\,d\mittau.
\end{equation}
\end{document}
부록
모호함을 피하기 위해 텍스트 모드와 수학 모드는 글꼴 측면에서 완전히 다른 세계입니다.
이탤릭체 x(