aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--.boilerplates/txt/md.md9
-rw-r--r--.boilerplates/txt/ms.ms19
-rw-r--r--.boilerplates/txt/tex.tex23
-rwxr-xr-x.scripts/boil2
-rwxr-xr-x.scripts/compile8
-rwxr-xr-x.scripts/preview12
-rw-r--r--packages.txt15
7 files changed, 84 insertions, 4 deletions
diff --git a/.boilerplates/txt/md.md b/.boilerplates/txt/md.md
new file mode 100644
index 0000000..a94ea2f
--- /dev/null
+++ b/.boilerplates/txt/md.md
@@ -0,0 +1,9 @@
+---
+title: "Awesome paper"
+date: \today
+author: "Marvin Borner"
+---
+
+# Abstract
+
+Writing a professional paper in latex can be hard and exhausting. If you write your paper in `markdown` with `Pandoc` though, you can easily write professional-looking papers with almost no effort!
diff --git a/.boilerplates/txt/ms.ms b/.boilerplates/txt/ms.ms
new file mode 100644
index 0000000..766ae3f
--- /dev/null
+++ b/.boilerplates/txt/ms.ms
@@ -0,0 +1,19 @@
+.TL
+Awesome paper
+.DA
+.AU
+Marvin Borner
+
+.AB
+Writing a professional paper in latex can be hard and exhausting. If you write your paper in
+.B groff
+with
+.B "ms macros"
+though, you can easily write professional-looking papers with almost no effort
+.B "and lightning speed"!
+.AE
+
+.NH
+Introduction
+.PP
+Good morning!
diff --git a/.boilerplates/txt/tex.tex b/.boilerplates/txt/tex.tex
new file mode 100644
index 0000000..9588fa4
--- /dev/null
+++ b/.boilerplates/txt/tex.tex
@@ -0,0 +1,23 @@
+\documentclass{article}
+\usepackage{graphicx}
+
+\begin{document}
+
+\title{Awesome paper}
+\author{Marvin Borner}
+
+\maketitle
+
+\begin{abstract}
+Writing a professional paper in latex can be hard and exhausting. It takes a long time to compile but it's just the best option if you need a flawless vectorized font with a specific instruction set.
+\end{abstract}
+
+\section{Introduction}
+Welcome back!
+
+\begin{equation}
+ \label{simple_equation}
+ \alpha = \sqrt{\beta}
+\end{equation}
+
+\end{document}
diff --git a/.scripts/boil b/.scripts/boil
index 906c59a..b111f9b 100755
--- a/.scripts/boil
+++ b/.scripts/boil
@@ -13,6 +13,8 @@ if [ "${mode}" = "clj" ]; then
lein new app "$name"
cp "$boilerplates/$mode/run" "$name"
rm -rf "$name/CHANGELOG.md" "$name/LICENSE" "$name/README.md" "$name/doc/"
+elif [ "${mode}" = "md" ] || [ "${mode}" = "tex" ] || [ "${mode}" = "ms" ]; then
+ cp "$boilerplates/txt/$mode.$mode" "$name.$mode"
else
cp -r "$boilerplates/$mode" "$name" || echo "Something went wrong"
fi
diff --git a/.scripts/compile b/.scripts/compile
index 41dd951..fec470c 100755
--- a/.scripts/compile
+++ b/.scripts/compile
@@ -1,18 +1,22 @@
#!/usr/bin/env sh
file=$(readlink -f "$1")
+dir=${file%/*}
base="${file%.*}"
ext="${file##*.}"
case "$ext" in
ms) preconv "$file" | refer -PS -e | groff -me -ms -kept -T pdf >"$base".pdf ;;
[0-9]) preconv "$file" | refer -PS -e | groff -mandoc -T pdf >"$base".pdf ;;
-md) lowdown -d nointem -e super "$file" -Tms | groff -T pdf -ms -kept >"$base".pdf ;;
+#md) lowdown -d nointem -e super "$file" -Tms | groff -t -mspdf -k -Kutf8 -T pdf >"$base".pdf ;;
+md) pandoc "$file" --pdf-engine=xelatex -V geometry:a4paper -V geometry:margin=2cm -V toc-title='Table of contents' -o "$base.pdf" ;;
+[rR]md) Rscript -e "rmarkdown::render('$file', quiet=TRUE)" ;;
+tex) pdflatex --output-directory "$dir" "$base" ;;
+sent) setsid -f sent "$file" 2>/dev/null ;;
h) sudo make install ;;
c) cc "$file" -o "$base" && "$base" ;;
py) python "$file" ;;
rs) cargo build ;;
go) go run "$file" ;;
-sent) setsid -f sent "$file" 2>/dev/null ;;
*) sed 1q "$file" | grep "^#!/" | sed "s/^#!//" | xargs -r -I % "$file" ;;
esac
diff --git a/.scripts/preview b/.scripts/preview
index 18173ec..43ef6f0 100755
--- a/.scripts/preview
+++ b/.scripts/preview
@@ -4,8 +4,18 @@ if [ -z "$1" ]; then exit 1; fi
basename="$(echo "$1" | sed 's/\.[^\/.]*$//')"
+wait_pdf() {
+ sleep 5 # Some start delay
+ while true; do
+ if ! pgrep -x "zathura" >/dev/null; then
+ rm -f "$basename".pdf
+ exit 0
+ fi
+ done
+}
+
case "$1" in
-*.tex | *.m[dse] | *.[rR]md | *.mom | *.[0-9]) compile "$1" && preview "$basename".pdf >/dev/null 2>&1 ;;
+*.tex | *.m[dse] | *.[rR]md | *.mom | *.[0-9]) compile "$1" && preview "$basename".pdf >/dev/null 2>&1 && wait_pdf & ;;
*.html) setsid -f "$BROWSER" "$basename".html >/dev/null 2>&1 ;;
*.sent) setsid -f sent "$1" >/dev/null 2>&1 ;;
*) setsid -f xdg-open "$1" >/dev/null 2>&1 ;;
diff --git a/packages.txt b/packages.txt
index 2758e3b..3cfc11b 100644
--- a/packages.txt
+++ b/packages.txt
@@ -164,6 +164,7 @@ otf-latin-modern
otf-latinmodern-math
pacman-contrib
pandoc
+pandoc-citeproc
papirus-icon-theme
patch
patchutils
@@ -185,6 +186,7 @@ python2-virtualenv
qemu
qemu-arch-extra
qutebrowser
+r
rclone
read-edid
ripgrep
@@ -207,8 +209,18 @@ sudo
sxiv
telegram-desktop
texinfo
-texlive-bin
+texlive-bibtexextra
texlive-core
+texlive-fontsextra
+texlive-formatsextra
+texlive-games
+texlive-humanities
+texlive-latexextra
+texlive-music
+texlive-pictures
+texlive-pstricks
+texlive-publishers
+texlive-science
the_silver_searcher
thunar
thunar-archive-plugin
@@ -217,6 +229,7 @@ thunar-volman
thunderbird
thunderbird-i18n-de
thunderbird-i18n-en-us
+tk
tmate
transmission-gtk
ttf-dejavu