Skip to content

Commit d4ff07b

Browse files
committed
[ratio.syn] Fix formatting of codeblock with digit separators.
1 parent 60a4e5f commit d4ff07b

File tree

2 files changed

+11
-6
lines changed

2 files changed

+11
-6
lines changed

source/macros.tex

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -257,16 +257,21 @@
257257
% Our usual abbreviation for 'listings'. Comments are in
258258
% italics. Arbitrary TeX commands can be used if they're
259259
% surrounded by @ signs.
260-
\lstnewenvironment{codeblock}
261-
{
260+
\newcommand{\CodeBlockSetup}{
262261
\lstset{escapechar=@}
263262
\renewcommand{\tcode}[1]{\textup{\CodeStylex{##1}}}
264263
\renewcommand{\techterm}[1]{\textit{\CodeStylex{##1}}}
265264
\renewcommand{\term}[1]{\textit{##1}}
266265
\renewcommand{\grammarterm}[1]{\textit{##1}}
267266
}
268-
{
269-
}
267+
\lstnewenvironment{codeblock}{\CodeBlockSetup}{}
268+
269+
% A code block in which single-quotes are digit separators
270+
% rather than character literals.
271+
\lstnewenvironment{codeblockdigitsep}{
272+
\CodeBlockSetup
273+
\lstset{deletestring=[b]{'}}
274+
}{}
270275

271276
% Permit use of '@' inside codeblock blocks (don't ask)
272277
\makeatletter

source/utilities.tex

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10276,7 +10276,7 @@
1027610276

1027710277
\rSec2[ratio.syn]{Header \tcode{<ratio>} synopsis}
1027810278

10279-
\begin{codeblock}
10279+
\begin{codeblockdigitsep}
1028010280
namespace std {
1028110281
// \ref{ratio.ratio}, class template \tcode{ratio}
1028210282
template <intmax_t N, intmax_t D = 1> class ratio;
@@ -10317,7 +10317,7 @@
1031710317
typedef ratio< 1'000'000'000'000'000'000'000, 1> zetta; // \seebelow
1031810318
typedef ratio<1'000'000'000'000'000'000'000'000, 1> yotta; // \seebelow
1031910319
}
10320-
\end{codeblock}
10320+
\end{codeblockdigitsep}
1032110321

1032210322
\rSec2[ratio.ratio]{Class template \tcode{ratio}}
1032310323

0 commit comments

Comments
 (0)