72 lines
2.3 KiB
Perl
72 lines
2.3 KiB
Perl
# =====================================================================
|
|
# Custom latex make file to bew used with TexLive and Latexmk
|
|
# _ _ __ __ _ ______ ____
|
|
# | | __ _| |_ _____ _| \/ | |/ / _ \ / ___|
|
|
# | |/ _` | __/ _ \ \/ / |\/| | ' /| |_) | |
|
|
# | | (_| | || __/> <| | | | . \| _ <| |___
|
|
# |_|\__,_|\__\___/_/\_\_| |_|_|\_\_| \_\\____|
|
|
|
|
# main file to compile
|
|
# this is the entry point file
|
|
@default_files = ('main.tex');
|
|
|
|
# =====================================================================
|
|
# custom folders to store auxilary and build files inside
|
|
# so they don't clutter everything
|
|
|
|
# Move all axuiliary files to a separate directory, so they do not clutter up the project directory
|
|
$emulate_aux = 1;
|
|
$aux_dir = "build";
|
|
|
|
# Move the compiled files (and synctex) to a separate directory
|
|
$out_dir = 'build';
|
|
|
|
# command to compile and run
|
|
$pdflatex = 'pdflatex %O -interaction=nonstopmode -shell-escape %S';
|
|
|
|
# =====================================================================
|
|
# bibtex
|
|
|
|
# Specify the bibliography
|
|
$bibtex = 'bibtex %O %B';
|
|
$makeglossaries = 'makeglossaries %O %B';
|
|
|
|
# Continuous preview mode
|
|
$continuous_mode = 1;
|
|
|
|
# Set the program used to generate the PDF
|
|
# 1: pdflatex
|
|
# 2: postscript conversion, don't use this
|
|
# 3: dvi conversion, don't use this
|
|
# 4: lualatex
|
|
# 5: xelatex
|
|
$pdf_mode = 1;
|
|
|
|
# Keep auxiliary files
|
|
$clean_ext = " ";
|
|
|
|
# =====================================================================
|
|
# Custom dependency and function for nomencl package
|
|
# See: https://www.overleaf.com/learn/how-to/How_does_Overleaf_compile_my_project%3F
|
|
|
|
add_cus_dep("nlo", "nls", 0, "nlo2nls");
|
|
sub nlo2nls {
|
|
system("makeindex $_[0].nlo -s nomencl.ist -o $_[0].nls -t $_[0].nlg");
|
|
}
|
|
# =====================================================================
|
|
# custom dependency handling for glossaries
|
|
|
|
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;
|
|
}
|
|
|
|
# =====================================================================
|
|
# Silence warnings
|
|
$silent = 1; |