ho-tex / oberdiek

Updating the oberdiek bundle
Other
16 stars 6 forks source link

New version of zref-abspage breaks the bidi package #4

Closed ghost closed 8 years ago

ghost commented 8 years ago

Run

\documentclass{article}
\usepackage[footnoterule=automatic]{bidi}
\begin{document}
\footnote{test}
\end{document}

with xelatex in TeXLive 2016 and you get this error

./test.tex:5: You can't use `\relax' after \the.
<recently read> \c@zabspage 

l.5 \end{document}

? 

If you look at file footnote-xetex-bidi.def line 55, you will see something like this

\@ifpackagelater{zref-abspage}{2012/10/27}{%
...

This code is at least 4 years old. At the time of writing the code, this was based on a development version of zref-abspage.sty that Heiko had not published officially on CTAN.

Now that you just got the latest version from CTAN and just updated the date and version number (without actually updating the code), this fails. I was wondering if you could contact Heiko and ask for his own development version of zref-abspage.sty so that you can update it accordingly and publish it to CTAN?

I can myself update bidi but I think it is best if it is done upstream.

davidcarlisle commented 8 years ago

Hi,

thanks for the report.

Heiko is on the ho-tex list so gets all the messages including your issue report and this reply, however he's not had a lot of time recently so he asked a few of us to step in to do some "emergency updates" mostly for luatex changes.

So this git repo has the latest version of all of the files that I have, but if you or Heiko have an updated version and can let me have the code I could do something, but you should probably update the date check in bidi anyway as if we update zref we wouldn't roll the date back we'd just move on to a new date even if the actual code was from an older development base.

davidcarlisle commented 8 years ago

If there is new zref code to be incorporated that could be done but I think the real error here is in bidi

the form

\@ifpackagelater{zref-abspage}{2012/10/27}{%

is occasionally useful if you know some feature was added in a 2012/10/27 release but can't really work reliably here to test for a potential future release. As seen here it will break if the package is updated for another reason (in this case essential changes to the documentation to mention this support address, and to meet current ctan rules.)

It is better to test the actual feature that you need so something like

\@ifundefined{c@zabspage}{%
  \providecommand*{\c@zabspage}{\c@abspage}%
  \newcommand*{\footdir@LeftRightElse}{%
    \footdir@write
    \zifrefundefined{\thefootdir@label}{%
      \footdir@debug{abspage ??: else}%
      \ltx@thirdofthree
    }{%
      \edef\footdir@abspage{%
        \zref@extractdefault{\thefootdir@label}{abspage}{0}%
      }%
      \ltx@ifundefined{footdir@\footdir@abspage}{%
        \footdir@debug{\footdir@abspage: else}%
        \ltx@thirdofthree
      }{%
        \if\csname footdir@\footdir@abspage\endcsname L%
          \footdir@debug{\footdir@abspage: left}%
          \expandafter\ltx@firstofthree
        \else
          \footdir@debug{\footdir@abspage: right}%
          \expandafter\ltx@secondofthree
        \fi
      }%
    }%
  }%
}{%
  \newcommand*{\footdir@LeftRightElse}{%
    \ltx@ifundefined{footdir@\the\value{zabspage}}{%
      \footdir@debug{abspage \the\value{zabspage}: else}%
      \ltx@thirdofthree
    }{%
      \if\csname footdir@\the\value{zabspage}\endcsname L%
        \footdir@debug{abspage \the\value{zabspage}: left}%
        \expandafter\ltx@firstofthree
      \else
        \footdir@debug{abspage \the\value{zabspage}: right}%
        \expandafter\ltx@secondofthree
      \fi
    }%
  }%
}
ghost commented 8 years ago

David, I fixed this in bidi package and uploaded version 19.7 of bidi to CTAN. You may now close this issue.

davidcarlisle commented 8 years ago

Hi thanks for letting us know, glad you got it sorted out.