-
Notifications
You must be signed in to change notification settings - Fork 0
/
.latexmkrc
44 lines (38 loc) · 1.44 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
system ("mkdir -p build/figures");
@default_files = ('report.tex');
@cus_dep_list = (@cus_dep_list, "glo gls 0 makenomenclature");
sub makenomenclature {
system("makeindex $_[0].glo -s nomencl.ist -o $_[0].gls"); }
@generated_exts = (@generated_exts, 'glo');
# Custom dependency and function for nomencl package
add_cus_dep( 'nlo', 'nls', 0, 'makenlo2nls' );
sub makenlo2nls {
system( "makeindex -s nomencl.ist -o \"$_[0].nls\" \"$_[0].nlo\"" );
}
$out_dir = 'build';
$pdflatex = 'xelatex --synctex=1 -interaction=nonstopmode --shell-escape';
$latex = 'latex --synctex=1 -interaction=nonstopmode --shell-escape';
$clean_ext .= " pythontex-files-%R/* pythontex-files-%R";
push @generated_exts, 'pytxcode';
$pythontex = 'pythontex %O %S';
$extra_rule_spec{'pythontex'} = [ 'internal', '', 'mypythontex', "%Y%R.pytxcode", "%Ypythontex-files-%R/%R.pytxmcr", "%R", 1 ];
sub mypythontex {
my $result_dir = $aux_dir1."pythontex-files-$$Pbase";
my $ret = Run_subst( $pythontex, 2 );
rdb_add_generated( glob "$result_dir/*" );
open( my $fh, "<", $$Pdest );
if ($fh) {
while (<$fh>) {
if ( /^%PythonTeX dependency:\s+'([^']+)';/ ) {
print "Found pythontex dependency '$1'\n";
rdb_ensure_file( $rule, $aux_dir1.$1 );
}
}
undef $fh;
}
else {
warn "mypythontex: I could not read '$$Pdest'\n",
" to check dependencies\n";
}
return $ret;
}