extract to submodule
This commit is contained in:
parent
51528f767c
commit
e86b823910
@ -1,9 +0,0 @@
|
|||||||
\begin{document}
|
|
||||||
\maketitle
|
|
||||||
% ----------------------------------------------------------
|
|
||||||
% ----------------------------------------------------------
|
|
||||||
|
|
||||||
|
|
||||||
% ----------------------------------------------------------
|
|
||||||
% ----------------------------------------------------------
|
|
||||||
\end{document}
|
|
@ -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}
|
|
||||||
|
|
@ -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
|
|
@ -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}
|
|
@ -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}
|
|
||||||
|
|
@ -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/}}
|
|
||||||
|
|
||||||
% ---------------------------------------------------
|
|
@ -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}
|
|
@ -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}
|
|
@ -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}}
|
|
||||||
}
|
|
||||||
|
|
@ -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/}}
|
|
166
zsh/latex
166
zsh/latex
@ -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;
|
|
||||||
}
|
|
Loading…
Reference in New Issue
Block a user