Hi (I'm new to the forum, but not new to latex),
I am trying to make a custom class. One issue I just ran into was how the renewenvironment command, which works fine inside the .tex document itself, does not work at all when it is inside the .cls document.
Here is the command (it makes all equations unnumbered by default)
\renewenvironment{equation}{\begin{equation*}}{\end{equation*}}
Like I said, inside the preamble of the source tex file, it does its job. But I want it in a class file called foobar.cls. However, whenever I put it in foobar.cls, and do use \documentclass{foobar}, that command just gets ignored. Everything else in foobar.cls is behaving well.
Any suggestions?
Thanks for any help and insight.
-m
Text Formatting ⇒ renewenvironment inside a custom class not working
NEW: TikZ book now 40% off at Amazon.com for a short time.

- localghost
- Site Moderator
- Posts: 9202
- Joined: Fri Feb 02, 2007 12:06 pm
renewenvironment inside a custom class not working
This should work.
Best regards and welcome to the board
Thorsten
Code: Select all
\renewenvironment{equation}{\[}{\]}
Best regards and welcome to the board
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: renewenvironment inside a custom class not working
Thorsten, Thanks for your very swift reply. Unfortunately, that solution runs into the same problem: Its works fine inside in tex source file, but not the cls file. That's what's perplexing me. Why would a command work inside in the tex file, but make no difference, being essentially ignored it seems, when inside a cls file?
thanks again,
mark
thanks again,
mark
- localghost
- Site Moderator
- Posts: 9202
- Joined: Fri Feb 02, 2007 12:06 pm
Re: renewenvironment inside a custom class not working
Hm. I thought my idea would work because these commands are defined in the LaTeX kernel (file »latex.ltx«). At the moment I'm out of advice. Perhaps somebody else can help.
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: renewenvironment inside a custom class not working
interesting ... thanks for your help though.
I'll keep looking.
-m
I'll keep looking.
-m