diff --git a/source/back.tex b/source/back.tex index f94ef43f35..9437d44b9f 100644 --- a/source/back.tex +++ b/source/back.tex @@ -158,6 +158,15 @@ \printindex[conceptindex] } +\clearpage +\renewcommand{\preindexhook}{The bold page number for each entry is the page +where the macro is defined. +Other page numbers refer to pages where the macro is mentioned in the general text.\\} +{ +\raggedright +\printindex[macroindex] +} + \clearpage \renewcommand{\preindexhook}{The entries in this index are rough descriptions; exact specifications are at the indicated page in the general text.\\} diff --git a/source/macros.tex b/source/macros.tex index 9afe466f40..3b06a0cbb1 100644 --- a/source/macros.tex +++ b/source/macros.tex @@ -138,6 +138,7 @@ \newcommand{\indexhdr}[1]{\index[headerindex]{\idxhdr{#1}}} \newcommand{\indexconcept}[1]{\index[conceptindex]{#1}} \newcommand{\indexgram}[1]{\index[grammarindex]{#1}} +\newcommand{\indexmacro}[1]{\index[macroindex]{#1}} % Collation helper: When building an index key, replace all macro definitions % in the key argument with a no-op for purposes of collation. @@ -192,6 +193,7 @@ \newcommand{\idxcode}[1]{#1@\CodeStylex{#1}} \newcommand{\idxconcept}[1]{#1@\CodeStylex{#1}} \newcommand{\idxexposconcept}[1]{#1@\CodeStylex{\placeholder{#1}}} +\newcommand{\idxmacro}[1]{#1@\CodeStylex{#1}} \newcommand{\idxhdr}[1]{#1@\CodeStylex{<#1>}} \newcommand{\idxgram}[1]{#1@\gterm{#1}} \newcommand{\idxterm}[1]{#1@\term{#1}} @@ -504,6 +506,12 @@ \newcommand{\defexposconcept}[1]{\ecname{#1}\indexconcept{\idxexposconcept{#1}|idxbfpage}} % macro length: 16 \newcommand{\defexposconceptnc}[1]{\ecname{#1}\indexconcept{\idxexposconcept{#1}|idxbfpage}\itcorr[-1]} % macro length: 18 +%% Macros +\newcommand{\macroname}[1]{\tcode{#1}} +\newcommand{\stdmacrox}[2]{\macroname{#1}\indexmacro{\idxmacro{#2}}} +\newcommand{\stdmacro}[1]{\stdmacrox{#1}{#1}} +\newcommand{\defstdmacro}[1]{\macroname{#1}\indexmacro{\idxmacro{#1}}\indexmacro{\idxmacro{#1}|idxbfpage}} + %% Ranges \newcommand{\Range}[4]{\ensuremath{#1}\tcode{#3}\ensuremath{,}\,\penalty2000{}\tcode{#4}\ensuremath{#2}} \newcommand{\crange}[2]{\Range{[}{]}{#1}{#2}} diff --git a/source/std.tex b/source/std.tex index 2761dbee82..6f7b9e8362 100644 --- a/source/std.tex +++ b/source/std.tex @@ -67,6 +67,7 @@ \makeindex[name=headerindex,title=Index of library headers] \makeindex[name=libraryindex,options=-s libraryindex.ist,title=Index of library names] \makeindex[name=conceptindex,title=Index of library concepts] +\makeindex[name=macroindex,title=Index of macro names] \makeindex[name=impldefindex,title=Index of implementation-defined behavior] \makeglossary[xrefindex] \makeglossary[xrefdelta]