diff options
| author | Luke Smith <luke@lukesmith.xyz> | 2022-08-19 14:40:31 -0400 |
|---|---|---|
| committer | Luke Smith <luke@lukesmith.xyz> | 2022-08-19 14:40:31 -0400 |
| commit | cf0918452fe5fdc30793695b17e447e55b55a6fa (patch) | |
| tree | b7569c69c92859ad7c5ef455222dfd2f88ae9eb8 /.local/bin/getcomproot | |
| parent | 03bcbdb2efa8dbe0a0f7f198d58d3e3896618eb0 (diff) | |
| parent | b82b091d96447860decae6d8495d036b4abddaa0 (diff) | |
| download | eibhear-cf0918452fe5fdc30793695b17e447e55b55a6fa.tar.gz eibhear-cf0918452fe5fdc30793695b17e447e55b55a6fa.tar.zst eibhear-cf0918452fe5fdc30793695b17e447e55b55a6fa.zip | |
Merge branch 'ssnailed-patch-2'
Diffstat (limited to '.local/bin/getcomproot')
| -rwxr-xr-x | .local/bin/getcomproot | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/.local/bin/getcomproot b/.local/bin/getcomproot new file mode 100755 index 0000000..d34a2e4 --- /dev/null +++ b/.local/bin/getcomproot @@ -0,0 +1,12 @@ +#!/bin/bash + +# 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 |
