我正在尝试使用注释包来编写边注,我可以用一个命令(包选项)方便地隐藏这些边注。不幸的是,当涉及到数学公式和带单位的数量时,注释的间距非常奇怪(并且是错误的?)(从希尼奇包裹)。
以下是展示这些问题的 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=text
以siunitx
获得 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}