6

I've been trying to make the integral symbol "upright", meaning I want it not to be slanted, as in Born's Principles of Optics 7th edition. I've tried the \varint of the wasysym package, but it appears not to be automatically resized.

Can someone help me with this? Thank you for your attention and patience.

Per @Mico's suggestion, here's the preamble of my document:

\documentclass{book} 
\usepackage[utf8]{inputenc} 
\usepackage{amssymb} 
\usepackage[T1]{fontenc} 
\usepackage{amsmath} 
\usepackage{fancyhdr} 
\usepackage{english}{} 
\usepackage{amsthm} 
\usepackage{xfrac} 
\usepackage{makeidx} 
\usepackage{physics} 
\usepackage{commath} 
\usepackage[toc,page]{appendix}
Mico
  • 506,678
  • Welcome to TeX.SE. Please advise whether you use pdfLaTeX, XeLaTeX, or LuaLaTeX. Please also confirm that you use either Computer Modern or Latin Modern as the text and math font family. – Mico Aug 09 '19 at 13:18
  • To be honest I'm really an amateur, so I just work with what I've found on the web. In case it can help, I'll list all the packages I'm currently using below. Anyhow, as editor I use TeXstudio, and I visualize everything as a pdf. – Operatore_Nabla Aug 09 '19 at 15:30
  • \documentclass{book} \usepackage[utf8]{inputenc} \usepackage{amssymb} \usepackage[T1]{fontenc} \usepackage{amsmath} \usepackage{fancyhdr} \usepackage{english}{} \usepackage{amsthm} \usepackage{xfrac} \usepackage{makeidx} \usepackage{physics} \usepackage{commath} \usepackage[toc,page]{appendix} – Operatore_Nabla Aug 09 '19 at 15:31
  • 1
    Off-topic: Instead of \usepackage{english}, do please use \usepackage[english]{babel}. – Mico Aug 09 '19 at 16:04
  • For example I use the excellent code of @egreg's answer here: https://tex.stackexchange.com/questions/88281/how-to-change-font-for-the-integral-symbol/88288 – Sebastiano Aug 09 '19 at 20:40
  • Mico thanks for your suggestion! Sebastiano That's just great. The code appears to work just as I had in mind. – Operatore_Nabla Aug 10 '19 at 09:04
  • see https://tex.stackexchange.com/questions/170028/integral-sign-int – Steven B. Segletes Apr 16 '20 at 23:02

4 Answers4

8

If you can use the modern toolchain with unicode-math, then either the command

\setmathfont[StylisticSet=8]{XITS Math}

or

\setmathfont[StylisticSet=8]{STIX Two Math}

will load a font variant with upright integrals. You could instead load only the upright integrals over another math font with

\setmathfont[range={"222B-"2233,"2A0B-"2A1C},StylisticSet=8]{STIX Two Math}

Several other Unicode math fonts use upright integrals by default, such as TeX Gyre Pagella Math. You can see font samples here.

If you’re mixing and matching fonts, it’s a good idea to add an option such as Scale=MatchUppercase.

If you must use legacy font packages, many of them support an upright-integral option, including \usepackage[upint]{stix}, \usepackage[upint]{newpxmath}, stix2, newtxmath, and so on. Check the documentation. Others have upright integrals by default.

Davislor
  • 44,045
6

If you load the wasysym package with the option integrals, all integral symbols will automatically be rendered in an upright style. Do note, though, that the size difference between text-style and display-style integrals won't be as pronounced as is the case when the default, i.e., Computer Modern-based, integral symbols are employed.

enter image description here

\documentclass{book} 
\usepackage[utf8]{inputenc} 
\usepackage[T1]{fontenc} 
\usepackage{amssymb,amsmath,amsthm} 
\usepackage{fancyhdr} 
\usepackage[english]{babel} 
\usepackage{xfrac} 
\usepackage{makeidx} 
\usepackage{physics} 
\usepackage{commath} 
\usepackage[toc,page]{appendix}

\usepackage[integrals]{wasysym} % <-- new

\begin{document}
$\int\iint\iiint\oint \quad \displaystyle\int\iint\iiint\oint$
\end{document}
Mico
  • 506,678
5

A very short example of upintegrals using kpfonts package. Here there is a screenshot.

enter image description here

\documentclass[12pt]{article}
\usepackage[T1]{fontenc}
\usepackage{kpfonts}
\begin{document}
$\int f(x)dx,\quad \iint_D f(x,y)dxdy$
\[\int f(x)dx,\quad \iint_D f(x,y)dxdy\]
\[\oint \quad \oiint\]
\end{document}
Sebastiano
  • 54,118
4

You can use cmupint package; it also contains a quite number of upright integral symbols:

\documentclass{article}
\usepackage{cmupint}
\newcommand{\ud}{\,\mathrm{d}}
\begin{document}
$ \int x\ud x \oiint_D y\ud y \sumint z\ud z \npolint a\ud a $
$$ \int x\ud x \oiint_D y\ud y \sumint_0^1 z\ud z \npolint a\ud a $$
\end{document}

cmupint example

Урош
  • 313
  • 1
    This is by far the best method out of all proposed here. It does exactly what is required and nothing else. No package conflicts, no broken layouts, etc. – ScumCoder May 07 '23 at 22:30