paolobrasolin / commutative-diagrams

CoDi: Commutative Diagrams for TeX
https://paolobrasolin.github.io/commutative-diagrams/
MIT License
30 stars 3 forks source link

Negative lastline trick is broken #27

Closed paolobrasolin closed 4 years ago

paolobrasolin commented 4 years ago

This trick in preamble.tex is broken:

% http://tex.stackexchange.com/a/336331/82186
\makeatletter
\lst@Key{lastline}\relax{\ifnumcomp{#1}{<}{0}{%
  \let\mylst@file\lst@intname\sbox0{\lstinputlisting{\mylst@file}}%
  \def\lst@lastline{\the\numexpr#1+\value{lstnumber}-1\relax}}%
  {\def\lst@lastline{#1\relax}}}
\makeatother

Something inside listings or tcolorbox changed and \lst@intname is not working anymore. A solution is replacing \lst@intname with \kvtcb@listingfile, which is a tcblisting internal.