>From b69a5a8bcb76b49c5f1f30ba31d7280a67c0b87d Mon Sep 17 00:00:00 2001 From: Akira Yokosawa <akiyks@xxxxxxxxx> Date: Thu, 30 Aug 2018 23:01:03 +0900 Subject: [PATCH 7/9] Enable 'single' frame around inline code snippets Inline code snippets can have frames by modifying the definitions of VerbatimN and VerbatimU environments. Definition of \lnlbl{} command for VerbatimN needs tweaks to raise the position of anchor a bit to compensate extra vertical space around frame. Signed-off-by: Akira Yokosawa <akiyks@xxxxxxxxx> --- perfbook.tex | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/perfbook.tex b/perfbook.tex index 1dc72c2..3547f64 100644 --- a/perfbook.tex +++ b/perfbook.tex @@ -117,9 +117,9 @@ {fontsize=\scriptsize,numbers=left,numbersep=5pt,xleftmargin=9pt,obeytabs=true,tabsize=2} \AfterEndEnvironment{VerbatimL}{\vspace*{-9pt}} \DefineVerbatimEnvironment{VerbatimN}{Verbatim}% -{fontsize=\scriptsize,numbers=left,numbersep=5pt,xleftmargin=25pt,obeytabs=true,tabsize=2} +{fontsize=\scriptsize,numbers=left,numbersep=3pt,xleftmargin=5pt,xrightmargin=5pt,obeytabs=true,tabsize=2,frame=single} \DefineVerbatimEnvironment{VerbatimU}{Verbatim}% -{fontsize=\scriptsize,numbers=none,xleftmargin=15pt,obeytabs=true,tabsize=2,samepage=true} +{fontsize=\scriptsize,numbers=none,xleftmargin=5pt,xrightmargin=5pt,obeytabs=true,tabsize=2,samepage=true,frame=single} \IfLmttForCode{ \AtBeginEnvironment{verbatim}{\renewcommand{\ttdefault}{lmtt}} @@ -242,6 +242,9 @@ %\fvset{fontsize=\scriptsize,numbers=left,numbersep=5pt,xleftmargin=9pt,obeytabs=true,tabsize=2} \newcommand{\lnlblbase}{} \newcommand{\lnlbl}[1]{\phantomsection\label{\lnlblbase:#1}} +\AtBeginEnvironment{VerbatimN}{% +\renewcommand{\lnlbl}[1]{\raisebox{6pt}{\phantomsection\label{\lnlblbase:#1}}}% +} \newcommand{\lnrefbase}{} \newcommand{\lnref}[1]{\ref{\lnrefbase:#1}} -- 2.7.4