[XeTeX] Conflict among XeLaTeX, LaTeX.mk, and pdfpages

mskala at ansuz.sooke.bc.ca mskala at ansuz.sooke.bc.ca
Tue Jan 2 00:22:12 CET 2018


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.

All three elements seem to be necessary:  it doesn't happen with other TeX
engines I've tried; when invoking XeLaTeX manually instead of through
LaTeX.mk; nor without using pdfpages.  However, I can also reproduce the
problem by loading texdepends in my .tex file (with \RequirePackage - it
must be loaded before \documentclass and \usepackage cannot be used then)
and running xelatex from the command line instead of through make.

The relevant messages in the log file when it fails look like:

Package texdepends Warning: No 'testa.xbb' file
(texdepends)                using 1 for graphic dimensions on input line 31.

File: testa.pdf Graphic file (type pdf)
<use testa.pdf, page 1>
! Arithmetic overflow.
<recently read> \calc at Acount

l.31 \includepdf[pages=-]{testa.pdf}

Any thoughts on how this might be fixable?

-- 
Matthew Skala
mskala at ansuz.sooke.bc.ca                 People before principles.
http://ansuz.sooke.bc.ca/
-------------- next part --------------
define lu-define-flavor-XELATEX
  $$(eval $$(call lu-create-flavor,XELATEX,tex,XELATEX,.pdf,pdf,\
    .pdftex_t .$$(_LU_XELATEX_EXT)))
endef

LU_FLAVORS=XELATEX
XELATEX=xelatex

include LaTeX.mk
-------------- next part --------------
\documentclass{article}

\title{Test document A}
\author{Matthew Skala}
\date{\today}

\begin{document}

\maketitle

Lorem ipsum dolor sit amet, consectetur adipiscing elit.  Donec egestas
pharetra dui, nec sagittis ex gravida at.  Nulla facilisi.  Vivamus non est
diam.  Nunc eget ullamcorper tellus.  Cras ut ligula volutpat, fermentum est
nec, dictum magna.  Proin consectetur posuere consectetur.  Vestibulum
gravida, ipsum et varius rutrum, arcu massa sodales sapien, ac scelerisque
odio quam sed odio.  Sed sit amet arcu pellentesque, rutrum tortor vitae,
ullamcorper purus.  Integer rhoncus arcu at augue efficitur, quis auctor mi
blandit.  Duis vitae metus turpis.  Integer ultricies arcu eget ante
convallis, id gravida ante feugiat.  Praesent non nisi vitae metus lobortis
pharetra.  Quisque a lacus ipsum.  Nullam sed convallis erat, vitae aliquet
tellus.  Nam ullamcorper nulla vitae elit porta gravida.  Suspendisse
vestibulum nulla non sapien consectetur, sed vehicula ipsum pharetra.

Nam in ullamcorper metus, et mattis nibh.  Fusce non arcu mauris.  Aliquam
ornare nisi mauris, a lacinia dolor aliquam eget.  Phasellus efficitur
venenatis rhoncus.  Etiam eu elit eu felis suscipit hendrerit et id urna. 
Vivamus porttitor, velit sed volutpat condimentum, dui arcu dictum erat, id
dignissim ex turpis a neque.  Nunc lacinia neque id leo egestas molestie eu
vel ligula.  Integer ac ex commodo, tincidunt tortor eu, convallis nulla. 
Aliquam a odio vitae velit viverra blandit.

Ut nec consectetur est.  Nulla quis magna efficitur, luctus nisl eget,
blandit metus.  Sed ante lorem, finibus eget malesuada eu, fringilla nec
nulla.  Praesent vitae mattis elit, vitae suscipit dolor.  Nunc in velit
arcu.  Aenean nibh augue, pellentesque nec accumsan non, tristique ac lacus. 
Quisque bibendum tortor at nunc fermentum interdum.  Nullam et neque quis
ligula mollis bibendum.  Integer molestie, diam ut consectetur suscipit,
neque sapien sollicitudin odio, non condimentum enim quam quis odio.  Aenean
commodo mauris quis scelerisque eleifend.  Vivamus nec libero elit.  Integer
sed purus euismod, elementum nulla vitae, fermentum velit.  Etiam aliquet at
metus ut dignissim.

Maecenas vehicula sem sed ex vehicula malesuada.  Vestibulum ante ipsum
primis in faucibus orci luctus et ultrices posuere cubilia Curae; Nunc diam
nisi, ullamcorper vitae leo vel, consectetur dapibus massa.  Quisque ac
velit enim.  Fusce bibendum est nec pulvinar congue.  Aenean ex enim,
viverra vitae sem a, volutpat imperdiet justo.  In tempor quis tellus
posuere blandit.  Morbi ornare ultricies tellus, pharetra ornare odio
efficitur id.  Vivamus neque dui, commodo ut turpis in, mattis tempor
lectus.  Duis vitae dui ut elit porttitor faucibus sit amet nec metus.

\end{document}
-------------- next part --------------
% uncomment this to test without needing to invoke make
% \RequirePackage{texdepends}

\documentclass{article}

\usepackage{pdfpages}

\title{Test document B}
\author{Matthew Skala}
\date{\today}

\begin{document}

\maketitle

Lorem ipsum dolor sit amet, consectetur adipiscing elit.  Donec egestas
pharetra dui, nec sagittis ex gravida at.  Nulla facilisi.  Vivamus non est
diam.  Nunc eget ullamcorper tellus.  Cras ut ligula volutpat, fermentum est
nec, dictum magna.  Proin consectetur posuere consectetur.  Vestibulum
gravida, ipsum et varius rutrum, arcu massa sodales sapien, ac scelerisque
odio quam sed odio.  Sed sit amet arcu pellentesque, rutrum tortor vitae,
ullamcorper purus.  Integer rhoncus arcu at augue efficitur, quis auctor mi
blandit.  Duis vitae metus turpis.  Integer ultricies arcu eget ante
convallis, id gravida ante feugiat.  Praesent non nisi vitae metus lobortis
pharetra.  Quisque a lacus ipsum.  Nullam sed convallis erat, vitae aliquet
tellus.  Nam ullamcorper nulla vitae elit porta gravida.  Suspendisse
vestibulum nulla non sapien consectetur, sed vehicula ipsum pharetra.

\clearpage

\includepdf[pages=-]{testa.pdf}

\end{document}


More information about the XeTeX mailing list