Re: [PATCH -perfbook 1/2] Define macros for multi-part listings in preamble

"Paul E. McKenney" <[email protected]> Sat, 27 Jun 2026 10:26:35 -0700
Newsgroups org.kernel.vger.perfbook
Message-ID <0c861958-99e8-4358-b74f-eb25590594f5@paulmck-laptop>
On Sat, Jun 27, 2026 at 02:26:14PM +0900, Akira Yokosawa wrote:
> On Fri, 26 Jun 2026 10:59:03 -0700, Paul E. McKenney wrote:
> > On Fri, Jun 26, 2026 at 08:34:47PM +0900, Akira Yokosawa wrote:
> >> Paul said he has a plan to add listings similar to Listings 9.13
> >> and 9.14 [1].
> >>
> >> Move local definitions in rcuintro.tex for such multi-part listings
> >> into preamble so that they can be used elsewhere.  Note that
> >> "VerbatimT" and "adjustwidth" envs have vertical spacing tweaks
> >> applied.
> > 
> > Queued, thank you very much!!!
> > 
> > I queued the following commit on top of these two in order to create
> > the first Tools of the Trade triple listing.  Does this make sense,
> > or is there a better way?
> > 
> > 							Thanx, Paul
> > 
> > ------------------------------------------------------------------------
> > 
> > commit 72f863e04bf56ec4e95e90a789570a2434caf61e
> > Author: Paul E. McKenney <[email protected]>
> > Date:   Fri Jun 26 10:44:49 2026 -0700
> > 
> >     Add definitions of \adjvspace{above,below,bottom}
> 
> I removed those definitions in Patch 1/2 because (new) VerbatimT and
> adjustwidth envs now have those extra vertical spaces on their own.
> 
> diff --git a/perfbook-lt.tex b/perfbook-lt.tex
> index 0dc05325..cb8299a5 100644
> --- a/perfbook-lt.tex
> +++ b/perfbook-lt.tex
> @@ -397,6 +397,12 @@
>  {numbers=left,numbersep=3pt,xleftmargin=5pt,xrightmargin=5pt,frame=single}
>  \DefineVerbatimEnvironment{VerbatimU}{Verbatim}%
>  {numbers=none,xleftmargin=5pt,xrightmargin=5pt,samepage=true,frame=single}
> +% for multi-part listings with explanation
> +\DefineVerbatimEnvironment{VerbatimT}{Verbatim}%
> +{numbers=left,numbersep=5pt,frame=single,xrightmargin=5pt}
> +\BeforeBeginEnvironment{VerbatimT}{\vspace*{2pt}}
> +\AfterEndEnvironment{VerbatimT}{\vspace*{-1pt}}
> +\AfterEndEnvironment{adjustwidth}{\vspace*{-2pt}}
>  
>  \IfLmttForCode{
>  \AtBeginEnvironment{verbatim}{\renewcommand{\ttdefault}{lmtt}}
> 
> >     
> >     Signed-off-by: Paul E. McKenney <[email protected]>
> > 
> > diff --git a/perfbook-lt.tex b/perfbook-lt.tex
> > index f6d6efc2..3c1e15f1 100644
> > --- a/perfbook-lt.tex
> > +++ b/perfbook-lt.tex
> > @@ -407,6 +407,9 @@
> >  \newcommand{\myfvline}{\arabic{FancyVerbLine}} % redefine on-the-fly
> >  \AtBeginEnvironment{VerbatimT}{%
> >    \renewcommand{\theFancyVerbLine}{\rmfamily\tiny \myfvline}}
> > +\newcommand{\adjvspaceabove}{\vspace*{2pt}}
> > +\newcommand{\adjvspacebelow}{\vspace*{-1pt}}
> > +\newcommand{\adjvspacebottom}{\vspace*{-2pt}}
> >  
> >  \IfLmttForCode{
> >  \AtBeginEnvironment{verbatim}{\renewcommand{\ttdefault}{lmtt}}
> 
> I think the easiest way forward for both of us is to keep your
> change without applying my changes.  I'll rebase my changes after
> seeing your new multi-part listing(s) and submit v2.

OK, so I need to revert my addition of \adjvspace{above,below,bottom},
remove them from my toolsoftrade table, change the Verbatim instances
to VerbatimT, then all should be well.  (Hey, I can dream, can't I?)

Let me try that, then please do adjust on top if needed.

							Thanx, Paul