From 0de1728334e6401c581f1ab1639e4388155b466e Mon Sep 17 00:00:00 2001 From: Michael Smith Date: Tue, 4 Mar 2008 04:20:37 +0000 Subject: [PATCH] Deal with case of verbatim environments that have a linebreak after the opening tag. Assumption is that users generally don't want that linebreak to appear in output, so we do some groff hackery to mess with vertical spacing and close the space. --- xsl/manpages/block.xsl | 53 ++++++++++++++++++++++++++++++++++++++++-- xsl/manpages/other.xsl | 8 +++++++ 2 files changed, 59 insertions(+), 2 deletions(-) diff --git a/xsl/manpages/block.xsl b/xsl/manpages/block.xsl index 4d4b32a49..0dd46f206 100644 --- a/xsl/manpages/block.xsl +++ b/xsl/manpages/block.xsl @@ -121,6 +121,17 @@ + + + + + + + + + Yes + + @@ -185,10 +196,48 @@ - .BB lightgray + + + + + + t + + .sp -1 + + .BB lightgray + + adjust-for-leading-newline + + + + .sp -1 + + + .BB lightgray + + - .EB lightgray + + + .EB lightgray + + adjust-for-leading-newline + + t + + + + + + .sp 1 + + + + .EB lightgray + + diff --git a/xsl/manpages/other.xsl b/xsl/manpages/other.xsl index 7c9ce2f37..9572df3df 100644 --- a/xsl/manpages/other.xsl +++ b/xsl/manpages/other.xsl @@ -802,6 +802,9 @@ db:manvolnum .. .de EB .if t \{\ +.if "\\$2"adjust-for-leading-newline" \{\ +.sp -1 +.\} .br .di .in @@ -810,7 +813,12 @@ db:manvolnum .nr BW \\n(.lu-\\n(.i .nr BH \\n(dn+.5v .ne \\n(BHu+.5v +.ie "\\$2"adjust-for-leading-newline" \{\ +\M[\\$1]\h'1n'\v'+.5v'\D'P \\n(BWu 0 0 \\n(BHu -\\n(BWu 0 0 -\\n(BHu'\M[] +.\} +.el \{\ \M[\\$1]\h'1n'\v'-.5v'\D'P \\n(BWu 0 0 \\n(BHu -\\n(BWu 0 0 -\\n(BHu'\M[] +.\} .in 0 .sp -.5v .nf -- 2.40.0