Update Makefile

This commit is contained in:
2025-08-16 10:47:34 +08:00
parent 3877bc44be
commit 64d655742d
+26 -2
View File
@@ -54,9 +54,9 @@ GREPSTR := " \|(\|)\|^submit\|^analysis\|_cache\|_freeze\|^site_libs\|^www"
all: local upload clean commit push
force: updrefbib check_git_status updvariable render
force: updextensions updrefbib check_git_status updvariable render fixtex
local: updrefbib check_git_status updvariable lazyrender
local: updextensions updrefbib check_git_status updvariable lazyrender fixtex
updmakefile:
@if [ "$(OS)" = "OSX" ] && [ "$(HOSTNAME)" = "max" ]; then \
@@ -91,6 +91,17 @@ updrefbib:
git commit -m "Update Ref.bib"; \
fi
updextensions:
@if [ ! -d "_extensions/drwater/dwms" ]; then \
mkdir -p _extensions && \
git clone https://git.drwater.net/quarto/drwater.git _extensions/drwater; \
else \
cd _extensions/drwater && git pull && cd -; \
fi
check_git_status:
@uncommitted=$$(git status --porcelain); \
if [ -n "$$uncommitted" ]; then \
@@ -123,6 +134,19 @@ lazyrender:
render:
@quarto render
fixtex:
@if [ -f "MS/SM.tex" ]; then \
echo "Fixing longtable formatting in SM.tex..."; \
$(SEDI) 's/\\end{longtable\*}/\\bottomrule\\noalign{}\n\\end{longtable*}/g' MS/SM.tex; \
echo "Compiling with xelatex..."; \
cd MS && xelatex SM.tex; \
echo "Moving PDF to www directory..."; \
mv SM.pdf ../www/MS/ && cd ..; \
echo "TeX fixes applied and document rebuilt."; \
else \
echo "MS/SM.tex not found. Operation skipped."; \
fi
commit:
@echo "提交修改(commit)..."; \
git add .; \