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

  • Does the use of \usepackage[upint]{stix} not produce the vertical closed integrals? If so, that appears to be a bug, and should be reported. – barbara beeton Aug 15 at 16:44
  • @barbarabeeton It does work, but it changes all other fonts in my documents which I do not want. I just want the integrals to change. – Kumarm Aug 15 at 16:51
  • Okay. You want just the vertical integrals from stix. Then you might try the techniques shown in one of these questions: Importing a single symbol from a different font or How to get only one symbol from a symbol package?. – barbara beeton Aug 15 at 17:23
  • @barbarabeeton Thats what I have been reading and trying since two days but I could not get it to work. – Kumarm Aug 15 at 17:54
  • Have you tried \setmathfont[StylisticSet=8]{XITS Math}? – Mico Aug 15 at 19:48
3

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.

  • Yes that's what I was looking for. Thanks a ton. – Kumarm Aug 15 at 22:33
4

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.

  • @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 at 0:37
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}

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.