8

I would like to do this:

\pdfsuppresswarningpagegroup=1

However, this feature is only supported by pdftex 1.40.15 and higher. How can I do this conditionally, so that my document won't be broken in other tex engines or in earlier versions of pdftex?

As a side issue, does this command go in the preamble? (I can't test it because I'm not yet running 1.40.15+.)

Related: Can't silence a pdftex "PDF inclusion: multiple PDFs with page group" error

14

Of course, the version number can be checked, but it is not so trivial, because the numbering scheme has changed in the past several times. I think, it is easier to check for the feature, whether \pdfsuppresswarningpagegroup is defined:

\begingroup\expandafter\expandafter\expandafter\endgroup
\expandafter\ifx\csname pdfsuppresswarningpagegroup\endcsname\relax
\else
  \pdfsuppresswarningpagegroup=1\relax
\fi

\csname has the side effect, that it defines an undefined command with the meaning of \relax. Therefore \ifx with \csname is executed inside a local group.

\pdfsuppresswarningpagegroup should then be set before it is used. Therefore the preamble is a good place for it.

  • +1 Someone is perfectionist here :p I would simply do \begingroup\expandafter\ifx\csname pdfsuppresswarningpagegroup\endcsname\relax\else\global\pdfsuppresswarningpagegroup=1\relax\fi\endgroup – yo' Aug 29 '14 at 22:54

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.