Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

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

share|improve this question
    
According to the docs, it was introduced in 1.40.14 :-) –  Joseph Wright Aug 29 at 21:48
1  
See How can I programmatically populate a PDF's pdfcreator field? for some detail on conditioning based on the version of pdfTeX. –  Werner Aug 29 at 21:50
1  
@JosephWright pdftex-a.pdf says 1.40.14, but NEWS says 1.40.15. Anyway I would not check for the version, but for the feature instead. –  Heiko Oberdiek Aug 29 at 22:21
    
I have 1.40.14, and the feature is not present in my version. –  Ben Crowell Aug 30 at 17:38

1 Answer 1

up vote 9 down vote accepted

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.

share|improve this answer
    
+1 Someone is perfectionist here :p I would simply do \begingroup\expandafter\ifx\csname pdfsuppresswarningpagegroup\endcsname\relax\else\global\pdfsuppresswarningpagegr‌​oup=1\relax\fi\endgroup –  tohecz Aug 29 at 22:54

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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