Text Formatting ⇒ modifying a .sty file
modifying a .sty file
Hello,
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.
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.

Re: modifying a .sty file
Okay I made some changes and saved it as a new file called:
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 ?
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
Your modified package will never appear in the MiKTeX Package Manager (MPM) because it has no entry in the MiKTeX database. So the MPM won't recognize it as a package which belongs to the distribution.
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.
Best regards
Thorsten
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
How to make a "Minimal Example"
Board Rules
Avoidable Mistakes
¹ System: TeX Live 2025 (vanilla), TeXworks 0.6.10
Board Rules
Avoidable Mistakes
¹ System: TeX Live 2025 (vanilla), TeXworks 0.6.10
Re: modifying a .sty file
Thanks Thorsten!
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
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
A small modification lets the new command accept an optional argument. But now the characters are upright.
But I'm not sure if it still looks neat because the characters of different size have still the same baseline and don't remain centered horizontally. Perhaps somebody else can offer a more elegant solution.
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}
How to make a "Minimal Example"
Board Rules
Avoidable Mistakes
¹ System: TeX Live 2025 (vanilla), TeXworks 0.6.10
Board Rules
Avoidable Mistakes
¹ System: TeX Live 2025 (vanilla), TeXworks 0.6.10
modifying a .sty file
Thanks Thorsten,
That actually works quite well!
The last symbol looks just the way I like:
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 ??
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}
1,1,2,3,5,8,13,21,34,55,89,144,233,...