From 5c916d69d457101326803eb076a746060e3618cf Mon Sep 17 00:00:00 2001 From: Vikas Kushwaha Date: Thu, 21 Nov 2024 13:30:52 +0530 Subject: Moved from github --- .local/bin/development/getcomproot | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100755 .local/bin/development/getcomproot (limited to '.local/bin/development/getcomproot') 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 -- cgit v1.2.3