Closed JensBee closed 7 years ago
This is an upstream bug/limitation. Line numbering does not work inside floats:
\definefloat[sourcecode][sourcecodes]
\startbuffer
\startlinenumbering
\input tufte
\stoplinenumbering
\stopbuffer
\starttext
\startplacesourcecode
\getbuffer
\stopplacesourcecode
\getbuffer
\stoptext
The best way will be to post a feature request on the ConTeXt mailing list.
This has been fixed upstream, but you need to wrap the contents inside a framed. Here is one option:
\usemodule[vim]
\definefloat[sourcecode][sourcecodes]
\defineframedtext
[JSONframed]
[
align=normal,
frame=off,
width=fit,
]
\definevimtyping
[JSON]
[
syntax=json,
numbering=yes,
before=\startJSONframed,
after=\stopJSONframed,
]
\starttext
\startplacesourcecode
\startJSON
some code
\stopJSON
\stopplacesourcecode
\stoptext
Note that a drawback of this approach is that the listings will not split across pages.
Hi, I'm trying to use a vim typing block inside a float. If it's wrapped in a float the line numbers are not visible. Here's a short example:
If I comment
\*placesourcecode
the code get's typeset as expeced (numbering visible).Is there anything I can do to make them visible inside floating areas?