summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/latex
diff options
context:
space:
mode:
Diffstat (limited to 'Master/texmf-dist/tex/latex')
-rw-r--r--Master/texmf-dist/tex/latex/errata/errata.sty75
1 files changed, 75 insertions, 0 deletions
diff --git a/Master/texmf-dist/tex/latex/errata/errata.sty b/Master/texmf-dist/tex/latex/errata/errata.sty
new file mode 100644
index 00000000000..0c8930acd86
--- /dev/null
+++ b/Master/texmf-dist/tex/latex/errata/errata.sty
@@ -0,0 +1,75 @@
+%%
+%% This is file `errata.sty',
+%% generated with the docstrip utility.
+%%
+%% The original source files were:
+%%
+%% errata.dtx (with options: `package')
+%%
+\NeedsTeXFormat{LaTeX2e}[1999/12/01]
+\ProvidesPackage{errata}[2006/11/121v0.3 Errata Management]
+\newif\ifmargins\marginsfalse
+\newif\iffoots\footsfalse
+\newif\ifrecord\recordfalse
+\DeclareOption{show}{\marginstrue\footstrue}
+\DeclareOption{hide}{}
+\DeclareOption{margins}{\marginstrue}
+\DeclareOption{foots}{\footstrue}
+\DeclareOption{record}{\recordtrue}
+\ProcessOptions
+\RequirePackage{keyval}[1997/11/10]
+\define@key{erratum}{id}{\def\erratum@id{#1}}
+\define@key{erratum}{type}{\def\erratum@type{#1}}
+\define@key{erratum}{date}{\def\erratum@date{#1}}
+\define@key{erratum}{reported-by}{\def\erratum@reported-by{#1}}
+\newcounter{erratum}
+\newcounter{erratum@note}[erratum]
+\ifrecord\newwrite\errata@file
+\immediate\openout\errata@file=\jobname-errata.tex
+\AtEndDocument{\closeout\errata@file}\fi
+\def\ErratumRef{\@ifundefined{thechapter}{}{\arabic{chapter}.}%
+\@ifundefined{thesection}{}{\ifnum\value{section}>0{}\arabic{section}\fi}%
+\@ifundefined{thesubsection}{}{\ifnum\value{subsection}>0.\arabic{subsection}\fi}%
+\@ifundefined{thesubsubsection}{}{\ifnum\value{subsubsection}>0.\arabic{subsubsection}\fi}}
+\def\record@erratum#1{\ifrecord\protected@write\errata@file{}%
+{\string\erratumItem{\ErratumRef}{#1}}\fi}
+\def\erratumItem#1#2{\item[#1] #2}
+\def\printerrata#1{\IfFileExists{#1-errata.tex}{\begin{errata}\input{#1-errata}\end{errata}}{}}
+\def\PrintErrata{\ifrecord\immediate\closeout\errata@file\fi\printerrata\jobname}
+\newenvironment{errata}{\begin{description}}{\end{description}}
+\newcommand{\erratumAdd}[3][]% keyvals, explanation, new
+{\setkeys{erratum}{#1}\stepcounter{erratum}\record@erratum{#2}%
+\marginpar{Err(\arabic{erratum})}\immediate\typeout{Erratum!}%
+[#3]$_a^{\arabic{erratum}}$%
+\footnotetext[\value{erratum}]{{\scshape{Erratum!}}%
+\@ifundefined{erratum@type}{}{(\erratum@type)} #2 (added text)}}
+\newcommand{\erratumDelete}[3][]% keyvals, explanation, old
+{\setkeys{erratum}{#1}\stepcounter{erratum}\record@erratum{#2}%
+\marginpar{Err(\arabic{erratum})}\immediate\typeout{Erratum!}%
+[]$_d^{\arabic{erratum}}$%
+\footnotetext[\value{erratum}]{{\scshape{Erratum!}}%
+\@ifundefined{erratum@type}{}{(\erratum@type)} #2 (deleted ``#3'')}}
+\newcommand{\erratumReplace}[4][]% keyvals, explanation, old, new
+{\setkeys{erratum}{#1}\stepcounter{erratum}\record@erratum{#2}%
+\marginpar{Err(\arabic{erratum})}\immediate\typeout{Erratum!}%
+[#4]$_r^{\arabic{erratum}}$%
+\footnotetext[\value{erratum}]{{\scshape{Erratum!}}%
+\@ifundefined{erratum@type}{}{(\erratum@type)} #2 (original text was: ``#3'')}}
+\newenvironment{erratum}[2][]% keys, explanation
+{\setkeys{erratum}{#1}\stepcounter{erratum}
+\edef\new@number{\theerratum}\message{Erratum \new@number!}
+\iffoots\footnotetext[\value{erratum}]{{\scshape{Erratum}%
+\@ifundefined{erratum@type}{}{(\erratum@type)}: #2}}\marginpar{BErr(\new@number)}\fi
+\record@erratum{#2}
+\def\eAdd##1{[##1]$_a$}%
+\def\eDelete##1{\erratum@mark[]$_d^{\@thefnmark}$\@footnotetext{deleted: ##1}}%
+\def\eReplace##1##2{\erratum@mark[##2]$_r^{\@thefnmark}$\@footnotetext{was: ##1}}}%
+{\ifmargins\marginpar{EErr(\new@number)}\fi}
+\def\erratum@mark{\stepcounter{erratum@note}{}
+\def\@thefnmark{\arabic{erratum}:\arabic{erratum@note}}}
+\def\ednotemessage{\ifnum\value{erratum}>0\typeout{}%
+\typeout{This document contains \arabic{erratum} Errata; see \jobname-errata.tex!}%
+\typeout{}\fi}
+\endinput
+%%
+%% End of file `errata.sty'.