方程式和 SI 单位的边注间距错误

方程式和 SI 单位的边注间距错误

我正在尝试使用注释包来编写边注,我可以用一个命令(包选项)方便地隐藏这些边注。不幸的是,当涉及到数学公式和带单位的数量时,注释的间距非常奇怪(并且是错误的?)(从希尼奇包裹)。

以下是展示这些问题的 MWE:

\documentclass[a4paper]{book}

\usepackage{lipsum}
\usepackage[mnwidth=\marginparwidth,
sidenotes]{mnotes}

\usepackage{siunitx}

\usepackage[euler-digits,euler-hat-accent]{eulervm}
\usepackage{beramono}
\usepackage{newpxtext}

\begin{document}

This paragraph is a test for the \texttt{mnote} package,\MNOTE{This is a note. Formulae displayed with \texttt{mnote} look rather odd: \[\int_a^b f(x)\,dx = F(b) - F(a).\] The spacing looks off in formulae such as $E=mc^2$ as well as numbers \SI{10}{\angstrom}.} which does not seem to play well with mathematical formulae:
\[
    \int_a^b f(x)\,dx = F(b) - F(a).
\]
$E = mc^2$ is an equation with the expected spacing. \textit{$E = mc^2$ is an equation within italic text}. \SI{10}{\angstrom} also has the expected spacing.

\end{document}

平均能量损失

有没有办法在使用创建的边注中获得正确的间距(与正文相同)注释

答案1

mnote这与其使用的字体大小无关\tiny

“问题”在于 Euler 字体,通过精确的选择,它在较小尺寸的字体中使用了相当宽的边距。

\documentclass[a4paper]{book}

\usepackage[euler-digits,euler-hat-accent]{eulervm}
\usepackage{newpxtext}

\begin{document}

\[
    \int_a^b f(x)\,dx = F(b) - F(a).
\]

\tiny
\[
    \int_a^b f(x)\,dx = F(b) - F(a).
\]

\end{document}

在此处输入图片描述

使用 你会得到稍微好一点的输出\scriptsize

\documentclass[a4paper]{book}

\usepackage{lipsum}
\usepackage[
  mnwidth=\marginparwidth,
  sidenotes
]{mnotes}

\usepackage{siunitx}

\usepackage[euler-digits,euler-hat-accent]{eulervm}
\usepackage{beramono}
\usepackage{newpxtext}

\renewcommand{\MNFONT}{\scriptsize}

\begin{document}

This paragraph is a test for the \texttt{mnote} package,%
\MNOTE{This is a note. Formulae displayed with \texttt{mnote} 
  look rather odd: \[\int_a^b f(x)\,dx = F(b) - F(a).\] The 
  spacing looks off in formulae such as $E=mc^2$ as well as numbers \SI{1}{\nano\meter}.}
which does not seem to play well with mathematical formulae:
\[
    \int_a^b f(x)\,dx = F(b) - F(a).
\]
$E = mc^2$ is an equation with the expected spacing. 
\textit{$E = mc^2$ is an equation within italic text}. \SI{1}{\nano\meter} 
also has the expected spacing.

\end{document}

我修复了\angstrom弃用的单元。

在此处输入图片描述

或者,定义一个合适的数学版本,其中字体从 10pt 大小缩放。我还添加了mode=textsiunitx获得 Palatino 作为单位。

\documentclass[a4paper]{book}

\usepackage{lipsum}
\usepackage[
  mnwidth=\marginparwidth,
  sidenotes
]{mnotes}

\usepackage[mode=text]{siunitx}

\usepackage[euler-digits,euler-hat-accent,small]{eulervm}
\usepackage{beramono}
\usepackage{newpxtext}

\DeclareFontFamily{U}{scaledzeur}{\skewchar \font =127}
\DeclareFontShape{U}{scaledzeur}{m}{n}{<-> zeurm10}{}
\DeclareFontFamily{U}{scaledzeus}{\skewchar \font =176}
\DeclareFontShape{U}{scaledzeus}{m}{n}{<-> zeusm10}{}
\DeclareMathVersion{scaledeuler}{}
\SetSymbolFont{letters}{scaledeuler}{U}{scaledzeur}{m}{n}
\SetSymbolFont{symbols}{scaledeuler}{U}{scaledzeus}{m}{n}


\renewcommand{\MNFONT}{\tiny\mathversion{scaledeuler}}

\begin{document}

This paragraph is a test for the \texttt{mnote} package,%
\MNOTE{This is a note. Formulae displayed with \texttt{mnote} 
  look rather odd: \[\int_a^b f(x)\,dx = F(b) - F(a).\] The 
  spacing looks off in formulae such as $E=mc^2$ as well as numbers \SI{1}{\nano\meter}.}
which does not seem to play well with mathematical formulae:
\[
    \int_a^b f(x)\,dx = F(b) - F(a).
\]
$E = mc^2$ is an equation with the expected spacing. 
\textit{$E = mc^2$ is an equation within italic text}. \SI{1}{\nano\meter} 
also has the expected spacing.

\end{document}

在此处输入图片描述

相关内容