Browse Source

Merge commit 'eb70c7f9e67a3b663c069ad9b35ace0d86243721' as 'texmf'

Samuel W. Flint 4 years ago
parent
commit
55dc20070a
3 changed files with 260 additions and 0 deletions
  1. 165 0
      texmf/.gitignore
  2. 51 0
      texmf/helpers.sty
  3. 44 0
      texmf/recipe.sty

+ 165 - 0
texmf/.gitignore

@@ -0,0 +1,165 @@
+# -*- mode: gitignore; -*-
+.*
+!.gitignore
+!.gitmodules
+!.gitkeep
+
+# Emacs Stuff
+*~
+\#*\#
+/.emacs.desktop
+/.emacs.desktop.lock
+*.elc
+auto-save-list
+tramp
+.\#*
+
+# Org-mode
+.org-id-locations
+*_archive
+
+# flymake-mode
+*_flymake.*
+
+# eshell files
+/eshell/history
+/eshell/lastdir
+
+# elpa packages
+/elpa/
+
+# reftex files
+*.rel
+
+# AUCTeX auto folder
+/auto/
+*/auto/
+
+# cask packages
+.cask/
+dist/
+
+# Flycheck
+flycheck_*.el
+
+# server auth directory
+/server/
+
+# projectiles files
+.projectile
+
+## Core latex/pdflatex auxiliary files:
+*.aux
+*.lof
+*.log
+*.lot
+*.fls
+*.out
+*.toc
+*.fmt
+*.fot
+*.cb
+*.cb2
+
+## Intermediate documents:
+*.dvi
+*.ps
+*.eps
+*.pdf
+
+## Bibliography auxiliary files (bibtex/biblatex/biber):
+*.bbl
+*.bcf
+*.blg
+*-blx.aux
+*-blx.bib
+*.brf
+*.run.xml
+
+## Build tool auxiliary files:
+*.fdb_latexmk
+*.synctex
+*.synctex.gz
+*.synctex.gz(busy)
+*.pdfsync
+
+## Auxiliary and intermediate files from other packages:
+# algorithms
+*.alg
+*.loa
+
+# achemso
+acs-*.bib
+
+# amsthm
+*.thm
+
+# beamer
+*.nav
+*.snm
+*.vrb
+
+# glossaries
+*.acn
+*.acr
+*.glg
+*.glo
+*.gls
+*.glsdefs
+
+# hyperref
+*.brf
+
+# listings
+*.lol
+
+# makeidx
+*.idx
+*.ilg
+*.ind
+*.ist
+
+# minitoc
+*.maf
+*.mlf
+*.mlt
+*.mtc
+*.mtc[0-9]
+*.mtc[1-9][0-9]
+
+# minted
+_minted*
+*.pyg
+
+# mylatexformat
+*.fmt
+
+# nomencl
+*.nlo
+
+# sympy
+*.sout
+*.sympy
+sympy-plots-for-*.tex/
+
+# pdfcomment
+*.upa
+*.upb
+
+# thmtools
+*.loe
+
+# TikZ & PGF
+*.dpth
+*.md5
+*.auxlock
+
+# xindy
+*.xdy
+
+# xypic precompiled matrices
+*.xyc
+
+# endfloat
+*.ttt
+*.fff

+ 51 - 0
texmf/helpers.sty

@@ -0,0 +1,51 @@
+\ProvidesPackage{helpers}[2019/11/15 Common/Personal Utility
+Commands]
+
+\RequirePackage{ifdraft}
+\RequirePackage{setspace}
+\RequirePackage{ifmtarg}
+
+\newcommand\mycommon@font{\textit}
+\newcommand\foreign[1]{\mycommon@font{#1}}
+
+\ProcessOptions\relax
+
+\ifdraft{\RequirePackage{background}\backgroundsetup{contents={DRAFT}}}
+\ifdraft{\RequirePackage[color]{showkeys}}
+\ifdraft{\RequirePackage{setspace}\AtBeginDocument{\doublespace}}
+
+
+\newcommand\@ensurecomma{\@ifnextchar,{}{\PackageWarning{helpers}{
+      You appear to have forgotten a necessary comma}}}
+
+\newcommand\@ensuresingleperiod{\@ifnextchar.{}{.\@\PackageWarning{helpers}{
+      You appear to have forgotten a necessary period}}}
+
+\newcommand\commaabbrev[2]{\newcommand#1{\mycommon@font{#2}\@ensurecomma}}
+\newcommand\spaceabbrev[2]{\newcommand#1{\mycommon@font{#2}\ }}
+\newcommand\periodabbrev[2]{\newcommand#1{\mycommon@font{#2}\@ensuresingleperiod}}
+
+\commaabbrev{\eg}{e.g.}
+\commaabbrev{\Eg}{E.g.}
+\commaabbrev{\ie}{i.e.}
+\commaabbrev{\Ie}{I.e.}
+\commaabbrev{\viz}{viz.}
+\commaabbrev{\Viz}{Viz.}
+\commaabbrev{\ibid}{ibid.}
+\commaabbrev{\Ibid}{Ibid.}
+\commaabbrev{\ia}{i.a.}
+\commaabbrev{\Ia}{I.a.}
+
+\spaceabbrev{\cf}{cf.}
+\spaceabbrev{\Cf}{Cf.}
+
+
+\periodabbrev{\etal}{et al}
+\periodabbrev{\Etal}{Et al}
+\periodabbrev{\etc}{\&c}
+\periodabbrev{\Etc}{\&c}
+\periodabbrev{\etseq}{et seq}
+\periodabbrev{\Etseq}{Et seq}
+\periodabbrev{\Sic}{Sic}
+
+\endinput

+ 44 - 0
texmf/recipe.sty

@@ -0,0 +1,44 @@
+\ProvidesPackage{recipe}[2020/01/30 Recipe Typesetting for OpenCookbook]
+
+\ProcessOptions\relax
+
+\RequirePackage{etoolbox}
+\RequirePackage{nicefrac}
+\RequirePackage{booktabs}
+\RequirePackage{changepage}
+
+\newcommand\half{\nicefrac{1}{2}}
+\newcommand\quarter{\nicefrac{1}{4}}
+\newcommand\third{\nicefrac{1}{3}}
+\newcommand\twothirds{\nicefrac{2}{3}}
+\newcommand\threequarters{\nicefrac{3}{4}}
+
+\newcommand\recipe@ingredient[2]{#1 & #2 \\}
+\newcommand\recipe@serving[1]{\ifempty{#1}{}{\textit{#1 servings}}}
+\newcommand\recipe@contributor[1]{\ifempty{#1}{}{Courtesy of #1}}
+
+\newenvironment{recipe}[1]{%
+  \bigskip%
+  \begin{adjustwidth}{4em}{4em}%
+    \centerline{\textbf{#1}}%
+    \recipe@contributor{#2}\hfill\recipe@servings{#3}\\
+    \newenvironment{note}{\textit{Note:}}{}
+    \newenvironment{ingredients}{%
+      \smallskip%
+      \begin{center}%
+        \let\ingredient=\recipe@ingredient
+        \begin{tabular}{lr}
+          \toprule%
+          }{%
+          \bottomrule%
+        \end{tabular}%
+      \end{center}%
+      \smallskip%
+    }%
+    \smallskip
+  }{%
+  \end{adjustwidth}%
+  \bigskip%
+}
+
+\endinput