Skip to content

Commit 003506a

Browse files
AlisdairMtkoeppe
authored andcommitted
[macros] Add LaTeX macros to index library macros
The immediate idea is to support using the new macros directly in header synopses when defining each library macro. This will ensure that no macros are accidentally not indexed. A follow-up plan is that this separation of library macros will make it easier to create a separate index of macros, or apply other macro-specific renderings, in the future. To this end, all indexed uses of a macro, not just those in header files, should be replaced by use of these new macros. Similarly, these LaTeX macros can be used in-place in regular text to index cross-references where standard library macros are used throughout the standard.
1 parent 3e4ebec commit 003506a

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

source/macros.tex

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -214,6 +214,13 @@
214214
\newcommand{\libmember}[2]{\indexlibrarymember{#1}{#2}#1}
215215
\newcommand{\libspec}[2]{\indexlibrarymemberx{#1}{#2}#1}
216216

217+
% index for macros
218+
% \libmacro is suitable for use directly in header synopses to add the macro
219+
% to both the text and the library index. \libxmacro does the same, but
220+
% prepends a well-rendered double underscore.
221+
\newcommand{\libmacro}[1]{\indexlibraryglobal{#1}\CodeStylex{#1}}
222+
\newcommand{\libxmacro}[1]{\indexlibraryglobal{\idxxname{#1}}\CodeStylex{\xname{#1}}}
223+
217224
% index for library headers
218225
\newcommand{\libheaderx}[2]{\indexhdr{#1}\tcode{<#2>}}
219226
\newcommand{\libheader}[1]{\libheaderx{#1}{#1}}

0 commit comments

Comments
 (0)