Skip to content

Commit 3fc5b43

Browse files
committed
Add new note* and example* environments to suppress paragraph break.
The new note* and example* environments will suppress the trailing paragraph break. This is useful when the environment is followed by a punctuation mark.
1 parent cdf68b3 commit 3fc5b43

File tree

3 files changed

+16
-11
lines changed

3 files changed

+16
-11
lines changed

source/classes.tex

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -746,10 +746,10 @@
746746
\item every static data member of class \tcode{T};
747747

748748
\item every member function of class \tcode{T}
749-
\begin{note}
749+
\begin{note*}
750750
This restriction does not apply to constructors, which do not have
751751
names\iref{class.ctor}
752-
\end{note}%
752+
\end{note*}%
753753
;
754754

755755
\item every member of class \tcode{T} that is itself a type;

source/expressions.tex

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6893,10 +6893,10 @@
68936893

68946894
\item
68956895
an invocation of a non-constexpr function
6896-
\begin{note}
6896+
\begin{note*}
68976897
Overload resolution\iref{over.match}
68986898
is applied as usual.
6899-
\end{note}%
6899+
\end{note*}%
69006900
;
69016901

69026902
\item
@@ -6922,12 +6922,12 @@
69226922
\item
69236923
an operation that would have undefined behavior
69246924
as specified in \ref{intro} through \ref{cpp}
6925-
\begin{note}
6925+
\begin{note*}
69266926
including,
69276927
for example, signed integer overflow\iref{expr.prop}, certain
69286928
pointer arithmetic\iref{expr.add}, division by
69296929
zero\iref{expr.mul}, or certain shift operations\iref{expr.shift}
6930-
\end{note}%
6930+
\end{note*}%
69316931
;
69326932

69336933
\item

source/macros.tex

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -275,12 +275,17 @@
275275
% ending with END TEXT. A counter with name ENVIRON indicates the
276276
% number of this kind of note / example that has occurred in this
277277
% subclause.
278-
\newcommand{\newnoteenvironment}[3]{
279-
\newsubclausecounter{#1}
280-
\newenvironment{#1}
281-
{\def\noteend{#3}\par\small\stepcounter{#1}\noteintro{#2}}
282-
{\noteoutro{\noteend}\par}
278+
\ExplSyntaxOn
279+
\NewDocumentCommand \newnoteenvironment { m m m } {
280+
\newsubclausecounter{#1}
281+
\NewDocumentEnvironment {#1*} { }
282+
{\def\noteend{#3}\par\small\stepcounter{#1}\noteintro{#2}}
283+
{\noteoutro{\noteend}}
284+
\NewDocumentEnvironment {#1} { }
285+
{\begin{note*}}
286+
{\end{note*}\par}
283287
}
288+
\ExplSyntaxOff
284289

285290
\newnoteenvironment{note}{Note \arabic{note}}{end note}
286291
\newnoteenvironment{example}{Example \arabic{example}}{end example}

0 commit comments

Comments
 (0)