Text Formatting ⇒ modifying a .sty file
modifying a .sty file
MnSymbol.sty allows me to make integrals with fancy symbols inside,
such as \sumint (which is an integral sign with a Sigma embedded in its center)
I want to add some new custom integrals to this package. For example, I would like to have an integral with a Z in its center instead of a Sigma.
I looked at the MnSymbol.sty file in a text editor, but I couldn't figure out how it worked.
What I was thinking of doing was adding the line:
\Decl@Mn@Int\Zint
After the line
\Decl@Mn@Int\sumint\dsumint\tsumint
and then the line:
\Decl@Mn@OpD
after the line:
\Decl@Mn@Op\sum\dsum\tsum
Since those are the only two lines that contain the string '\sum' so I'm assuming those are the only two lines necessary in order to make the integral symbol with the Sigma inside it, and therefore probably the only two lines that need to be added in order for my custom symbol to work.
But I'm not sure if this is the way it works and I don't want to risk having to reinstall MikTex again if I screw it up.
NEW: TikZ book now 40% off at Amazon.com for a short time.
And: Currently, Packt sells ebooks for $4.99 each if you buy 5 of their over 1000 ebooks. If you choose only a single one, $9.99. How about combining 3 LaTeX books with Python, gnuplot, mathplotlib, Matlab, ChatGPT or other AI books? Epub and PDF. Bundle (3 books, add more for higher discount): https://packt.link/MDH5p
Re: modifying a .sty file
MnSymbolNew.sty
which is in a new folder called MikTeX2.8/tex/latex/MnSymbolNew
But my MikTeX package manager doesn't have MnSymbolNew as a package that can be installed. It just doesn't show up on the list.
How do I get MikTeX to recognize that I've added this package ?
- localghost
- Site Moderator
- Posts: 9202
- Joined: Fri Feb 02, 2007 12:06 pm
modifying a .sty file
Since it is not recommendable to modify a package file you should create your own integral signs by defining a new command. See code below.
Code: Select all
\documentclass[11pt]{article}
\makeatletter
\newcommand{\charint}[1]{\int\kern-1\@ptsize pt #1}
\makeatother
\begin{document}
\[
\charint{Z} \charint{A}
\]
\end{document}
Best regards
Thorsten
Board Rules
Avoidable Mistakes
¹ System: TeX Live 2025 (vanilla), TeXworks 0.6.10
Re: modifying a .sty file
That's really neat. Now is there a way to make the Z bigger with respect to the rest of the integral ??
I tried \charint{\scriptsize{Z}} and \charint{\LARGE{Z}} and they were the exact same
- localghost
- Site Moderator
- Posts: 9202
- Joined: Fri Feb 02, 2007 12:06 pm
modifying a .sty file
Code: Select all
\documentclass[11pt]{article}
\usepackage{amsmath}
\makeatletter
\newcommand{\charint}[2][\normalsize]{\int\kern-1\@ptsize pt \text{#1#2}}
\makeatother
\begin{document}
\[
\charint[\Large]{Z} \charint{A}
\]
\end{document}
Board Rules
Avoidable Mistakes
¹ System: TeX Live 2025 (vanilla), TeXworks 0.6.10
modifying a .sty file
That actually works quite well!
The last symbol looks just the way I like:
Code: Select all
\documentclass[11pt]{article}
\usepackage{amsmath}
\makeatletter
\newcommand{\charint}[2][\normalsize]{\int\kern-1\@ptsize pt \text{#1#2}}
\makeatother
\begin{document}
\[
\charint{n} \charint[\LARGE]{n} \charint[\LARGE]{\em{n}} \charint[\LARGE]{\hspace{-2.4mm} \em{n}}
\]
\end{document}
But unfortunately none of this works with when documentclass is revtex4

Do you think there's any way to trick revtex4 into letting me use this ??
modifying a .sty file
Even though it's not a perfect solution, perhaps the following could be useful. The \nint command defined below uses the \mathchoice TeX primitive to produce the appropriate symbol (an integral symbol crossed by an "n") according to the fourth basic math styles. Of course, some adjustments will be necessary if the font size for the document is not 11pt. Feel free to adapt my example according to your needs.juliette wrote: ...Do you think there's any way to trick revtex4 into letting me use this ?
Code: Select all
\documentclass[11pt]{revtex4}
\usepackage{amsmath}
\newcommand\nint{\int\mathchoice%
{\mkern-20mu\fontsize{16}{19}\selectfont\textit{n}}
{\mkern-15mu\raisebox{1.2pt}{\fontsize{11}{13}\selectfont\textit{n}}}
{\mkern-14.5mu\raisebox{.8pt}{\fontsize{8}{10}\selectfont\textit{n}}}
{\mkern-14mu\raisebox{.5pt}{\fontsize{6}{7}\selectfont\textit{n}}}}
\begin{document}
\[ \nint \]
$\nint$
$_{\nint}$
$_{_{\nint}}$
\end{document}