在给定的 MWE 中,新sd
命令产生的 ^ 插入符号高于hat
插入符号。有没有办法调整newcommand
序言底部的 以降低这些插入符号以匹配?(Alegreya 可以从字体松鼠。
这可能看起来很傻,但我确实更追求\newcommand
插入符号的外观而不是hat
插入符号本身。
%XeLaTeX
\documentclass{article}
\usepackage{mathspec}
\setmainfont[
Extension = .otf,
UprightFont = Alegreya-Regular,
ItalicFont = Alegreya-Italic,
BoldFont = Alegreya-Bold,
BoldItalicFont = Alegreya-BoldItalic,
UprightFeatures = {SmallCapsFont = AlegreyaSC-Regular},
ItalicFeatures = {SmallCapsFont = AlegreyaSC-Italic},
BoldFeatures = {SmallCapsFont = AlegreyaSC-Bold},
BoldItalicFeatures = {SmallCapsFont = AlegreyaSC-BoldItalic},
Ligatures = TeX]
{Alegreya}
\setmathsfont(Digits,Latin,Greek)
[Numbers=OldStyle]{Alegreya}
\newcommand{\sd}[1]{\accent"02C6 #1}
\begin{document}
\sd{1} $\hat{1}$ \sd{2} $\hat{2}$ \sd{3} $\hat{3}$ \sd{4} $\hat{4}$ \sd{5} $\hat{5}$ \sd{6} $\hat{6}$ \sd{7} $\hat{7}$
\end{document}
奇怪的是,sd
当以下内容时,插入符号正是我想要的fontspec
:
\setmainfont[
SmallCapsFont={Alegreya SC},
ItalicFeatures={SmallCapsFont=AlegreyaSC-Italic},
BoldFeatures={SmallCapsFont=AlegreyaSC-Bold},
BoldItalicFeatures={SmallCapsFont=AlegreyaSC-BoldItalic},
Ligatures=TeX,
]{Alegreya}
由于连字符和国际字符的原因,我必须澄清fontspec
您在原始 MWE 中看到的内容;有人能解释一下为什么会这样吗?
答案可能是如何降低 \widetilde 重音,但说实话我甚至不知道从哪里开始。
答案1
\halign
您可以使用而不是来修复字符的高度\accent
:
\documentclass{article}
\usepackage{mathspec}
\setmainfont[
Extension = .ttf, % I only have TrueType
UprightFont = *-Regular,
ItalicFont = *-Italic,
BoldFont = *-Bold,
BoldItalicFont = *-BoldItalic,
UprightFeatures = {SmallCapsFont = *SC-Regular},
ItalicFeatures = {SmallCapsFont = *SC-Italic},
BoldFeatures = {SmallCapsFont = *SC-Bold},
BoldItalicFeatures = {SmallCapsFont = *SC-BoldItalic},
Ligatures = TeX
]{Alegreya}
\setmathsfont(Digits,Latin,Greek)[
Numbers=OldStyle
]{Alegreya-Regular}
\DeclareRobustCommand{\sd}[1]{%
\leavevmode
\vbox{\offinterlineskip
\ialign{%
##\cr
\hidewidth\char"02C6 \hidewidth\cr
\noalign{\kern-0.95ex}
#1\cr
}%
}%
}
\begin{document}
\sd{1} $\hat{1}$ \sd{2} $\hat{2}$ \sd{3} $\hat{3}$
\sd{4} $\hat{4}$ \sd{5} $\hat{5}$ \sd{6} $\hat{6}$
\sd{7} $\hat{7}$ \sd{8} $\hat{8}$ \sd{9} $\hat{9}$
\sd{0} $\hat{0}$
\end{document}