summaryrefslogtreecommitdiffstats
path: root/notes/tex/docstyle.sty
diff options
context:
space:
mode:
authorNao Pross <np@0hm.ch>2022-04-25 16:55:28 +0200
committerNao Pross <np@0hm.ch>2022-04-25 16:55:28 +0200
commit9f820f9fa115b3cdb287b22a214e091378f25331 (patch)
treefedd96ecb4a332bd60ef8aa53c6f14f16303fc30 /notes/tex/docstyle.sty
parentAdd manimgl variant (diff)
downloadFourierOnS2-9f820f9fa115b3cdb287b22a214e091378f25331.tar.gz
FourierOnS2-9f820f9fa115b3cdb287b22a214e091378f25331.zip
Add draft of handout for presentation
Diffstat (limited to '')
-rw-r--r--notes/tex/docstyle.sty100
1 files changed, 100 insertions, 0 deletions
diff --git a/notes/tex/docstyle.sty b/notes/tex/docstyle.sty
new file mode 100644
index 0000000..f813c99
--- /dev/null
+++ b/notes/tex/docstyle.sty
@@ -0,0 +1,100 @@
+\NeedsTeXFormat{LaTeX2e}
+\ProvidesPackage{tex/docstyle}[2021/03/12 v0.1 Styling for a Notebook]
+
+%% Margins
+\RequirePackage{geometry}
+\newgeometry{a4paper, margin=2.2cm, top=3cm, bottom=3cm}
+
+%% Headers and footers
+\RequirePackage{fancyhdr}
+\fancypagestyle{docstyle}{
+ \fancyhf{} % clear currrent values
+ \fancyhead[L]{\itshape\leftmark}
+ \fancyhead[R]{}
+ \fancyfoot[C]{\thepage}
+ \renewcommand{\headrulewidth}{0pt}
+}
+\pagestyle{docstyle} % apply style
+
+%% Main font
+% \PassOptionsToPackage{11pt, noamsfont}{amsart}
+% \RequirePackage{amsart}
+
+\PassOptionsToPackage{p,osf}{scholax}
+\RequirePackage{scholax}
+
+% must be loaded before newtxmath
+% amssymb should not be loaded
+\RequirePackage{amsmath}
+\RequirePackage{amsthm}
+
+\PassOptionsToPackage{scaled=1.075,ncf,vvarbb}{newtxmath}
+\RequirePackage{newtxmath}
+
+%% Link colors
+\RequirePackage{xcolor}
+\PassOptionsToPackage{
+ plainpages=false,
+ pdfpagelabels,
+ pdfusetitle,
+ colorlinks = true,
+ linkcolor = darkgray!50!black,
+ urlcolor = blue!60!black,
+ citecolor = black,
+ anchorcolor = black
+}{hyperref}
+\RequirePackage{hyperref}
+
+%% Source code listings
+\RequirePackage{listings}
+\lstset{
+ belowcaptionskip=\baselineskip,
+ breaklines=true,
+ frame=none,
+ inputencoding=utf8,
+ % margin
+ xleftmargin=\parindent,
+ % numbers
+ numbers=left,
+ numbersep=5pt,
+ numberstyle=\ttfamily\footnotesize\color{gray},
+ % background
+ backgroundcolor=\color{white},
+ showstringspaces=false,
+ % default language
+ language=[LaTeX]TeX,
+ % break long lines, and show an arrow where the line was broken
+ breaklines=true,
+ % postbreak=\mbox{\textcolor{blue!60!black}{$\hookrightarrow$}\space},
+ % font
+ basicstyle=\ttfamily\small,
+ identifierstyle=\color{black},
+ keywordstyle=\color{blue!60!black},
+ commentstyle=\color{red!60!black},
+ stringstyle=\color{orange!60!black},
+}
+
+%% Pretty drawings
+\RequirePackage{graphicx}
+\RequirePackage{tikz}
+
+\colorlet{GridColor}{lightgray}
+\newcommand{\makegrid}[1]{
+ \begin{center}\begin{tikzpicture}
+ \draw[
+ dotted, draw=GridColor, fill=white,
+ step=4mm,
+ ] (0, 0) grid (\linewidth, #1 * 8mm);
+ \end{tikzpicture}\end{center}
+}
+
+\newcommand{\makefigure}[2][]{
+ \begin{center}\begin{tikzpicture}
+ \draw[
+ draw=GridColor, fill=white
+ ] (0, 0) rectangle (\linewidth, #2);
+ \node[
+ text=GridColor, anchor=north west
+ ] at (0, #2) {#1};
+ \end{tikzpicture}\end{center}
+}