From e86b8239103c53faff20281a9dde5e02fe933387 Mon Sep 17 00:00:00 2001 From: Wryn Wagner Date: Thu, 16 Sep 2021 15:51:06 -0600 Subject: [PATCH] extract to submodule --- latex/default/body.tex | 9 -- latex/default/formatting.sty | 40 --------- latex/default/imports.sty | 19 ---- latex/math/body.tex | 43 --------- latex/math/formatting.sty | 45 ---------- latex/math/imports.sty | 26 ------ latex/template.tex | 19 ---- latex/times12/body.tex | 19 ---- latex/times12/formatting.sty | 38 -------- latex/times12/imports.sty | 10 --- zsh/latex | 166 ----------------------------------- 11 files changed, 434 deletions(-) delete mode 100644 latex/default/body.tex delete mode 100644 latex/default/formatting.sty delete mode 100644 latex/default/imports.sty delete mode 100644 latex/math/body.tex delete mode 100644 latex/math/formatting.sty delete mode 100644 latex/math/imports.sty delete mode 100644 latex/template.tex delete mode 100644 latex/times12/body.tex delete mode 100644 latex/times12/formatting.sty delete mode 100644 latex/times12/imports.sty delete mode 100644 zsh/latex diff --git a/latex/default/body.tex b/latex/default/body.tex deleted file mode 100644 index 83538ec..0000000 --- a/latex/default/body.tex +++ /dev/null @@ -1,9 +0,0 @@ -\begin{document} -\maketitle -% ---------------------------------------------------------- -% ---------------------------------------------------------- - - -% ---------------------------------------------------------- -% ---------------------------------------------------------- -\end{document} diff --git a/latex/default/formatting.sty b/latex/default/formatting.sty deleted file mode 100644 index 941221e..0000000 --- a/latex/default/formatting.sty +++ /dev/null @@ -1,40 +0,0 @@ -\ProvidesPackage{formatting} - -% -% - -\newcommand{\headerLeft} {\documentTitle: \documentDate} -\newcommand{\headerCenter} {\documentId} -\newcommand{\headerRight} {\authorName\ (\authorId)} -\newcommand{\pageOfTotal} {\thepage\ of~\pageref{LastPage}} - -% -% - -% margins -\RequirePackage[margin=1in,bottom=.5in,includefoot]{geometry} - -\RequirePackage{lastpage} -\RequirePackage{fancyhdr} \pagestyle{fancy} - -% Page 1 -\fancypagestyle{plain}{% - \fancyhf{} - \fancyhead[L]{\headerLeft} - \fancyhead[R]{\headerRight} - \fancyhead[C]{\headerCenter} - \fancyfoot[C]{\pageOfTotal} -} - -% Subsequent Pages -\fancyhf{} -\fancyhead[L]{\headerLeft} -\fancyhead[R]{\headerRight} -\fancyhead[C]{\headerCenter} -\fancyfoot[C]{\pageOfTotal} - - -\title{\documentTitle} -\author{\authorName\ \\ \authorId} -\date{\documentDate} - diff --git a/latex/default/imports.sty b/latex/default/imports.sty deleted file mode 100644 index fcf3c4f..0000000 --- a/latex/default/imports.sty +++ /dev/null @@ -1,19 +0,0 @@ -\ProvidesPackage{imports} - -\RequirePackage{amssymb} % -- "bold" math letters (e.g. set of all integers `Z`) -\RequirePackage{amsmath} % -- advanced math symbols - -\RequirePackage{arydshln} % -- dashed lines within tables -\RequirePackage{dashrule} % -- dashed lines outside tables - -\RequirePackage{listings} % -- code snippet styling block - -\RequirePackage{tikz} % -- generates graphs and other graphics -\RequirePackage[final]{pdfpages} % -- inserts external pdf excerpts -\RequirePackage{graphicx} % -- inserts standard image graphics -\graphicspath{{./graphics/}} - -\RequirePackage{lipsum} % -- generates lorem ipsum -\RequirePackage{kantlipsum} % -- generates Kantian lorem ipsum - -\RequirePackage[english]{babel} % -- Ensures correct compilation rules for English diff --git a/latex/math/body.tex b/latex/math/body.tex deleted file mode 100644 index 508808f..0000000 --- a/latex/math/body.tex +++ /dev/null @@ -1,43 +0,0 @@ -\newcommand{\problemdivider}{\noindent\rule{2in}{0.4pt}} - -\newtheorem{theorem}{Theorem}[section] -\newtheorem{lemma}[theorem]{Lemma} -\newtheorem{corollary}{Corollary}[theorem] - -\newcommand{\egfcoefficient}{\ensuremath{\left[\frac{x^n}{n!}\right]}} -\newcommand{\ogfcoefficient}{\ensuremath{\left[x^n\right]}} -\newcommand{\falling}[1]{^{\underline{#1}}} -\newcommand{\divides}{\ensuremath{\;\backslash\;}} - -\newcommand{\sumgz}{\ensuremath{\sum_{n\geq 0}}} -\newcommand{\sumdiv}{\ensuremath{\sum_{d\divides n}}} - -\newcommand{\union}{\ensuremath{\cup}} -\newcommand{\intersect}{\ensuremath{\cap}} - -\newcommand{\clispsnippet}[2]{% - \lstinputlisting[% - caption=#1, - language=Lisp, - showstringspaces=false, - numbers=left, - ]{#2} -} - -\begin{document} -\maketitle -% ---------------------------------------------------------- -% ---------------------------------------------------------- - -%\input{1.tex}% -\setcounter{section}{0} -\section{}% Problem 1 -\subsection{Prompt} - - -\problemdivider% -% ---------------------------------------------------------- - -% ---------------------------------------------------------- -% ---------------------------------------------------------- -\end{document} diff --git a/latex/math/formatting.sty b/latex/math/formatting.sty deleted file mode 100644 index 741e54d..0000000 --- a/latex/math/formatting.sty +++ /dev/null @@ -1,45 +0,0 @@ -\ProvidesPackage{formatting} - -% -% - -\newcommand{\headerLeft} {\documentTitle: \documentDate} -\newcommand{\headerCenter} {\documentId} -\newcommand{\headerRight} {\authorName\ (\authorId)} -\newcommand{\pageOfTotal} {\thepage\ of~\pageref{LastPage}} - -% -% - -% margins -\RequirePackage[margin=1in,bottom=.5in,includefoot]{geometry} - -\RequirePackage{lastpage} -\RequirePackage{fancyhdr} \pagestyle{fancy} - -% Page 1 -\fancypagestyle{plain}{% - \fancyhf{} - \fancyhead[L]{\headerLeft} - \fancyhead[R]{\headerRight} - \fancyhead[C]{\headerCenter} - \fancyfoot[C]{\pageOfTotal} -} - -% paragraph spacing / line indent -\renewcommand{\baselinestretch}{1} -\setlength{\parskip}{0em} -\setlength{\parindent}{0em} - -% Subsequent Pages -\fancyhf{} -\fancyhead[L]{\headerLeft} -\fancyhead[R]{\headerRight} -\fancyhead[C]{\headerCenter} -\fancyfoot[C]{\pageOfTotal} - - -\title{\documentTitle} -\author{\authorName\ \\ \authorId} -\date{\documentDate} - diff --git a/latex/math/imports.sty b/latex/math/imports.sty deleted file mode 100644 index 59163ef..0000000 --- a/latex/math/imports.sty +++ /dev/null @@ -1,26 +0,0 @@ -\ProvidesPackage{imports} - -\RequirePackage{amssymb} % -- "bold" math letters (e.g. set of all integers `Z`) -\RequirePackage{amsmath} % -- advanced math symbols - -\RequirePackage{listings} % -- code snippet styling block - -\RequirePackage[english]{babel} % -- ensures correct compilation rules for English - -% --------------------------------------------------- -% --- OPTIONAL IMPORTS ------------------------------ -% --------------------------------------------------- - -% graphic drawing / generation -%\RequirePackage{tikz} - -%\usetikzlibrary{arrows,automata} -%\usetikzlibrary{trees} - -% --------------------------------------------------- - -% include images -%\RequirePackage{graphicx} -%\graphicspath{{./graphics/}} - -% --------------------------------------------------- diff --git a/latex/template.tex b/latex/template.tex deleted file mode 100644 index 583270c..0000000 --- a/latex/template.tex +++ /dev/null @@ -1,19 +0,0 @@ -% -% - -\newcommand{\documentTitle} {DOC TITLE} -\newcommand{\documentDate} {DOC DATE} -\newcommand{\documentId} {DOC ID} - -\newcommand{\authorName} {AUTHOR NAME} -\newcommand{\authorId} {AUTHOR ID} - -% -% - -\documentclass[letterpaper]{article} - -\usepackage{imports} -\usepackage{formatting} - -\input{body.tex} diff --git a/latex/times12/body.tex b/latex/times12/body.tex deleted file mode 100644 index a690683..0000000 --- a/latex/times12/body.tex +++ /dev/null @@ -1,19 +0,0 @@ -\usepackage{times} - -% custom headers -\newcommand{\firstH}[1] {\begin{large}\textbf{#1}\end{large}\par} -\newcommand{\secondH}[1] {\textbf{#1}\par} -\newcommand{\thirdH}[1] {\textbf{#1}. } -\newcommand{\fourthH}[1] {\textbf{\textit{#1}}. } - -\begin{document} -\insertTitle% -% ---------------------------------------------------------- -% ---------------------------------------------------------- - -\firstH{First-level Header} -\kant% - -% ---------------------------------------------------------- -% ---------------------------------------------------------- -\end{document} diff --git a/latex/times12/formatting.sty b/latex/times12/formatting.sty deleted file mode 100644 index 70c319b..0000000 --- a/latex/times12/formatting.sty +++ /dev/null @@ -1,38 +0,0 @@ -\ProvidesPackage{formatting} - -% -% - -\newcommand{\horizontalHeader} {% - \authorName\hfill - \authorId\hfill - \documentId\hfill - \documentDate% -} - -% -% - -% margins -\RequirePackage[margin=1in]{geometry} - - -% page header / page footer -\RequirePackage{fancyhdr} \pagestyle{fancy} - -\renewcommand{\headrulewidth}{0pt} -\fancyhead[C]{\horizontalHeader} -\fancyfoot[C]{\thepage} - -% paragraph spacing / line indent -\renewcommand{\baselinestretch}{1} -\setlength{\parskip}{1em} -\setlength{\parindent}{0em} -\raggedright% - - -% title format -\newcommand{\insertTitle} {% - \centerline{\begin{large}\textbf{\documentTitle}\end{large}} -} - diff --git a/latex/times12/imports.sty b/latex/times12/imports.sty deleted file mode 100644 index f21526e..0000000 --- a/latex/times12/imports.sty +++ /dev/null @@ -1,10 +0,0 @@ -\ProvidesPackage{imports} - -\RequirePackage{times} % -- Formats document with "Times New Roman" font - -\RequirePackage[english]{babel} % -- Ensures correct compilation rules for English - -\RequirePackage{kantlipsum} % -- generates Kantian lorem ipsum - -\RequirePackage{graphicx} % -- inserts standard image graphics -\graphicspath{{./graphics/}} diff --git a/zsh/latex b/zsh/latex deleted file mode 100644 index d256331..0000000 --- a/zsh/latex +++ /dev/null @@ -1,166 +0,0 @@ -#!/bin/zsh - -# -# tek() = Local LaTeX Utility -# -# Performs one of the following actions based on first argument: -# - (arg = NO ARGUMENT) Attempt to compile the latex project in the current directory -# - (arg = clean) Clears out LaTeX log files and build files (pdf and dvi) -# - (arg = new) Copy a template to the current directory (prompts for document name) -# - (arg = compile) Attempt to compile the latex project in the current directory -# - -function tek() { - case $1 in - clean) - LATEX_CLEANUP "${@:2}"; - ;; - new) - LATEX_NEW_DOCUMENT "${@:2}"; - ;; - compile) - LATEX_COMPILE "${@:2}"; - ;; - *) - LATEX_COMPILE "${@:1}"; - ;; - esac -} -_tek () { # autocompletion - local state; - - _arguments \ - '1: :->primary_command'\ - ':: :->command_args'\ - ; - case "$state" in - primary_command) - compadd clean new compile; - ;; - command_args) - [ $words[2] == 'clean' ] && _LATEX_NEW_DOCUMENT; - [ $words[2] == 'new' ] && _LATEX_NEW_DOCUMENT; - [ $words[2] == 'compile' ] && _LATEX_COMPILE; - ;; - esac -} -compdef _tek tek; - - -############################################################################### -### HELPERS ################################################################### -############################################################################### - -function LATEX_CLEANUP() { - rm *.aux *.log *.pdf *.dvi >/dev/null 2>&1; - echo 'All clean!'; - return 0; -} - -function LATEX_NEW_DOCUMENT() { - local PARENT_TEMPLATE_DIR="$DOTWRYN/latex"; - local FILE_NAME; - - [ $2 ] && FILE_NAME="$2" || { - printf '\nInput document title : ' - read FILE_NAME; echo; - } - - [ ! "$FILE_NAME" ] && { echo "ERROR :: File name required!"; return 1; } - - local NEW_FILE="$FILE_NAME.tex"; - [ -f "./$NEW_FILE" ] && { echo "ERROR :: File already already exists : $FILE_NAME.tex"; return 2; } - - [[ $1 && -d "$PARENT_TEMPLATE_DIR/$1" ]] \ - && local TEMPLATE_DIR="$PARENT_TEMPLATE_DIR/$1" \ - || local TEMPLATE_DIR="$PARENT_TEMPLATE_DIR/default"; - - cp "$PARENT_TEMPLATE_DIR/template.tex" "./$FILE_NAME.tex"; - - [ ! -f "./body.tex" ] \ - && cp "$TEMPLATE_DIR/body.tex" "./body.tex" \ - || echo 'WARNING :: `./body.tex` already exists. Template body not copied.' ; - - [ ! -f "./imports.sty" ] \ - && cp "$TEMPLATE_DIR/imports.sty" "./imports.sty" \ - || echo 'WARNING :: `./imports.sty` already exists. Template imports not copied.'; - - [ ! -f "./formatting.sty" ] \ - && cp "$TEMPLATE_DIR/formatting.sty" "./formatting.sty" \ - || echo 'WARNING :: `./formatting.sty` already exists. Template formatting not copied.'; -} -_LATEX_NEW_DOCUMENT () { - compadd $(ls $DOTWRYN/latex | grep -v .tex); -} - -function LATEX_COMPILE() { - local COMPILE_TYPE='pdf'; - - [ $1 ] && COMPILE_TYPE="$1"; - - local COMPILE_ME="$(find -mindepth 0 -maxdepth 1 -name \*.tex | grep -v body.tex)"; - [ $(echo "$COMPILE_ME" | wc -l) -gt 1 ] && { echo 'ERROR :: Multiple compatible files detected. Please compile manually.'; return 1; } - [[ ! $COMPILE_ME || $(echo "$COMPILE_ME" | wc -l) -lt 1 ]] && { echo 'ERROR :: No compatible files detected. Please ensure .tex file exists in current direcotory'; return 2;} - - case $COMPILE_TYPE in - pdf) - pdflatex --version >/dev/null 2>&1 && { - echo 'Beginning initial compile...'; - timeout 3 pdflatex $COMPILE_ME >/dev/null && { - echo 'Beginning secondary compile...'; - timeout 3 pdflatex $COMPILE_ME >/dev/null && LATEX_SUCCESS; - } || { - echo 'ERROR :: Failed to compile. Check local log files'; - return 1; - } - } || { - echo 'ERROR :: Compiling LaTeX to pdf requires pdflatex: (https://www.tug.org/applications/pdftex)'; - return 2; - } - ;; - dvi) - latex --version >/dev/null 2>&1 && { - echo 'Beginnint initial compile...'; - timeout 3 latex $COMPILE_ME >/dev/null && { - echo 'Beginning secondary compile...'; - timeout 3 latex $COMPILE_ME >/dev/null && LATEX_SUCCESS; - } || { - echo 'ERROR :: Failed to compile. Check local log files'; - return 1; - } - } || { - echo 'ERROR :: Compiling LaTeX to dvi requires latex: (https://www.latex-project.org/get/)'; - return 2; - } - ;; - *) - echo "ERROR :: Unsupported LaTeX compile format : $COMPILE_TYPE"; - return 2; - ;; - esac -} -_LATEX_COMPILE () { - compadd pdf dvi default; -} - -function LATEX_SUCCESS() { - local MSG='success'; - local MSG_LONG='LaTeX compile successful!'; - - local FIGLET_SUPPORT=0; - local LOLCAT_SUPPORT=0; - - figlet -v >/dev/null 2>&1 && FIGLET_SUPPORT=1; - lolcat -v >/dev/null 2>&1 && LOLCAT_SUPPORT=1; - - [ $FIGLET_SUPPORT -ne 0 ] && { - [ $LOLCAT_SUPPORT -ne 0 ] \ - && figlet $MSG | lolcat \ - || figlet $MSG; - } || { - [ $LOLCAT_SUPPORT -ne 0 ] \ - && echo $MSG | lolcat \ - || echo $MSG_LONG; - } - echo; -}