
문서 중간에 글꼴 크기를 변경해야 합니다. 문제는 어떤 방법을 시도하더라도 인라인 수학의 문자가 텍스트 모드에 비해 늘어나(더 넓어지고) 보기 좋지 않고 페이지 공간이 낭비된다는 것입니다. 이 문제를 어떻게 해결할 수 있나요?
MWE는 다음과 같습니다.
\documentclass{scrbook}
\usepackage{unicode-math}
\begin{document}
Same character width:\\
123456789012345678901234567890\\
$ 123456789012345678901234567890 $\par
\KOMAoptions{fontsize=10}
% or other change in size like \footnotesize \LARGE etc
Different character width:\\
123456789012345678901234567890\\
$ 123456789012345678901234567890 $\par
\end{document}
답변1
unicode-math가 숫자에 일반 라틴 현대 텍스트 글꼴을 사용하도록 강제할 수 있습니다.
\documentclass{scrbook}
\usepackage{unicode-math}
\setmathfont{Latin Modern Math}
\setmathfont[range={"0030-"0039}]{Latin Modern Roman}
\setmathfont[range=\int]{Latin Modern Math} %last font should be a math font
\begin{document}
Same character width:\\
123456789012345678901234567890\\
$ 123456789012345678901234567890 $\par
\KOMAoptions{fontsize=10}
Different character width:\\
123456789012345678901234567890\\
$ 123456789012345678901234567890 x^3$\par
\end{document}
편집하다
실제로 범위 명령은 필요하지 않습니다. egreg가 답변에서 하는 것처럼 수학 글꼴을 설정하기만 하면 현대 tex 시스템에서 문제가 해결됩니다.
\documentclass{scrbook}
\usepackage{unicode-math}
\setmathfont{Latin Modern Math}
\begin{document}
Same character width:\\
123456789012345678901234567890\\
$ 123456789012345678901234567890 $\par
\KOMAoptions{fontsize=10}
Different character width:\\
123456789012345678901234567890\\
$ 123456789012345678901234567890 x^3$\par
\end{document}
편집 2
좀 더 자세히 살펴보고 다른 글꼴 크기를 테스트한 후 문제의 원인을 찾았습니다. unicode-math는 다른 "수학 스타일"을 사용하여 수학을 설정하고 있습니다. 더 작은 글꼴 크기는 예 +ssty=0;
를 들어 숫자가 더 넓어집니다(이것은 버그가 아닌 기능입니다. 더 넓은 문자는 작은 크기에서 더 읽기 쉽습니다).
따라서 전체 글꼴 크기를 변경하면 수학 글꼴을 다시 설정해야 합니다.
\documentclass[fontsize=11pt]{scrbook}
\usepackage{unicode-math}
\setmathfont{Latin Modern Math}
\begin{document}
Same character width:\\
123456789012345678901234567890 abc\\
$ 123456789012345678901234567890 abc$
\KOMAoptions{fontsize=9}
\setmathfont{Latin Modern Math}
Different character width:\\
123456789012345678901234567890 abc\\
$ 123456789012345678901234567890 abc$
\end{document}
텍스트 글꼴에 시각적 크기가 있는 Latin Modern 글꼴의 경우 여전히 차이가 있습니다.
답변2
수학 글꼴을 지정하기만 하면 됩니다. 이런 일이 발생하는 이유는 버그 unicode-math
(또는 작동 방식의 결과 fontsize=10
)일 수 있습니다.
\documentclass{scrbook}
\usepackage{unicode-math}
\setmathfont{Latin Modern Math}
\begin{document}
Same character width:\\
123456789012345678901234567890\\
$ 123456789012345678901234567890 $\par
\KOMAoptions{fontsize=10}
% or other change in size like \footnotesize \LARGE etc
Different character width:\\
123456789012345678901234567890\\
$ 123456789012345678901234567890 $\par
\end{document}
디스플레이의 작은 변화는 Latin Modern Math 글꼴의 버그로 인해 발생합니다. 만약 내가한다면
\sbox0{78}\showbox0
\sbox0{$78$}\showbox0
일반 scrbook
설정(11pt)으로 설정하면 다음과 같은 결과를 얻습니다.
\hbox(7.40219+0.24089)x10.95
.\EU1/lmr/m/n/10.95 78
첫 번째 상자의 경우, 내가 얻는 동안
\hbox(7.40219+0.2409)x11.09236
.\mathon
.\EU1/LatinModernMath(0)/m/n/10.95 glyph#24
.\kern0.14235
.\EU1/LatinModernMath(0)/m/n/10.95 glyph#25
.\mathoff
크기의 차이는 다음과 같습니다 11.09236 - 10.95 = 0.14236
(이진 연산으로 인해 차이가 1sp이므로 관련 없음). 컨은 7과 사이에 추가됩니다.어느숫자. 숫자 사이에는 다른 커닝이 삽입되지 않습니다.