shiblon / latex-makefile

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

Problem with glossaries package #169

Open shiblon opened 8 years ago

shiblon commented 8 years ago

Originally reported on Google Code with ID 156

Hi,

I tried using the latex-makefile with a document that uses the glossaries package (with
xindy). It works great, but only on a clean working directory. If I make a change to
the document the .gls file isn't regenerated, and the document is rendered with the
previous version's glossary. After doing a 'make clean' it works fine again.

Reported by haggai.eran on 2012-04-16 09:30:10

shiblon commented 8 years ago
I have the same problem with makeidx and indexes. The index file is not regenereated
after first run. When there are changes that touch also the index I have to do a make
clean.

Reported by TimMelzer on 2012-06-05 20:17:42

shiblon commented 8 years ago
I have also run into this problem. I think this might even be a duplicate of #158.

So, I have figured out that the .gls is only generated when it shows up in the .log.
This means that when something updates the glossary (e.g. when I change something in
\newglossaryentry in my case), the .glo is rebuilt but the .gls is not, because the
.gls already exists. Since there is no new dependency on the .gls, it never gets rebuilt.

I've looked at a few possible solutions.

(1) This Makefile copies the .glo before running latex. If the new and old files are
different, then it runs makeindex again.
http://etherlabmaster.hg.sourceforge.net/hgweb/etherlabmaster/etherlabmaster/raw-file/7920ca086e5c/doc/Makefile

(2) I did a hack myself to to ensure the .gls was rebuilt. Simply remove any existing
.gls at the top of the 1st.make rule:
%.$(build_target_extension).1st.make %.d %.aux %.aux.make %.fls: %.tex
    $(QUIET)$(RM) -f '$*.gls'

Of course, it now always builds the .gls, but that may not be so bad.

As an aside, I just discovered this project, and I like the approach. I was using latexmk,
but I also couldn't get it to rebuild the .gls.

Reported by sean.leather on 2012-07-14 17:46:53