(模式 1)复制不正确

(模式 1)复制不正确

请考虑以下 MWE:

\documentclass{article}
\usepackage[spanish]{babel}
\selectlanguage{spanish}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}

\begin{document}
Works: áéà

Does not work: \(\pmod1\)
\end{document}

文本áéà复制正确,但如果我尝试复制(mód 1)它说:(m´od 1)

有人知道为什么会发生这种情况吗? 如何解决?

谢谢!

答案1

babel模块spanish.ldf重新定义了\pmod要执行的操作m\es@op@ac od,并且\es@op@ac本质上是(为了使用无点 i\acute进行了修正)。i

以一个新的数学组为代价,你可以做

\documentclass{article}
\usepackage[T1]{fontenc}
\usepackage[spanish]{babel}

\usepackage{amsmath}

\makeatletter
\protected\def\es@op@ac#1{\csname math#1acute\endcsname}
\AtBeginDocument
 {%
  \DeclareSymbolFont{toneoperators}{T1}{\familydefault}{m}{n}%
  \SetSymbolFont{toneoperators}{bold}{T1}{\familydefault}{bx}{n}%
  \DeclareMathSymbol{\mathAacute}{\mathord}{toneoperators}{193}%
  \DeclareMathSymbol{\mathEacute}{\mathord}{toneoperators}{201}%
  \DeclareMathSymbol{\mathIacute}{\mathord}{toneoperators}{205}%
  \DeclareMathSymbol{\mathOacute}{\mathord}{toneoperators}{211}%
  \DeclareMathSymbol{\mathUacute}{\mathord}{toneoperators}{218}%
  \DeclareMathSymbol{\mathaacute}{\mathord}{toneoperators}{225}%
  \DeclareMathSymbol{\matheacute}{\mathord}{toneoperators}{233}%
  \DeclareMathSymbol{\mathiacute}{\mathord}{toneoperators}{237}%
  \DeclareMathSymbol{\mathoacute}{\mathord}{toneoperators}{243}%
  \DeclareMathSymbol{\mathuacute}{\mathord}{toneoperators}{250}%
 }%
\def\operator@font{\mathgroup\symtoneoperators}%
\makeatother

\begin{document}

mód lím máx

$\mod\quad\lim\quad\max$

\end{document}

在此处输入图片描述

相关内容