%\filename{searchmacros.tex}
%\edited{last by stolfi on Sat Mar  7 02:38:21 1987}

\catcode`@=11 \endlinechar=-1

  %  Dummy macros to facilitate searches and substitutes on item numbers
  %  (theorems, algorithms, sections+subsections, equations, figures)
  %  For the idea to work, within the same file all references to the same
  %    item must use EXACTLY the same string, and this string must be
  %    distinct from the one used for any other item.
  %  In particular, braces must always be used: \Ch{5}, not \Ch5.
  %  References to subitems numbered independently within larger items
  %    must include the number of the larger item within
  %    the braces. For example, if theorems are numbered independently
  %    within each section you must use
  %    ``theorem \Th{\Sec{5}.17}'',
  %    and NOT "theorem \Sec{5}.\Th{17} or ``theorem \Th{17} of section
  %    \Sec5''.

  %  SPECIAL OBSERVATIONS FOR BOOK FORMAT: It is OK to have a "local"
  %    naming scheme, so that for example "theorem \Th{17}" means
  %    "theorem \Th{17} of the current chapter", AS LONG AS (i) this
  %    usage is applied consitently, (ii) the file contains only one
  %    chapter, or part thereof, and (iii) references to items in other
  %     chapters are fully qualified, as "theorem \Th{\Ch{10}.3}".

  %  Note that, if local naming is used as described above,
  %     section HEADERS must be either "\section{\Sec{5}. Blah blah}" or
  %     "\section{\Ch{3}.\Sec{5}. Blah blah}"
  %     rather than "\section{\Sec{\Ch{3}.5}. Blah blah}", because of rule (i).
  %     Similarly, subsection HEADERS must be
  %     "\subsection{\Sbsec{\Sec{5}.1}. Blah}" or
  %     "\subsection{\Ch{3}.\Sbsec{\Sec{5}.1}. Blah}",
  %     rather than "\subsection{\Sbsec{\Sec{\Ch{3}.5}.1}. Blah}".

  \def\Part#1{{#1}}        % Part of a book
  \def\Prob#1{{#1}}        % problem number
  \def\Prog#1{{#1}}        % program number
  \def\Th#1{{#1}}          % theorem or lemma number
  \def\Fig#1{{#1}}         % figure number
  \def\Def#1{{#1}}         % definition number
  \def\Sec#1{{#1}}         % section number
  \def\Sbsec#1{{#1}}       % subsection number
  \def\Eq#1{{#1}}          % equation number
  \def\Ch#1{{#1}}          % chapter number
  \def\Alg#1{{#1}}         % algorithm number
  \def\Step#1{{#1}}        % step number
  \def\Ref#1{{#1}}         % bibliography reference

% TEMPORARY HACKS

  % It is useful to precede the defining occurrence of a part number
  % by the noise macro "\here", as in \section{\here\Sec{5}. Blah...}.
  % Then you can use EMACS to renumber equations, theorems, etc.
  % automatically.
  
  \def\here{} 

\catcode`@=12 \endlinechar=`\^^M

% END
