LaTeX arev 包和不起作用的 nmid 宏

LaTeX arev 包和不起作用的 nmid 宏

我刚刚在 MacBook 上安装了最新的 texlive 发行版。我注意到有一件事不起作用。如果我使用 arev 包,那么 $a \nmid b$ 不起作用。以下是代码:

\documentclass{article}
\usepackage{amssymb}
\usepackage{amsmath}
\usepackage{arev}
\begin{document}

$a \nmid b$

$a \mid b$

\end{document}

pdflatex 对此文件没有任何结果,而我期望出现一个负除法符号。日志文件显示,尽管这是 texlive2016,但 arev 包已经过时了 —— 事实上,与我之前使用的版本相同。因此,似乎一定缺少某种字体或其他东西。

答案1

您不应该加载amssymb,因为符号已经由提供了arev

修改后的答案

但是,TeX Live 2012 和 TeX Live 2013 之间的变化mathdesign并未反映在ams-mdbch.sty作为发行版一部分的中arev

您可以通过手动重新定义已删除的符号来修复此问题。

\documentclass{article}
\usepackage{amsmath}
\usepackage{arev}

%% fix the bug in ams-mdbch.sty
\DeclareFontFamily{U}{mdbchbmb}{}
\DeclareFontShape{U}{mdbchbmb}{b}{n}{<-> s*[0.96]mdbchbmb}{}
\DeclareSymbolFont{mathdesignB}{U}{mdbchbmb}{b}{n}

    \DeclareMathSymbol{\lvertneqq}    {\mathrel}{mathdesignB}{"00}
    \DeclareMathSymbol{\gvertneqq}    {\mathrel}{mathdesignB}{"01}
    \DeclareMathSymbol{\nleq}         {\mathrel}{mathdesignB}{"02}
    \DeclareMathSymbol{\ngeq}         {\mathrel}{mathdesignB}{"03}
    \DeclareMathSymbol{\nless}        {\mathrel}{mathdesignB}{"04}
    \DeclareMathSymbol{\ngtr}         {\mathrel}{mathdesignB}{"05}
    \DeclareMathSymbol{\nprec}        {\mathrel}{mathdesignB}{"06}
    \DeclareMathSymbol{\nsucc}        {\mathrel}{mathdesignB}{"07}
    \DeclareMathSymbol{\lneqq}        {\mathrel}{mathdesignB}{"08}
    \DeclareMathSymbol{\gneqq}        {\mathrel}{mathdesignB}{"09}
    \DeclareMathSymbol{\nleqslant}    {\mathrel}{mathdesignB}{"0A}
    \DeclareMathSymbol{\ngeqslant}    {\mathrel}{mathdesignB}{"0B}
    \DeclareMathSymbol{\lneq}         {\mathrel}{mathdesignB}{"0C}
    \DeclareMathSymbol{\gneq}         {\mathrel}{mathdesignB}{"0D}
    \DeclareMathSymbol{\npreceq}      {\mathrel}{mathdesignB}{"0E}
    \DeclareMathSymbol{\nsucceq}      {\mathrel}{mathdesignB}{"0F}
    \DeclareMathSymbol{\precnsim}     {\mathrel}{mathdesignB}{"10}
    \DeclareMathSymbol{\succnsim}     {\mathrel}{mathdesignB}{"11}
    \DeclareMathSymbol{\lnsim}        {\mathrel}{mathdesignB}{"12}
    \DeclareMathSymbol{\gnsim}        {\mathrel}{mathdesignB}{"13}
    \DeclareMathSymbol{\nleqq}        {\mathrel}{mathdesignB}{"14}
    \DeclareMathSymbol{\ngeqq}        {\mathrel}{mathdesignB}{"15}
    \DeclareMathSymbol{\precneqq}     {\mathrel}{mathdesignB}{"16}
    \DeclareMathSymbol{\succneqq}     {\mathrel}{mathdesignB}{"17}
    \DeclareMathSymbol{\precnapprox}  {\mathrel}{mathdesignB}{"18}
    \DeclareMathSymbol{\succnapprox}  {\mathrel}{mathdesignB}{"19}
    \DeclareMathSymbol{\lnapprox}     {\mathrel}{mathdesignB}{"1A}
    \DeclareMathSymbol{\gnapprox}     {\mathrel}{mathdesignB}{"1B}
    \DeclareMathSymbol{\nsim}         {\mathrel}{mathdesignB}{"1C}
    \DeclareMathSymbol{\ncong}        {\mathrel}{mathdesignB}{"1D}
    \DeclareMathSymbol{\diagup}       {\mathord}{mathdesignB}{"1E}
    \DeclareMathSymbol{\diagdown}     {\mathord}{mathdesignB}{"1F}
    \DeclareMathSymbol{\varsubsetneq}   {\mathrel}{mathdesignB}{"20}
    \DeclareMathSymbol{\varsupsetneq}   {\mathrel}{mathdesignB}{"21}
    \DeclareMathSymbol{\nsubseteqq}     {\mathrel}{mathdesignB}{"22}
    \DeclareMathSymbol{\nsupseteqq}     {\mathrel}{mathdesignB}{"23}
    \DeclareMathSymbol{\subsetneqq}     {\mathrel}{mathdesignB}{"24}
    \DeclareMathSymbol{\supsetneqq}     {\mathrel}{mathdesignB}{"25}
    \DeclareMathSymbol{\varsubsetneqq}  {\mathrel}{mathdesignB}{"26}
    \DeclareMathSymbol{\varsupsetneqq}  {\mathrel}{mathdesignB}{"27}
    \DeclareMathSymbol{\subsetneq}      {\mathrel}{mathdesignB}{"28}
    \DeclareMathSymbol{\supsetneq}      {\mathrel}{mathdesignB}{"29}
    \DeclareMathSymbol{\nsubseteq}      {\mathrel}{mathdesignB}{"2A}
    \DeclareMathSymbol{\nsupseteq}      {\mathrel}{mathdesignB}{"2B}
    \DeclareMathSymbol{\nparallel}      {\mathrel}{mathdesignB}{"2C}
    \DeclareMathSymbol{\nmid}           {\mathrel}{mathdesignB}{"2D}
    \DeclareMathSymbol{\nshortmid}      {\mathrel}{mathdesignB}{"2E}
    \DeclareMathSymbol{\nshortparallel} {\mathrel}{mathdesignB}{"2F}
    \DeclareMathSymbol{\nvdash}         {\mathrel}{mathdesignB}{"30}
    \DeclareMathSymbol{\nVdash}         {\mathrel}{mathdesignB}{"31}
    \DeclareMathSymbol{\nvDash}         {\mathrel}{mathdesignB}{"32}
    \DeclareMathSymbol{\nVDash}         {\mathrel}{mathdesignB}{"33}
    \DeclareMathSymbol{\ntrianglerighteq}{\mathrel}{mathdesignB}{"34}
    \DeclareMathSymbol{\ntrianglelefteq}{\mathrel}{mathdesignB}{"35}
    \DeclareMathSymbol{\ntriangleleft}  {\mathrel}{mathdesignB}{"36}
    \DeclareMathSymbol{\ntriangleright} {\mathrel}{mathdesignB}{"37}
    \DeclareMathSymbol{\nleftarrow}     {\mathrel}{mathdesignB}{"38}
    \DeclareMathSymbol{\nrightarrow}    {\mathrel}{mathdesignB}{"39}
    \DeclareMathSymbol{\nLeftarrow}     {\mathrel}{mathdesignB}{"3A}
    \DeclareMathSymbol{\nRightarrow}    {\mathrel}{mathdesignB}{"3B}
    \DeclareMathSymbol{\nLeftrightarrow}{\mathrel}{mathdesignB}{"3C}
    \DeclareMathSymbol{\nleftrightarrow}{\mathrel}{mathdesignB}{"3D}
%% end of fix

\begin{document}
$a \nmid b$

$a \mid b$

\end{document}

在此处输入图片描述

原始答案

您不应该加载amssymb,因为符号已经由提供了arev

但也有少数例外。以下是字体表mdbchbma

在此处输入图片描述

应该提供\nmid由设置的符号

\DeclareMathSymbol{\nmid}{\mathrel}{mathdesignA}{"2D}

但是,正如您在字体表中看到的,该位置没有字形,而且,您的示例的日志文件确实有

Missing character: There is no - in font mdbchbma!

(连字符有 ASCII 码"2D)。

你可以得到一个不错的替代品\nmid

\documentclass{article}
\usepackage{amsmath}
\usepackage{arev}

\DeclareMathSymbol{\highnot}{\mathrel}{mathdesignA}{"7D}
\renewcommand{\nmid}{%
  \mathrel{\mspace{-4mu}}%
  \highnot
  \mathrel{\mspace{4mu}}%
  \mid
}

\begin{document}

$a \nmid b$

$a \mid b$

\end{document}

在此处输入图片描述

更短更低:

\documentclass{article}
\usepackage{amsmath}
\usepackage{arev}

\DeclareMathSymbol{\highnotsymbol}{\mathrel}{mathdesignA}{"7D}
\renewcommand{\nmid}{%
  \mathrel{\mspace{-2.5mu}}%
  \mathrel{\mathpalette\highnot\relax}%
  \mathrel{\mspace{2.5mu}}%
  \mid
}
\newcommand{\highnot}[2]{%
  \ifx#1\displaystyle\scriptstyle\else
    \ifx#1\textstyle\scriptstyle\else
      \scriptscriptstyle
  \fi\fi
  \highnotsymbol
}

\begin{document}
$a \nmid b$

$a \mid b$

\end{document}

在此处输入图片描述

相关内容