MathJax上标

时间:2016-08-21 18:11:15

标签: mathjax

如何制作此图片:

expected result

MathJax的结果

Result with MathJax

{}_{88}^{226}\mathrm{Ra},\;{}_6^{12}\mathrm C,\;{}_{14}^{30}\mathrm{Si},\;{}_{92}^{235}\mathrm U

2 个答案:

答案 0 :(得分:0)

下标和上标与左侧对齐。

如果将它们居中,那么您可以使用smallmatrix



<script src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.4/MathJax.js?config=TeX-MML-AM_CHTML"></script>
$$
\begin{smallmatrix}
  112 \\
  4
\end{smallmatrix}
\mathrm{Ra}
$$
&#13;
&#13;
&#13;

但如果您希望它们与右侧对齐,我认为您唯一的选择是使用array,但数字看起来过于分散。

&#13;
&#13;
<script src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.4/MathJax.js?config=TeX-MML-AM_CHTML"></script>
$$
{
  \scriptsize
  \begin{array}{r}
    112 \\
    4
  \end{array}
}
\mathrm{Ra}
$$
&#13;
&#13;
&#13;

答案 1 :(得分:0)

这里还有一个示例(基于 MathJax/mhchem ):

window.MathJax = {
  config: ["MMLorHTML.js"],
  jax: ["input/TeX", "input/MathML", "input/AsciiMath", "output/HTML-CSS", "output/NativeMML"],
  extensions: ["tex2jax.js", "mml2jax.js", "asciimath2jax.js", "MathMenu.js", "MathZoom.js"],
  asciimath2jax: {
    delimiters: [
      ['`', '`'],
      ['$', '$']
    ]
  },
  TeX: {
    extensions: ["AMSmath.js", "AMSsymbols.js", "noErrors.js", "noUndefined.js", "mhchem.js"]
  },
  tex2jax: {
    inlineMath: [
      ['$', '$'],
      ["\\(", "\\)"]
    ],
    processEscapes: true
  }
};
.MathJax_CHTML {
  font-size: 30px !important;
}
<script type="text/javascript" async src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.4/MathJax.js?config=TeX-MML-AM_CHTML">
</script>


<p>
  $\ce{^{226}_{88}$Ra$}$, $\ce{^{12}_{6}$C$}$, $\ce{^{30}_{14}$Si$}$, $\ce{^{235}_{92}$U$}$
</p>