atom-latextools icon indicating copy to clipboard operation
atom-latextools copied to clipboard

latextools seem to ignoring my newer version of an .eps figure

Open navidcy opened this issue 8 years ago • 7 comments

I am on a mac os x yosemite and I am using graphicx. Latextools works ok with atom. However, when I replace one of my .eps files with a newer version and compile my .tex file it does not seem to be using the newer version. Why is that? TeXShop does it...

navidcy avatar Apr 18 '16 21:04 navidcy

The most likely cause is that gs isn't available on the path specified by your texpath, especially if you've modified the texpath setting. Can you check what your latextools.texpath setting is set to and where gs is installed on your system (you can run which gs from the Terminal to get that).

Otherwise, there may be a message in your log file that indicates the problem but isn't picked up by our parser.

ig0774 avatar Apr 23 '16 09:04 ig0774

Where do I find this setting? which gs in terminal gives me /usr/local/bin/gs thanks

navidcy avatar Apr 24 '16 21:04 navidcy

It's in the per-OS section of the latextools settings. The relevant one is "Darwin Texpath." The default value includes /usr/local/bin.

ig0774 avatar Apr 25 '16 09:04 ig0774

Yes you are right, it is included there. So what could be the problem then?

navidcy avatar Apr 25 '16 17:04 navidcy

This is where the log file might be helpful...

ig0774 avatar Apr 25 '16 18:04 ig0774

It seems to be recognizing the timestamps of the files but still I don't see the final pdf having updated the corresponding figure.

Package epstopdf Info: Source file: <topo_used_2.eps>
(epstopdf)                    date: 2016-04-25 15:53:58
(epstopdf)                    size: 1920217 bytes
(epstopdf)             Output file: <topo_used_2-eps-converted-to.pdf>
(epstopdf)                    date: 2016-04-25 15:59:34
(epstopdf)                    size: 250193 bytes
(epstopdf)             Command: <repstopdf --outfile=topo_used_2-eps-converted-
to.pdf topo_used_2.eps>
(epstopdf)             \includegraphics on input line 581.
Package epstopdf Info: Output file is already uptodate.

<topo_used_2-eps-converted-to.pdf, id=242, 562.1pt x 421.575pt>
File: topo_used_2-eps-converted-to.pdf Graphic file (type pdf)

<use topo_used_2-eps-converted-to.pdf>

navidcy avatar Apr 25 '16 23:04 navidcy

What the log tells you is that the .eps file was last modified before the corresponding generated .pdf file, which is whats actually loaded into your final document. epstopdf is thus not updating the .pdf file, so your final document has whatever is in that .pdf file, which could be the previous version of your .eps file, as you are seeing.

How this might work: say you had a previous file topo_used_2.eps which you use to build a pdf document. As part of this processing, epstopdf produces a pdf document from your eps file, which is included in your final output pdf. You update this eps file to a new version, say by copying the file from one folder to another. The last modified date of topo_used_2.eps is the last time this file was generated rather than when it was copied, so when epstopdf is run it thinks the corresponding pdf file is already up-to-date and doesn't change it. Which would explain the behaviour you're seeing and the log snippet you provided.

If that's the case, the easiest thing to do is to simply delete the topo_used_2-eps-converted-to.pdf file. Alternatively, you could change the last modified date of the eps file to be more recent than the generated pdf, using touch or just opening and saving the document in Atom. Either way, this will force it to be regenerated and update your final pdf document.

Alternatively, you could turn off update mode for epstopdf either by adding:

\usepackage{epstopdf}
\epstopdfsetup{update=false}

to your preamble or creating an epstopdf.cfg file in the same directory as your tex file with:

\epstopdfsetup{update=false}

Turning off update will result in the all eps files being converted every time you compile, which may get you closer to the behaviour you're expecting, but may also slow down your compilation dramatically (depending on how many figures you have).

If you try one of the above and it doesn't work, the log file would be helpful again...

ig0774 avatar Apr 26 '16 09:04 ig0774