Ungetestet und ohne Gewähr:
Code:
%%
%% This is file `atbegenv.sty'.
%%
%% Copyright (C) 2007-2008 Axel Sommerfeldt (caption@sommerfee.de)
%%
%% --------------------------------------------------------------------------
%%
%% This work may be distributed and/or modified under the
%% conditions of the LaTeX Project Public License, either version 1.3
%% of this license or (at your option) any later version.
%% The latest version of this license is in
%% http://www.latex-project.org/lppl.txt
%% and version 1.3 or later is part of all distributions of LaTeX
%% version 2003/12/01 or later.
%%
%% This work has the LPPL maintenance status "maintained".
%%
%% This Current Maintainer of this work is Axel Sommerfeldt.
%%
%% This work consists of the files caption.ins, caption.dtx, caption2.dtx,
%% ltcaption.dtx, and subcaption.dtx, the derived files caption.sty,
%% caption2.sty, caption3.sty, ltcaption.sty, and subcaption.sty, and the
%% user manuals caption-deu.tex, caption-eng.tex, and caption-rus.tex.
%%
\NeedsTeXFormat{LaTeX2e}[1994/12/01]
\ProvidesPackage{atbegenv}[2008/05/10 v0.1 AtBegin+EndEnvironment (AR)]
%
\providecommand*\AtBeginEnvironment[1]{%
\At@Environment{#1}{#1}\@AtBeginEnvironment}
\@onlypreamble\AtBeginEnvironment
\providecommand*\@AtBeginEnvironment[2]{#1#2}
%
\providecommand*\AtEndEnvironment[1]{%
\At@Environment{#1}{end#1}\@AtEndEnvironment}
\@onlypreamble\AtEndEnvironment
\providecommand*\@AtEndEnvironment[2]{#2#1}
%
\providecommand*\At@Environment[3]{%
\@ifundefined{#1}%
{\@latex@error{Environment #1 undefined}\@ehc
\@gobble}%
{\@ifundefined{ABE@env@#2}%
{\expandafter\let\csname ABE@env@#2\expandafter\endcsname
\csname #2\endcsname
\expandafter\let\csname ABE@hook@#2\endcsname\@empty
\@namedef{#2}{#3{\@nameuse{ABE@hook@#2}}{\@nameuse{ABE@env@#2}}}}%
{}%
\expandafter\g@addto@macro\csname ABE@hook@#2\endcsname}}
\@onlypreamble\At@Environment
%
\endinput
Gruß,
Axel
Lesezeichen