diff options
Diffstat (limited to 'macros/latex/contrib/gmutils/gmnotonlypream.sty')
-rw-r--r-- | macros/latex/contrib/gmutils/gmnotonlypream.sty | 88 |
1 files changed, 88 insertions, 0 deletions
diff --git a/macros/latex/contrib/gmutils/gmnotonlypream.sty b/macros/latex/contrib/gmutils/gmnotonlypream.sty new file mode 100644 index 0000000000..1578aba3d9 --- /dev/null +++ b/macros/latex/contrib/gmutils/gmnotonlypream.sty @@ -0,0 +1,88 @@ +%% +%% \iffalse ^^A we skip the debug setting +\IfFileExists{\string~/bin/gen_and_xela}{\errorcontextlines=1000 }{} +%% \fi +%% ^^A $Id: TheUltimateMaster.gmd,v 0.352 2011/10/12 15:19:42 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) gmail (dot) com +%% +%% 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 documentation please refer to the file(s) +%% gmutils.{gmd,pdf}. +%% +%% +\NeedsTeXFormat{LaTeX2e} +\ProvidesPackage{gmnotonlypream} + [2011/10/12 v0.996 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}% + +\endinput +%% +%% End of file `gmnotonlypream.sty'. |