-
-
Notifications
You must be signed in to change notification settings - Fork 1
/
latexmkrc
64 lines (55 loc) · 2.77 KB
/
latexmkrc
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
# https://mirrors.ctan.org/support/latexmk/example_rcfiles/glossaries_latexmkrc
# This shows how to use the glossaries package
# (http://www.ctan.org/pkg/glossaries) and the glossaries-extra package
# (http://www.ctan.org/pkg/glossaries-extra) with latexmk.
# N.B. There is also the OBSOLETE glossary package
# (http://www.ctan.org/pkg/glossary), which has some differences. See item 3.
# 1. If you use the glossaries or the glossaries-extra package, then you can use:
add_cus_dep( 'acn', 'acr', 0, 'makeglossaries' );
add_cus_dep( 'glo', 'gls', 0, 'makeglossaries' );
$clean_ext .= " acr acn alg glo gls glg";
sub makeglossaries {
my ($base_name, $path) = fileparse( $_[0] );
my @args = ( "-q", "-d", $path, $base_name );
if ($silent) { unshift @args, "-q"; }
return system "makeglossaries", "-d", $path, $base_name;
}
# 2. The above will tend to run makeglossaries more often than needed, since
# each out of date file will trigger the use of makeglossaries, even
# though makeglossaries makes all the glossaries. The following solution
# solves this, but at the expense of not having the convenience that
# makeglossaries can change how it makes the glossaries depending on the
# settings of the glossaries package.
# A better solution will need more advanced work.
#
# add_cus_dep( 'acn', 'acr', 0, 'makeglossaries' );
# add_cus_dep( 'glo', 'gls', 0, 'makeglossaries' );
# $clean_ext .= " acr acn alg glo gls glg";
#
# sub makeglossaries {
# my @args = ( "-s", "$_[0].ist", "-t", "$$Psource.ilg",
# "-o", $$Pdest, $$Psource );
# if ($silent) { unshift @args, "-q"; }
# return system "makeindex", @args;
# }
# 3. If you use the OBSOLETE glossary package, then you can do the following:
# (Note that the code lines are commented out to avoid trouble when this
# file is simply copied into a latexmkrc or this file is arranged to be
# read by latexmk, and one of the modern packages glossaries and
# glossaries-extra is used.)
## For the main glossary:
#add_cus_dep( 'glo', 'gls', 0, 'makeglo2gls' );
#sub makeglo2gls {
# system("makeindex -s \"$_[0].ist\" -t \"$_[0].glg\" -o \"$_[0].gls\" \"$_[0].glo\"" );
#}
## For acronyms:
##
## ===> WARNING: The code below is ONLY FOR PACKAGE glossary, NOT FOR
## glossaries and glossaries-extra. In the current glossaries and
## glossaries-extra packages the roles of the .acr and .acn files are
## exchanged compared with the old glossary package. Hence the the
## code below will fail with the more modern packages.
#add_cus_dep( 'acr', 'acn', 0, 'makeacr2acn' );
#sub makeacr2acn {
# system( "makeindex -s \"$_[0].ist\" -t \"$_[0].alg\" -o \"$_[0].acn\" \"$_[0].acr\"" );
#}