# This shows how to use the glossary package 
# (http://www.ctan.org/pkg/glossary) and the glossaries package
# (http://www.ctan.org/pkg/glossaries) with latexmk.  Note that there
# are important differences between these two packages, so you should
# take careful note of the comments below.



# 1. For glossaries using glossary package

add_cus_dep( 'glo', 'gls', 0, 'makeglo2gls' );
sub makeglo2gls {
    system("makeindex -s \"$_[0].ist\" -t \"$_[0].glg\" -o \"$_[0].gls\" \"$_[0].glo\"" );
}



# 2. For acronyms using glossary package:

add_cus_dep( 'acr', 'acn', 0, 'makeacr2acn' );
sub makeacr2acn {
    system( "makeindex -s \"$_[0].ist\" -t \"$_[0].alg\" -o \"$_[0].acn\" \"$_[0].acr\"" );
}


# ===> 3. If you use the package glossaries rather than the package
# glossary, you need to EXCHANGE acn and acr in the above.

# 4. If you use the glossaries package and have the makeglossaries
#    script installed, then you can do something simpler:

   add_cus_dep( 'glo', 'gls', 0, 'makeglossaries' );
   sub makeglossaries {
      system( "makeglossaries \"$_[0]\"" );
   }

