shiblon / latex-makefile

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

glossaries support #131

Closed shiblon closed 8 years ago

shiblon commented 8 years ago

Originally reported on Google Code with ID 118

I use the glossaries package in latex:

\usepackage{glossaries}
\begin{document}
\newglossaryentry{foo}{name=bla,description{spam spam spam}}
Use \gls{foo} to get spam.
\printglossery
\end{document}

This short tex-file doesn't complie with the latex-makefile-2.2.0-rc11. I'll get an
error:

$ make 
= main.glo --> main.gls =
!! Input index error (file = main.glo, line = 1):
   -- Unknown index keyword \glossaryentry.
make: *** [main.gls] Error 1

I found a solution that woks for me. I create a new target:

@@ -2672,12 +2672,18 @@
 # get index file dependencies from the logs.
 %.ind: %.idx
        $(QUIET)$(call echo-build,$<,$@)
        $(QUIET)$(call run-makeindex,$<,$@,$*.ilg)

 # Create the working glossary file out of my ist file
+%.gls:        %.glo %.tex %.ist
+      $(QUIET)$(call echo-build,$<,$@)
+      $(QUIET)$(call run-makeindex,$<,$@,$*.glg,-s $*.ist)
+
+
+# Create the glossary file
 %.gls: %.glo %.tex
        $(QUIET)$(call echo-build,$<,$@)
        $(QUIET)$(call run-makeindex,$<,$@,$*.glg,-s nomencl.ist)

 # Create the nomenclature file
 %.nls: %.nlo %.tex

Reported by sandroknauss on 2011-03-13 16:25:56

shiblon commented 8 years ago
I'm having a hard time reproducing this.  After fixing the missing \documentclass in
your example above, it still gives me the following errors in my log file.  Any thoughts?

./test.tex:4: You can't use `macro parameter character #' in horizontal mode.
\in@ #1#2->\def \in@@ ##1#1##
                             2##3\in@@ {\ifx \in@ ##2\in@false \else \in@tru...
l.4 ...{foo}{name=bla,description{spam spam spam}}
●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●
Sorry, but I'm not programmed to handle this case;
I'll just pretend that you didn't ask for it.
If you're in the wrong mode, you might be able to
return to the right one by typing `I}' or `I$' or `I\par'.

./test.tex:4: You can't use `macro parameter character #' in horizontal mode.
\in@ #1#2->\def \in@@ ##1#1##2##
                                3\in@@ {\ifx \in@ ##2\in@false \else \in@tru...
l.4 ...{foo}{name=bla,description{spam spam spam}}
●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●
Sorry, but I'm not programmed to handle this case;
I'll just pretend that you didn't ask for it.
If you're in the wrong mode, you might be able to
return to the right one by typing `I}' or `I$' or `I\par'.

./test.tex:4: Extra \else.
\XKV@s@tk@ys ...V@tkey ,}{,\XKV@na ,}\ifin@ \else●
                                                  \XKV@knftrue \KV@@sp@def \...
l.4 ...{foo}{name=bla,description{spam spam spam}}
●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●
I'm ignoring this; it doesn't match any \if.

./test.tex:4: Package xkeyval Error: `description{spam spam spam}' undefined in   

 families `glossentry'.

See the xkeyval package documentation for explanation.
Type  H <return>  for immediate help.
 ...●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●
●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●
l.4 ...{foo}{name=bla,description{spam spam spam}}
●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●
Try typing  <return>  to proceed.
If that doesn't work, type  X <return>  to quit.

./test.tex:4: Extra \fi.
\XKV@f@r ...two \else #2\expandafter \XKV@f@r \fi●
                                                  #1{#2}
l.4 ...{foo}{name=bla,description{spam spam spam}}
●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●
I'm ignoring this; it doesn't match any \if.

./test.tex:6: Undefined control sequence.
l.6 \printglossery
●●●●●●●●●●●●●●●●●●
The control sequence at the end of the top line
of your error message was never \def'ed. If you have
misspelled it (e.g., `\hobx'), type `I' and the correct
spelling (e.g., `I\hbox'). Otherwise just continue,
and I'll forget about whatever was undefined.

Package glossaries Warning: \makeglossaries hasn't been used,
the glossaries will not be updated.

Package glossaries Warning: No \printglossary or \printglossaries found.
This document will not have a glossary.

Reported by shiblon on 2011-03-15 13:50:41

shiblon commented 8 years ago
Sorry I wrote the code block too fast. And didn't actually tested this part. So now
I've written a complete example, that runs without an error.

Here without patch:

$ ls
gl-test.tex  Makefile

$ make
NOTE: You may ignore warnings about the following files:

     gl-test.d

Makefile:2476: gl-test.d: No such file or directory
= gl-test.tex --> gl-test.d gl-test.pdf.1st.make (0-1) =
= gl-test.glo --> gl-test.gls =
!! Input index error (file = gl-test.glo, line = 1):
   -- Unknown index keyword \glossaryentry.
make: *** [gl-test.gls] Error 1

adding patch for Makefile:
$ make clean

$ ls
gl-test.tex  Makefile

$ make
NOTE: You may ignore warnings about the following files:

     gl-test.d

Makefile:2476: gl-test.d: No such file or directory
= gl-test.tex --> gl-test.d gl-test.pdf.1st.make (0-1) =
= gl-test.glo --> gl-test.gls =
= gl-test.tex --> gl-test.pdf (1-2) =
Success!  Wrote 1 page, 13001 bytes to gl-test.pdf

Reported by sandroknauss on 2011-03-15 14:28:06

shiblon commented 8 years ago
Cool - it appears that your attachment is 0 bytes in size.  Empty file.  Maybe try again?

Reported by shiblon on 2011-03-15 14:50:12

shiblon commented 8 years ago
another try ;)

Reported by sandroknauss on 2011-03-15 15:11:37


shiblon commented 8 years ago
Very good.  This actually pointed to some other bugs I had in the dependencies.  Attached
is the new makefile - let me know if it works for you.

The changes are in r3158161c26f3.   I'll push out another version at some point in
the next few days, probably, meanwhile you can use the attached.

Reported by shiblon on 2011-03-15 16:32:31


shiblon commented 8 years ago
Jup works for me.

Reported by sandroknauss on 2011-03-15 16:49:10

shiblon commented 8 years ago
Uploading rc12 now.

Reported by shiblon on 2011-03-15 18:05:32