Skip to content

Instantly share code, notes, and snippets.

@0undefined
Created June 21, 2019 10:50
Show Gist options
  • Save 0undefined/9351e0ee281b25de57898b6790a3301c to your computer and use it in GitHub Desktop.
Save 0undefined/9351e0ee281b25de57898b6790a3301c to your computer and use it in GitHub Desktop.
Report preamble
% Usual packages++
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage[danish]{babel}
\usepackage{graphicx}
\usepackage{amsfonts}
\usepackage{amsmath}
\usepackage{amssymb}
\usepackage[hidelinks]{hyperref}
\usepackage{url}
\usepackage{array}
\usepackage[usenames, dvipsnames, svgnames, table]{xcolor}
\usepackage{tabularx}
\usepackage{colortbl}
\usepackage{verbatim}
\usepackage{fancyvrb}
\usepackage{listings}
\usepackage{lipsum}
\usepackage{float}
\usepackage{wrapfig}
\usepackage{caption}
\usepackage{subcaption}
\usepackage{enumerate}
\usepackage[yyyymmdd]{datetime}
% Cool graphs and plots
\usepackage{tikz}
\usepackage{pgfplots}
\pgfplotsset{compat=1.16}
% Will complain if you don't use xelatex and biber
%% references (bibtex)
%\usepackage{csquotes}
%\usepackage{fontspec}
%\usepackage{polyglossia}
%\usepackage[backend=biber,style=ieee]{biblatex}
%\addbibresource{references.bib}
% Basic layout:
\setlength{\textwidth}{165mm}
\setlength{\textheight}{220mm}
\setlength{\parindent}{0mm}
\setlength{\parskip}{\parsep}
\setlength{\headheight}{0mm}
\setlength{\headsep}{0mm}
\setlength{\hoffset}{-2.5mm}
\setlength{\voffset}{0mm}
\setlength{\footskip}{15mm}
\setlength{\oddsidemargin}{0mm}
\setlength{\topmargin}{0mm}
\setlength{\evensidemargin}{0mm}
% Blackboard bold
\newcommand{\NN}{\mathbb{N}}
\newcommand{\ZZ}{\mathbb{Z}}
\newcommand{\QQ}{\mathbb{Q}}
\newcommand{\RR}{\mathbb{R}}
\newcommand{\EE}{\mathbb{E}}
\newcommand{\PP}{\mathbb{P}}
\newcommand{\FF}{\mathbb{F}}
\newcommand{\CC}{\mathbb{C}}
\newcolumntype{C}[1]{>{\centering\arraybackslash}p{#1}}
\DeclareFixedFont{\ttb}{T1}{txtt}{bx}{n}{9} % for bold
\DeclareFixedFont{\ttm}{T1}{txtt}{m}{n}{9} % for normal
% Colors:
\definecolor{KU-red}{RGB}{144, 26, 30}
\definecolor{lightblue}{rgb}{0.6,0.6,1.0}
\definecolor{deepblue}{rgb}{0,0,0.5}
\definecolor{deepred}{rgb}{0.6,0,0}
\definecolor{deepgreen}{rgb}{0,0.5,0}
\definecolor{yellow}{rgb}{0.6,0.6,0}
\definecolor{mattegreen}{rgb}{0.45,0.85,0.45}
\definecolor{gray}{rgb}{0.95,0.95,0.95}
\definecolor{mediumgray}{rgb}{0.60,0.65,0.63}
\definecolor{darkgray}{rgb}{0.45,0.45,0.45}
% Text Coloring:
\newcommand{\dgreen} [1]{\textbf{\color{deepgreen}{#1}}}
\newcommand{\green} [1]{\textbf{\color{green}{#1}}}
\newcommand{\yello} [1]{\textbf{\color{yellow}{#1}}}
\newcommand{\blue} [1]{\textbf{\color{blue} {#1}}}
\newcommand{\red} [1]{\textbf{\color{red} {#1}}}
\newcommand{\grey} [1]{\textbf{\color{gray} {#1}}}
\newcommand{\dgrey} [1]{\textbf{\color{darkgray} {#1}}}
% Misc Commands
\newcommand\code[1]{\texttt{\colorbox{blue!5}{#1}}}
\newcommand\link[2]{\href{#2}{\textbf{#1}}}
% Source code
\lstset{%
language=Python,
basicstyle=\ttm,
keywordstyle=\ttb\color{deepblue},
emphstyle=\ttb\color{deepred},
commentstyle=\ttb\color{mediumgray},
stringstyle=\color{deepgreen},
showstringspaces=false,
tabsize=2,
numbers=left,
frame=l,
framesep=6mm,
framexleftmargin=2.5mm,
fillcolor=\color{gray},
rulecolor=\color{lightblue},
numberstyle=\ttfamily\small\color{darkgray}
}
% Sectioning
% 0-indexing
\setcounter{section}{-1}
% Edit this accordingly to assignment
\renewcommand{\thesection}{\Large{\textbf{Part \arabic{section}}}}
\newcommand{\makeheader}[4]{%
\begin{minipage}[b]{1.0\linewidth}
\includegraphics[height=30mm]{KULogo}
\vspace*{-19.7ex}
\begin{center}
{\Large \bf #1} \vspace*{1ex} \\
{\large #2: \today} \vspace*{1ex} \\
{\large #3: \code{\href{mailto:#4}{#4}}}
\end{center}
\vspace*{-0.2pt}
{%
\color{KU-red}
\noindent\makebox[\linewidth]{\rule{1.05\paperwidth}{1.2pt}}
}%
\end{minipage}
\vspace{2ex}
}
% Or use article
\documentclass[11pt,a4paper]{report}
\input{preamble}
\begin{document}
\makeheader{Title}
{Subtitle}
{Name}
{Email}
\end{document}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment