shiblon / latex-makefile

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

\usepackage[xindy]{glossary} causes infinite loop on build (fix included) #133

Closed shiblon closed 8 years ago

shiblon commented 8 years ago

Originally reported on Google Code with ID 120

Problem description:
 - If [xindy] option is selected for glossary/glossaries package, build ends up in
infinite loop. This is because makeindex doesn't support xindy index file format. Surprisingly
makeindex fails with return code 0 in this case, although it doesn't create the output
file. As the *.gls files are not generated, the cycle starts from the beginning during
next main latex/pdflatex pass.

 - The xindy indexer is the only choice for people wanting any non-ISO-8859-1 inputs
in glossaries (especially UTF8). 

Proposed fix:
 - One can easily check for xindy glossary alternative, as it creates additional files:
*.xdy
 - check attachment for quick-fix.

Reported by lukost on 2011-03-27 16:08:11


shiblon commented 8 years ago
Some questions about this patch (it looks fine overall):

- Did you want xindy or texindy?
- You are searching for the $* module, which is basically the % in %.gls.  Is that
what you wanted?
- You are calling the colorize function on $* also - I assume you meant to call it
on $4 (which is $*.glg), not $3?
- The log colorizing script colorizes the xindy:, but nothing following it on that
line.  Additionally, it lets every other line through uncolored.  I assume that you
wanted something more like the following:

$(SED) -e 's/^xindy:.*/$(C_ERROR)&$(C_RESET)/p' -e 'd' '$1'

This will output all lines that start with xindy:, colorize the entire line, print
that line, and not print any other lines.  Not knowing the xindy log file format, I
can't tell whether that's right, but it feels right to me.

Thoughts welcome.

Reported by shiblon on 2011-04-06 18:43:34

shiblon commented 8 years ago
It was kind of quick-fix, I know it could be better (but it works). As for the questions:
 - texindy is xindy with one more command line param. I think it is better to call
xindy, as it works on all my machines as opposed to texindy (something goes wrong with
gentoo's texlive+xindy).
 - $* is exactly what xindy requires. More precisely this would be % in %.tex, but
%.gls is still OK in typical cases.
 - My coloring is crapped. I don't know much about xindy error log format, as I never
got any error from xindy in latex->glossaries->xindy scenario. It seems however, that

 $(SED) -e 's/^xindy:.*/$(C_ERROR)&$(C_RESET)/p' -e 'd' '$1'
is OK (I used several flawed index files to check).

Thanks for suggestions.

Reported by lukost on 2011-04-06 19:00:52

shiblon commented 8 years ago
Super.  I've attached a file that contains the current patch candidate.  Will you let
me know if it works properly for you?

Reported by shiblon on 2011-04-06 19:14:36


shiblon commented 8 years ago
Doesn't work:

= praca.glo --> praca.gls =
/bin/sh: -c: line 0: syntax error near unexpected token `;'
/bin/sh: -c: line 0: `success=1; if ! xindy -q -o praca.gls -L english -C utf8 -I xindy
-M praca -t praca.glg praca.glo > /dev/null || egrep -q '^xindy:' praca.glg; then ;
rm -f -f 'praca.gls'; success=0; fi; [ "$success" = "1" ] && : || ! :;'
make: *** [praca.gls] Error 1

Reported by lukost on 2011-04-06 19:28:35

shiblon commented 8 years ago
Oops - typo.  Try this one.

Reported by shiblon on 2011-04-06 19:35:12


shiblon commented 8 years ago
RESULTS (tested pdflatex and dvi->ps->pdf):

Single glossary: OK
'faked' idx: coloring seems OK
Multiple glossaries (acronyms + custom defined): OK

Nice, thanks.

Reported by lukost on 2011-04-06 19:44:21

shiblon commented 8 years ago
Very good!  Marking as fixed.  It should come out in a download near you, real soon
now.

Reported by shiblon on 2011-04-06 19:48:31