数学模式下的边界连字符

数学模式下的边界连字符

我知道电子书说:“在数学模式下边界连字符会自动禁用”。但我想知道是否可以绕过这种行为。

我正在创造一个环境来复制我(年轻)学生的作品。为此,我使用递归式包。但问题是,在数学模式下,字母会部分显示,因为边界连线字体设计师在他的 METAFONT 字体文件中使用的字体。

正如您在下面的 ECM 中看到的,TeX 在文本和数学模式下都能完美地呈现字母之间的连字,但是边界连线仅在文本模式下。奇怪的是,字母的右边界连字符显示正确A就在右括号之前……

如果您能帮助我,我提前谢谢您。

非常好。

(抱歉我说的是英语,里面是法语)

发动机控制模块

\documentclass{article}

\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{frcursive}

\DeclareMathVersion{cursiveMath}

% Initialize cursive fonts with default ones
\DeclareSymbolFont{cursiveOperators}{OT1}{cmr}{m}{n}
\DeclareSymbolFont{cursiveLetters}{OML}{cmm}{m}{it}

% Modification of cursive fonts for the "cursiveMath" version
\SetSymbolFont{cursiveOperators}{cursiveMath}{T1}{frc}{m}{n}
\SetSymbolFont{cursiveLetters}{cursiveMath}{T1}{frc}{m}{n}

% Some new symbols
\DeclareMathSymbol{a}{\mathalpha}{cursiveLetters}{`a}
\DeclareMathSymbol{b}{\mathalpha}{cursiveLetters}{`b}
\DeclareMathSymbol{m}{\mathalpha}{cursiveLetters}{`m}
\DeclareMathSymbol{r}{\mathalpha}{cursiveLetters}{`r}
\DeclareMathSymbol{s}{\mathalpha}{cursiveLetters}{`s}

\DeclareMathSymbol{2}{\mathalpha}{cursiveOperators}{`2}
\DeclareMathSymbol{,}{\mathpunct}{cursiveOperators}{`,}

\DeclareMathSymbol{(}{\mathopen}{cursiveLetters}{`(}
\DeclareMathSymbol{)}{\mathclose}{cursiveLetters}{`)}


\begin{document}

\cursive
\mathversion{cursiveMath}
\begin{center}
    Test with {\slshape frcursive}
\end{center}

\bigskip
\underline{Text mode:}

\smallskip
\qquad a, b, m, r, s


\vspace{20pt}
\underline{Math mode:}

\medskip
\qquad $ab^2 + ba^2 = ab (b + a)$

\smallskip
\qquad $mr^2 + sm^2 = rs^2$

\end{document}

答案1

由于这可能只适用于相对简单的数学运算,因此您可以保留文本模式但伪造数学运算。实际上,您可能希望将这些定义限制在定义的环境中,例如,fontdimen 设置意味着忽略空格。

在此处输入图片描述

\documentclass{article}

\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{frcursive}

\DeclareMathVersion{cursiveMath}

% Initialize cursive fonts with default ones
\DeclareSymbolFont{cursiveOperators}{OT1}{cmr}{m}{n}
\DeclareSymbolFont{cursiveLetters}{OML}{cmm}{m}{it}

% Modification of cursive fonts for the "cursiveMath" version
\SetSymbolFont{cursiveOperators}{cursiveMath}{T1}{frc}{m}{n}
\SetSymbolFont{cursiveLetters}{cursiveMath}{T1}{frc}{m}{n}

% Some new symbols
\DeclareMathSymbol{a}{\mathalpha}{cursiveLetters}{`a}
\DeclareMathSymbol{b}{\mathalpha}{cursiveLetters}{`b}
\DeclareMathSymbol{m}{\mathalpha}{cursiveLetters}{`m}
\DeclareMathSymbol{r}{\mathalpha}{cursiveLetters}{`r}
\DeclareMathSymbol{s}{\mathalpha}{cursiveLetters}{`s}

\DeclareMathSymbol{2}{\mathalpha}{cursiveOperators}{`2}
\DeclareMathSymbol{,}{\mathpunct}{cursiveOperators}{`,}

\DeclareMathSymbol{(}{\mathopen}{cursiveLetters}{`(}
\DeclareMathSymbol{)}{\mathclose}{cursiveLetters}{`)}


\begin{document}

\cursive
\mathversion{cursiveMath}
\begin{center}
    Test with {\slshape frcursive}
\end{center}

\bigskip
\underline{Text mode:}

\smallskip
\qquad a, b, m, r, s


\vspace{20pt}
\underline{Math mode:}

\medskip
\qquad $ab^2 + ba^2 = ab (b + a)$

\smallskip
\qquad $mr^2 + sm^2 = rs^2$

\vspace{20pt}
\underline{New Not Math mode:}

\catcode`\^\active
\let^\textsuperscript

\catcode`\+\active
\edef+{${}\string+{}$}

\catcode`\=\active
\edef={${}\string={}$}

\fontdimen2\font0pt
\fontdimen3\font0pt
\fontdimen4\font0pt
\fontdimen7\font0pt

\medskip
\qquad ab^2 + ba^2 = ab (b + a)

\smallskip
\qquad mr^2 + sm^2 = rs^2

\end{document}

相关内容