From ffb4ba12edcfeed1baed9eedb390b12f6b940bcb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Christoffer=20M=C3=BCller=20Madsen?= Date: Wed, 23 Nov 2016 22:48:44 +0100 Subject: [PATCH] improved handin template --- handin/handin.md | 29 ++++++++++++++------------- handin/makefile | 12 ++++++++++-- handin/template.tex | 48 +++++++++++++++++++++++++++++++++++---------- 3 files changed, 63 insertions(+), 26 deletions(-) diff --git a/handin/handin.md b/handin/handin.md index 48b75d9..98d4840 100644 --- a/handin/handin.md +++ b/handin/handin.md @@ -1,26 +1,27 @@ --- -course: Concurrency -title: Threaded Prime Number Counting -author_name: Christoffer Müller Madsen -author_group: DA3 -author_id: 201506991 +course: +title: +subtitle: +author_name: +author_group: +author_id: +lang: danish # Settings -# mainfont: Linux Libertine +mainfont: Linux Libertine # mainfont: Iowan Old Style -mainfont: Times New Roman -altfont: Helvetica Neue -monofont: Courier -lang: english +#mainfont: Times New Roman +#altfont: Helvetica Neue +altfont: Linux Biolinum +#monofont: Courrier +monofont: DejaVu Sans Mono fontsize: 10pt -geometry: a4paper, left=25mm, right=25mm, top=30mm, bottom=30mm -parskip: 0.8em +geometry: a4paper, left=20mm, right=20mm, top=30mm, bottom=30mm +parskip: 0.6em parindent: 0em -secspacingdiff: 0em multicol: true columns: 2 columnsep: 0.8cm # customdate: YYYY-MM-DD --- -Text goes here \ No newline at end of file diff --git a/handin/makefile b/handin/makefile index 25b19dc..2b85f18 100644 --- a/handin/makefile +++ b/handin/makefile @@ -1,10 +1,18 @@ TEX = pandoc -src = template.tex handin.md +texsrc = template.tex handin.md +src = output.pdf FLAGS = --latex-engine=xelatex +pdfname = $(shell basename $(CURDIR)) -output.pdf : $(src) +package: $(src) + mkdir -p output + cp $(src) output/ + mv output/output.pdf output/$(pdfname) + +output.pdf : $(texsrc) $(TEX) $(filter-out $<,$^ ) -o $@ --template=$< $(FLAGS) .PHONY: clean clean : rm output.pdf + rm -R output diff --git a/handin/template.tex b/handin/template.tex index e10a67f..c291b80 100644 --- a/handin/template.tex +++ b/handin/template.tex @@ -4,6 +4,7 @@ %\documentclass[$fontsize$, a4paper]{article} \documentclass[$fontsize$, a4paper, headings=small, markcase=upper]{scrartcl} \usepackage{fontspec} +\usepackage{amsmath} % KOMASCRIPT %-------------------------------- @@ -53,11 +54,21 @@ $endif$ % Header and footer \usepackage[headsepline,automark]{scrlayer-scrpage} \pagestyle{scrheadings} -\ihead{$course$ - $title$} +\ihead{$course$ - $title$$if(subtitle)$ - $subtitle$$endif$} \ohead[]{\headmark} \chead{} %\renewcommand*{\titlepagestyle}{scrheadings} +% Figure floats +\usepackage{float} +\let\origfigure=\figure +\let\endorigfigure=\endfigure +\renewenvironment{figure}[1][]{% + \origfigure[H] +}{% + \endorigfigure +} + % LANGUAGE %-------------------------------- $if(lang)$ @@ -73,8 +84,9 @@ $endif$ % converts LaTeX specials (quotes, dashes etc.) to Unicode \defaultfontfeatures{Mapping=tex-text} -\setromanfont [Ligatures={Common}, Numbers={OldStyle}]{$mainfont$} -\setsansfont[Scale=0.9]{$altfont$} +%\setromanfont [Ligatures={Common}, Numbers={OldStyle}]{$mainfont$} +\setromanfont[Ligatures={Common}]{$mainfont$} +\setsansfont[Scale=1]{$altfont$} \setmonofont[Scale=0.8]{$monofont$} % Set paragraph break @@ -86,9 +98,20 @@ $endif$ % Upper-case section headings \renewcommand\sectionlinesformat[4]{% - \@hangfrom{\hskip#2 #3}{\MakeUppercase{#4}}% + \@hangfrom{\hskip#2#3}{\MakeUppercase{#4}}% } +% Remove numbers from section headings +\renewcommand*{\sectionformat}{} +\renewcommand*{\subsectionformat}{} +\renewcommand*{\subsubsectionformat}{} + +% Make section headings slightly bigger than subsection headings +\addtokomafont{section}{\large} + +% Center sectionheads +%\let\raggedsection\centering + $if(mainfont)$ \setmainfont{$mainfont$} $endif$ @@ -110,10 +133,12 @@ $endif$ pdftitle={$course$ - $title$}, colorlinks,breaklinks, filecolor=black, - urlcolor=[rgb]{0.117,0.682,0.858}, - linkcolor=[rgb]{0.117,0.682,0.858}, - linkcolor=[rgb]{0.117,0.682,0.858}, - citecolor=[rgb]{0.117,0.682,0.858} + urlcolor=[rgb]{0,0,0.7}, + linkcolor=[rgb]{0,0,0.7}, + citecolor=[rgb]{0,0,0.7} + %urlcolor=[rgb]{0.117,0.682,0.858}, + %linkcolor=[rgb]{0.117,0.682,0.858}, + %citecolor=[rgb]{0.117,0.682,0.858} } % To display custom date in the example @@ -127,8 +152,11 @@ $endif$ \begin{document} \subject{\vspace{-6ex}$course$\vspace{-1.5ex}} -\title{$title$\vspace{-1ex}} -\author{$author_name$, $author_group$, $author_id$} +\title{$title$} +$if(subtitle)$ +\subtitle{$subtitle$} +$endif$ +\author{\vspace{-1ex}$author_name$, $author_group$, $author_id$} \date{\vspace{-1ex} \today} %\begin{spacing}{1}