I'm writing the documentation to a large piece of Matlab code. I would like include tags in my Matlab code and then read the lines of code between the tags into Latex and output them as verbatim (or use some other form of code representation such as the lstlisting package).
I noticed that the catchfile package can help me with reading code as verbatim (as described here) and that the catchfilebetweentags package does essentially the other part of the job (as described in the answers to this question, yet I'm still struggling to do both simultaneously. Any ideas? Thank you.