diff options
author | Vikas Kushwaha <dev@vikas.rocks> | 2024-11-21 13:30:52 +0530 |
---|---|---|
committer | Vikas Kushwaha <dev@vikas.rocks> | 2024-11-21 13:30:52 +0530 |
commit | 5c916d69d457101326803eb076a746060e3618cf (patch) | |
tree | d6fce3256eede1c1bf78fb6a1be75b9cc4b84cee /.local/bin/development/getcomproot |
Moved from github
Diffstat (limited to '.local/bin/development/getcomproot')
-rwxr-xr-x | .local/bin/development/getcomproot | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/.local/bin/development/getcomproot b/.local/bin/development/getcomproot new file mode 100755 index 0000000..16e946a --- /dev/null +++ b/.local/bin/development/getcomproot @@ -0,0 +1,14 @@ +#!/bin/bash + +# author: Luke Smith +# +# A helper script for LaTeX/groff files used by `compiler` and `opout`. +# The user can add the root file of a larger project as a comment as below: +# % root = mainfile.tex +# And the compiler script will run on that instead of the opened file. + +texroot="$(grep -i "^.\+\s*root\s*=\s*\S\+" "$1")" +texroot="${texroot##*=}" +texroot="${texroot//[\"\' ]}" + +[ -f "$texroot" ] && readlink -f "$texroot" || exit 1 |