From 6e70a46771d3b28edc80a88de22b98df47147dc1 Mon Sep 17 00:00:00 2001 From: Gregor Kleen Date: Tue, 19 Apr 2016 15:20:48 +0200 Subject: TeX preamble with listings & algorithms --- gup/pdf.gup | 2 +- preamble.tex | 20 ++++++++++++++++++++ shell.nix | 2 +- 3 files changed, 22 insertions(+), 2 deletions(-) create mode 100644 preamble.tex diff --git a/gup/pdf.gup b/gup/pdf.gup index f49ec39..7604813 100755 --- a/gup/pdf.gup +++ b/gup/pdf.gup @@ -3,6 +3,6 @@ gup -u ${2%.pdf}.md for i in 0 1; do - pandoc -t latex -o $2 -V "geometry=margin=2cm" -V "fontfamily=libertine" --listings --latex-engine=lualatex ${2%.pdf}.md >&2 + pandoc -t latex -o $2 -V "geometry=margin=2cm" -V "fontfamily=libertine" -H preamble.tex --listings --latex-engine=lualatex ${2%.pdf}.md >&2 done [[ -e $2 ]] && touch $2 diff --git a/preamble.tex b/preamble.tex new file mode 100644 index 0000000..3aeecda --- /dev/null +++ b/preamble.tex @@ -0,0 +1,20 @@ +\usepackage{listings} +\usepackage{algorithmic} +\usepackage{amsmath} + +\renewcommand{\algorithmicrequire}{\textbf{Input:}} +\renewcommand{\algorithmicensure}{\textbf{Output:}} + +\lstset{ +frame=tb, +numbers=left, +numberstyle=\tiny, +breaklines=true, +postbreak=\raisebox{0ex}[0ex][0ex]{\ensuremath{\color{red}\hookrightarrow\space}} +} + +\DeclareMathOperator{\Hom}{Hom} +%\DeclareMathOperator{\P}{\frak{P}} +%\DeclareMathOperator{\exp}{exp} +%\DeclareMathOperator{\ln}{ln} +\newcommand{\N}{\ensuremath{\mathbb{N}}} diff --git a/shell.nix b/shell.nix index a121ec4..2ba975c 100644 --- a/shell.nix +++ b/shell.nix @@ -14,7 +14,7 @@ pkgs.stdenv.mkDerivation rec { with p; [ yesod yesod-bin pandoc monad-par persistent-sqlite ])) (pkgs.texlive.combine { - inherit (pkgs.texlive) scheme-small libertine tipa cm-super context bussproofs mweights fontaxes backnaur enumitem varwidth beamer; + inherit (pkgs.texlive) scheme-small libertine tipa cm-super context bussproofs mweights fontaxes backnaur enumitem varwidth beamer ctablestack algorithms; }) ]; shellHook = '' -- cgit v1.2.3