3

Is it possible, using the minted or listings package to format a file between or till a certain textual marker automatically. E.g. consider a source file:

code
code
//marker
code ...
//end marker
code

I would like to input the code between the two markers without manually specifying the firstline & lastline as they can change during the project.

  • 1
    You can use listings's arbitrary line-range markers for that. See section 5.7 in the documentation for more details, and http://tex.stackexchange.com/a/200128/21891 for an example. – jub0bs May 18 '15 at 19:52
  • 2
    This feature has been requested for minted, and some form will be present in the next release. Basic functionality should already be possible using fancyvrb syntax, which is a bit ugly (hence the need for a nice minted wrapper); see the linked issue for an example. – G. Poore May 18 '15 at 19:55
  • Any news here? @G.Poore How is the status of this development? – TeXnician Dec 30 '17 at 16:20
  • @TeXnician Getting this to work properly in the general case is more complex than anticipated due to all the factors involved (regex, caching, handling line numbers, etc.). I think I've figured out how to do it, but it will have to wait on major revisions planned for minted v3.0. I don't have an estimate for when that will be released. – G. Poore Jan 05 '18 at 15:06

0 Answers0