\newif\iforig\origfalse  		% Produce corrected version
\newif\iforigfnmarks\origfnmarkstrue	% Include original footnote signs
\newif\ifnewpages\newpagestrue		% Include new (TeX) page numbers
\newif\ifpartial\partialfalse		% Compiling only a part of RS
\newif\ifpagesinntrefs\pagesinntrefsfalse	% Insert page numbers into note references
\newif\ifmargntrefs\margntrefstrue	% Show note references on margins
\let\ntfnt=\rm				% Note marks in \rm (can be changed into \relax)
\def\correct#1#2{\relax\iforig{#1}\else{#2}\fi}%
\def\fntag#1(#2){\relax\iforigfnmarks(#2) \else\fi\margntrefsfalse}%
\def\fntagx#1(#2){\fntag#1(#2)\label{\curorigpage-#2}}%
\def\fnmark#1(#2){\footnotemark\iforigfnmarks(#2)\else\fi}%
\def\fnmarkref#1(#2){$^{\ref{#1}}$\iforigfnmarks(#2)\else\fi}%
\def\ntmarki#1(#2){$\ntfnt(#1{}^{#2})$}%
\def\ntmark#1(#2){\relax\ifpagesinntrefs$\ntfnt(^{#2}$\hskip0.2em\tpgref{=#2=})%
\else$\ntfnt(^{#2})$\fi\ifmargntrefs\marginpar{$\to\rm(^{#2})$}\else
\fi\message{=>#2}}%
\let\ntmarkex=\ntmarki
\def\xntmark#1(#2){\ntmarki#1(#2)\marginpar{\ntmarki#1(#2)}\label{=#2=}\message{=#2=}}%
\def\nextnt(->#1){\hfill($\to\negthinspace\ntfnt#1$\ifpagesinntrefs
\hskip0.2em\tpgref{=#1=}\else\fi)\message{->#1}}%
\def\nextnttwo(->#1,#2){\hfill($\to\negthinspace\ntfnt#1$\ifpagesinntrefs
\hskip0.2em\tpgref{=#1=}\else\fi\message{->#1}, $\ntfnt#2$\ifpagesinntrefs
\hskip0.2em\tpgref{=#2=}\else\fi)\message{->#2}}%
\def\nextntex(->#1){$(\to\negthinspace\ntfnt#1)$}%
\def\gset#1#2{\toks0={#2}\xdef#1{\the\toks0}}%
\def\origpage#1{\leavevmode\marginpar{#1}\gset\curorigpage{#1}\message{<#1>}}%
\def\origpagex#1{\origpage{#1}\label{pg:#1}}%
\def\truepg#1{\relax\ifnewpages$\langle$#1$\rangle$\else\fi}%
\def\pg#1#2{#1\ifnewpages\hskip0.2em\truepg{#2}\else\fi}%
\def\pgref#1#2{\pg{#1}{\pageref{#2}}}%
\def\tpgref#1{\truepg{\pageref{#1}}}%
\def\xnopref{}%
\def\nno#1.{{\bf #1}.\marginpar{{\it #1}}\label{\xnopref#1}\message{#1.}}%
\def\lostpage#1{\dots\par\bigbreak\hrule\bigskip\centerline{\huge Page {\bf#1} LOST!}%
\bigskip\hrule\bigbreak\dots\message{  Page #1 LOST!  }}%
\newdimen\digitwidth\setbox0\hbox{0}\digitwidth=\wd0%
\def\starskip{\bigskip\centerline{*\quad\quad*}\smallskip\centerline{*}\bigbreak}%
\def\idate#1{\noindent {\sl #1}\par}%
\def\leaderdotfill{\leaders\hbox to 1em{\hss.\hss}\hfill}%
\def\sfrac#1/#2{\leavevmode\kern.1em\raise.5ex\hbox{\the\scriptfont0 #1}\kern-.1em%
/\kern-.15em\lower.25ex\hbox{\the\scriptfont0 #2}}%
\def\half{\sfrac1/2}\def\fifth{\sfrac1/5}%
%
\def\sD{\mathscr{D}}%
\def\sC{\mathscr{C}}%
\def\sB{\mathscr{B}}%
\def\sA{\mathscr{A}}%
\def\sF{\mathscr{F}}%
\def\bbC{\mathbb{C}}%
\def\bbZ{\mathbb{Z}}%
\def\bbN{\mathbb{N}}%
\def\bbQ{\mathbb{Q}}%
\def\bbR{\mathbb{R}}%
\def\bbF{\mathbb{F}}%
\def\Qbar{\overline\bbQ}%
\def\Kbar{\bar K}%
\def\kbar{\bar k}%
\def\Rd{\mathrm{R}}\def\Ld{\mathrm{L}}%
\def\Lotimes{\overset{\Ld}{\otimes}}%
\def\Hom{\operatorname{Hom}}%
\def\Gal{\operatorname{Gal}}%
\def\Spec{\operatorname{Spec}}%
\def\Sl{\operatorname{Sl}}%
\def\EP{\operatorname{EP}}%
\let\mathuf=\textsl
\let\mathcat=\textbf
\def\iHOM{\mathuf{Hom}}%
\def\HOM{\operatorname{\iHOM}}%
\def\RHOM{\operatorname{\Rd\iHOM}}%
\def\Cat{\mathcat{Cat}}%
\def\Pro{\operatorname{Pro}}%
\def\Cons{\operatorname{Cons}}%
