# How to write “upright” integrals with automatic sizing

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}

• 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 9 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 9 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 9 at 15:31
• Off-topic: Instead of \usepackage{english}, do please use \usepackage[english]{babel}. – Mico Aug 9 at 16:04
• For example I use the excellent code of @egreg's answer here: tex.stackexchange.com/questions/88281/… – Sebastiano Aug 9 at 20:40

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.

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.

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


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

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

• +1 kpfonts is a package created by a Frenchman: Christophe Caignaert :-) – AndréC Aug 9 at 20:58