#!/bin/sh if [ "$1" = "-h" ]; then cat <&2 Usage: ${0##*/} [OPTIONS] [FILES] LaTeX quick compiler. It adds the preambule and the "\end{document}" automatically. If no FILES are specified, use stdin. Options: -p PACKAGES: Use the comma separated list of packages. EOF exit fi [ "$1" = "--" ] && shift ## One line is mandatory. PREAMBLE='\documentclass[10pt,a4paper]{article}\usepackage[utf8]{inputenc}\usepackage[T1]{fontenc}\usepackage{amsmath,amssymb,amsfonts}\usepackage{geometry}\usepackage{lmodern}\usepackage{marvosym}\usepackage{textcomp}\DeclareUnicodeCharacter{20AC}{\EUR{}}\DeclareUnicodeCharacter{2264}{\leqslant}\DeclareUnicodeCharacter{2265}{\geqslant}' if [ "$1" = "-p" ]; then PACKAGES="\usepackage{$2}" shift 2 fi if [ $# -eq 0 ]; then buf="$(cat)" cat <