Am Mon, 1 Jan 2018 17:22:12 -0600 (CST) schrieb
msk...@ansuz.sooke.bc.ca:

> I've run into a problem when using all three of XeLaTeX, LaTeX.mk, and
> pdfpages, in their current versions from the latest TeXLive.  It appears
> that in order to determine file dependencies, LaTeX.mk runs the TeX engine
> with the texdepends package (which is part of LaTeX.mk) wedged into the
> input file; then texdepends intercepts a bunch of internal macros used by
> various graphics packages including indirectly by pdfpages, and the result
> is a failure with "arithmetic overflow" when trying to include PDF files.

texdepends gets the test for the graphic existence wrong for xetex,
it assumes that the graphic is not there and set its size to 1pt
which then confuses pdfpages. It also gives errors if you set the
width of a graphic. This here could work (but I'm not sure that it
covers all cases):

\RequirePackage{texdepends}
\makeatletter
%
\def\TD@Gread@pdf#1{%
  \IfFileExists{\ifxetex \Gin@base\Gin@ext \else #1\fi}{% changed
    %\PackageWarning{texdepends}{Gread File '#1' exists}%
    \TD@orig@Gread@pdf{#1}%
  }{%
    \PackageWarning{texdepends}{No '#1' file \MessageBreak
      using 1 for graphic dimensions}%
    \setbox\@tempboxa\hbox{\relax}%
    \def\Gin@llx{1}\let\Gin@lly\Gin@llx
    \Gin@defaultbp\Gin@urx{\wd\@tempboxa}%
    \Gin@defaultbp\Gin@ury{\ht\@tempboxa}%
  }%
}%

\makeatother
\documentclass{article}

\usepackage{graphicx,pdfpages}

\begin{document}

\includegraphics[width=5cm]{example-image.pdf}

\includepdf{example-image}

\end{document}


-- 
Ulrike Fischer 
http://www.troubleshooting-tex.de/



--------------------------------------------------
Subscriptions, Archive, and List information, etc.:
  http://tug.org/mailman/listinfo/xetex

Reply via email to