Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Maximum runs of pdflatex reached without getting stable files #12

Closed
flaport opened this issue Sep 13, 2019 · 7 comments
Closed

Maximum runs of pdflatex reached without getting stable files #12

flaport opened this issue Sep 13, 2019 · 7 comments
Assignees
Labels
Milestone

Comments

@flaport
Copy link

flaport commented Sep 13, 2019

When running latexmk with xelatex, the pdf file of the svg keeps being regenerated every run. This causes latexmk to rerun xelatex about 5 times every time to finally halt with a

Rule 'pdflatex': File changes, etc:
   Changed files, or newly in use since previous run(s):
      'svg-inkscape/test_svg-tex.pdf'
Latexmk: Maximum runs of pdflatex reached without getting stable files

or a

Latexmk: Failure in processing file 'test':
   'xelatex' needed too many passes

error (depending on the recipe used; see below). Although the pdf file is created, this is quite annoying, as compiling the file takes longer this way.

This should give a reproducible example (let's assume this file is called test.tex):

\documentclass{article}
\usepackage{graphicx}
\usepackage{svg}
\usepackage{svg-extract}
% same problem when explicitly setting convert and extract to true:
%\usepackage[convert=true,extract=true]{svg-extract}
\begin{document}
\includesvg{test.svg}
\section{Introduction}
\end{document}

run either with

latexmk -pdf -pdflatex="xelatex %O %S" -synctex=1 -interaction=nonstopmode -shell-escape test

or

latexmk -pdf -xelatex -synctex=1 -interaction=nonstopmode -shell-escape test

To reproduce the problem. Is this a bug? or are there any settings I don't know about? Note that the problem does not exists when running latexmk with the normal pdflatex.

@garyng
Copy link

garyng commented Sep 13, 2019

What I did for this is to configure latexmk to ignore changes for pdf files by adding this into .latexmkrc

$hash_calc_ignore_pattern{'pdf'}='^';

(https://tex.stackexchange.com/questions/347980/how-to-make-latexmk-ignore-certain-input-files-as-dependencies/348361#348361)

@flaport
Copy link
Author

flaport commented Sep 14, 2019

Thanks, that did the trick!

However, I still think this is an issue worth solving in this package as well. If I understand it correctly, latexmk will look at the hash of each file to see if any of them have been modified and if that is the case it will rerun the build process. This means (i think) that the svg package rebuilds the pdf every run, even if the svg has not changed and the pdf was already generated. In my opinion, this should be prevented.

@garyng
Copy link

garyng commented Sep 14, 2019

Yeah, I agree it was kinda hack-y.

The idea of checking the hash is also mentioned in #11 though. My bad, misread the reply.

@flaport
Copy link
Author

flaport commented Sep 14, 2019

Yes, I do.

OK this explains it. Too bad there's no built-in workaround... anyway, the workaround above seems to work fine, so I'll stick with that for now.

@flaport flaport closed this as completed Sep 14, 2019
@garyng
Copy link

garyng commented Sep 14, 2019

Yes, I do.

OK this explains it. Too bad there's no built-in workaround... anyway, the workaround above seems to work fine, so I'll stick with that for now.

(I fat-fingered and deleted the reply... Original reply is here for future reference)

Do you happen to use xelatex?
From the package documentation:

Unfortunately a primitive like \pdffilemoddate is missing for XeTeX, so with this engine, the behaviour will be the same as inkscape=forced

Is this possibly the cause?

@mrpiggi
Copy link
Owner

mrpiggi commented Sep 16, 2019

XeTeX now provides \filemoddate which will be supported with svg version v2.03

@mrpiggi mrpiggi added the bug label Sep 24, 2019
@mrpiggi mrpiggi self-assigned this Sep 24, 2019
@mrpiggi mrpiggi reopened this Sep 24, 2019
@mrpiggi mrpiggi added this to the v2.03 milestone Oct 10, 2019
@garyng
Copy link

garyng commented Nov 7, 2019

Seems like the new version is still regenerating pdfs...
I updated to texlive 2019 (on Ubuntu 19.10), the svg package is up-to-date right?

It's not. My bad!
image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants