减号太长

减号太长

减号arevmath太长了。具体来说,它比加号还长。有办法纠正吗?

\documentclass{article}

\usepackage{arevmath}
\usepackage{xcolor}

% \DeclareSymbolFont{mathdesignC}{OMS}{zavm}{m}{n}
% \DeclareMathSymbol{-}{\mathrel}{mathdesignC}{"01}

\begin{document}

\begin{tabular}{|@{}l@{}|}
  $+$\\
  \color{red}$-$\\
  $\pm$
\end{tabular}

\end{document}

在此处输入图片描述

答案1

的确!

\documentclass{article}

\usepackage{arevmath}
\usepackage{xcolor}

\begin{document}

\fboxsep=0pt \fboxrule=0.1pt

\sbox0{$+$}\the\wd0\fbox{\box0}

\sbox0{$-$}\the\wd0\fbox{\box0}

\makebox[0pt][l]{\color{red}$-$}$+$

\makebox[0pt][l]{\color{red}$+$}$-$

\end{document}

在此处输入图片描述

但是,如您所见,边界框具有相同的宽度。

我们能做什么?我们可以水平缩放减号(利用矩形形状),但保持原始宽度。

\documentclass{article}
\usepackage{amsmath} % always do it for math

\usepackage{arevmath}
\usepackage{graphicx}
\usepackage{xcolor}

\makeatletter
\DeclareRobustCommand{\scaledarevminus}{\mathbin{\mathpalette\scaledarevminus@\relax}}
\newcommand{\scaledarevminus@}[2]{%
  \begingroup
  \sbox\z@{$\m@th#1\std@minus$}%
  \makebox[\wd\z@]{\kern-0.01\wd\z@\scalebox{0.85}[1]{\usebox\z@}}%
  \endgroup
}
\AtBeginDocument{%
  \begingroup\lccode`~=`-\lowercase{\endgroup\let~}\scaledarevminus
  \mathcode`-="8000
}
\def\newmcodes@{% fix the amsopn.sty definition
  \mathcode`\'39 \mathcode`\*42 \mathcode`\."613A
  \mathcode`\-45\mathcode`\/47\mathcode`\:"603A
  \relax
}
\makeatother

\begin{document}

\fboxsep=0pt \fboxrule=0.1pt
\sbox0{$+$}\the\wd0\fbox{\box0}
\sbox0{$-$}\the\wd0\fbox{\box0}

\makebox[0pt][l]{\color{red}$-$}$+$
\makebox[0pt][l]{$+$}\textcolor{red}{$-$}
\makebox[0pt][l]{\color{red}$\scriptstyle -$}$\scriptstyle +$
\makebox[0pt][l]{$\scriptstyle +$}\textcolor{red}{$\scriptstyle -$}
\makebox[0pt][l]{\color{red}$\scriptscriptstyle -$}$\scriptscriptstyle +$
\makebox[0pt][l]{$\scriptscriptstyle +$}\textcolor{red}{$\scriptscriptstyle -$}

\end{document}

在此处输入图片描述

放大版本

在此处输入图片描述

符号在边界框中的位置不对称,但这是字体设计师的选择。但我们也可以解决这个问题。

\documentclass{article}
\usepackage{amsmath} % always do it for math

\usepackage{arevmath}
\usepackage{graphicx}
\usepackage{xcolor}

\makeatletter
\mathchardef\std@plus=\mathcode`+
\DeclareRobustCommand{\scaledarevminus}{\mathbin{\mathpalette\scaledarevminus@\relax}}
\DeclareRobustCommand{\movedarevplus}{\mathbin{\mathpalette\movedarevplus@\relax}}
\newcommand{\scaledarevminus@}[2]{%
  \begingroup
  \sbox\z@{$\m@th#1\std@minus$}%
  \makebox[\wd\z@]{\kern0.06\wd\z@\scalebox{0.85}[1]{\usebox\z@}}%
  \endgroup
}
\newcommand{\movedarevplus@}[2]{%
  \begingroup
  \sbox\z@{$\m@th#1\std@plus$}%
  \makebox[\wd\z@]{\kern0.07\wd\z@\usebox\z@}%
  \endgroup
}
\AtBeginDocument{%
  \begingroup\lccode`~=`-\lowercase{\endgroup\let~}\scaledarevminus
  \begingroup\lccode`~=`+\lowercase{\endgroup\let~}\movedarevplus
  \mathcode`-="8000
  \mathcode`+="8000
}

\def\newmcodes@{% fix the amsopn.sty definition
  \mathcode`\'39 \mathcode`\*42 \mathcode`\."613A
  \mathcode`\-45\mathcode`\/47\mathcode`\:"603A
  \relax
}
\makeatother

\begin{document}

\fboxsep=0pt \fboxrule=0.1pt
\sbox0{$+$}\the\wd0\fbox{\box0}
\sbox0{$-$}\the\wd0\fbox{\box0}

\makebox[0pt][l]{\color{red}$-$}$+$
\makebox[0pt][l]{$+$}\textcolor{red}{$-$}
\makebox[0pt][l]{\color{red}$\scriptstyle -$}$\scriptstyle +$
\makebox[0pt][l]{$\scriptstyle +$}\textcolor{red}{$\scriptstyle -$}
\makebox[0pt][l]{\color{red}$\scriptscriptstyle -$}$\scriptscriptstyle +$
\makebox[0pt][l]{$\scriptscriptstyle +$}\textcolor{red}{$\scriptscriptstyle -$}

\end{document}

在此处输入图片描述

相关内容