summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGregor Kleen <gkleen@yggdrasil.li>2016-04-19 15:20:48 +0200
committerGregor Kleen <gkleen@yggdrasil.li>2016-04-19 15:20:48 +0200
commit6e70a46771d3b28edc80a88de22b98df47147dc1 (patch)
tree36a57af96167a027f4700e0a98032caa51e90189
parentd11b37a10cefd4b9b739008df49f06978fdefc11 (diff)
downloaduni-6e70a46771d3b28edc80a88de22b98df47147dc1.tar
uni-6e70a46771d3b28edc80a88de22b98df47147dc1.tar.gz
uni-6e70a46771d3b28edc80a88de22b98df47147dc1.tar.bz2
uni-6e70a46771d3b28edc80a88de22b98df47147dc1.tar.xz
uni-6e70a46771d3b28edc80a88de22b98df47147dc1.zip
TeX preamble with listings & algorithms
-rwxr-xr-xgup/pdf.gup2
-rw-r--r--preamble.tex20
-rw-r--r--shell.nix2
3 files changed, 22 insertions, 2 deletions
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 @@
3gup -u ${2%.pdf}.md 3gup -u ${2%.pdf}.md
4 4
5for i in 0 1; do 5for i in 0 1; do
6 pandoc -t latex -o $2 -V "geometry=margin=2cm" -V "fontfamily=libertine" --listings --latex-engine=lualatex ${2%.pdf}.md >&2 6 pandoc -t latex -o $2 -V "geometry=margin=2cm" -V "fontfamily=libertine" -H preamble.tex --listings --latex-engine=lualatex ${2%.pdf}.md >&2
7done 7done
8[[ -e $2 ]] && touch $2 8[[ -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 @@
1\usepackage{listings}
2\usepackage{algorithmic}
3\usepackage{amsmath}
4
5\renewcommand{\algorithmicrequire}{\textbf{Input:}}
6\renewcommand{\algorithmicensure}{\textbf{Output:}}
7
8\lstset{
9frame=tb,
10numbers=left,
11numberstyle=\tiny,
12breaklines=true,
13postbreak=\raisebox{0ex}[0ex][0ex]{\ensuremath{\color{red}\hookrightarrow\space}}
14}
15
16\DeclareMathOperator{\Hom}{Hom}
17%\DeclareMathOperator{\P}{\frak{P}}
18%\DeclareMathOperator{\exp}{exp}
19%\DeclareMathOperator{\ln}{ln}
20\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 {
14 with p; [ yesod yesod-bin pandoc monad-par persistent-sqlite 14 with p; [ yesod yesod-bin pandoc monad-par persistent-sqlite
15 ])) 15 ]))
16 (pkgs.texlive.combine { 16 (pkgs.texlive.combine {
17 inherit (pkgs.texlive) scheme-small libertine tipa cm-super context bussproofs mweights fontaxes backnaur enumitem varwidth beamer; 17 inherit (pkgs.texlive) scheme-small libertine tipa cm-super context bussproofs mweights fontaxes backnaur enumitem varwidth beamer ctablestack algorithms;
18 }) 18 })
19 ]; 19 ];
20 shellHook = '' 20 shellHook = ''