From 7ffd7604f8dd57a76858bc7cf5ef8eb077558500 Mon Sep 17 00:00:00 2001 From: Janis Hutz Date: Fri, 9 Jan 2026 15:04:22 +0100 Subject: [PATCH] Formatting: Update script --- latex/fmt/format.sh | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/latex/fmt/format.sh b/latex/fmt/format.sh index 01d4f11..378e501 100755 --- a/latex/fmt/format.sh +++ b/latex/fmt/format.sh @@ -1,25 +1,32 @@ #!/bin/sh if [ ! "$1" == "" ]; then - cp .latexindent.yaml "$1/" || true - cp latexindent.yaml "$1/" || true + cp .latexindent.yaml "$1/" || true + cp latexindent.yaml "$1/" || true cd $1 fi echo "Formatting directory $(pwd)" +if [ -f .latexindent.yaml ]; then + echo "latexindent config found" +elif [ -f latexindent.yaml ]; then + echo "latexindent config found" +else + echo "No latexindent config found. Using defaults" +fi files=$(find . -type f | grep "\.tex") idx=1 total=$(echo "$files" | wc -l) for file in $files; do - echo "Processing file $idx / $total" + echo "Processing file $idx / $total" latexindent -s -w -l $file - idx=$((idx + 1)) + idx=$((idx + 1)) done echo "Cleaning up..." backups=$(find . -type f | grep "\.bak") for backup in $backups; do - rm $backup + rm $backup done