latex-packages/packages/wip/gag.pysty

17 lines
959 B
Plaintext
Raw Normal View History

2021-10-06 20:16:07 +02:00
__HEADER__(Numbering of environments with a fractional environment number)
% For the stack exchange source, see
% https://tex.stackexchange.com/questions/598076/how-to-have-a-fractional-environment-number/598080?noredirect=1#comment1499689_598080
% However, for a reason i don't understand the posted answer does not work for me, but i had to replace theorem with definition in the definition of the gag environment (so apparently, i have to do this for each environment separately). It seems that the definitions of this document do use \thedefinition and not \thetheorem, although by default this is not the case.
\newcounter{gag}
\makeatletter
\newenvironment{gag}[1]{%
\let\savedthedefinition\thedefinition
\thm@headfont{\bfseries\boldmath}%
\stepcounter{gag}%
\renewcommand{\thedefinition}{\savedthedefinition#1}%
\renewcommand{\theHdefinition}{gag\thegag}%
\addtocounter{definition}{-1}\ignorespaces
}{\ignorespacesafterend}
\makeatother