Created
December 9, 2022 11:24
-
-
Save maksimil/20e3e7df74174b80e2cba901c2601a77 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env sh | |
buildroot="build" | |
srcroot="src" | |
filepath=$1 | |
filename=$(python3 -c " | |
import os | |
basename=os.path.basename(\"$filepath\") | |
print(os.path.splitext(basename)[0]) | |
") | |
dirname=$(python3 -c " | |
import os | |
dirname=os.path.dirname(\"$filepath\") | |
srcpath=os.path.relpath(dirname, \"$srcroot\") | |
print(os.path.join(srcpath, \"$filename\")) | |
") | |
builddir=$(printf "%s/%s" "$buildroot" "$dirname") | |
# pdffilename=$(printf "%s/%s.pdf" "$builddir" "$filename") | |
# creating the build dir | |
mkdir -p "$builddir" | |
# creating pdf file if it doesn't exist | |
# if [ ! -f "$pdffilename" ]; then | |
# touch "$pdffilename" | |
# fi | |
# start the latexmk | |
latexmk "$filepath" -pvc -pdf -outdir="$builddir" \ | |
-e '$pdf_previewer=q[evince %S];' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment