2

The pdfTeX manual claims that "the token list [in \pdfpageattr] is expanded when pdfTeX ships out a page" (page 32, dated 18 February 2021). However, this does not seem to be true. Here is a simple example:

\pdfcompresslevel=0
\pdfobjcompresslevel=0
\pdfpageattr={\iffalse /Rotate 90\fi}
Hello world
\bye

The PDF page object is the following:

2 0 obj
<<
/Type /Page
/Contents 3 0 R
/Resources 1 0 R
/MediaBox [0 0 612 792]
\iffalse /Rotate 90\fi 
/Parent 5 0 R
>>
endobj

Clearly, the conditional was not expanded. Incidentally, the same issue occurs with \pdfpagesattr.

Is this a bug? Or did I misinterpret the manual or do something wrong?

RobertR
  • 379
  • 1
    well I think it is the intended behaviour and the manual is simply misleading, but it would be nice if it were otherwise, then one could test for the page number at shipout and adapt the rotation to it. – Ulrike Fischer Aug 10 '21 at 07:07
  • 3
    @UlrikeFischer I'd say that the manual is utterly wrong, because no expansion is performed. I even tried with older pdftex versions and it's always the same. – egreg Aug 10 '21 at 09:48
  • @egreg Thanks for checking older versions. I suppose this is a bug, then. I've submitted a bug report on the pdfTeX development mailing list. – RobertR Aug 10 '21 at 18:16

1 Answers1

0

According to pdftex manual \pdfpageattr as well as \pdfpagesattr are token registers, so everything you put in is not expanded. You may look for solution here.

  • The manual claims that the tokens are expanded at the time of ship out, not when the register is assigned. No expansion at assignment time is not an issue, as you can simply use edef or expandafter, like in the post you linked; but expansion at ship out time would be useful for checking page numbers, as Ulrike mentioned in a comment. – RobertR Aug 10 '21 at 17:46
  • Yes, at first glance it looks slightly confusing. But, keeping in mind that the token list is not expandable item (as far as I understand), I can conclude that expansion of token list does not mean expansion of tokens in list. And then I see what "expansion of token list" means in context of shipout procedure - ".. resulting character stream ..". Finally I can suppose that this register is intended for storing only character tokens, not for command sequence tokens. – ElGatoGris Aug 11 '21 at 04:50