yochju / latex-makefile

Automatically exported from code.google.com/p/latex-makefile
Other
0 stars 0 forks source link

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

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
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.

Original issue reported on code.google.com by luk...@gmail.com on 27 Mar 2011 at 4:08

Attachments:

GoogleCodeExporter commented 9 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.

Original comment by shiblon on 6 Apr 2011 at 6:43

GoogleCodeExporter commented 9 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.

Original comment by luk...@gmail.com on 6 Apr 2011 at 7:00

GoogleCodeExporter commented 9 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?

Original comment by shiblon on 6 Apr 2011 at 7:14

Attachments:

GoogleCodeExporter commented 9 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

Original comment by luk...@gmail.com on 6 Apr 2011 at 7:28

GoogleCodeExporter commented 9 years ago
Oops - typo.  Try this one.

Original comment by shiblon on 6 Apr 2011 at 7:35

Attachments:

GoogleCodeExporter commented 9 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.

Original comment by luk...@gmail.com on 6 Apr 2011 at 7:44

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

Original comment by shiblon on 6 Apr 2011 at 7:48