olsak / OpTeX

OpTeX - LuaTeX format with extended Plain TeX macros
http://petr.olsak.net/optex/
35 stars 13 forks source link

Unexpected behaviour when ttline>0 #121

Open robertbachmann opened 1 year ago

robertbachmann commented 1 year ago

Given the following input:

\ttline=0

Listing 1: 
\begtt\hisyntax{C}
int main() {
  return 0;
}
\endtt

% \ttline=0

Listing 2: 
\begtt\hisyntax{C}
int foo() {
  return 0;
}
\endtt

\bye

I get the following result: image

Is this intended? Do I need to (re)set \ttline=0 for each listing?

olsak commented 1 year ago

Yes, it is documented behavior. Unfortunately, numbering each listing form one is somewhat tricky:

\everytt{\ttline=0} \ttline=0

I'll think about a better solution...