0

Is there a way to instruct \includepdf to carry-on if no file present?

It occurs to me that this could be done via an option, or by wrapping the \includepdf command in an if statement which leverages some filesystem query.

1
  • 1
    \IfFileExists{some.pdf}{true}{false} Jul 26 at 14:58
1

There doesn't seem to be an option in includepdf, but if you want to redefine \includepdf to behave this way, you can use code like this (assuming you always provide an optional argument):

\let\realincludepdf=\includepdf
\def\includepdf[#1]#2{\IfFileExists{#2}
  {\realincludepdf[#1]{#2}}
  {\fbox{Missing #2}}}

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.