From 041d85956cabc0a2b5245098c8ae0ff7e517ec81 Mon Sep 17 00:00:00 2001 From: KenwoodFox Date: Sat, 8 Feb 2025 14:25:17 -0500 Subject: [PATCH] Good enough templating for homework anyway --- .../Homework {{ cookiecutter.number }}.tex | 23 +++++++++++++++++++ Homework {{ cookiecutter.number }}/README.md | 3 +++ README.md | 17 ++++++++++++++ SNHU.sty | 22 ++++++++++++++++-- cookiecutter.json | 6 +++++ moghimi.sty | 5 +++- monk.sty | 2 +- 7 files changed, 74 insertions(+), 4 deletions(-) create mode 100644 Homework {{ cookiecutter.number }}/Homework {{ cookiecutter.number }}.tex create mode 100644 Homework {{ cookiecutter.number }}/README.md create mode 100644 README.md create mode 100644 cookiecutter.json diff --git a/Homework {{ cookiecutter.number }}/Homework {{ cookiecutter.number }}.tex b/Homework {{ cookiecutter.number }}/Homework {{ cookiecutter.number }}.tex new file mode 100644 index 0000000..a5afd9c --- /dev/null +++ b/Homework {{ cookiecutter.number }}/Homework {{ cookiecutter.number }}.tex @@ -0,0 +1,23 @@ +\documentclass[12pt]{article} +\usepackage{ {{cookiecutter.professor}} } + + +% Set title page details +\reporttitle{Homework {{cookiecutter.number}} } +\class{ {{cookiecutter.class}} } +\studentname{ {{cookiecutter.name}} } +\submissiondate{\today} +\universityname{Southern New Hampshire University} + +\begin{document} +\maketitle + +\exer[Question]{1} + +\mpart{a} + +Question 1, Part a + + +\revision{1} +\end{document} diff --git a/Homework {{ cookiecutter.number }}/README.md b/Homework {{ cookiecutter.number }}/README.md new file mode 100644 index 0000000..bbe0085 --- /dev/null +++ b/Homework {{ cookiecutter.number }}/README.md @@ -0,0 +1,3 @@ +# Homework {{cookiecutter.number}} + +Find the source for this template [here](https://git.kitsunehosting.net/Kenwood/SNHU-LaTeX). \ No newline at end of file diff --git a/README.md b/README.md new file mode 100644 index 0000000..4784246 --- /dev/null +++ b/README.md @@ -0,0 +1,17 @@ +# Usage + +Clone this repository and (for ease of use) add the directory to your `TEXINPUTS` env variable. +If this is not easy for you or you don't want to mess with your env variables, just copy your relevant `.sty` +files locally. + +# Cookiecutter + +For making new projects/homework assignments I've put some cookiecutter defs here. +Cookiecutter is easy to invoke even without manually cloning. In the directory you want +to create a new project, just invoke cookiecutter with the url to this repo. + +```shell +cookiecutter https://git.kitsunehosting.net/Kenwood/SNHU-LaTeX +``` + +Follow the prompts! diff --git a/SNHU.sty b/SNHU.sty index 89da1ed..7c0a16c 100644 --- a/SNHU.sty +++ b/SNHU.sty @@ -37,7 +37,7 @@ } % Custom header/footer -\fancypagestyle{moghimi}{ +\fancypagestyle{snhudefault}{ \fancyhf{} \fancyhead[L]{\@reporttitle} \fancyhead[R]{\@studentname} @@ -48,7 +48,7 @@ % Package options to load fancy headers by default \AtBeginDocument{ - \pagestyle{moghimi} + \pagestyle{snhudefault} } % ===================================== @@ -78,3 +78,21 @@ \noindent\textbf{Part (#1)}% } + +% Default revision command +\providecommand{\revision}[1]{ + \clearpage + \null + \vfill + \begin{center} + \texttt{Revision: #1} \\ + \texttt{Compiled on \today} + + \texttt{If this document contains any listings, images or other embedded media, you should have received a copy of the source.zip} + + \bigskip + + \texttt{Libs:} \\ + - \texttt{SNHU\_Sty \snhuversion} + \end{center} +} \ No newline at end of file diff --git a/cookiecutter.json b/cookiecutter.json new file mode 100644 index 0000000..39819de --- /dev/null +++ b/cookiecutter.json @@ -0,0 +1,6 @@ +{ + "number": "1", + "name": "Your Name", + "class": "EE-101", + "professor": ["SNHU", "monk", "moghimi"] +} diff --git a/moghimi.sty b/moghimi.sty index f30c825..cbf1831 100644 --- a/moghimi.sty +++ b/moghimi.sty @@ -6,6 +6,7 @@ \RequirePackage{titlesec} \RequirePackage{siunitx} \RequirePackage{amsmath} +\RequirePackage{tikz} % Provides \usepackage {snhu} @@ -16,6 +17,7 @@ % Circuits \usepackage[american]{circuitikz} +\usetikzlibrary{circuits.logic.US} % Title formatting for sections \titleformat{\section} @@ -41,7 +43,7 @@ } % Custom version command to print revision and compile date in footer -\newcommand{\revision}[1]{ +\renewcommand{\revision}[1]{ \clearpage \null \vfill @@ -75,3 +77,4 @@ captionpos=b, tabsize=2, } + diff --git a/monk.sty b/monk.sty index d8735dd..5c24bba 100644 --- a/monk.sty +++ b/monk.sty @@ -93,7 +93,7 @@ } % Custom version command to print revision and compile date in footer -\newcommand{\revision}[2][false]{ +\renewcommand{\revision}[2][false]{ \clearpage \null \vfill