diff --git a/simpler-wick.pdf b/simpler-wick.pdf index 306f4e6..6165403 100644 Binary files a/simpler-wick.pdf and b/simpler-wick.pdf differ diff --git a/simpler-wick.sty b/simpler-wick.sty index 1533ae0..f54590f 100644 --- a/simpler-wick.sty +++ b/simpler-wick.sty @@ -25,10 +25,11 @@ \RequirePackage{tikz} \RequirePackage{pgfopts} \usetikzlibrary{calc} +\usetikzlibrary{external} \pgfkeys{ - simplerwick/.is family, - simplerwick, + /simplerwick/.is family, + /simplerwick, sep/.store in=\swick@sep, sep=3pt, offset/.store in=\swick@offset, @@ -36,6 +37,7 @@ \ProcessPgfOptions{/simplerwick} +% Works just like \@ifnextchar[, except for digits [1-9] \def\swick@ifnextdigit#1#2{ \@ifnextchar 1{#1}{ \@ifnextchar 2{#1}{ @@ -47,8 +49,10 @@ \@ifnextchar 8{#1}{ \@ifnextchar 9{#1}{#2}}}}}}}}}} +% A count to keep track of how many contraction are currently open. \countdef\swick@count=0 +% Convert the digit to its representation as a word \def\swick@translate#1{% \ifcase#1\or one\or @@ -62,6 +66,7 @@ nine\fi } +% Keeping track of which contraction is open or closed. \newif\ifswick@if@one@ \newif\ifswick@if@two@ \newif\ifswick@if@three@ @@ -72,15 +77,24 @@ \newif\ifswick@if@eight@ \newif\ifswick@if@nine@ +% Shortcut to the ith 'if' variable \def\swick@settrue@#1{ \csname swick@if@\swick@translate{#1}@true\endcsname} \def\swick@setfalse@#1{ \csname swick@if@\swick@translate{#1}@false\endcsname} +% Returns true or false based on whether the ith. Use as: +% +% \if\swick@cond@4 +% +% \else +% {}x<{} +\usepackage{booktabs} % Provides nicer horizontal lines +\usepackage{multirow} % Allows cells to span multiple rows +%\usepackage{longtable} % Allows for tables to span multiple pages + +%% Define the maths version of clr columns. +\newcolumntype{C}{>{\(}c<{\)}} +\newcolumntype{L}{>{\(}l<{\)}} +\newcolumntype{R}{>{\(}r<{\)}} + %% Other Packages %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -\usepackage{fancyvrb} -\usepackage{enumitem} % Can customize {enumerate} and {itemize} lists -\usepackage{hyperref} % Automatically inserts hyperlinks. \usepackage{listings} % Code listings -\usepackage{fp} % Floating point arithmetics \usepackage{minted} % Use Pygments -\usepackage{makeidx} +\usepackage{fp} % Floating point arithmetics +\usepackage{makeidx} % Index creation \usepackage{xr} % Cross-referencing +\usepackage{hyperref} % Automatically inserts hyperlinks. +\usepackage{cleveref} % Use `\cref{}` to reference anything + +\usepackage{autonum} %% Other modifications %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -\makeatletter % Modify the skip after each paragraph \setlength{\parskip}{1ex plus 0.5ex minus 0.2ex} -% \setlength{\headheight}{25.23pt} - -\definecolor{link-color}{RGB}{0 0 75} -\definecolor{cite-color}{RGB}{75 0 25} -\definecolor{file-color}{RGB}{75 25 0} -\definecolor{url-color}{RGB}{75 25 0} -\definecolor{link-border-color}{RGB}{100 200 255} -\definecolor{cite-border-color}{RGB}{255 0 150} -\definecolor{url-border-color}{RGB}{255 150 0} - -\hypersetup{ - pdftitle={simpler-wick: Simpler Wick contractions}, - pdfkeywords={wick contraction; TeX; LaTeX; ConTeXt; Tikz; pgf; simpler-wick}, - colorlinks=true, % If colorlinks is false, a border is drawn instead - % which does not appear in print. If it is true, the - % font is coloured and does appear in print. - linkcolor=link-color, - citecolor=cite-color, - filecolor=file-color, - urlcolor=url-color, - linkbordercolor=link-border-color, - citebordercolor=cite-border-color, - urlbordercolor=url-border-color, -} +\setlength{\parindent}{0pt} \providecommand\href[2]{\texttt{#1}} \providecommand\hypertarget[2]{\texttt{#1}} @@ -139,7 +150,7 @@ \inputminted[resetmargins]{latex}{example.out}% \end{minipage}% \hspace{0.05\linewidth}% - \begin{minipage}{0.4\linewidth}% + \begin{minipage}{0.43\linewidth}% \input{example.out}% \end{minipage}% \vspace{1ex}}} @@ -160,45 +171,89 @@ \makeindex +%% Define some slightly nicer colors +\definecolor{link-color}{RGB}{96 0 0} +\definecolor{cite-color}{RGB}{0 96 0} +\definecolor{file-color}{RGB}{0 0 96} +\definecolor{url-color}{RGB}{0 0 96} +\definecolor{link-border-color}{RGB}{255 159 159} +\definecolor{cite-border-color}{RGB}{159 255 159} +\definecolor{file-border-color}{RGB}{159 159 255} +\definecolor{url-border-color}{RGB}{159 159 255} + +\hypersetup{ + pdfborder=0 0 0, +} + +%% Document Information +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +\makeatletter +\newcommand{\@keywords}{} +\newcommand{\keywords}[1]{\renewcommand{\@keywords}{#1}} + +\newcommand{\@version}{} +\newcommand{\version}[1]{\renewcommand{\@version}{#1}} + +\AtBeginDocument{ + \hypersetup{ + pdftitle={\@title}, + pdfauthor={\@author}, + pdfkeywords={\@keywords}, + } +} +\makeatother + +\title{Simpler-Wick} +\version{1.0.0} +\author{Joshua \textsc{Ellis}} +\keywords{Wick contractions; TeX; LaTeX; TikZ; Simpler-Wick} + + + %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %% DOCUMENT %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \begin{document} -\begin{center} -\vspace*{1em} -\tikz\node[scale=1.2]{% - \color{gray}\Huge\ttfamily \char`\{\textcolor{green!50!black}{simpler-wick}\char`\}}; +\begin{titlepage} + \makeatletter + \begin{center} + \vspace*{1em} + \tikz\node[scale=1.5]{% + \color{gray}\Huge\ttfamily \char`\{\textcolor{red!75!black}{\@title}\char`\}}; -\vspace{0.5em} -{\Large\bfseries Simpler Wick Contractions} + \vspace{0.5em} + {\Large\bfseries Simpler Wick Contractions} -\vspace{0.7em} -{Version 0.1.0 \qquad \today} + \vspace{0.7em} + {Version \@version \qquad \today} -\vspace{1.3em} -{by Joshua Ellis} -\end{center} + \vspace{1.3em} + {by \@author} + \end{center} + \makeatother -\vfill + \vfill \begin{VerbatimOut}{example.out} -\(\wick{\c1Simp\c2le\c3r\ \c2Wick\ \c3Contracti\c1{on}}\) +\(\wick{\c1Simp\c2le\c3r\ \c2Wick\ \c3Contractio\c1n}\) \end{VerbatimOut} -\begin{center} - \tikzexternaldisable - \tikz\node[scale=2]{\input{example.out}}; - \tikzexternalenable - - \begin{minipage}{0.65\linewidth} - \inputminted{latex}{example.out} - \end{minipage} -\end{center} + \begin{center} + \tikzexternaldisable + \tikz\node[scale=2]{\input{example.out}}; + \tikzexternalenable + + \begin{minipage}{0.65\linewidth} + \inputminted{latex}{example.out} + \end{minipage} + \end{center} -\vfill + \vfill -\tableofcontents + \tableofcontents +\end{titlepage} %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %% CONTENT %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% @@ -215,24 +270,20 @@ \section{Introduction} \subsection{Installation} \label{subsec:installation} -This package is \emph{not} currently offered on -\href{https://www.ctan.org}{CTAN} as it is just a personal project of mine; -however, if enough people find it useful, I will look into making it available -through CTAN. - In order to use this as it is, simply download |simpler-wick.sty| and place it in the same directory as your \TeX~file and include it using the usual |\usepackage{simpler-wick}|. Alternatively, it is also possible to install |simpler-wick| system-wide by placing it inside \TeX's search path (which will -vary based on your operating system). +vary based on your operating system). This package is also available through +\href{https:/ctan.org}{\textsc{ctan}}. \section{Usage} \label{sec:usage} The package is imported by adding |\usepackage{simpler-wick}| to your preamble. -In your math environment, you now use the |\wick| command in combination with -|\c|: +In your math environment, you can now use the |\wick| command in combination +with |\c|: \begin{example} \begin{equation} @@ -272,12 +323,6 @@ \section{Usage} \end{equation} \end{example} -\begin{example} - \begin{equation} - \wick[sep=10pt]{\c1\phi \c2\psi \c2\psi \c1\phi} - \end{equation} -\end{example} - \end{document} %%% Local Variables: