latex中怎样写上标_如何调整上标的垂直位置?

一种方法是,写一个「空的下标」,不输出内容、仅使用它纵向的尺寸(高度和深度)。

```tex

\[

t_i^j = t_{\vphantom{i}}^j

\]

```

如果下标内容变得更高(例如 `k`,例如 `i^i`),`\vphantom` 的参数也要随之变化。

个人建议,尽一切可能避免使用具体数字,它们或者依赖具体输入内容(的字符尺寸),或者依赖字体字号。

------

更多信息

公式中,

\# 上标偏移高度(上标文字基线相对于正常文字基线上移的高度)有个默认值,这就是 `t^j`的效果。

\# 如果下标太高了,为了避免重叠,上标会随之上移,这就是 `t_i^j` 的效果。

上述提到的「上标偏移高度的默认值」,是由字体定义的(传统是通过 tfm 文件)。在 tex 文档里,我们也可以修改它

```tex

\documentclass{article}

\makeatletter

\newcommand{\showFontdimen}{

\check@mathfonts

\noindent minimum shift up, from the main baseline, of the baseline of a

superscript, \par

- for display style: \the\fontdimen13\textfont2 \par

- other style and non-cramped: \the\fontdimen14\textfont2 \par

- other style and cramped: \the\fontdimen15\textfont2

\setbox0=\hbox{$\scriptstyle j$}

\textbf{inline} $t_i^j = t^j$ text $t_i\raise\the\fontdimen14\textfont2\copy0$

\begin{equation}

\mbox{\bfseries display } t_i^j = t^j \quad t_i\raise\the\fontdimen13\textfont2\copy0

\end{equation}

}

\makeatother

\begin{document}

\showFontdimen

\fontdimen13\textfont2=1.5em

\fontdimen14\textfont2=1em

\showFontdimen

\end{document}

```

![](https://pics.latexstudio.net/data/images/202002/3a053887a612258.png)

例子里为了突出效果,分别修改为了 1.5em 和 1em。可以根据实际需要进行修改。

\# 参考 `texdoc texbytopic`, `\fontdimen` 相关内容

\# 对 `\fontdimen` 第一个参数的解释 https://tex.stackexchange.com/a/88993

\# 如果要在导言区全局修改,参考 https://tex.stackexchange.com/a/96063

回答于 2020-02-17 20:34

741ddce5195542c333bbe118aebabd72.gif

论坛 github.com/C论坛 github.com/C

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值