Bug#752773: Bug report: the new listings.sty yields failures
Dear Jobst,
one more thing: On the TeX Live mailing list Qing Lee send a fix:
**********************8
It seems that listings used brace trick in a wrong way since 2014/03/04 v1.5c:
...
% \lstthanks{Luc~Van~Eycken}{Luc.VanEycken@esat.kuleuven.be}{2014/01/22}
% reported, that the experimental implementation of |\lstinline| with
% braces instead of characters surrounding the source code resulted in an
% error if used in a tabular environment. He found that this error comes
% from the master counter (cf. appendix D (Dirty Tricks), item 5. (Brace
% hacks), of the TeXbook (p. 385-386)). Adding the following line remedies
% the wrong behaviour.
A quick fix is
\makeatletter
\renewcommand\lstinline[1][]{%
\leavevmode\bgroup % \hbox\bgroup --> \bgroup
\def\lst@boxpos{b}%
\lsthk@PreSet\lstset{flexiblecolumns,#1}%
\lsthk@TextStyle
\ifnum\iffalse{\fi`}=\z@\fi
\@ifnextchar\bgroup{%
\ifnum`{=\z@}\fi%
\afterassignment\lst@InlineG \let\@let@token}{%
\ifnum`{=\z@}\fi\lstinline@}}
\makeatother
Details: http://tex.stackexchange.com/a/10371
*********************
Hope that helps
Norbert
On Sat, 28 Jun 2014, Norbert Preining wrote:
> Dear Jobst,
>
> here at Debian we got a bug report concerning the latest listings
> package, and I can confirm that it is the same on TeX Live
> original.
>
> The minimal file that worked with previous version but not
> anymore is:
>
> --------------------
> \documentclass{article}
> \usepackage{listings}
> \newcommand\foo{\lstinline{t}}
> \begin{document}
> \begin{tabular}{l}
> \foo
> \end{tabular}
> \end{document}
> --------------------
>
> The error is:
> ! Missing { inserted.
> <inserted text>
> {
> l.7 \end{tabular}
>
> ?
>
> The original reporter (in Cc) also provided an analysis:
>
> > \newcommand\lstinline[1][]{%
> > \leavevmode\bgroup % \hbox\bgroup --> \bgroup
> > \def\lst@boxpos{b}%
> > \lsthk@PreSet\lstset{flexiblecolumns,#1}%
> > \lsthk@TextStyle
> > \@ifnextchar\bgroup{%
> > \ifnum`{=0}\fi%
> > \afterassignment\lst@InlineG \let\@let@token}%
> > \lstinline@}
> >
> > and it is the "\ifnum`{=0}\fi%" line (added in this new version) that
> > triggers the error.
>
>
> Thanks for your great work and all the best
>
> Norbert
>
> ------------------------------------------------------------------------
> PREINING, Norbert http://www.preining.info
> JAIST, Japan TeX Live & Debian Developer
> GPG: 0x860CDC13 fp: F7D8 A928 26E3 16A1 9FA0 ACF0 6CAC A448 860C DC13
> ------------------------------------------------------------------------
>
>
> --
> To UNSUBSCRIBE, email to debian-tex-maint-request@lists.debian.org
> with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
> Archive: [🔎] 20140628091619.GJ19555@auth.logic.tuwien.ac.at">https://lists.debian.org/[🔎] 20140628091619.GJ19555@auth.logic.tuwien.ac.at
>
Norbert
------------------------------------------------------------------------
PREINING, Norbert http://www.preining.info
JAIST, Japan TeX Live & Debian Developer
GPG: 0x860CDC13 fp: F7D8 A928 26E3 16A1 9FA0 ACF0 6CAC A448 860C DC13
------------------------------------------------------------------------
Reply to: