## LaTeX forum ⇒ Text Formatting ⇒ renewenvironment inside a custom class not working

Information and discussion about LaTeX's general text formatting features (e.g. bold, italic, enumerations, ...)
mjandrews
Posts: 3
Joined: Sun May 02, 2010 5:26 pm

### renewenvironment inside a custom class not working

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

localghost
Site Moderator
Posts: 9206
Joined: Fri Feb 02, 2007 12:06 pm
Location: Braunschweig, Germany
This should work.
\renewenvironment{equation}{$}{$}

Best regards and welcome to the board
Thorsten
LaTeX Community Moderator

¹ System: openSUSE 42.2 (Linux 4.4.52), TeX Live 2016 (vanilla), TeXworks 0.6.1

mjandrews
Posts: 3
Joined: Sun May 02, 2010 5:26 pm
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

localghost
Site Moderator
Posts: 9206
Joined: Fri Feb 02, 2007 12:06 pm
Location: Braunschweig, Germany
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.
LaTeX Community Moderator

¹ System: openSUSE 42.2 (Linux 4.4.52), TeX Live 2016 (vanilla), TeXworks 0.6.1

mjandrews
Posts: 3
Joined: Sun May 02, 2010 5:26 pm
interesting ... thanks for your help though.
I'll keep looking.
-m