dotfiles

My personal shell configs and stuff
git clone git://git.alex.balgavy.eu/dotfiles.git
Log | Files | Refs | Submodules | README | LICENSE

commit 4097a0b9c5ff122ee94be912cff8184e32c7f9bf
parent e98967d6deff4939b0c1e3137f8811c766692bdc
Author: Alex Balgavy <alex@balgavy.eu>
Date:   Sat,  5 Dec 2020 19:51:37 +0100

Latex templates


Former-commit-id: 3f93b67a3de060a22a26a63e613d5acd01212dd7
Diffstat:
Alatex-templates/latex-paper/Makefile | 28++++++++++++++++++++++++++++
Alatex-templates/latex-paper/src/.projections.json | 4++++
Alatex-templates/latex-paper/src/background.tex | 2++
Alatex-templates/latex-paper/src/conclusion.tex | 2++
Alatex-templates/latex-paper/src/images/vrije-universiteit-amsterdam.png | 0
Alatex-templates/latex-paper/src/introduction.tex | 3+++
Alatex-templates/latex-paper/src/meta.tex | 11+++++++++++
Alatex-templates/latex-paper/src/numbers/sample.tex | 1+
Alatex-templates/latex-paper/src/references.bib | 7+++++++
Alatex-templates/latex-paper/src/related.tex | 2++
Alatex-templates/latex-paper/src/results.tex | 74++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Alatex-templates/latex-paper/src/thesis.tex | 60++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Alatex-templates/latex-paper/src/titlepage.tex | 50++++++++++++++++++++++++++++++++++++++++++++++++++
Alatex-templates/markdown-paper/Makefile | 8++++++++
Alatex-templates/markdown-paper/paper.md | 36++++++++++++++++++++++++++++++++++++
Alatex-templates/markdown-paper/references.bib | 8++++++++
16 files changed, 296 insertions(+), 0 deletions(-)

