%% 
%% \iffalse ^^A we skip the debug setting
\IfFileExists{\string~/bin/gen_and_xela}{\errorcontextlines=1000 }{}
%% \fi
%% ^^A $Id: TheUltimateMaster.gmd,v 0.250 2010/10/24 14:42:35 natror Exp natror $
%% This is file “gmnotonlypream.sty” generated with the DocStrip utility.
%% 
%%
%% The original source files were:
%%
%% gmutils/gmutils.gmd  (with options: `notonlypream')
%%
%% 
%% Copyright ©  
%% by Grzegorz ‘Natror’ Murzynowski
%% natror (at) o2 (dot) pl
%% 
%% This program is subject to the LaTeX Project Public License.
%% See http://www.ctan.org/tex-archive/help/Catalogue/licenses.lppl.html
%% for the details of that license.
%%
%% LPPL status: "author-maintained".
%%
%% 
%% 
%% For the documentation please refer to the file(s)
%% gmutils.{gmd,pdf}.
%% 
%% 
\NeedsTeXFormat{LaTeX2e}
\ProvidesPackage{gmnotonlypream}
    [2010/10/24 v0.993 modification of the 'only preamble' clause (GM)]


%%
%%
%%     ^^A\typeout{\unexpanded{#4}}%%

\RequirePackage{gmampulex}


\newcommand\not@onlypreamble[1]{{%
  \def\do##1{\ifx#1##1\else\@nx\do\@nx##1\fi}%
  \xdef\@preamblecmds{\@preamblecmds}}}

\not@onlypreamble\@preamblecmds
\not@onlypreamble\@ifpackageloaded
\not@onlypreamble\@ifclassloaded
\not@onlypreamble\@ifl@aded
\not@onlypreamble\@pkgextension

\not@onlypreamble\@pushfilename
\not@onlypreamble\@popfilename

\not@onlypreamble\@currnamestack


\def\gmu@notprerr{ can be used only in preamble (\on@line)}

\AtBeginDocument{%
  \def\do#1{\@nx\do\@nx#1}%
  \edef\@preamblecmds{%
    \def\@nx\do##1{%
      \def##1{\@nx\gmno@NotprerrMessage##1}\@nx\@eha}}%
    \@preamblecmds}

\def\gmno@NotprerrMessage#1{%
  \PackageError{gmutils/LaTeX}%
  {\@nx\string#1 \@nx\gmu@notprerr}{}%
}


\def\gmu@nocite@ampulex{% we wrap the stuff in a~macro to hide an open
  % \incs{if}. And not to make the begin-input hook too large.
  % \label{ampulexset} the first optional argument is the
  % parameters string and the second the argument for one-level
  % expansion of \incs{nocite}. Both hash strings are doubled to pass
  % the  % first \incs{def}.
  \ampulexdef\nocite[##1][##1]
  \ifx
  {\@onlypreamble\document}%
  \iftrue}

\AtBeginDocument{\gmu@nocite@ampulex}%

%%% (For my GNU Emacs:)
%%% Local Variables:
%%% mode: doctex
%%% coding: utf-8
%%% End:
\endinput
%%
%% End of file `gmnotonlypream.sty'.
