Text Formattingrenewenvironment inside a custom class not working

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

renewenvironment inside a custom class not working

Post by mjandrews »

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

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

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

localghost
Site Moderator
Posts: 9202
Joined: Fri Feb 02, 2007 12:06 pm

renewenvironment inside a custom class not working

Post by localghost »

This should work.

Code: Select all

\renewenvironment{equation}{\[}{\]}

Best regards and welcome to the board
Thorsten
mjandrews
Posts: 3
Joined: Sun May 02, 2010 5:26 pm

Re: renewenvironment inside a custom class not working

Post by mjandrews »

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
User avatar
localghost
Site Moderator
Posts: 9202
Joined: Fri Feb 02, 2007 12:06 pm

Re: renewenvironment inside a custom class not working

Post by localghost »

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

Re: renewenvironment inside a custom class not working

Post by mjandrews »

interesting ... thanks for your help though.
I'll keep looking.
-m
Post Reply