diff --git a/latex-templates/latex-paper/Makefile b/latex-templates/latex-paper/Makefile @@ -0,0 +1,28 @@ +LMK_AUXDIR=build +MAINFILE=src/thesis.tex + +LMK_FLAGS=-bibtex -cd -auxdir=$(LMK_AUXDIR) -outdir=$(LMK_AUXDIR) +SRCFILES=$(wildcard $(dir $(MAINFILE))*.tex) +PDFNAME:=$(basename $(notdir $(MAINFILE))).pdf + +.PHONY: all clean cleanall open + +all: $(PDFNAME) + +open: $(PDFNAME) + @open $(PDFNAME) || xdg-open $(PDFNAME) || echo "Don't know how to open." + + +$(PDFNAME): $(dir $(MAINFILE))$(LMK_AUXDIR)/thesis.pdf + mv $(dir $(MAINFILE))$(LMK_AUXDIR)/thesis.pdf ./$(PDFNAME) + +$(dir $(MAINFILE))$(LMK_AUXDIR)/thesis.pdf: $(SRCFILES) + latexmk $(LMK_FLAGS) -pdf $(MAINFILE) + +clean: + latexmk $(LMK_FLAGS) -c $(MAINFILE) + +cleanall: + latexmk $(LMK_FLAGS) -C $(MAINFILE) + rm ./src/numbers/* + rm ./$(PDFNAME) diff --git a/latex-templates/latex-paper/src/.projections.json b/latex-templates/latex-paper/src/.projections.json @@ -0,0 +1,4 @@ +{ + "references.bib": {"type": "bibliography"}, + "thesis.tex": {"type": "main"} +} diff --git a/latex-templates/latex-paper/src/background.tex b/latex-templates/latex-paper/src/background.tex @@ -0,0 +1,2 @@ +\section{Background Information} +Some background info. diff --git a/latex-templates/latex-paper/src/conclusion.tex b/latex-templates/latex-paper/src/conclusion.tex @@ -0,0 +1,2 @@ +\section{Conclusion} +And the conclusion. diff --git a/latex-templates/latex-paper/src/images/vrije-universiteit-amsterdam.png b/latex-templates/latex-paper/src/images/vrije-universiteit-amsterdam.png Binary files differ. diff --git a/latex-templates/latex-paper/src/introduction.tex b/latex-templates/latex-paper/src/introduction.tex @@ -0,0 +1,3 @@ +\section{Introduction} +The introduction. +And I'll cite someone here \cite{author2001}. diff --git a/latex-templates/latex-paper/src/meta.tex b/latex-templates/latex-paper/src/meta.tex @@ -0,0 +1,11 @@ +{ + \pagestyle{empty} + \hypersetup{ + linkcolor={black} + } + \tableofcontents + \listoffigures + \listoftables + \lstlistoflistings +} +\clearpage diff --git a/latex-templates/latex-paper/src/numbers/sample.tex b/latex-templates/latex-paper/src/numbers/sample.tex @@ -0,0 +1 @@ +42 diff --git a/latex-templates/latex-paper/src/references.bib b/latex-templates/latex-paper/src/references.bib @@ -0,0 +1,7 @@ +@article{author2001, + title={2001: A Space Odyssey}, + author={Clarke, Arthur C.}, + journal={Space Inc.}, + year={2001}, + publisher={Someone} +} diff --git a/latex-templates/latex-paper/src/related.tex b/latex-templates/latex-paper/src/related.tex @@ -0,0 +1,2 @@ +\section{Related Work} \label{sec:related work} +Related work is here. diff --git a/latex-templates/latex-paper/src/results.tex b/latex-templates/latex-paper/src/results.tex @@ -0,0 +1,74 @@ +\section{Results \& Evaluation} +\clearpage +This section has some results. + +Code listings are available, e.g. \autoref{code:sample}. + +\begin{lstlisting}[float=tb,caption={Some caption.}, label={code:sample}, language=C] +#include <stdio.h> +int main() { + printf("Hello World\n"); +} +\end{lstlisting} + +I can use subtables, like \autoref{tab:bigtable}. + +\begin{table}[tb] + \begin{subtable}[t]{\textwidth} + \centering + \begin{tabular}{l r | r } + & \multicolumn{2}{c}{\underline{Create}} \\ + Heading & Heading & Heading \\ + \hline \hline + Heading & \result{sample} & \result{sample} \\ + \end{tabular} + \caption{Some caption.} + \label{tab:subtable 1} + \end{subtable} + + \bigskip + + \begin{subtable}[t]{\textwidth} + \centering + \begin{tabular}{l r | r } + & \multicolumn{2}{c}{\underline{Create}} \\ + Heading & Heading & Heading \\ + \hline \hline + Heading & \result{sample} & \result{sample} \\ + \end{tabular} + \caption{Some caption.} + \label{tab:subtable 2} + \end{subtable} + + \bigskip + + \begin{subtable}[t]{\textwidth} + \centering + \begin{tabular}{l r | r } + & \multicolumn{2}{c}{\underline{Create}} \\ + Heading & Heading & Heading \\ + \hline \hline + Heading & \result{sample} & \result{sample} \\ + \end{tabular} + \caption{Some caption.} + \label{tab:subtable 3} + \end{subtable} + + \caption{It's a big table} + \label{tab:bigtable} +\end{table} + +Or simple tables, like \autoref{tab:smalltable}. + +\begin{table}[tb] + \centering + \begin{tabular}{l | r | r} + Heading & Heading & Heading \\ + \hline \hline + Row & \result{sample} & \result{sample} \\ + Row & \result{sample} & \result{sample} + \end{tabular} + \caption{Smaller table} + \label{tab:smalltable} +\end{table} +\clearpage diff --git a/latex-templates/latex-paper/src/thesis.tex b/latex-templates/latex-paper/src/thesis.tex @@ -0,0 +1,60 @@ +\documentclass[12pt,notitlepage,]{article} +\usepackage[a4paper, top=0.7in, left=0.7in, right=0.7in, bottom=0.7in]{geometry} +\usepackage[utf8]{inputenc} +\usepackage[english]{babel} +\usepackage{hyperref} +\usepackage{xcolor} +\hypersetup{ + colorlinks, + linkcolor={red!50!black}, + citecolor={blue!50!black}, + urlcolor={blue!80!black} +} +\usepackage{csquotes} +\usepackage{amsmath} +\usepackage{amssymb} +\usepackage{caption} +\usepackage{subcaption} +\captionsetup{width=0.8\textwidth,font+=it} + +\usepackage{listings} +\lstset{captionpos=b, frame=lines, xleftmargin=1em, framextopmargin=0.5em, framexbottommargin=0.5em, aboveskip=1em, belowskip=1em, linewidth=0.98\linewidth, basicstyle=\small} +\captionsetup[lstlisting]{justification=centering} + +\usepackage{graphicx} +\graphicspath{{images/}{diagrams/}} + +\usepackage{import} +\usepackage{xifthen} +\usepackage{pdfpages} +\usepackage{transparent} +\newcommand{\result}[1]{\input{numbers/#1}\unskip} + +\usepackage[style=ieee]{biblatex} +\addbibresource{references.bib} + +% To show overfull boxes: +\setlength{\overfullrule}{5pt} + +\def\theauthor{Author} +\def\thetitle{Title} +\def\thedate{\today} +\def\theinstitution{Institution Name} +\def\thesubject{Subject} + +\begin{document} + \input{titlepage} + + \begin{abstract} + This is the abstract. + \end{abstract} + + \input{meta} + \input{introduction} + \input{background} + \input{results} + \input{related} + \input{conclusion} + \printbibliography + +\end{document} diff --git a/latex-templates/latex-paper/src/titlepage.tex b/latex-templates/latex-paper/src/titlepage.tex @@ -0,0 +1,50 @@ +\begin{titlepage} + \newcommand{\HRule}{\rule{0.8\linewidth}{0.2mm}} + + \centering + + \vspace*{1em} + \textsc{\large \theinstitution}\\[1em] + + \includegraphics[width=0.45\textwidth]{vrije-universiteit-amsterdam.png} \\[2em] + + \vspace{4em} + \textsc{\Large \thesubject}\\ + \vspace{4em} + + \HRule\\[0.7cm] + + \begin{minipage}{0.75\textwidth} + \centering + \setlength{\baselineskip}{2em} + {\LARGE\bfseries \thetitle}\\[1em] + \vspace{1em} + \end{minipage} + + \HRule\\[1.5cm] + + {\Large \theauthor}\\ + \vspace{2em} + \begin{minipage}{0.72\textwidth} + \large + \centering + \begin{tabular}{ r l } + \textit{Supervisor:} & Supe \\ + \textit{First reader:} & Reader \\ + \textit{Second reader:} & Reader + \end{tabular} + \end{minipage} + + \vfill + \begin{minipage}{0.8\textwidth} + \centering + \textit{\large + Subtext. + } + \end{minipage} + + \vspace{2em} + {\large\today} + + \vspace{4em} +\end{titlepage} diff --git a/latex-templates/markdown-paper/Makefile b/latex-templates/markdown-paper/Makefile @@ -0,0 +1,8 @@ +FLAGS = -f markdown --citeproc +pdf = paper.pdf +src = paper.md + +all: $(pdf) + +$(pdf): $(src) + pandoc $(src) $(FLAGS) -o $(pdf) diff --git a/latex-templates/markdown-paper/paper.md b/latex-templates/markdown-paper/paper.md @@ -0,0 +1,36 @@ +--- +title: | + This is a multiline title... + ...and here's the second line! +subtitle: 'I''ve got a subtitle too.' +author: +- First author +- Second author + +fontsize: 12pt + +csl: https://raw.githubusercontent.com/citation-style-language/styles/master/apa.csl +bibliography: +- references.bib + +link-citations: true + +geometry: +- a4paper +- left=1in +- right=1in +- top=1in +- bottom=1in + +header-includes: + \usepackage{fancyhdr} + \pagestyle{fancyplain} + \rhead{\textit{Subject}} +--- +\maketitle + +I can also cite stuff, like this sample 'article' [@author2001]. + +# References +::: {#refs} +::: diff --git a/latex-templates/markdown-paper/references.bib b/latex-templates/markdown-paper/references.bib @@ -0,0 +1,7 @@ +@article{author2001, + title={2001: A Space Odyssey}, + author={Clarke, Arthur C.}, + journal={Space Inc.}, + year={2001}, + publisher={Someone} +}+ \ No newline at end of file