[Tex/LaTex] Error using pdfpages and lualatex

atbegshiluatexpdfpagestexlive-2016

After upgrading to Tex Live 2016/Debian i get errors when using the package pdfpages and compiling with Lualatex. If i try to compile

\documentclass[a4paper,portrait]{article}
\usepackage{pdfpages}
\usepackage{pgffor}
\includepdf{document.pdf}

i get the errors

! Undefined control sequence.
\AtBegShi@horigin ->\pdfhorigin
! Missing number, treated as zero.
<to be read again> 
\relax 

! Illegal unit of measure (pt inserted).
<to be read again> 
\relax

! Undefined control sequence.
\AtBegShi@vorigin ->\pdfvorigin

(these are not the complete error messages, just the parts i think are important)

I get no errors compiling with pdflatex.

The versions i'm using are

Package: pdfpages 2016/04/19 v0.5f
pdfTeX, Version 3.14159265-2.6-1.40.17
LuaTeX, Version 0.95.0

Is this some sort of bug, or has something changed in the way pdfpages should be used?

Best Answer

LuaTeX has changed quite a lot this year. Among other things the LuaTeX developers removed a lot of known (pdf)primitives from pdfTeX. Thus several packages that make use of these primitives need to be updated.

Alternatively you can add the luatex85 package, which will reintroduce thise "missing" primitives.

Related Question