11

I'm looking how to change the integral symbol.

For example:

\documentclass{article}
\begin{document}
\[\int_a^b f(x) \mathrm{d} dx\]
\end{document}

I want to only change the font of \int to get a \rm\int like \mathrm{d} or can I define a new \rmint using other package, for example arev?

\documentclass{article}
 %define a new command for \rm font of int

\begin{document}
\[\rmint_a^b \]
\end{document}

to get the style of \int is

enter image description here


I have get \rmoint and \rmint by

\DeclareMathSymbol{\rmintop}{\mathop}{rmlargesymbols}{82}
\DeclareMathSymbol{\rmointop}{\mathop}{rmlargesymbols}{72}

but I can not get all of integrals as follows:

enter image description here

1
11

Define a new math font from a new font family besides the default cmex, for instance, mdbch and euex. Refer to 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
  • 1
    If you use \DeclareMathSymbol{\intop}..., then \int will give the new symbol without any other intervention. With amsmath one may get wrong spacing with multiple integrals and so may need to modify \intkern@ and \intdots@.
    – egreg
    Dec 27 '12 at 11:46
  • I'm trying to get this method to work with a different font, pxfonts. The reason for this is that I need both \int and \boldsymbol{\int} (which is not provided in the default). I don't need multiple integrals. I can't understand what "82" is (I cannot even find the symbol \int in mdbch.sty...). Can anyone help me with this? Thank you. May 3 at 14:28
11

Here's a "complete" selection of "upright integrals" using the mathdesign fonts, suitably scaled. The part between \makeatletter and \makeatother has been taken from amsmath.sty and edited.

\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}

enter image description here

10
  • @Manuel Sorry, I introduced a bug with my last edit. Fix in a minute.
    – egreg
    Dec 27 '12 at 16:58
  • A new small problem, all the limits work well except in \upiint, \upiiint and (may be) \upidotsint. Try with this code: \upiint_a^b\quad\upiiint_a^b\quad\upidotsint_a^b (if you use \limits the b is not correctly positioned, and if you use \nolimits the a is not correctly positioned. Could you solve this?
    – Manuel
    Dec 27 '12 at 17:23
  • Thank you! Can we get it by changing the font of esint package? I have no idea until now.
    – TeX.pig
    Dec 28 '12 at 1:31
  • @Manuel When using \limits after multiple integrals only the lower limit makes sense and the code in amsmath is providing a centered lower limits; in my experiment the behavior with \nolimits seems correct.
    – egreg
    Dec 28 '12 at 10:48
  • @TeX.pig esint uses its own font, that consists only of integral symbols.
    – egreg
    Dec 28 '12 at 10:50

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.