43 lines
1.1 KiB
Perl
43 lines
1.1 KiB
Perl
$pdf_mode = 1;
|
|
$pdflatex =
|
|
q{lualatex -shell-escape -interaction=nonstopmode %O %S 2>&1 | perl -pe 's/(^!.*)/\e[1;31m$1\e[0m/; s/([Ww]arning)/\e[1;33m$1\e[0m/'};
|
|
$out_dir = "build";
|
|
$bibtex = "biber %O %S";
|
|
$pdf_previewer = "zathura %O %S";
|
|
|
|
# Color output: https://tex.stackexchange.com/questions/617572/is-it-possible-to-make-latexmk-ouput-with-color
|
|
{
|
|
no warnings 'redefine';
|
|
use Term::ANSIColor;
|
|
|
|
my $old_warn_running = \&main::warn_running;
|
|
|
|
sub color_warn_running {
|
|
print STDERR color('green');
|
|
$old_warn_running->(@_);
|
|
print STDERR color('reset');
|
|
}
|
|
|
|
my $old_failure = \&main::failure;
|
|
|
|
sub color_failure {
|
|
print STDERR color('bold red');
|
|
$old_failure->(@_);
|
|
print STDERR color('reset');
|
|
}
|
|
|
|
my $old_failure_msg = \&main::failure_msg;
|
|
|
|
sub color_failure_msg {
|
|
print STDERR color('bold red');
|
|
$old_failure_msg->(@_);
|
|
print STDERR color('reset');
|
|
}
|
|
|
|
if ( -t STDERR ) {
|
|
*main::warn_running = \&color_warn_running;
|
|
*main::failure = \&color_failure;
|
|
*main::failure_msg = \&color_failure_msg;
|
|
}
|
|
}
|