% EVERYBODY IS FREE TO BORROW THE FILE AND CHANGE IT % UNDER ONE CONDITION OF NEVER ASKING ME WHY THE THING WORKS % OR DOES NOT WORK % % If I write a book, % % I use this file TheGOST.tex when I wish to number thms and such and % formulas by one number like 25 put on the left in the case of thms % and such and to refer to say Thm 25 in the same section as Thm 25, % otherwise in the same chapter as Sec.Thm 25, where Sec is the number % of the section in which Thm 25 appears, and otherwise in the book % as Ch.Sec.Thm 25, where Ch is the ...The same for formulas. % % To use the file some work is to be done. % Type \swapnumbers righ after \documentclass{amsbook}. % Type \input{TheGOST} (this-file name) after all definitions in preamble % where \newcommand{\mysection} should not be present (otherwise % change below \newcommand{\mysection} by \renewcommand{\mysection}). % In addition, all \section{ and \chapter{ commands in the tex file % should be replaced with \mysection{ and \mychapter{ % (but not those like \section*{ which % should be addressed in a different way). % What about \subsection's? I don't know. Never had one. % % To see what an ugly thing I have only using the standard Latex2e, % in preamble comment out \input{TheGOST} and \swapnumbers, % type \newcommand{\mysection}{\section}, the same % with \mychapter, and change \def\thechapter{-1A} (see later) % with \def\thechapter{A} % \makeatletter % \renewcommand{\thechapter}{\arabic{chapter}} \renewcommand{\thesection}{\arabic{section}} \renewcommand{\theequation}{.\thechapter.\arabic{section}.\arabic{equation}} \renewcommand{\thetheorem}{.\thechapter.\arabic{section}.\arabic{theorem}}% % \newcommand{\mysection}[1]{% \section{#1}\setcounter{equation}{0} \edef\@currentlabel{.\thechapter.\arabic{section}}} % \newcommand{\mychapter}[1]{\chapter{#1} \edef\@currentlabel{.\arabic{chapter}}} % % To number equations in the printout by one number like 25 % but get in aux file % the info .Ch.Sec.25 which through \ref (defined below) % allows to extract different versions of ref numbers % on different occasions \def\mojtag#1{\hbox{\m@th\normalfont#1}} \def\tagform@#1{\mojtag{(\ignorespaces\arabic{equation}\unskip)}} % \def\swappedhead#1#2#3{% \arabic{theorem}\thmname{. #1}\thmnote{ {\the\theoremnotefont(#3)}}} % % Next found by \meaning\ref Probably very old. \def\granddadref#1{\expandafter\@setref\csname r@#1\endcsname\@firstoftwo{#1}} % \renewcommand{\ref}[1]{% good to know that \if...\else whatever\fi % produces . and \if11something\else whatever\fi % yields this something. Therefore % the command \if.\dadref{#1} and so on below % chops off . (one point) from \dadref{#1} % if there is anything to chop from. $\def\aref{\if.\granddadref{#1}\else-1{\bf??}% \@warning{Reference `#1' on page \thepage \space HE OnpegeleHA}\fi}% % % Next was found after many tries to accomodate all the above % wihses and also to cope with the case of \chapter*{Appendix} % to results of which I wanted to refer to like...Lemma A.1.1.. % "A" is not any \arabic{chapter}. This is why right after % \chapter*{Appendix} I typed \def\thechapter{-1A}. % \def\refa{\ifnum\arabic{chapter}=\aref\else\aref\fi}% \def\refb{\if.\refa\else\arabic{section}.\aref\fi}% \def\refc{\ifnum\arabic{section}=\refb\else.\refb\fi}% \def\refd{\if.\refc\else\refb\fi} % % $'s eliminate extra space (of which there is plenty) and \text % is for right appearance of references in texts of thms. % It is also perfect for run-in headings in 10pt. % \text{\ifnum-1=\refd\else\refd\fi}$} % % next commands for numbering in the first chapter % like \chapter*{Preface} % \setcounter{chapter}{0}\setcounter{section}{0} \makeatother %% END of file TheGOST.tex