Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add new note* and example* environments to suppress paragraph break. #4241

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions source/classes.tex
Original file line number Diff line number Diff line change
Expand Up @@ -746,10 +746,10 @@
\item every static data member of class \tcode{T};

\item every member function of class \tcode{T}
\begin{note}
\begin{note*}
This restriction does not apply to constructors, which do not have
names\iref{class.ctor}
\end{note}%
\end{note*}%
;

\item every member of class \tcode{T} that is itself a type;
Expand Down
8 changes: 4 additions & 4 deletions source/expressions.tex
Original file line number Diff line number Diff line change
Expand Up @@ -6893,10 +6893,10 @@

\item
an invocation of a non-constexpr function
\begin{note}
\begin{note*}
Overload resolution\iref{over.match}
is applied as usual.
\end{note}%
\end{note*}%
;

\item
Expand All @@ -6922,12 +6922,12 @@
\item
an operation that would have undefined behavior
as specified in \ref{intro} through \ref{cpp}
\begin{note}
\begin{note*}
including,
for example, signed integer overflow\iref{expr.prop}, certain
pointer arithmetic\iref{expr.add}, division by
zero\iref{expr.mul}, or certain shift operations\iref{expr.shift}
\end{note}%
\end{note*}%
;

\item
Expand Down
15 changes: 10 additions & 5 deletions source/macros.tex
Original file line number Diff line number Diff line change
Expand Up @@ -275,12 +275,17 @@
% ending with END TEXT. A counter with name ENVIRON indicates the
% number of this kind of note / example that has occurred in this
% subclause.
\newcommand{\newnoteenvironment}[3]{
\newsubclausecounter{#1}
\newenvironment{#1}
{\def\noteend{#3}\par\small\stepcounter{#1}\noteintro{#2}}
{\noteoutro{\noteend}\par}
\ExplSyntaxOn
\NewDocumentCommand \newnoteenvironment { m m m } {
\newsubclausecounter{#1}
\NewDocumentEnvironment {#1*} { }
{\def\noteend{#3}\par\small\stepcounter{#1}\noteintro{#2}}
{\noteoutro{\noteend}}
\NewDocumentEnvironment {#1} { }
{\begin{#1*}}
{\end{#1*}\par}
}
\ExplSyntaxOff

\newnoteenvironment{note}{Note \arabic{note}}{end note}
\newnoteenvironment{example}{Example \arabic{example}}{end example}
Expand Down