[NTG-context] typing and linenumbering
Taco Hoekwater
taco at elvenkind.com
Thu Mar 16 10:02:46 CET 2006
nico wrote:
> Hello,
> The output is pretty as I wish, but unfortunately the line numbers are
> *not* the numbers of the listing lines, but the numbers of the lines once
> wrapped in the frame. In the example below the first line is very long
> (the "blah blah" line), but in the output it is shown as 4 lines (with 4
> line numbers).
I've tried this with a "method" trick, but that does not work too well
with 'location=intext'. Anyway, here is what I did:
\setuptyping[prog]
[bodyfont=small,
before={\begingroup\setuplinenumbering[style=small,%
step=2,start=3,location=inmargin,method=type]
\startframelisting \obeylines
\startlinenumbering},
after={\stoplinenumbering\stopframelisting\endgroup}]
> Is there a way to achieve this in a more integrated way with the typing
> environment?
Probably, but I do not know.
> The other side effect of the method used is that it changes
> the linenumbering behaviour outside the typing environment. I tried the
> "reset" option, but it doesn't change the intext location. Is there a
> possibility to come back to default settings?
The setup obeys normal grouping rules (hence the \begingroup ...
\endgroup in the code above)
> Last but not least, is it possible to customize the wrapping behaviour so
> that an arbitrary command can be called before the cut, and another
> command after the cut? What I would like to have is {\space\wrapsign}
> before the cut and an indentation after the cut to show that the line is
> wrapped.
That should be possible in typing environments. I even think there was
a wiki page on that. But in non-verbatim environments, the breaking is
simply TeX's paragraph builder, and I do not think context allows
tinkering with that (I could be proven wrong, of course)
Cheers, Taco
More information about the ntg-context
mailing list