[texhax] Weird citations when using the documentclass and Bibtex stylefile of the Association for Symbolic Logic

Donald Arseneau asnd at triumf.ca
Fri Feb 27 04:07:23 CET 2015


On Tue, February 24, 2015 4:15 am, Pierre Boutry wrote:

> when I do a citation using \cite{key} together with the documentclass and
> Bibtex stylefile of the Association for Symbolic Logic together with the
> package pstricks I get a weird output.

aka: [1, ]

I was ready to swear that this was a manifestation of an old
LaTeX version containing the bug latex/4092, viz
http://www.latex-project.org/cgi-bin/ltxbugs2html?pr=latex/4092
because the \cite defined by asl.cls contains font commands.

But no.  In fact both asl and pstricks boldly (foolishly)
redefine the internal general-purpose \@for loop for their
own purposes, inserting some private hacks.  This prevents
them working together.

The \cite macros in asl.cls are quite tortuous.

The redefinition in pstricks is done in the "generic" pstricks.tex,
so it may be provided to use pstricks outside of LaTeX, but it also
includes a strange initialization "\pst at cntm=0" that I see no use for.
Does anybody know if this is used for anything?

As an ugly solution to the problem, the definitions can be made with
both sets of hacks.  Insert the following just before \begin{document}.

Neither package should be redefining the \@for loop.


\makeatletter
\long\def\@for#1:=#2\do#3{%
    \pst at cntm=0%                          %   !insertion for pstricks
    \@soltrue%                            %   !insertion: \@sol inited.
    \@eolfalse%                           %   !insertion: \@eol inited.
    \expandafter\def\expandafter\@fortmp\expandafter{#2}%
    \ifx\@fortmp\@empty \else
        \expandafter\@forloop#2,\@nil,\@nil\@@#1{#3}\fi}
\long\def\@forloop#1,#2,#3\@@#4#5{%
    \@update at eol{#2,#3}%                  %  !insertion: \@eol updated.
    \def#4{#1}%
    \ifx #4\@nnil \else%
        #5%
        \@solfalse%                       %  !insertion: \@sol updated.
        \@update at eol{#3}%                 %  !insertion: \@eol updated.
        \def#4{#2}%
        \ifx #4\@nnil \else%
            #5%
            \@iforloop #3\@@#4{#5}%
        \fi%
    \fi%
}
\long\def\@iforloop#1,#2\@@#3#4{%
    \@update at eol{#2}%                     %  !insertion: \@eol updated.
    \def#3{#1}%
    \ifx #3\@nnil%
        \expandafter\@fornoop%
    \else%
        #4\relax%
        \expandafter\@iforloop%
    \fi%
    #2\@@#3{#4}%
}
\makeatother



Donald Arseneau, TRIUMF CMMS, asnd at triumf.ca



More information about the texhax mailing list