dotfiles/scripts/groff-compiler

23 lines
875 B
Bash
Executable file

#!/bin/sh
#
# Compiler script for groff
#
# [-k (preconv)] Convert encoding to something groff understands
# [-e (eqn)] Format equations for troff or MathML
# [-t (tbl)] Format tables for troff
# [-p (pic)] Compile pictures for troff or TeX
# [-G (grap)] Typesetting graphs (grap usually not installed by default)
# [-j (chem)] Chemical structure diagrams (messes up spacing!)
# Configuration
REFS="$HOME/Documents/bibliography" # Bibliography file
MAC="$HOME/.config/groff/" # Macros dir
GROMACS="-mspdf" # groff macros
PRE="-ketp" # Preprocessors
OUT="pdf" # Output format
# groff-img: Personal script, image manipulation
# soelim: Enable macros dir
# refer: Enable bibliography
groff-img "$1" | soelim -I "$MAC" | refer -p "$REFS" |
groff "$GROMACS" -T "$OUT" -U "$PRE"