summary refs log tree commit diff
path: root/bin/latexmk
diff options
context:
space:
mode:
authorRobert Günzler <r@gnzler.io>2022-04-15 15:50:35 +0200
committerRobert Günzler <r@gnzler.io>2022-04-15 15:50:35 +0200
commit73bb00e4afea78f4f4b14c621300ec0912e6210e (patch)
treea548121bd2c4c5fd54e199f061d6b252d595410d /bin/latexmk
parent5251f51bf91cf8cecef4a553ac75bd3a0b2fc20d (diff)
bin/latexmk: detect main.tex
Diffstat (limited to 'bin/latexmk')
-rwxr-xr-xbin/latexmk10
1 files changed, 4 insertions, 6 deletions
diff --git a/bin/latexmk b/bin/latexmk
index c3b70d8..e56cadc 100755
--- a/bin/latexmk
+++ b/bin/latexmk
@@ -90,14 +90,12 @@ if [ -z "${once}" ]; then
 	trap '{ rm "${pidfile}"; }' EXIT
 fi
 
-if [ -z "$1" ]; then
+(
+	[ -f "$1" ] && printf "%s\n" "$1"
+	[ -z "$1" ] && [ -f main.tex ] && printf "main.tex\n"
 	if command -v fd >/dev/null 2>&1; then
 		fd -e tex -e cls -e jpg -e png -e svg . . 2>/dev/null
 	else
 		ls ./**/*.{tex,cls,jpg,png,svg} 2>/dev/null
 	fi
-
-else
-	[ -f "$1" ] && printf "%s\n" "$1"
-	ls ./*.{tex,cls,jpg,png,svg}
-fi | entr ${entr_args} -ns 'latexmk -R $0'
+) | entr ${entr_args} -ns 'latexmk -R $0'