summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/doc/support/latexmk/example_rcfiles/glossary_latexmkrc
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2017-11-20 22:01:59 +0000
committerKarl Berry <karl@freefriends.org>2017-11-20 22:01:59 +0000
commit16db2735dd5c2cd2aa72643ed707730eb62e5bb1 (patch)
tree009a21f673192e806c3b4143d9ab932e371b5620 /Master/texmf-dist/doc/support/latexmk/example_rcfiles/glossary_latexmkrc
parent21337afd777f807a4932c5b0a106798dcfd9d626 (diff)
latexmk (20nov17)
git-svn-id: svn://tug.org/texlive/trunk@45867 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/doc/support/latexmk/example_rcfiles/glossary_latexmkrc')
-rw-r--r--Master/texmf-dist/doc/support/latexmk/example_rcfiles/glossary_latexmkrc32
1 files changed, 29 insertions, 3 deletions
diff --git a/Master/texmf-dist/doc/support/latexmk/example_rcfiles/glossary_latexmkrc b/Master/texmf-dist/doc/support/latexmk/example_rcfiles/glossary_latexmkrc
index 937df6f9e71..203a0a3fe72 100644
--- a/Master/texmf-dist/doc/support/latexmk/example_rcfiles/glossary_latexmkrc
+++ b/Master/texmf-dist/doc/support/latexmk/example_rcfiles/glossary_latexmkrc
@@ -31,6 +31,32 @@ sub makeacr2acn {
add_cus_dep( 'glo', 'gls', 0, 'makeglossaries' );
sub makeglossaries {
- system( "makeglossaries \"$_[0]\"" );
- }
-
+ my ($base_name, $path) = fileparse( $_[0] );
+ pushd $path;
+ my $return = system "makeglossaries $base_name";
+ popd;
+ return $return;
+ }
+
+# This code works around a problem with makeglossaries when the
+# -output-directory option of latexmk is used. When makeglossaries is
+# called with a filename that has a directory in it, e.g.,
+#
+# makeglossaries output/document
+#
+# the makeindex or xindy commmands look for a document.ist or
+# document.xdy file that is created by the glossaries package. The
+# file is correctly created in the output/ directory, but the
+# makeindex or xindy commands are called in way that they look for
+# that file in the document directory, not in the output directory.
+# So the above definition of a subroutine makeglossaries works around
+# that.
+#
+# Note that the 3rd definition of a custom dependency, the one that
+# invokes the makeglossaries script, has the advantage that it can
+# change automatically to use the xindy program instead of makeindex,
+# according to the setting by which the glossaries package is invoked
+# in the document. The first two solutions I gave for the custom
+# dependency have the choice of makeindex hard-coded (which can be
+# changed, of course). Automatic switching would need a more
+# complicated solution.