shiblon / latex-makefile

A Makefile for LaTeX - drop it in, type make, and magic happens.
Other
185 stars 30 forks source link

Broken support for eps.gz files #139

Closed shiblon closed 8 years ago

shiblon commented 8 years ago

Originally reported on Google Code with ID 126

Hi Chris,

Makefile version 2.2.0-rc15 doesn't compile a document from sources containing gzip'ed
eps files:
------------------------------------------------------------------
bash-3.2$ make -f Makefile.2.2.0-rc15
NOTE: You may ignore warnings about the following files:

     foo.d

Makefile.2.2.0-rc15:2554: foo.d: No such file or directory
= foo.tex --> foo.d foo.dvi.1st.make (0-1) =
make: stat: bar.eps'\ not\ found.\ See\ the\ LaTeX\ manual\ or\ LaTeX\ Companion\ for\
explanation.\ Type\ H\ <return>\ for\ immediate\ help.\ ...\ l.8\ \includegraphics[width=\textwidth]{bar.eps}\
Try\ typing\ <return>\ to\ proceed.\ If\ that\ doesn't\ work,\ type\ X\ <return>\ to\
quit.\ .gpi.d: File name too long
make: *** No rule to make target `bar.eps'\\\', needed by `foo.d'.  Stop.
------------------------------------------------------------------

Source files and output files are attached.

System:
------------
bash-3.2$ uname -a
Linux optimus.lexas 2.6.18-238.el5 #1 SMP Sun Dec 19 14:22:44 EST 2010 x86_64 x86_64
x86_64 GNU/Linux

Regards,
Slavik

Reported by viatcheslav.bugayov on 2011-04-26 19:29:25


shiblon commented 8 years ago
OK - a couple of things that I noticed right away:

1) In 2.2.x, pdflatex is the default, so .eps files are *not understood*.  You can't
\includegraphics{something.eps}.  Instead, do \includegraphics{something}  (no extension,
will assume things like pdf, jpg, etc.) and pdflatex will try to find something.pdf,
which the makefile knows how to build from something.eps.gz.

2) There is a log parsing bug, and I'm going to fix that.  However, in this case the
outcome will be an error that you are missing a file, not a working compilation.

I'll post again here when it's fixed.  Meanwhile, try the bare include (no .eps extension).

Reported by shiblon on 2011-04-27 13:41:15

shiblon commented 8 years ago
Whoops - I just noticed that you are using the latex BUILD_STRATEGY setting.  So, ignore
what I said about bare includes (although those really ought to work.  Sigh).

Reported by shiblon on 2011-04-27 13:45:20

shiblon commented 8 years ago
Give the attached a whirl and let me know if it fixes your issue (it works on my system).
 Then I'll upload this new fix.

You should still be able to compile specifying the .eps extension, but you can also
remove it, which will make you more forward compatible with pdflatex, should you choose
to use it later.

The changes are in re48a3da39295 if you want to have a look.

Reported by shiblon on 2011-04-27 14:56:30


shiblon commented 8 years ago
That was quick! Thank you for the fix.

I compiled the source files successfully with BUILD_STRATEGY=latex and the eps extension
in the \includegraphics command.
If the extension is removed and I still have BUILD_STRATEGY=latex, compilation fails:
-----------------------------------------------------------
bash-3.2$ make
NOTE: You may ignore warnings about the following files:

     foo.d

Makefile:2597: foo.d: No such file or directory
= foo.tex --> foo.d foo.dvi.1st.make (0-1) =
make: *** No rule to make target `bar.eps.bb', needed by `foo.d'.  Stop.
-----------------------------------------------------------
I don't consider it a problem, though. The extension of the included file simply can
be adjusted according to the value of BUILD_STRATEGY.

I tried the new version of the Makefile with the beamer style and the compilation failed.
I probably should have started a new issue on the tracker... Anyways, the source files
and the log file are attached. Although make fails to build the beamer document, typing
"make" twice does the job.

Thanks!

Reported by viatcheslav.bugayov on 2011-04-27 16:16:01


shiblon commented 8 years ago
Changing status to "Started" to continue working on this.

I was able to get a bounding box created by doing the following, by the way (you can
try this in your Makefile.ini if you're feeling brave):

%.eps.bb: %.eps
        sed -e '/^%%EndComments/{' -e 'd' -e 'q' -e '}' -e '/^%%/p' -e 'd' $< > $@

I'm not at all sure about the beamer issue.   I'll look into that.

Reported by shiblon on 2011-04-27 18:39:55

shiblon commented 8 years ago
Thank you, the trick with "%.eps.bb: %.eps" rule in Makefile.ini works!

Reported by viatcheslav.bugayov on 2011-04-27 19:57:27

shiblon commented 8 years ago
I have added the eps.bb trick to the makefile, now.  I am currently looking at the beamer
problem.

Reported by shiblon on 2011-05-09 20:43:05

shiblon commented 8 years ago
OK - I looked at your make output (for beamer), and it appears that there is something
amiss in your source file.  I can't really tell from looking at that output, though.

Would you mind terribly if I closed this and we opened another issue for the beamer
stuff?  We can then attach logs, etc. there and the confusion will be a little less.
 :-)

Reported by shiblon on 2011-05-09 20:44:50

shiblon commented 8 years ago
Sure, lets close this issue and I will open a new beamer-related.

Reported by viatcheslav.bugayov on 2011-05-09 20:54:11