-
Notifications
You must be signed in to change notification settings - Fork 4
/
latexmkrc
56 lines (49 loc) · 2.36 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
# vim: set ft=perl:
@default_files = ('report.tex');
$bibtex_use = 2;
$recorder = 1;
# output directory, the fold and subfold should be make before compile
$out_dir = "build";
$do_cd = 1;
# 1 for pdflatex, 5 for xelatex. By default, TexStudio using `latexmk -pdf -silent -synctex=1 %O %S`
$pdf_mode = 1;
$pdflatex = "xelatex -file-line-error --shell-escape -src-specials -synctex=1 -interaction=nonstopmode %O %S";
$xelatex = "xelatex -file-line-error --shell-escape -src-specials -interaction=nonstopmode %O %S";
# clear postfix for `latexmk -c`
$clean_ext = "synctex.gz acn acr alg aux bbl bcf blg brf fdb_latexmk glg glo ".
"gls idx ilg ind lof log lot out run.xml toc pdf thm toe ist ".
"%R-china* %R-english*";
# uncomment the following two line for auto compile, even if the formula is only half written
# $preview_continuous_mode = 1;
# $pdf_update_method = 0;
# making index
$makeindex = 'internal splitindex';
sub splitindex {
# Use splitindex instead of makeindex.
# The splitindex programe starts from an .idx file, makes a set of
# other .idx files for separate indexes, and then runs makeindex to
# make corresponding .ind files.
# However, it is possible that the document uses the splitindex
# package, but in a way compatible with the standard methods
# compatible with makeindex, i.e., with a single index and with the
# use of the \printindex command.
# Then we need to invoke makeindex.
# In addition, latexmk assumes that makeindex or its replacement makes
# an .ind file from an .idx file, and latexmk gives an error if it
# doesn't exist, we need to make an .ind file.
# Both problems are solved by running makeindex and then splitindex.
# Note: errors are returned by makeindex and splitindex for things
# like a missing input file. No error is returned for lines in an
# input file that are in an incorrect format; they are simply
# ignored. So no problem is caused by lines in the .idx file
# that are generated by splitindex in a format incompatible with
# makeindex.
my $ret1 = system( "makeindex", $$Psource);
my $ret2 = system( "splitindex", $$Psource);
return $ret1 || $ret2;
}
@cus_dep_list = (@cus_dep_list, "idx ind 0 makenomenclature");
sub makenomenclature {
system("splitindex $_[0] -- -s $_[0].ist");
}
@generated_exts = (@generated_exts, 'glo');