
XeTeX를 fontspec
및 와 함께 사용하여 unicode-math
문서의 기본 글꼴을 에 사용하고 싶습니다.숫자(숫자) 수학 모드에서. 또한 \text{}
문서의 기본값은 OldStyle 번호인 반면 수학 모드에서는 Lining 번호를 사용하고 싶습니다 . 이 동작을 어떻게 달성할 수 있습니까?
삽입을 시도했지만 \setmathfont[range=\mathup/{num}]{Linux Libertine O}
원하는 결과가 나오지 않습니다.
다음은 문제를 지적하는 MWE입니다.
\documentclass{article}
\usepackage{iftex}
\usepackage{libertine}
\usepackage{fontspec}
\setmainfont[Numbers=OldStyle]{Linux Libertine O}
\usepackage{amsmath}
\usepackage{unicode-math}
% Here I try to set up the normal text font for digits in mathmode:
\setmathfont[range=\mathup/{num}]{Linux Libertine O}
\parindent0pt
\begin{document}
This is \ifXeTeX XeTeX\fi\ifLuaTeX LuaTeX\fi
with \fontname\font
\bigskip
Text numbers:
0123456789; italic: \textit{0123456789}; bold: \textbf{0123456789}
Text numbers lining:
\liningnums{0123456789; italic: \textit{0123456789}; bold:
\textbf{0123456789}}
Numbers in mathmode: $0123456789$ (ok)\\
mathit: $\mathit{0123456789}$ (wrong font)\\
mathbf: $\mathbf{0123456789}$ (wrong font)\\
mathrm: $\mathrm{0123456789}$ (wrong font)\\
text (math): $\text{0123456789}$ (should be lining)
In big equation, fonts for big brackets $\big( \Big( \bigg( \Bigg($ are
missing:
\[
\left(\frac{12a}{34b}\right)
\]
\end{document}
XeTeX를 사용하면 다음과 같은 결과가 나타납니다.
따라서 3가지 문제가 있습니다.
Linux Libertine O
\mathrm
for digits는 ,\mathit
,\mathbf
등에 나타나지 않습니다 .- 큰 괄호가 작동하지 않습니다. (이에 대한 자세한 내용은 아래를 참조하세요.)
\text{}
문서 번호 스타일이 OldStyle인데도 수학 모드에서 Lining 번호를 얻을 수 있는 방법이 있습니까 ?
range=\mathup/{num}
문제 1과 관련하여 이는 수직 수학 텍스트에만 적용하기 때문입니다 . 모든 범위의 모든 숫자에 대해 이 명령을 적용하는 방법을 아는 사람이 있습니까? 만 사용하면 range={num}
오류가 발생합니다.
문제 2와 관련하여 두 가지 정보가 더 있습니다. A) 동일한 파일에서 LuaTeX를 사용하면 대괄호나타나다, 그러나 크기가 조정되지 않은 경우:
나) 해당 줄을 주석 처리하면 \setmathfont[range=\mathup/{num}]{Linux Libertine O}
전혀 문제가 발생하지 않습니다. 이는 숫자의 글꼴을 변경하면 대괄호 메커니즘이 영향을 받는다는 것을 의미합니다. 그렇지 않습니까?
그런데 이 문제는 Linux Libertine O
. SabonNextLTPro
메인 문서 글꼴로 사용했을 때도 나타났습니다 .
답변1
누군가가 아이디어를 내놓을 때까지는 해결 방법을 공유하겠습니다. 기본적으로 mathspec
대신 으로 되돌아갑니다 unicode-math
. 거의 모든 것이 단 세 줄로 즉시 작동합니다.
\documentclass{article}
\usepackage{iftex}
\usepackage[no-math]{fontspec}
\usepackage{libertine}
\setmainfont[Numbers=OldStyle]{Linux Libertine O}
\usepackage{amsmath}
\usepackage{mathspec}
\setmathfont(Digits){Linux Libertine O}
\parindent0pt
\begin{document}
This is \ifXeTeX XeTeX\fi\ifLuaTeX LuaTeX\fi
with \fontname\font
\bigskip
Text numbers:
0123456789; italic: \textit{0123456789}; bold: \textbf{0123456789}
Text numbers lining:
\liningnums{0123456789; italic: \textit{0123456789}; bold:
\textbf{0123456789}}
Numbers in mathmode: $0123456789$ (ok)\\
mathit: $\mathit{0123456789}$ (correct font but no italic)\\
mathbf: $\mathbf{0123456789}$ (correct font but no boldface)\\
mathrm: $\mathrm{0123456789}$ (ok)\\
text (math): $\text{0123456789}$ (should be lining)
In equations, testing fonts for big brackets $\big( \Big( \bigg( \Bigg($:
\[
\left(\frac{12a}{34b}\right)
\]
\end{document}