Skip to content

Instantly share code, notes, and snippets.

@OliverBrotchie
Created June 3, 2021 04:06
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save OliverBrotchie/647be03e9021b73e490174276f26ebed to your computer and use it in GitHub Desktop.
Save OliverBrotchie/647be03e9021b73e490174276f26ebed to your computer and use it in GitHub Desktop.
Autocompile and display a Groff document
/bin/sh
# Automatically compiles and views a pdf from Groff. [Requires Zathura, entr]
if [ $# -eq 0 ] || [ "$1" == "-h" ] ; then
echo "Usage: \$0 \$1"
echo " \$0 The name of the ms document you wish to autocompile."
echo " \$1 The name of the output."
exit
fi
[ -f $2 ] || touch $2
echo "Autocompiling and displaying $1!"
echo "$1" | entr sh -c 'refer references.bib "$1" | groff -ms "$1" -Tpdf > "$2"' . "$1" "$2" &
zathura $2
@OliverBrotchie
Copy link
Author

OliverBrotchie commented Jun 3, 2021

This command works fine but I get the following errors from Zathura (mupdf):

error: cannot recognize version marker
warning: trying to repair broken xref
warning: repairing PDF document
error: cannot tell in file
error: could not open document 

Can anyone help?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment