This is not the whole code, so don't ask: why do you have such meaningless code in there - in the original article, it means something - because I also have other code defined.
The problem is that the redefinition of verbatim environment scans for the optional argument in the newline - towards the '#' character ... and it fails.
Then the problem goes away and the compilation completes successfully.
My question now is: how to enable the verbatim package to read the argument correctly without needing to define the catcodes. Is it possible to set the verbatim environment like that - so it only reads for optional arguments in the current line, and if no arguments given, then there is no arguments present. What's in the next line is already the verbatim text?
eleanor wrote:[…] This is not the whole code, so don't ask: why do you have such meaningless code in there - in the original article, it means something - because I also have other code defined. […]
It seems that you did not understand the meaning of a minimal example. In case you use the term "language" here in terms of a programming language, you should take a look at one of the packages listings or minted.
Minimal example is example where you present the problem you're having in as little code as possible, so others can help you figure out the problem.
About your reply: I don't want to use listings or minted, I want to use my redefined verbatim - but it doesn't work now - because of the problem I outlined.
So I would only like little help solving the problem I'm having. I don't want to use another package.
This is how a minimal example could look like. All the settings regarding margins, color, graphics etc. are not important for the problem and could be omitted, making it easier for readers and testers.
Hello. Let me just say that I'm grateful for the answer, but this is not what I want. I would only like to change the definition of verbatim - not the actual code inside it.
Maybe I can define a command like this:
\verbset[a=first_arg, b=second_arg]
And use that inside the verbatim environment - so the verbatim wouldn't have any arguments at all.