[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Groff] horizontal trap
From: |
Daode |
Subject: |
Re: [Groff] horizontal trap |
Date: |
Fri, 01 Jan 2016 18:30:52 +0100 |
User-agent: |
s-nail v14.8.6-141-gfbc4af2-dirty |
Happy new (Christian++) year everybody.
Tadziu Hoffmann <address@hidden> wrote:
|> [...] and also supports five different builtin styles for
|> verbatim output instead of only a silly numbered one.
|
|Okay, I'm curious. What different styles apart from numbering
|could there possibly be? (I can't think of any, except of
|course for variants of this, such as numbering only every
|fifth line, or numbering only lines containing text and
|skipping empty ones, or setting the number in a different
|color/font/size, etc.)
No, no.. It's really just that i don't have this in roff.
And no, i was impressed from Eckel's ?Thinking in Java? style,
which was so different to all the rest. (Unfortunately that made
me buy his ?Thinking in C++? one or two years later and that
wasn't really it.) Everybody goes the spiral staircase, so to
say. But on Tucholsky's "talking writing silence" i'm on two at
most. ^.^
Whereas the styles are pretty basic, the really great thing on my
TeX package was that almost everything was hookable; builtin:
% 5 (default) styles. The numbered (inside) ones are ok for up to 9999 lines
address@hidden@I{\hbox{}}% I = EMPTY
address@hidden@II{% II = Numbered; number inside document;
{\smallest\it\hbox to address@hidden@verbatimno}\hbox to.84em{}}%
}
address@hidden@III{% III = Numbered; number shifted to the left margin
address@hidden@verbatimno}\hbox to.84em{}}%
}
address@hidden@IV{% IV = black border left; border inside document
\vbox{\kern-3pt\vstrutbox{3}}\hbox to.84em{}%
}
address@hidden@V{% V = black border left; border shifted to the left margin.
\llap{\vbox{\kern-3pt\vstrutbox{3}}\hbox to.84em{}}%
}
A default to be chosen from by simple command
\def\setVerbatimStyle#1{%
\def\@@value{#1}\def\@@address@hidden
\ifx\@@value\@@address@hidden
address@hidden@I}%
..
}
\setVerbatimStyle{III}% Default is III
But you could adjust a lot of even those by doing some hooks
% Hooks
address@hidden@address@hidden
\setHookVerbatimPre{\tt}%
address@hidden@address@hidden
\setHookVerbatimAfter{}%
\def\setHookVerbatimStyle#1{% set in the style-section below
address@hidden@baseStyle{%
address@hidden@verbatimno by\TRUE\relax%
address@hidden@leftindent}{#1}%
}%
% one can choose "local" styles. this is used to restore the global
address@hidden@address@hidden@address@hidden
}%
% Dimen
address@hidden@leftindent{#1}}%
\setVerbatimLeftIndent{0pt}%
(I was sooo proud of that stuff and even wanted to write a book.
Maybe good that the c't magazine distributed a virus on CD in
a program called Street Graphics or so and that i forgot my PGP
password to restore from backup.)
--steffen