-
Notifications
You must be signed in to change notification settings - Fork 4
/
.latexmkrc
47 lines (40 loc) · 1.28 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
# General Settings
################################################################################
# Set to use PDFLatex and change the viewer
# $pdflatex = 'pdflatex';
$pdf_mode = 1;
$postscript_mode = 0;
$dvi_mode = 0;
$pdf_previewer = 'xdg-open %S';
# Increase the max repeats (for makeglossaries)
$max_repeat = 9;
# Add auxlock to the cleanup list
push @generated_exts, 'auxlock', 'synctex.gz';
# Support for PGF/TikZ Externalization
################################################################################
# Add a few files to cleanup
push @generated_exts, 'figlist', 'ist', 'makefile', 'unq';
# On the initial run, %tikzexternalflag is set to an empty list (when
# it reads this .latexmkrc).
#
# %tikzexternalflag is then set after successfully running make.
our %tikzexternalflag = ();
$pdflatex = 'internal tikzpdflatex -shell-escape -synctex=1 %O %S %B';
sub tikzpdflatex {
our %externalflag;
my $n = scalar(@_);
my @args = @_[0 .. $n - 2];
my $base = $_[$n - 1];
system 'lualatex', @args;
# Exit with error on failure
if ($? != 0) {
return $?
}
if ( !defined $externalflag->{$base} ) {
$externalflag->{$base} = 1;
if ( -e "$base.makefile" ) {
system ("$make -j8 -f $base.makefile");
}
}
return $?;
}