Latexmk: This is Latexmk, John Collins, 10 September 2009, version: 4.10d. **** Report bugs etc to John Collins <collins at phys.psu.edu>. **** Latexmk: applying rule 'cusdep glo gls bug2'... Rule 'cusdep glo gls bug2': File changes, etc: Non-existent destination files: 'bug2.gls' ------------ Run number 1 of rule 'cusdep glo gls bug2' ------------ For rule 'cusdep glo gls bug2', running '&do_cusdep( makeglossaries )' ... added glossary type 'main' (glg,gls,glo) Warning: File 'bug2.glo' is empty. Have you used any entries defined in glossary 'main'? *** Skipping glossary 'main'. *** Latexmk: In running custom-dependency rule to make 'bug2.gls' from 'bug2.glo' function 'makeglossaries' did not make the destination. Latexmk: Errors, so I did not complete making targets Collected error summary (may duplicate other messages): cusdep glo gls bug2: Run of rule 'cusdep glo gls bug2' gave a non-zero error code Latexmk: Did not finish processing file: Run of rule 'cusdep glo gls bug2' gave a non-zero error code Latexmk: Use the -f option to force complete processing.
> > Example: > > \documentclass{article} > \usepackage{glossaries} > \makeglossaries > \begin{document} > \printglossaries > abcd > \end{document} > > latexmk (4.10d) is configured to have: > > add_cus_dep('glo', 'gls', 0, 'makeglossaries'); > > Now run latexmk on the example: > > Latexmk: This is Latexmk, John Collins, 10 September 2009, version: 4.10d. > **** Report bugs etc to John Collins <collins at phys.psu.edu>. **** > Latexmk: applying rule 'cusdep glo gls bug2'... > Rule 'cusdep glo gls bug2': File changes, etc: > Non-existent destination files: > 'bug2.gls' > ------------ > Run number 1 of rule 'cusdep glo gls bug2' > ------------ > For rule 'cusdep glo gls bug2', running '&do_cusdep( makeglossaries )' > ... > added glossary type 'main' (glg,gls,glo) > Warning: File 'bug2.glo' is empty. > Have you used any entries defined in glossary 'main'? > *** Skipping glossary 'main'. *** > Latexmk: In running custom-dependency rule > to make 'bug2.gls' from 'bug2.glo' > function 'makeglossaries' did not make the destination. > > How to resolve this?
The problem is that the current version of the makeglossaries program does not produce an output file when the .glo file is empty. Latexmk assumes that non-existence of an output file in such a situation is an error (which would normally be sensible). You can overcome this by defining latexmk's custom dependency for glossaries in the following way to make an empty .gls file:
add_cus_dep('glo', 'gls', 0, 'makeglossaries');
sub makeglossaries { system "makeglossaries $_[0]"; if ( -z "$_[0].glo" ) { print "Latexmk: Empty glo file, I am making dummy gls file\n"; open GLS, ">$_[0].gls"; close GLS; } return 0; }
> The problem is that the current version of the makeglossaries program > does not produce an output file when the .glo file is empty. Latexmk > assumes that non-existence of an output file in such a situation is an > error (which would normally be sensible). You can overcome this by > defining latexmk's custom dependency for glossaries in the following > way to make an empty .gls file:
> add_cus_dep('glo', 'gls', 0, 'makeglossaries');
> sub makeglossaries { > system "makeglossaries $_[0]"; > if ( -z "$_[0].glo" ) { > print "Latexmk: Empty glo file, I am making dummy gls file\n"; > open GLS, ">$_[0].gls"; > close GLS; > } > return 0; > }
Leo wrote: > Do you think this is better fixed in glossaries?
Why is the gls file empty? If it's because you've not used the main glossary, then use the package option "nomain". If you are using the main glossary then the gls file ought not to be empty.
> Leo wrote: >> Do you think this is better fixed in glossaries?
> Why is the gls file empty? If it's because you've not used the main > glossary, then use the package option "nomain". If you are using the > main glossary then the gls file ought not to be empty.
> Regards > Nicola Talbot
I don't know exactly what's going on. However, compiling this example:
In article <m0r5shvsdc....@cam.ac.uk>, Leo <sdl....@gmail.com> wrote: > On 2009-11-02 14:21 +0000, Nicola Talbot wrote: > > Leo wrote: > >> Do you think this is better fixed in glossaries?
> > Why is the gls file empty? If it's because you've not used the main > > glossary, then use the package option "nomain". If you are using the > > main glossary then the gls file ought not to be empty.
> > Regards > > Nicola Talbot
> I don't know exactly what's going on. However, compiling this example:
My complete dependencies for the gloassary+glossaries package are simple use of makeindex rather than the makeglossaries script:
# ************ # Custom dependency for glossary/glossaries package # if you make custom glossaries you may have to add items to the @cus_dep_list and corresponding sub-routines add_cus_dep('glo', 'gls', 0, 'makeglo2gls'); sub makeglo2gls { system("makeindex -s '$_[0]'.ist -t '$_[0]'.glg -o '$_[0]'.gls '$_[0]'.glo"); } # The glossaries package, with the [acronym] option, produces a .acn file when processed with (xe/pdf)latex and # then makeindex to process the .acn into .acr and finally runs of (xe/pdf)latex to read in the .acr file. Unfortunately # the glossary package does just the reverse; i.e. (xe/pdf)latex processing produces a .acr files and makeindex then # is used to convert the .acr file to a .acn file which is then ... . This dependency assumes the glossaries package. add_cus_dep('acn', 'acr', 0, 'makeacn2acr'); sub makeacn2acr { system("makeindex -s '$_[0]'.ist -t '$_[0]'.alg -o '$_[0]'.acr '$_[0]'.acn"); } # for glossary package (Sigh...) --- they can co-exist! add_cus_dep('acr', 'acn', 0, 'makeacr2acn'); sub makeacr2acn { system("makeindex -s '$_[0]'.ist -t '$_[0]'.alg -o '$_[0]'.acn '$_[0]'.acr"); } # example of an added custom glossary type that is used in some of the glossary/glossaries example files: # this is for the new glossary type command \newglossary[nlg]{notation}{not}{ntn}{Notation} from the glossaries package # NOTE: the glossary package uses a very different command: the <in-ext> and <out-ext> # are reversed in the calling sequence :-( add_cus_dep('ntn', 'not', 0, 'makentn2not'); sub makentn2not { system("makeindex -s '$_[0]'.ist -t '$_[0]'.nlg -o '$_[0]'.not '$_[0]'.ntn"); } # for the glossary package (Sigh...) --- they can co-exist! add_cus_dep('not', 'ntn', 0, 'makenot2ntn'); sub makenot2ntn { system("makeindex -s '$_[0]'.ist -t '$_[0]'.nlg -o '$_[0]'.ntn '$_[0]'.not"); } # ************
Nicola Talbot wrote: > Leo wrote: >> Do you think this is better fixed in glossaries?
> Why is the gls file empty? If it's because you've not used the main > glossary, then use the package option "nomain". If you are using the > main glossary then the gls file ought not to be empty.
It's because the user used no glossary entries. Here's a test document:
This could quite typical in the early stages of writing a document. The author wishes to use a glossary, but has not yet written the parts of the document using the glossary entries. In that case the glo file is empty. Running makeindex gives an empty gls file, which as far as I can see is exactly correct for the situation of no uses of glossary entries. The next run of latex/pdflatex will have no glossary in the output file.
Unfortunately, the makeglossaries script (v. 1.6 and later) does not run makeindex in that situation. Then either (a) there is no gls file at all, or (b) the gls file is one left over from a previous run, which is now out of date, and therefore definitively wrong.
The original poster can change that by deleting the following lines in the makeglossaries script:
# v1.6 added file empty test if (-z $inputfile) { print "Warning: File '$inputfile' is empty.\n", "Have you used any entries defined in glossary '$type'?\n", "*** Skipping glossary '$type'. ***\n"; next; }
As far as my own simple testing are concerned, it seems to have no adverse effect.
> My complete dependencies for the gloassary+glossaries package are simple > use of makeindex rather than the makeglossaries script:
> ...
> and I had no problem compiling using latexmk.
That's because in the custom dependency rules you defined for latexmk, makeindex is run unconditionally. But the OP's custom dependencies used an invocation of makeglossaries instead. As I noted in my previous message, makeglossaries does not run makeindex when the glo file has zero length. This caused the reported problem.
Herbert Schulz wrote: > In article <m0r5shvsdc....@cam.ac.uk>, Leo <sdl....@gmail.com> wrote:
>> On 2009-11-02 14:21 +0000, Nicola Talbot wrote: >>> Leo wrote: >>>> Do you think this is better fixed in glossaries? >>> Why is the gls file empty? If it's because you've not used the main >>> glossary, then use the package option "nomain". If you are using the >>> main glossary then the gls file ought not to be empty.
> ...
> My complete dependencies for the gloassary+glossaries package are simple > use of makeindex rather than the makeglossaries script:
John Collins wrote: >> My complete dependencies for the gloassary+glossaries package are >> simple use of makeindex rather than the makeglossaries script:
> To make this clear, Herb
My error. Ignore that. I hit the Send button on an incomplete draft.
> > My complete dependencies for the gloassary+glossaries package are simple > > use of makeindex rather than the makeglossaries script:
> > ...
> > and I had no problem compiling using latexmk.
> That's because in the custom dependency rules you defined for latexmk, > makeindex is run unconditionally. But the OP's custom dependencies used an > invocation of makeglossaries instead. As I noted in my previous message, > makeglossaries does not run makeindex when the glo file has zero length. > This caused the reported problem.
> John Collins
Howdy,
I realize that. I wonder if there is a problem with unconditionally running makeindex? It certainly doesn't run into this kind of problem.
>> That's because in the custom dependency rules you defined for latexmk, >> makeindex is run unconditionally. But the OP's custom dependencies used an >> invocation of makeglossaries instead. As I noted in my previous message, >> makeglossaries does not run makeindex when the glo file has zero length. >> This caused the reported problem.
> I realize that. I wonder if there is a problem with unconditionally > running makeindex?
I don't think so. When there are entries in the input (idx or glo) file, makeindex makes an output file (ind or gls) containing the whole index. When the input has no entries, the output file is empty.
In the source document, the \printindex or \printglossary command inputs the ind or gls file. As long as this file contains valid LaTeX, there should be no problem.
John Collins wrote: > Nicola Talbot wrote: >> Why is the gls file empty? If it's because you've not used the main >> glossary, then use the package option "nomain". If you are using the >> main glossary then the gls file ought not to be empty.
> It's because the user used no glossary entries. Here's a test document:
> This could quite typical in the early stages of writing a document. The > author wishes to use a glossary, but has not yet written the parts of > the document using the glossary entries. In that case the glo file is > empty. Running makeindex gives an empty gls file, which as far as I can > see is exactly correct for the situation of no uses of glossary > entries.
makeindex may produce an empty gls file, but xindy doesn't. Change the second line in the above example to:
\usepackage[xindy]{glossaries}
then the xindy run will create a gls file containing:
If "theglossary" is a list environment (such as "description") this will cause a LaTeX empty list error, which is why I put in the test for an empty file. I'll change the code in makeglossaries to just create an empty gls file if the glo file is empty without calling makeindex/xindy.
> The problem is that the current version of the makeglossaries program > does not produce an output file when the .glo file is empty. Latexmk > assumes that non-existence of an output file in such a situation is an > error (which would normally be sensible). You can overcome this by > defining latexmk's custom dependency for glossaries in the following > way to make an empty .gls file:
> add_cus_dep('glo', 'gls', 0, 'makeglossaries');
> sub makeglossaries { > system "makeglossaries $_[0]"; > if ( -z "$_[0].glo" ) { > print "Latexmk: Empty glo file, I am making dummy gls file\n"; > open GLS, ">$_[0].gls"; > close GLS; > } > return 0; > }