scwrypts/zsh/latex/build-pdf
yage 96992e9344 v2.3.0
=====================================================================

--- New Scripts --------------------------

zsh )
  latex + latex template engine
   - latex/build-pdf
   - latex/cleanup
   - latex/create-new
   - latex/get-pdf
   - latex/open-pdf

  beta SQL script -- got tired of floating this; works, but only OK
   - db/run-sql/postgres

--- Changes ------------------------------

- Added 'math', 'basic', and 'times-new-roman' templates to latex
- Added 'readlink' to list of required coreutils
- Added __INPUT to read into a variable with prompt (zsh/utils/io)
- Added $EXECUTION_DIR to interact with the user's working directory

--- Bug Fixes ----------------------------

- subscwrypts no longer force stdout/stderr to tty
2022-08-09 21:51:31 -06:00

32 lines
730 B
Bash
Executable File

#!/bin/zsh
_DEPENDENCIES+=(
pdflatex
rg
)
_REQUIRED_ENV+=()
source ${0:a:h}/common.zsh
#####################################################################
PDFLATEX() {
[ ! $1 ] && __FAIL 1 'must provide filename'
local FILENAME=$(GET_MAIN_LATEX_FILENAME "$1")
local ARGS=(-interaction=nonstopmode)
ARGS+=("$FILENAME")
cd "$(dirname $FILENAME)"
__STATUS 'running compile (1/2)'
pdflatex ${ARGS[@]} \
|| __FAIL 2 'first compile failed (see above)'
__STATUS 'running compile (2/2)'
pdflatex ${ARGS[@]} >/dev/null 2>&1 \
|| __FAIL 3 'second compile failed :c'
__SUCCESS "created '$(echo $FILENAME | sed 's/\.[^.]*$/.pdf/')'"
}
#####################################################################
PDFLATEX $@