Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
Download
5 views
ubuntu2404
# LaTeXmkrc configuration for SIAM article with PythonTeX
# Optimized for CoCalc environment

# Use pdflatex as the default engine
$pdf_mode = 1;
$dvi_mode = 0;
$ps_mode = 0;

# Enable shell escape for PythonTeX and other packages
$pdflatex = 'pdflatex -shell-escape -interaction=nonstopmode -file-line-error %O %S';

# Configure PythonTeX integration
add_cus_dep('pytxcode', 'tex', 0, 'pythontex');
sub pythontex {
    return system("pythontex \"$_[0]\"");
}

# Additional custom dependencies for PythonTeX
add_cus_dep('figpytx', 'figpytx', 0, 'pythontex');
add_cus_dep('makepytx', 'makepytx', 0, 'pythontex');
add_cus_dep('pytxpyg', 'pytxpyg', 0, 'pythontex');

# Clean up PythonTeX files
$clean_ext = "pytxcode figpytx makepytx pytxpyg pytxmcr";

# Output directory for auxiliary files (optional)
# $aux_dir = "build";

# Output directory for PDF (optional)
# $out_dir = "build";

# Maximum number of runs
$max_repeat = 5;

# Show CPU time used
$show_time = 1;

# Continue on errors (useful for development)
$force_mode = 1;

# Automatically view PDF after successful compilation
# Disabled by default in CoCalc environment
# $pdf_previewer = 'start evince %O %S';

# File extensions to watch for changes
@default_files = ('*.tex', '*.py', '*.bib');

# Don't delete intermediate files that might be useful
$cleanup_mode = 1;
$cleanup_includes_generated = 0;

# Configuration for better error handling
$failure_cmd = "echo 'Compilation failed. Check the log file for errors.'";
$success_cmd = "echo 'SIAM article compiled successfully with PythonTeX!'";

# Silence some warnings that are common in academic papers
$silent = 0;
$warnings_as_errors = 0;