我正在寻找如何改变积分符号。
例如:
\documentclass{article}
\begin{document}
\[\int_a^b f(x) \mathrm{d} dx\]
\end{document}
我只想更改字体\int
以获得\rm\int
相似效果\mathrm{d}
,或者我可以\rmint
使用其他包定义新的字体arev
吗?
\documentclass{article}
%define a new command for \rm font of int
\begin{document}
\[\rmint_a^b \]
\end{document}
获得风格\int
是
我已经得到\rmoint
并且\rmint
\DeclareMathSymbol{\rmintop}{\mathop}{rmlargesymbols}{82}
\DeclareMathSymbol{\rmointop}{\mathop}{rmlargesymbols}{72}
但我无法得到所有的积分,如下所示:
答案1
除了默认的 之外,还可以从新字体系列中定义新的数学字体cmex
,例如mdbch
和euex
。请参阅arevmath.sty
。
\documentclass{article}
%define a new command for \rm font of int
\DeclareSymbolFont{rmlargesymbols}{OMX}{mdbch}{m}{n}
% or \DeclareSymbolFont{rmlargesymbols}{U}{euex}{m}{n}
\DeclareMathSymbol{\rmintop}{\mathop}{rmlargesymbols}{82}
\newcommand{\rmint}{\rmintop\nolimits}
\begin{document}
$\rmint_a^b$
\[\rmint_a^b \]
\end{document}
答案2
这是使用字体并经过适当缩放的“完整”“直立积分”选集。和mathdesign
之间的部分已摘录并编辑。\makeatletter
\makeatother
amsmath.sty
\documentclass{article}
\usepackage{amsmath}
\makeatletter
\def\upintkern@{\mkern-7mu\mathchoice{\mkern-3.5mu}{}{}{}}
\def\upintdots@{\mathchoice{\mkern-4mu\@cdots\mkern-4mu}%
{{\cdotp}\mkern1.5mu{\cdotp}\mkern1.5mu{\cdotp}}%
{{\cdotp}\mkern1mu{\cdotp}\mkern1mu{\cdotp}}%
{{\cdotp}\mkern1mu{\cdotp}\mkern1mu{\cdotp}}}
\newcommand{\upiint}{\DOTSI\protect\UpMultiIntegral{2}}
\newcommand{\upiiint}{\DOTSI\protect\UpMultiIntegral{3}}
\newcommand{\upiiiint}{\DOTSI\protect\UpMultiIntegral{4}}
\newcommand{\upidotsint}{\DOTSI\protect\UpMultiIntegral{0}}
\newcommand{\UpMultiIntegral}[1]{%
\edef\ints@c{\noexpand\upintop
\ifnum#1=\z@\noexpand\upintdots@\else\noexpand\upintkern@\fi
\ifnum#1>\tw@\noexpand\upintop\noexpand\upintkern@\fi
\ifnum#1>\thr@@\noexpand\upintop\noexpand\upintkern@\fi
\noexpand\upintop
\noexpand\ilimits@
}%
\futurelet\@let@token\ints@a
}
\makeatother
\DeclareFontFamily{OMX}{mdbch}{}
\DeclareFontShape{OMX}{mdbch}{m}{n}{ <->s * [0.8] mdbchr7v }{}
\DeclareFontShape{OMX}{mdbch}{b}{n}{ <->s * [0.8] mdbchb7v }{}
\DeclareFontShape{OMX}{mdbch}{bx}{n}{<->ssub * mdbch/b/n}{}
\DeclareSymbolFont{uplargesymbols}{OMX}{mdbch}{m}{n}
\SetSymbolFont{uplargesymbols}{bold}{OMX}{mdbch}{b}{n}
\DeclareMathSymbol{\upintop}{\mathop}{uplargesymbols}{82}
\DeclareMathSymbol{\upointop}{\mathop}{uplargesymbols}{"48}
\DeclareFontEncoding{MDB}{}{}
\DeclareFontFamily{MDB}{mdbch}{}
\DeclareFontShape{MDB}{mdbch}{m}{n}{ <->s * [0.8] mdbchrmb }{}
\DeclareFontShape{MDB}{mdbch}{b}{n}{ <->s * [0.8] mdbchbmb }{}
\DeclareFontShape{MDB}{mdbch}{bx}{n}{<->ssub * mdbch/b/n}{}
\DeclareFontSubstitution{MDB}{cmr}{m}{n}
\DeclareSymbolFont{mathdesignB}{MDB}{mdbch}{m}{n}%
\SetSymbolFont{mathdesignB}{bold}{MDB}{mdbch}{b}{n}%
\DeclareMathSymbol{\upintclockwise}{\mathop}{mathdesignB}{128}
\DeclareMathSymbol{\upointclockwise}{\mathop}{mathdesignB}{130}
\DeclareMathSymbol{\upointctrclockwise}{\mathop}{mathdesignB}{132}
\DeclareMathSymbol{\upoiint}{\mathop}{mathdesignB}{134}
\DeclareMathSymbol{\upoiiint}{\mathop}{mathdesignB}{136}
\makeatletter
\newcommand{\upint}{\DOTSI\upintop\ilimits@}
\newcommand{\upoint}{\DOTSI\upointop\ilimits@}
\makeatother
\begin{document}
$\upint_a^b\quad\int_a^b$ (for size comparison)
$\displaystyle\upint_a^b\quad\int_a^b$ (for size comparison)
$\displaystyle\upint\quad\upiint\quad\upiiint\quad\upidotsint$
$\displaystyle\upointclockwise\quad\upointctrclockwise\quad\upoint\quad\upoiint\quad\upoiiint$
\end{document}