|
141 | 141 | \let\BreakableUnderscore\textunderscore%
|
142 | 142 | \edef\x{#1}%
|
143 | 143 | \let\tcode\otcode%
|
144 |
| -\let\grammarterm\ogrammarterm% |
| 144 | +\let\grammarterm\gterm% |
145 | 145 | \let\mname\omname%
|
146 | 146 | \let\Cpp\oCpp%
|
147 | 147 | \let\BreakableUnderscore\oBreakableUnderscore%
|
148 | 148 | \index[impldefindex]{\x@#1}%
|
| 149 | +\let\grammarterm\ogrammarterm% |
149 | 150 | \let\textup\otextup%
|
150 | 151 | }
|
151 | 152 |
|
152 |
| -% These three commands use the "cooked" \indeximpldef command to emit index |
| 153 | +\newcommand{\indexdefn}[1]{\indextext{#1}} |
| 154 | +\newcommand{\idxbfpage}[1]{\textbf{\hyperpage{#1}}} |
| 155 | +\newcommand{\indexgrammar}[1]{\indextext{#1}\indexgram{#1|idxbfpage}} |
| 156 | +% This command uses the "cooked" \indeximpldef command to emit index |
153 | 157 | % entries; thus they only work for simple index entries that do not contain
|
154 | 158 | % special indexing instructions.
|
155 |
| -\newcommand{\indexdefn}[1]{\indextext{#1}} |
156 |
| -\newcommand{\indexgrammar}[1]{\indextext{#1}\indexgram{#1}} |
157 | 159 | \newcommand{\impldef}[1]{\indeximpldef{#1}implementation-defined}
|
158 | 160 | % \impldefplain passes the argument directly to the index, allowing you to
|
159 | 161 | % use special indexing instructions (!, @, |).
|
|
162 | 164 | % appearance
|
163 | 165 | \newcommand{\idxcode}[1]{#1@\tcode{#1}}
|
164 | 166 | \newcommand{\idxhdr}[1]{#1@\tcode{<#1>}}
|
165 |
| -\newcommand{\idxgram}[1]{#1@\textit{#1}} |
| 167 | +\newcommand{\idxgram}[1]{#1@\gterm{#1}} |
166 | 168 |
|
167 | 169 | % class member library index
|
168 | 170 | \newcommand{\indexlibrarymember}[2]{\indexlibrary{\idxcode{#1}!\idxcode{#2}}\indexlibrary{\idxcode{#2}!\idxcode{#1}}}
|
|
172 | 174 | \newcommand{\CodeStyle}{\ttfamily}
|
173 | 175 | \newcommand{\CodeStylex}[1]{\texttt{#1}}
|
174 | 176 |
|
| 177 | +% General grammar style |
| 178 | +\newcommand{\GrammarStyle}{\itfamily} |
| 179 | +\newcommand{\GrammarStylex}[1]{\textit{#1}} |
| 180 | + |
175 | 181 | % Code and definitions embedded in text.
|
176 | 182 | \newcommand{\tcode}[1]{\CodeStylex{#1}}
|
177 | 183 | \newcommand{\techterm}[1]{\textit{#1}}
|
178 | 184 | \newcommand{\defnx}[2]{\indexdefn{#2}\textit{#1}}
|
179 | 185 | \newcommand{\defn}[1]{\defnx{#1}{#1}}
|
180 | 186 | \newcommand{\term}[1]{\textit{#1}}
|
181 |
| -\newcommand{\grammarterm}[1]{\textit{#1}} |
182 |
| -\newcommand{\grammartermnc}[1]{\textit{#1}\nocorr} |
| 187 | +\newcommand{\gterm}[1]{\GrammarStylex{#1}} |
| 188 | +\newcommand{\grammarterm}[1]{\indexgram{\idxgram{#1}}\gterm{#1}} |
| 189 | +\newcommand{\grammartermnc}[1]{\indexgram{\idxgram{#1}}\gterm{#1}\nocorr} |
183 | 190 | \newcommand{\placeholder}[1]{\textit{#1}}
|
184 | 191 | \newcommand{\placeholdernc}[1]{\textit{#1\nocorr}}
|
185 | 192 |
|
|
194 | 201 | \newcommand{\CppXI}{\Cpp{} 2011}
|
195 | 202 | \newcommand{\CppXIV}{\Cpp{} 2014}
|
196 | 203 | \newcommand{\CppXVII}{\Cpp{} 2017}
|
197 |
| -\newcommand{\opt}[1]{\ifthenelse{\equal{#1}{}} |
198 |
| - {\PackageError{main}{argument must not be empty}{}} |
199 |
| - {#1\ensuremath{_\mathit{opt}}}} |
| 204 | +\newcommand{\opt}[1]{#1\ensuremath{_\mathit{opt}}} |
200 | 205 | \newcommand{\dcr}{-{-}}
|
201 | 206 | \newcommand{\bigoh}[1]{\ensuremath{\mathscr{O}(#1)}}
|
202 | 207 |
|
|
356 | 361 | \renewcommand{\tcode}[1]{\textup{\CodeStylex{##1}}}
|
357 | 362 | \renewcommand{\techterm}[1]{\textit{\CodeStylex{##1}}}
|
358 | 363 | \renewcommand{\term}[1]{\textit{##1}}
|
359 |
| - \renewcommand{\grammarterm}[1]{\textit{##1}} |
| 364 | + \renewcommand{\grammarterm}[1]{\gterm{##1}} |
360 | 365 | }
|
361 | 366 |
|
362 | 367 | \lstnewenvironment{codeblock}{\CodeBlockSetup}{}
|
|
0 commit comments