summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/latex/gmutils/gmnotonlypream.sty
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2010-10-24 23:46:12 +0000
committerKarl Berry <karl@freefriends.org>2010-10-24 23:46:12 +0000
commite5d25989ee337ac9399ae9e50bed87559488814f (patch)
treee08fa9fe408fbbd07d82226b3fd8a059c8d39d7b /Master/texmf-dist/tex/latex/gmutils/gmnotonlypream.sty
parent5d35798dc0ca224df75f912f020c70024e1a1169 (diff)
gmutils (24oct10)
git-svn-id: svn://tug.org/texlive/trunk@20183 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/latex/gmutils/gmnotonlypream.sty')
-rw-r--r--Master/texmf-dist/tex/latex/gmutils/gmnotonlypream.sty93
1 files changed, 93 insertions, 0 deletions
diff --git a/Master/texmf-dist/tex/latex/gmutils/gmnotonlypream.sty b/Master/texmf-dist/tex/latex/gmutils/gmnotonlypream.sty
new file mode 100644
index 00000000000..bb17a9e0eb3
--- /dev/null
+++ b/Master/texmf-dist/tex/latex/gmutils/gmnotonlypream.sty
@@ -0,0 +1,93 @@
+%%
+%% \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'.