Merge pull request #2007 from gaelicWizard/plugin-latex

Plugin/LaTeX: 2009 was thirteen years ago
pull/1958/head
Noah Gorny 2022-01-09 01:11:41 +02:00 committed by GitHub
commit 1fd601db7f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 18 additions and 7 deletions

View File

@ -103,6 +103,7 @@ plugins/available/hub.plugin.bash
plugins/available/java.plugin.bash
plugins/available/jekyll.plugin.bash
plugins/available/jump.plugin.bash
plugins/available/latex.plugin.bash
plugins/available/less-pretty-cat.plugin.bash
plugins/available/man.plugin.bash
plugins/available/nginx.plugin.bash

View File

@ -1,9 +1,19 @@
cite about-plugin
about-plugin 'use mactex'
# shellcheck shell=bash
about-plugin 'add MacTeX to PATH'
_bash_it_plugin_latex_paths=(
# Standard locations
/usr/local/texbin
# MacOS locations
/Library/TeX/texbin
)
# add mactex to the path if its present
MACTEX_PATH=/usr/local/texlive/2009/bin/universal-darwin
if [[ -d $MACTEX_PATH ]]; then
pathmunge $MACTEX_PATH after
for _bash_it_plugin_latex_path in "${_bash_it_plugin_latex_paths[@]}"; do
if [[ -d "$_bash_it_plugin_latex_path/" ]]; then
pathmunge "$_bash_it_plugin_latex_path" after && break
fi
unset MACTEX_PATH
done
# Cleanup
unset "${!_bash_it_plugin_latex_@}"