I am trying to merge some pdf files in one document. My filenames are numbers and it occurs that \includepdfmerge has problems with numbers as filenames. Does anyone have a solution?


\includepdfmerge[]{test.pdf, 1} %works
\includepdfmerge[]{133.pdf, 1} %does not work

  • It works for me on TeXLive 2020. What's your TeX distribution and what doesn't work? Commented Dec 19, 2020 at 14:50
  • I have TeXlive 2017. I get the message ! Missing = inserted for \ifnum. <to be read again> . l.35 \includepdfmerge[nup=2x1]{{1365.pdf}} ?
    – user125198
    Commented Dec 19, 2020 at 15:03

1 Answer 1


This was a bug in older versions of pdfpages, in which it tried to parse the argument to check if it was a file name or a page number, and failed because the file name starts with a number. You should update your system to fix the issue. Meanwhile, here's a patch to fix the wrong detection of the page number (not sure how well that interacts with the rest of pdfpages, so you really should update instead):


% Fix pdfpages < 2019


\includepdfmerge[]{testx.pdf, 1} %works
\includepdfmerge[]{133.pdf, 1} %also works

  • 1
    update solved the problem. Thanks
    – user125198
    Commented Dec 19, 2020 at 18:05
  • @Arno Good! No need for weird hacking :) Commented Dec 19, 2020 at 18:06

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .