summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/source/latex/latex-tds/tex/ams.drv
diff options
context:
space:
mode:
Diffstat (limited to 'Master/texmf-dist/source/latex/latex-tds/tex/ams.drv')
-rw-r--r--Master/texmf-dist/source/latex/latex-tds/tex/ams.drv152
1 files changed, 152 insertions, 0 deletions
diff --git a/Master/texmf-dist/source/latex/latex-tds/tex/ams.drv b/Master/texmf-dist/source/latex/latex-tds/tex/ams.drv
new file mode 100644
index 00000000000..3720eaada9b
--- /dev/null
+++ b/Master/texmf-dist/source/latex/latex-tds/tex/ams.drv
@@ -0,0 +1,152 @@
+% ams.drv
+% 2006/06/02 v1.0 Driver file for amslatex documentation files
+% Copyright 2006 Heiko Oberdiek.
+%
+% This file is part of project `latex-tds'.
+%
+% It 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.3c or later is part of all distributions of LaTeX
+% version 2005/12/01 or later.
+%
+% This work has the LPPL maintenance status `maintained'.
+%
+% The Current Maintainer of this work is Heiko Oberdiek.
+%
+% See `readme.txt' for a list of all files belonging to the
+% project `latex-tds' and additional information.
+%
+\NeedsTeXFormat{LaTeX2e}
+\makeatletter
+
+%%% Paper size
+\@for\reserved@a:=article,report,book,amsdtx,amsart\do{%
+ \PassOptionsToClass{a4paper}{\reserved@a}%
+}
+
+%%% Skip for cite-xa (unsupported)
+\begingroup
+ \edef\x{\jobname}%
+ \def\y{cite-xa}%
+ \@onelevel@sanitize\y
+\expandafter\endgroup
+\ifx\x\y
+ \expandafter\@firstofone
+\else
+ \expandafter\@gobble
+\fi
+{%
+ \input{\jobname.tex}%
+ \endinput
+}
+
+%%% Patch \documentclass
+\let\PATCH@ORG@documentclass\documentclass
+\renewcommand*{\documentclass}[2][]{%
+ \let\documentclass\PATCH@ORG@documentclass
+ \begingroup
+ \toks@{\documentclass}%
+ \def\x{#1}%
+ \ifx\x\@empty
+ \else
+ \toks@\expandafter{\the\toks@[{#1}]}%
+ \fi
+ \toks@\expandafter{\the\toks@{#2}}%
+ \PATCH@documentclass
+}
+\newcommand*{\PATCH@documentclass}[1][]{%
+ \def\x{#1}%
+ \ifx\x\@empty
+ \else
+ \toks@\expandafter{\the\toks@[#1]}%
+ \fi
+ \expandafter\endgroup
+ \the\toks@
+ %
+ % page layout
+ \addtolength{\topmargin}{-10mm}%
+ \addtolength{\textheight}{20mm}%
+ %
+ %%% Add hyperref support
+ \PassOptionsToPackage{hyperref}{draft=false}%
+ \IfFileExists{\jobname.dtx}{%
+ \RequirePackage{hypdoc}[2006/06/01]%
+ }{}{}%
+ \usepackage[pdfusetitle]{hyperref}%
+ \hypersetup{
+ draft=false,
+ colorlinks,
+ bookmarksnumbered,
+ }%
+ \pdfstringdefDisableCommands{%
+ \def\BibTeX{BibTeX}%
+ \let\pkg\@firstofone
+ \let\cls\@firstofone
+ \let\opt\@firstofone
+ \let\fld\@firstofone
+ \let\ntt\relax
+ \let\fn\@firstofone
+ \let\env\@firstofone
+ \def\cn{\textbackslash}%
+ \def\begend##1{%
+ \textbackslash begin\{##1\} \dots\space
+ \textbackslash end\{##1\}%
+ }%
+ \def\and{, }%
+ \def\linebreak[##1]{}%
+ }%
+}
+
+%%% Patch for cite-xh.tex
+\begingroup
+ \edef\x{\jobname}%
+ \def\y{cite-xh}%
+ \@onelevel@sanitize\y
+\expandafter\endgroup
+\ifx\x\y
+ \PassOptionsToPackage{%
+ colorlinks,citecolor=red,pagebackref,hypertexnames=false,hypertexnames%
+ }{hyperref}%
+\fi
+
+%%% Patch theindex for amsldoc.tex
+\begingroup
+ \edef\x{\jobname}%
+ \def\y{amsldoc}%
+ \@onelevel@sanitize\y
+\expandafter\endgroup
+\ifx\x\y
+\else
+ \expandafter\@gobbletwo
+\fi
+\AtBeginDocument{%
+ \let\PATCH@ORG@theindex\theindex
+ \def\theindex{%
+ \let\endtheindex\relax
+ \end{theindex}%
+ \let\theindex\PATCH@ORG@theindex
+ \InputIfFileExists{\jobname.ind}{}{}%
+ \end{document}%
+ }%
+}
+
+\makeatother
+
+%%% Load document source file
+\InputIfFileExists{\jobname.tex}{%
+ \typeout{* Document source: \jobname.tex}%
+}{%
+ \InputIfFileExists{\jobname.dtx}{%
+ \typeout{* Document source: \jobname.dtx}%
+ \AtBeginDocument{\CodelineIndex}%
+ \AtEndDocument{\PrintIndex}%
+ }{%
+ \PackageError{ams.drv}{%
+ Cannot find document source
+ }{\csname @ehc\endcsname}%
+ }%
+}
+\endinput