I'm trying to typeset some program listings with annotations alongside. I've 
tried both columns and tabulate but both have (different) issues:

1) Plain \typefile won't allow the line numbers to be in the text - they stay 
in the margin whch I don't want.

2) \typefile using a \definedtyping name does work and works in \columns as 
well. This is great until my listing is too long to fit on a page and then I'd 
rather have the column continue onto the next page but \columns balances of 
course.

3) \tabulate allows a single cell to continue down over the page exactly as I'd 
like, but the line numbers disappear altogether. (And it has to be a single 
cell because the program listings are in source files that I want to include 
using \typefile rather than re-enter to avoid typos.)

You can see each of these effects with the following MWE which first needs a 
file called "three_lines.txt" to be created in the local directory containing 
the lines:
one
two
three

%%%% begin
\setuplinenumbering[location=text,style=\small\tt]
\starttext

Location=text not working in main body
\typefile[numbering=line]{three_lines.txt}

But it does work if a custom typing environment is created.
\definetyping[MyTyping][style=\tt]
\typefile[MyTyping][numbering=line]{three_lines.txt}

Still works if used in a column
\startcolumns
 \typefile[MyTyping][numbering=line]{three_lines.txt}
\column
 :-)
\stopcolumns
\blank

But doesn't work if used in tabulate
\starttabulate[|p|p|]
\NC
 \typefile[MyTyping][numbering=line]{three_lines.txt}
\NC
  No line numbers at all :-(
\NR
\stoptabulate

\stoptext
%%%% end

What I'd most like is for tabulate to allow \typefile with line numbers if at 
all possible.
—
Bruce Horrocks
Hampshire, UK

Attachment: zz.pdf
Description: Adobe PDF document

___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : {listname} / https://mailman.ntg.nl/mailman3/lists/{list_id}
webpage  : https://www.pragma-ade.nl / https://context.aanhet.net (mirror)
archive  : https://github.com/contextgarden/context 
wiki     : https://wiki.contextgarden.net
___________________________________________________________________________________

Reply via email to