>From 111d908f713435dfd62384eb1cc29a24268537ea Mon Sep 17 00:00:00 2001 From: Akira Yokosawa <akiyks@xxxxxxxxx> Date: Mon, 8 Apr 2019 21:20:14 +0900 Subject: [PATCH 1/3] formal/dyntickrcu: Fix the way to redefine VerbatimN It turns out the \AtBeginEnvironment{} command accumulates specified commands in a hook. By using a length variable within the patching command, just setting the length is good enough in dyntickruc.tex. "9pt" in the old code was a typo. It should have been "6pt". Signed-off-by: Akira Yokosawa <akiyks@xxxxxxxxx> Fixes: xxxxxxxxxxxx ("formal/dyntickrcu: Mitigate ugliness around tall inline snippets") --- formal/dyntickrcu.tex | 8 ++------ perfbook.tex | 5 ++++- 2 files changed, 6 insertions(+), 7 deletions(-) diff --git a/formal/dyntickrcu.tex b/formal/dyntickrcu.tex index 94093ee9..0c09d1ce 100644 --- a/formal/dyntickrcu.tex +++ b/formal/dyntickrcu.tex @@ -4,9 +4,7 @@ \IfTwoColumn{ \RecustomVerbatimEnvironment{VerbatimN}{Verbatim}% {numbers=left,numbersep=5pt,xleftmargin=10pt,xrightmargin=0pt,frame=none} -\AtBeginEnvironment{VerbatimN}{% -\renewcommand{\lnlbl}[1]{\raisebox{0pt}{\phantomsection\label{\lnlblbase:#1}}}% -} +\setlength{\lnlblraise}{0pt} }{} \subsection{Promela Parable: dynticks and Preemptible RCU} @@ -1626,7 +1624,5 @@ Verification can be a good thing, but simplicity is even better. \IfTwoColumn{ \RecustomVerbatimEnvironment{VerbatimN}{Verbatim}% {numbers=left,numbersep=3pt,xleftmargin=5pt,xrightmargin=5pt,frame=single} -\AtBeginEnvironment{VerbatimN}{% -\renewcommand{\lnlbl}[1]{\raisebox{9pt}{\phantomsection\label{\lnlblbase:#1}}}% -} +\setlength{\lnlblraise}{6pt} }{} diff --git a/perfbook.tex b/perfbook.tex index dd4a8d42..641df90a 100644 --- a/perfbook.tex +++ b/perfbook.tex @@ -251,8 +251,11 @@ %\fvset{fontsize=\scriptsize,numbers=left,numbersep=5pt,xleftmargin=9pt,obeytabs=true,tabsize=2} \newcommand{\lnlblbase}{} \newcommand{\lnlbl}[1]{\phantomsection\label{\lnlblbase:#1}} +\newlength{\lnlblraise} +\setlength{\lnlblraise}{6pt} \AtBeginEnvironment{VerbatimN}{% -\renewcommand{\lnlbl}[1]{\raisebox{6pt}{\phantomsection\label{\lnlblbase:#1}}}% +\renewcommand{\lnlbl}[1]{% +\raisebox{\lnlblraise}{\phantomsection\label{\lnlblbase:#1}}}% } \newcommand{\lnrefbase}{} \newcommand{\lnref}[1]{\ref{\lnrefbase:#1}} -- 2.17.1