
続くTeX Gyre Termes および TeX Gyre Termes Math のワイド鋭角およびワイド重音では、広い抑揚アクセントと鋭アクセントが\smaller
TeX Gyre Termes (Math) フォントと UTF-8 エンジン (NewTX および の場合pdflatex
、cf.NewTX と pdflatex を使用するときに、\smaller でも広い抑揚アクセントと鋭アクセントを正確にするにはどうすればよいですか?):
\documentclass{article}
\pagestyle{empty}
\usepackage{unicode-math}
\setmainfont[Ligatures=TeX]{TeX Gyre Termes}
\setsansfont{TeX Gyre Heros}[Scale=0.88]%%% Somewhat ok.
\setmonofont{TeX Gyre Cursor}%%% No explicit turning on ligatures for the monospaced font.
\setmathfont[Ligatures=TeX]{TeX Gyre Termes Math}
\usepackage{scalerel,stackengine}\stackMath
\usepackage{relsize}
%%% thanks to http://tex.stackexchange.com/a/611030
\newcommand\wideacute[1]{%
\ThisStyle{\savestack\tmpA{$\SavedStyle#1$}%
\savestack{\tmpbox}{$\SavedStyle\stretchto{%
\scalerel*[\wd\tmpAcontent]%
{\kern-.83\LMpt\Umathchar"7"0"00B4\kern-.12\LMpt}%
{\rule{0ex}{\textheight}}%
}{2\LMex}$}%
\stackengine{-6.3\LMpt}{\SavedStyle#1}{\tmpbox}{O}{c}{F}{T}{S}}%
}
\newcommand\widegrave[1]{%
\ThisStyle{\savestack\tmpA{$\SavedStyle#1$}%
\savestack{\tmpbox}{$\SavedStyle\stretchto{%
\scalerel*[\wd\tmpAcontent]%
{\kern-.43\LMpt\char"0060%
\kern-.9\LMpt}%
{\rule{0ex}{\textheight}}%
}{1.05\LMex}$}%
\stackengine{-2.3\LMpt}{\SavedStyle#1}{\tmpbox}{O}{c}{F}{T}{S}}%
}
\begin{document}
\newcommand{\test}[1]{\(\displaystyle \wideacute{#1}\ \widegrave{#1}\) \(\textstyle \wideacute{#1}\ \widegrave{#1}\) \(\scriptstyle \wideacute{#1}\ \widegrave{#1}\) \(\scriptscriptstyle \wideacute{{#1}}\ \widegrave{#1}\)}%
\newcommand{\ttest}[1]{\test{#1}\\{\smaller\test{#1}}}%
\newcommand{\tttest}[1]{\ttest{\mathit{#1}}}%
\noindent
\tttest{sum}\\
\tttest{loop}\\
\tttest{pool}\\
\tttest{buffer}\\
\ttest{\sigma_k}
\end{document}
これをlualatex
投入すると、
ご覧のとおり、単語とアクセントの間の距離は、通常サイズのフォントではある程度許容範囲内です (ただし、抑音の「ループ」と鋭音の「プール」ではこの距離が大きすぎるという不満もあるでしょう)。ただし、バージョンでは、\smaller
これら 2 つの部分が重なっており、これは望ましくありません。通常サイズのバージョンがまだ見栄えがよく (または、少なくとも現状よりも悪くはなく、つまり、アクセントが単語の真上にある必要があります)、小さいサイズのバージョンがより見栄えがよく (つまり、アクセントが単語と重ならない) なるように、フォント サイズへの依存性を導入するにはどうすればよいでしょうか。
答え1
使用
\stackengine{-1.3\LMex}{\SavedStyle#1}{\tmpbox}{O}{c}{F}{T}{S}}%
\wideacute
の定義において
\stackengine{-.4\LMex}{\SavedStyle#1}{\tmpbox}{O}{c}{F}{T}{S}}%
の定義において\widegrave
。