Skip to content

Instantly share code, notes, and snippets.

@genba
Last active December 14, 2015 14:49
Show Gist options
  • Save genba/5103530 to your computer and use it in GitHub Desktop.
Save genba/5103530 to your computer and use it in GitHub Desktop.
Utilities for compiling LaTeX documents: - Makefile - open.sh: Script to open a PDF file on either Linux or OS X after compiling with pdflatex
all: pdf2 bib pdf open
@#@echo -e "\aSe ha generado el PDF."
pdf:
pdflatex mi_documento
pdf2:
pdflatex mi_documento
pdflatex mi_documento
pdf3:
pdflatex mi_documento
pdflatex mi_documento
pdflatex mi_documento
bib: pdf2
bibtex mi_documento
open:
./open.sh mi_documento.pdf
clean:
-rm *.aux
-rm *.dvi
-rm *.m*
-rm *.out
-rm *.stc?
-rm *.toc
-rm *.lo?
cleanall: clean
-rm mi_documento.pdf
help:
@echo "make"
@echo "make all"
@echo "make pdf"
@echo "make pdf3"
@echo "make open"
@echo "make clean"
@echo "make cleanall"
#!/bin/sh
if [ "$(uname)" = "Darwin" ]; then
if [ -e "/usr/bin/open" ]; then
open -a Skim $1 # open PDF file with custom PDF viewer (in this case: Skim)
# open $1 # open PDF file with default PDF viewer (usually Preview.app)
fi
elif [ "$(uname)" = "Linux" ]; then
if [ -e "$(which gnome-open)" ]; then
gnome-open $1
fi
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment