As a programmer, I wonder if I could create my own package for LaTeX. I need something like that famous “listings” package, but something that is much more capable for my needs. I look for a listings solution that would watch out for a comment line like
// BEGIN LISTING 3122
// END LISTING 3122
No syntax highlighting, but intelligent support for tab indents. That package then would be used with a file name or path, walk through the lines and copy out just the snippets of interest.
I am 100% sure there is absolutely nothing like this on the market. So I want to program it for LaTeX. If that’s possible. I have no idea how and what programming language / IDE. Where would I start looking?
This is certainly possible, but it is non-trivial in the TeX programming language. I don’t have time to code it up at the moment but here’s an algorithm; I suggest asking on comp.text.tex for more specific LaTeX programming advice.
\dospecials) and start reading in the input file line by line (\read)\ifor\ifx; there might be a package to make this easier such as stringstrings or xstring)// BEGIN LISTING, in which case save each line into a macro (something like\g@addto@macro)// END LISTING, obviously\ifeof)TeX by Topic is a good reference guide for this sort of work.