3

I tried a lot (2 days) and try to find a way to extend a answer

Using XITS with pdflatex

but I am unable to understand the method here. How do I extend above answer to include vertical closed integrals like '\oint'

I have been using straight vertical integral symbols so far and now I need closed integral. How do I do that

enter image description here

Kumarm
  • 942

3 Answers3

5

The Easy Way

As egreg wrote, the easy answer is to \usepackage[upint]{stix}. XITS is a fork of the STIX font.

\documentclass{article}
\usepackage[upint]{stix}

\begin{document}
\[ \int \oint \oiint \iint \iiint \]
\end{document}

STIX upint sample

The Complicated Way

If you want to add individual symbols the legacy way, you need to look up in the package documantation which slot of which font they are in. The symbol you are looking for is on page 39, in slot "E8 of font stix-mathcal. Then you open up the file stix.sty and reverse-engineer the necessary setup for that symbol font.

Since there are two versions of the symbol, a display-style one in slot "E8 and a smaller one at "B2, you in fact would want to select between them with \mathchoice.

\documentclass{article}

\DeclareFontEncoding{LS2}{}{\noaccents@}
\DeclareFontSubstitution{LS2}{stix}{m}{n}

\DeclareSymbolFont{integrals}{LS2}{stixcal}{m}{n}

\DeclareMathSymbol{\ointupbig}{\mathop}{integrals}{"E8}
\DeclareMathSymbol{\ointupsmall}{\mathop}{integrals}{"B2}

\DeclareRobustCommand{\ointup}{\mathchoice{\ointupbig}{\ointupsmall}{\ointupsmall}{\ointupsmall}}

\begin{document}
\( \displaystyle
   \oint_{\oint_{\oint}} \quad
   \ointup_{\ointup_{\ointup}} \)

\( \oint \quad
   \ointup \)
\end{document}

Sloped and upright <code>\oint</code> in the same document

I do not recommend this, as it depends on fiddly little implementation details of the stix package, runs into the limit on legacy math alphabets, and has other quirks.

But, I think that was what you were asking how to do?

The Modern Way

You can also do this with unicode-math, and I recommend that unless you are forced to submit to a site that does not yet support LuaLaTeX or XeLaTeX.

If you want to use XITS Math as your math font, you can load it with

\setmathfont[StylisticSet=8]{XITS Math}

If you want to use the XITS upright integrals together with another font, you can add the command

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

after you load your main \setmathfont. This also works with STIX Two Math. If you’re mixing different math fonts with different heights, you might want to add the Scale=MatchUppercase font option.

Davislor
  • 44,045
  • @Davisior Thanks for the answer. I can not use unicode-math as I am using pdflatex, or stix package it changes all the fonts. I found the way I was looking for. – Kumarm Aug 16 '19 at 00:37
2

Based on the linked answer you gave yourself, I suppose this is what you’re looking for.

\documentclass{article}
\usepackage{amsmath}

\DeclareFontEncoding{LS2}{}{\noaccents@}
\DeclareFontSubstitution{LS2}{stix}{m}{n}

\DeclareSymbolFont{integrals}{LS2}{stixcal}{m}{n}
\DeclareMathSymbol{\ointupop}{\mathop}{integrals}{"B2}

\makeatletter
\renewcommand*{\oint}{\DOTSI\ointupop\ilimits@}
\makeatother


\begin{document}
\[
  \oint
\]
\end{document}

You can find the definitions of the character code point (e.g., B2 for \oint) in tex/latex/stix/stix.sty in your LaTeX distribution.

0

wasysym.sty is one of the easiest way and the MWE (as you didn't provide any MWE, so I gave suggestion based on the standard template) is:

\documentclass{book}
\usepackage[integrals]{wasysym}
\begin{document}

\[
\int
\]

\end{document}
MadyYuvi
  • 13,693