如主题。我在 Overleaf 上使用 pdfLaTeX 编译器。
我已经找到了一种补救措施(?)作为主题,即不加粗箭头:\bm{a_{xxx}}{}_{\uparrow}
。但是,我想知道在符号\bm{a_{xxx\uparrow}}
后留下额外空白的原因。\uparrow
\bm{a_{xxx\downarrow}}
\documentclass[a4paper,12pt]{article}
\usepackage{amsmath,latexsym,amssymb,enumerate,amsthm}
\usepackage{setspace,color,graphicx,mathtools,yhmath}
\usepackage[hang]{caption}
\usepackage{dsfont}
\usepackage[dvipsnames]{xcolor}
\usepackage{subcaption,cancel}
\usepackage{bm}
\begin{document}
\begin{equation}
\bm{a_{xxx\uparrow}}(i), \bm{a_{xxx\downarrow}}(i).
\end{equation}
\end{document}
答案1
一个错误cmbsy7.tfm
:使用的字符是八进制 42(向上箭头)和八进制 43(向下箭头),我们在 tfm 文件中看到(转换为人类可读的形式)
(FAMILY CMBSY V2.2)
(FACE O 360)
(CODINGSCHEME TEX MATH SYMBOLS)
(DESIGNSIZE R 7.0)
(COMMENT DESIGNSIZE IS IN POINTS)
[...]
(CHARACTER O 42
(CHARWD R 0.65516)
(CHARHT R 0.694445)
(CHARDP R 0.194445)
(CHARIC R 0.714683)
)
(CHARACTER O 43
(CHARWD R 0.65516)
(CHARHT R 0.694445)
(CHARDP R 0.194445)
)
[...]
而斜体校正则完全不同,因为根据规则,当符号结束数学列表时,TeX 会添加斜体校正。斜体校正最终为 0.714683 乘以 7 点,高达 5pt!
事实上,如果我尝试,$x_{\bm{\uparrow}}x_{\bm{\downarrow}}$
我会得到
....\OML/cmm/m/it/10 x
....\hbox(4.8611+1.3611)x10.08888, shifted 1.49998
.....\hbox(4.8611+1.3611)x9.58888
......\mathon
......\OMS/cmsy/b/n/7 "
......\kern5.00278
......\mathoff
....\OML/cmm/m/it/10 x
....\hbox(4.8611+1.3611)x5.0861, shifted 1.49998
.....\hbox(4.8611+1.3611)x4.5861
......\mathon
......\OMS/cmsy/b/n/7 #
......\mathoff
您会看到增加了字距。
\documentclass{article}
\usepackage{amsmath}
\usepackage{bm}
\newcommand\fixup{\kern-\fontcharic\scriptfont2`\"}
\begin{document}
$x_{\bm{\uparrow\fixup}x_{\bm{\downarrow}}x$
\end{document}
另一个解决方法可能是
\newcommand{\fixup}{_{\kern-\scriptspace}}
第一个建议的破解方法不适用于箭头上标,第二个可以;但是,如果箭头有下标,它会自行删除错误的斜体校正。
问题始于 Knuth 本人编写的 METAFONT 源代码。我们在sym.mf
iff known down_arrow: cmchar "Downward arrow";
beginchar(down_arrow,9u#,asc_height#,asc_depth#);
adjust_fit(0,0); pickup crisp.nib;
pos1(rule_thickness,0); pos2(rule_thickness,0);
pos3(rule_thickness,90); pos4(rule_thickness,90);
lft x1l=hround(.5w-.5rule_thickness); y1+.5rule_thickness=h;
x0=x1=x2; bot y0=-d; x0-x3=x4-x0=if monospace:3u else:4u fi+eps;
y3=y4=y0+if monospace:.24 else:.36 fi asc_height+eps;
pos5(rule_thickness,angle(z4-z0)); z5l=z0;
pos6(rule_thickness,angle(z3-z0)); z6l=z0;
z9=.2[.5[z3,z4],z0];
numeric t; path p; p=z4r{z9-z4}..z6r;
t=xpart(p intersectiontimes((x2r,-d)--(x2r,h))); y2=ypart point t of p;
filldraw z0..{z4-z9}z4l--subpath (0,t) of\\(z4r{z9-z4}..z6r)
---z1r..z1l---subpath (t,0) of\\(z3r{z9-z3}..z5r)
--z3l{z9-z3}..z0 & cycle; % arrowhead and stem
penlabels(0,1,2,3,4,5,6,9); endchar;
iff known up_arrow: cmchar "Upward arrow";
beginchar(up_arrow,9u#,asc_height#,asc_depth#);
italcorr .76asc_height#*slant+.5crisp#-u#;
adjust_fit(0,0); pickup crisp.nib;
pos1(rule_thickness,0); pos2(rule_thickness,0);
pos3(rule_thickness,90); pos4(rule_thickness,90);
lft x1l=hround(.5w-.5rule_thickness); y1-.5rule_thickness=-d;
x0=x1=x2; top y0=h; x0-x3=x4-x0=if monospace:3u else:4u fi+eps;
y3=y4=y0-if monospace:.24 else:.36 fi asc_height-eps;
pos5(rule_thickness,angle(z4-z0)); z5l=z0;
pos6(rule_thickness,angle(z3-z0)); z6l=z0;
z9=.2[.5[z3,z4],z0];
numeric t; path p; p=z4l{z9-z4}..z6r;
t=xpart(p intersectiontimes((x2r,-d)--(x2r,h))); y2=ypart point t of p;
filldraw z0..{z4-z9}z4r--subpath (0,t) of\\(z4l{z9-z4}..z6r)
---z1r..z1l---subpath (t,0) of\\(z3l{z9-z3}..z5r)
--z3r{z9-z3}..z0 & cycle; % arrowhead and stem
penlabels(0,1,2,3,4,5,6,9); endchar;
并且应该有理由将“向上箭头”中的斜体更正改为“向下箭头”中的斜体更正。无论如何,这个斜体更正结果是负面的,因此被丢弃,cmsy5
改为cmsy10
。
真正的错误是在cmbsy7.mf
(在cmextra
,由AMS提供)它有
crisp#:=11pt#; % diameter of serif corners
同样,cmbsy5.mf
有 9pt,而cmsy7.mf
有
crisp#:=7/36pt#; % diameter of serif corners
这就是问题cmbsy10.mf
所在。事实上,
crisp#:=13/36pt#; % diameter of serif corners
类似的错误影响cmbsy5.mf
、cmbsy6.mf
和cmbsy8.mf
,但不影响cmbsy9.mf
和cmbsy10.mf
。