LaTeX forum ⇒ Text Formattingrenewenvironment 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

Postby mjandrews » Sun May 02, 2010 5:38 pm

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

Link:
BBcode:
HTML:
Hide post links
Show post links

User avatar
localghost
Site Moderator
Posts: 9206
Joined: Fri Feb 02, 2007 12:06 pm
Location: Braunschweig, Germany

Postby localghost » Sun May 02, 2010 7:19 pm

This should work.
  1. \renewenvironment{equation}{\[}{\]}



Best regards and welcome to the board
Thorsten
LaTeX Community Moderator
How to make a "Minimal Example"
Board Rules
Avoidable Mistakes


¹ System: openSUSE 13.1 (Linux 3.11.10), TeX Live 2013 (vanilla), TeXworks 0.5 (r1351)
² Posting stopped indefinitely due to offenses

Link:
BBcode:
HTML:
Hide post links
Show post links

mjandrews
Posts: 3
Joined: Sun May 02, 2010 5:26 pm

Postby mjandrews » Mon May 03, 2010 2:05 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

Link:
BBcode:
HTML:
Hide post links
Show post links

User avatar
localghost
Site Moderator
Posts: 9206
Joined: Fri Feb 02, 2007 12:06 pm
Location: Braunschweig, Germany

Postby localghost » Mon May 03, 2010 7:12 pm

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
How to make a "Minimal Example"
Board Rules
Avoidable Mistakes


¹ System: openSUSE 13.1 (Linux 3.11.10), TeX Live 2013 (vanilla), TeXworks 0.5 (r1351)
² Posting stopped indefinitely due to offenses

Link:
BBcode:
HTML:
Hide post links
Show post links

mjandrews
Posts: 3
Joined: Sun May 02, 2010 5:26 pm

Postby mjandrews » Tue May 04, 2010 3:26 am

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

Link:
BBcode:
HTML:
Hide post links
Show post links


Return to “Text Formatting”

Who is online

Users browsing this forum: No registered users and 1 guest