3

For every (most?) environment \begin{X}...\end{X} there exists the macros \X and \endX that can be used inside the \newenvironment command. I.e, one can write something like this

\newenvironment{Y}{\somemacro\X}{\endX}

How can I achieve a similar result if X has a starred version and I want to patch X*. N.b. it is not necessary that Y has a starred version.

More specifically at the moment I have this

\makeatletter
\newenvironment{smallequation}{\def\f@size{8}\check@mathfonts\equation}{\endequation}
\newenvironment{footnoteequation}{\def\f@size{7}\check@mathfonts\equation}{\endequation}
\newenvironment{scriptsizeequation}{\def\f@size{6}\check@mathfonts\equation}{\endequation}
\newenvironment{tinyequation}{\def\f@size{5}\check@mathfonts\equation}{\endequation}
\makeatother

This is the result of the answer to this question. However, now I want to do the same but for the equation*-environment.

nagmat84
  • 1,115
  • You can highlight code in your post using back-ticks. To highlight code-blocks, either indent them by four spaces or use the {} on the gui. –  May 19 '17 at 08:12
  • You can use \newenvironment{Y}{\somemacro\begin{X*}}{\end{X*}}. You might also want to look at section 3.4 of the etoolbox package. –  May 19 '17 at 08:19

1 Answers1

2

You can use

\csname equation*\endcsname
\csname endequation*\endcsname

For instance

\newenvironment{smallequation*}
  {\def\f@size{8}\check@mathfonts\csname equation*\endcsname}
  {\csname endequation*\endcsname}
egreg
  • 1,121,712