From 8efc57cbebe8f47cd93b8aeb286523bc26cd1e79 Mon Sep 17 00:00:00 2001 From: Mark Date: Mon, 20 Jan 2025 11:18:59 -0800 Subject: [PATCH] tweaks --- .editorconfig | 6 +++++- build.sh | 38 ++++++++++++++------------------------ 2 files changed, 19 insertions(+), 25 deletions(-) diff --git a/.editorconfig b/.editorconfig index 2b4f594..a925523 100644 --- a/.editorconfig +++ b/.editorconfig @@ -6,4 +6,8 @@ indent_size = 4 end_of_line = lf charset = utf-8 trim_trailing_whitespace = true -insert_final_newline = false \ No newline at end of file +insert_final_newline = false + +[*.yml] +indent_style = space +indent_size = 2 \ No newline at end of file diff --git a/build.sh b/build.sh index afe0f93..aac5dd6 100755 --- a/build.sh +++ b/build.sh @@ -4,23 +4,19 @@ # (handout and solutions, if they exist), and creates # a zip of all resulting files. - - # Where we're running this script run_dir=$(pwd) +tectonic=$(pwd)/tectonic + # Output files target_dir="${run_dir}/output" target_zip="${run_dir}/output.zip" - - - # Clean up previous build rm -drf "${target_dir}" rm -f "${target_zip}" - # Build one document. # Args: # target_dir: move output pdf to this directory @@ -38,12 +34,12 @@ function build() { tectonic_args=( --chatter minimal - --web-bundle "https://static.betalupi.com/tectonic/texlive2023.tar" + #--web-bundle "https://static.betalupi.com/tectonic/texlive2023.tar" ) # Build handout - echo "\\def\\argNoSolutions{1}\\input{${main_file}}" | \ - tectonic \ + echo "\\def\\argNoSolutions{1}\\input{${main_file}}" | + "${tectonic}" \ "${tectonic_args[@]}" \ --outfmt pdf \ - @@ -60,10 +56,9 @@ function build() { echo "" fi - # Build solutions - echo "\\def\\argYesSolutions{1}\\input{${main_file}}" | \ - tectonic \ + echo "\\def\\argYesSolutions{1}\\input{${main_file}}" | + "${tectonic}" \ "${tectonic_args[@]}" \ --outfmt pdf \ - @@ -88,7 +83,6 @@ function build() { echo "" - if [[ $handout_stat == 0 ]]; then ( echo -n "{" @@ -105,18 +99,15 @@ function build() { echo -n "\"starred\": false" fi echo -n "}," - ) >> "$target_dir/index.json" + ) >>"$target_dir/index.json" fi cd "${run_dir}" } - mkdir -p "${target_dir}" -echo -n "[" > "$target_dir/index.json" +echo -n "[" >"$target_dir/index.json" - - -for d in "${run_dir}/Misc/Warm-Ups"/*.tex ; do +for d in "${run_dir}/Misc/Warm-Ups"/*.tex; do file="$(basename "${d}")" build \ "${target_dir}/Warm-Ups" \ @@ -125,7 +116,7 @@ for d in "${run_dir}/Misc/Warm-Ups"/*.tex ; do "${file}" done -for d in "${run_dir}/Advanced"/*/ ; do +for d in "${run_dir}/Advanced"/*/; do doc_dir=$(realpath "${d}") job_name="$(basename "${doc_dir}")" @@ -136,7 +127,7 @@ for d in "${run_dir}/Advanced"/*/ ; do "main.tex" done -for d in "${run_dir}/Intermediate"/*/ ; do +for d in "${run_dir}/Intermediate"/*/; do doc_dir=$(realpath "${d}") job_name="$(basename "${doc_dir}")" @@ -147,11 +138,10 @@ for d in "${run_dir}/Intermediate"/*/ ; do "main.tex" done -echo -n "{}]" >> "$target_dir/index.json" - +echo -n "{}]" >>"$target_dir/index.json" # cd so paths in zip are relative cd "${target_dir}" zip -FSr "${target_zip}" . -zip -d "${target_zip}" "index.json" # We don't need this in the zip \ No newline at end of file +zip -d "${target_zip}" "index.json" # We don't need this in the zip