summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/latex/turabian-formatting/turabian-formatting.sty
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2014-12-10 23:47:35 +0000
committerKarl Berry <karl@freefriends.org>2014-12-10 23:47:35 +0000
commit03fae1fb00f3d4356c8cd25de95f527e7016168e (patch)
treeb039870cd273b4c708ddc434502b48471a283754 /Master/texmf-dist/tex/latex/turabian-formatting/turabian-formatting.sty
parentb9e3d7df5c02ed0faf5dd208f547619f3d96bd93 (diff)
turabian-formatting (10dec14)
git-svn-id: svn://tug.org/texlive/trunk@35781 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/latex/turabian-formatting/turabian-formatting.sty')
-rw-r--r--Master/texmf-dist/tex/latex/turabian-formatting/turabian-formatting.sty466
1 files changed, 466 insertions, 0 deletions
diff --git a/Master/texmf-dist/tex/latex/turabian-formatting/turabian-formatting.sty b/Master/texmf-dist/tex/latex/turabian-formatting/turabian-formatting.sty
new file mode 100644
index 00000000000..8c097d801ab
--- /dev/null
+++ b/Master/texmf-dist/tex/latex/turabian-formatting/turabian-formatting.sty
@@ -0,0 +1,466 @@
+% Provides Turabian-style Chicago formatting for LaTeX
+%
+% Based on the Chicago Manual of Style (16th edition) and Kate Turabian's A Manual for Writers of Research Papers, Theses, and Dissertations (7th edition)
+%
+% ==============================
+% Copyright 2013 Omar Abdool
+%
+% This work may be distributed and/or modified under the conditions of the LaTeX
+% Project Public License (LPPL), either version 1.3 of this license or (at your
+% option) any later version.
+%
+% The latest version of this license is in:
+% http://www.latex-project.org/lppl.txt
+% and version 1.3 or later is part of all distributions of LaTeX version
+% 2005/12/01 or later.
+%
+% LPPL Maintenance Status: maintained (by Omar Abdool)
+%
+% This work consists of the files: turabian-formatting.sty,
+% turabian-researchpaper.cls, turabian-thesis.cls, turabian-formatting-doc.tex, % and turabian-formatting-doc.pdf (in addition to this README file).
+%
+% ==============================
+% Last updated: 2014/12/09
+%
+% Documented errors from required packages (ignore):
+% - LaTeX warning: "xparse/redefine-command"
+% Redefining document command \oldstylenums with arg. spec. 'm' on line 128.
+%
+% Implementation notes:
+% - package must be loaded before biblatex-chicago to work properly;
+% - known bug: use of geometry showframe option and plain page style with emptymargins option
+%
+
+
+\NeedsTeXFormat{LaTeX2e}
+\ProvidesPackage{turabian-formatting}[2014/12/09 Turabian Formatting]
+
+
+% Flags adjusted with package options
+
+\newif\if@draftwork\@draftworkfalse
+
+\newif\if@optraggedright\@optraggedrightfalse
+
+\newif\if@optemptymargins\@optemptymarginsfalse
+
+\newif\if@maketitlepage\@maketitlepagetrue
+
+\newif\if@appendrefformat\@appendrefformattrue
+
+
+% Options for package
+
+\DeclareOption{draft}{\@draftworktrue}
+
+\DeclareOption{raggedright}{\@optraggedrighttrue}
+
+\DeclareOption{emptymargins}{\@optemptymarginstrue}
+
+\DeclareOption{notitlepage}{\@maketitlepagefalse}
+
+\DeclareOption{noadjustbib}{\@appendrefformatfalse}
+
+\ProcessOptions\relax
+
+
+% Packages used throughout
+
+\RequirePackage{setspace, xifthen, etoolbox}
+
+
+% Page geometry and layout
+
+\RequirePackage{geometry}
+
+\geometry{margin=1in, ignoreall}
+\geometry{headheight=14.5pt, headsep=0.5in-\headheight}
+\geometry{footskip=0.5in-\headheight}
+
+\if@optemptymargins
+ \geometry{includehead}
+\fi
+
+
+% Text formatting
+
+\doublespacing
+\setlength{\parindent}{0.5in}
+
+\if@optraggedright
+ \newlength{\@parindentraggedright}
+ \setlength{\@parindentraggedright}{\parindent}
+ \raggedright
+ \setlength{\parindent}{\@parindentraggedright}
+\fi
+
+\RequirePackage[defaultlines=2, all]{nowidow}
+
+\RequirePackage{url}
+\urlstyle{same}
+
+
+% Footnote layout and formatting
+
+\RequirePackage[bottom,marginal]{footmisc}
+
+\setlength{\skip\footins}{12pt}
+\setlength{\footnotesep}{1\baselineskip}
+
+\renewcommand{\footnoterule}{%
+ \vspace*{-3pt}
+ \hrule width 2in height 0.4pt
+ \vspace*{-10.4pt}
+}
+
+% Footnote marker indent
+\setlength{\footnotemargin}{0.5in}
+
+% footnotemark
+\newcommand{\@turabianfnmarkformat}{%
+ \renewcommand{\@makefntext}[1]{%
+ \if@optraggedright
+ \raggedright%
+ \fi
+ \setlength{\parindent}{\footnotemargin}%
+ \@thefnmark.\,\,##1%
+ }
+}
+
+% keep footnote lines together
+\interfootnotelinepenalty=10000
+
+
+% Header and footer style layouts
+
+\RequirePackage{fancyhdr}
+
+% Page identifier (author name, title, etc.)
+\newcommand{\pageidentifier}{}
+
+\newlength{\@pageidentifierspace}
+\setlength{\@pageidentifierspace}{0em}
+
+\newcommand{\setpageidentifier}[2][3ex]{%
+ \setlength{\@pageidentifierspace}{#1}
+ \renewcommand{\pageidentifier}{%
+ #2\hspace*{\@pageidentifierspace}}
+}
+\setpageidentifier{}
+
+% draft option: draft indicator text
+\newcommand{\draftindicator}{}
+
+\newcommand{\setdraftindicator}[1]{%
+ \if@draftwork
+ \renewcommand{\draftindicator}{#1}
+ \fi
+}
+\setdraftindicator{Draft (\today)}
+
+% fancyhdr: page styles
+\fancyhf{}
+\fancyhead[R]{\normalfont\singlespace \pageidentifier\thepage}
+\fancyhead[L]{\normalfont\singlespace \small\draftindicator}
+\renewcommand{\headrulewidth}{0pt}
+\renewcommand{\footrulewidth}{0pt}
+
+\fancypagestyle{plain}{%
+ \fancyhf{}
+ \fancyfoot[C]{\normalfont\singlespace \thepage}
+ \fancyfoot[R]{\normalfont\singlespace \small\draftindicator}
+ \if@optemptymargins
+ \setlength{\headheight}{0pt}
+ \setlength{\headsep}{0pt}
+ \fi
+}
+\renewcommand{\plainheadrulewidth}{0pt}
+\renewcommand{\plainfootrulewidth}{0pt}
+
+\fancypagestyle{headings}{%
+ \fancyhf{}
+ \fancyhead[R]{\normalfont\singlespace \pageidentifier\thepage}
+ \fancyhead[L]{\normalfont\singlespace \small\draftindicator}
+}
+
+% fancy page style: allow customization of geometry first
+\AtEndPreamble{%
+ \pagestyle{fancy}
+}
+
+% Thesis-related front and main matter formatting
+\newlength{\@bindingoffsetfm}
+\setlength{\@bindingoffsetfm}{0in}
+
+\appto{\frontmatter}{%
+ \singlespacing
+ \newgeometry{margin=1in, bindingoffset=\@bindingoffsetfm, ignoreall, noheadfoot}
+ \pagestyle{empty}
+}
+\if@optemptymargins
+ \preto{\tableofcontents}{%
+ \renewcommand{\contentsname}{Table of Contents}
+ \newgeometry{margin=1in, bindingoffset=\@bindingoffsetfm, ignoreall, nohead, includefoot, bottom=1in+\headheight}
+ \pagestyle{plain}
+ }
+\else
+ \preto{\tableofcontents}{%
+ \renewcommand{\contentsname}{Table of Contents}
+ \restoregeometry
+ \pagestyle{plain}
+ }
+\fi
+\appto{\mainmatter}{%
+ \doublespacing
+ \restoregeometry
+ \pagestyle{headings}
+}
+
+
+% Title section formatting (including chapter)
+
+\PassOptionsToPackage{compact}{titlesec}
+
+\RequirePackage{titlesec}
+
+\titleformat{\chapter}[display]%
+ {\normalfont\mdseries\normalsize\singlespacing\centering}%
+ {Chapter \thechapter}%
+ {1\baselineskip}%
+ {}
+\titlespacing*{\chapter}%
+ {0em}%
+ {-1.2\baselineskip}%
+ {1\baselineskip}
+
+\titleformat{\section}[block]%
+ {\normalfont\bfseries\normalsize\singlespacing\centering}%
+ {}%
+ {0pt}%
+ {}
+\titlespacing*{\section}%
+ {0em}%
+ {0.5\baselineskip}%
+ {0.5\baselineskip}
+
+\titleformat{\subsection}[block]%
+ {\normalfont\mdseries\normalsize\singlespacing\centering}%
+ {}%
+ {0pt}%
+ {}
+\titlespacing*{\subsection}%
+ {0em}%
+ {0.5\baselineskip}%
+ {0.5\baselineskip}
+
+\titleformat{\subsubsection}[block]%
+ {\normalfont\mdseries\normalsize\singlespacing\raggedright}%
+ {}%
+ {0pt}%
+ {}
+\titlespacing*{\subsubsection}%
+ {0em}%
+ {0.5\baselineskip}%
+ {0pt}
+
+
+% Title Page: optional text
+
+\newcommand{\mytitlepage}{}
+
+\newcommand{\subtitle}[1]{\def\@subtitle{#1}}
+\subtitle{}
+
+\newcommand{\course}[1]{\def\@course{#1}}
+\course{}
+
+\newcommand{\institution}[1]{\def\@institution{#1}}
+\institution{}
+
+\newcommand{\setwordcount}[1]{\def\@wordcount{#1}}
+\setwordcount{}
+
+
+% Title Page: reformat \maketitle (Research Paper default)
+
+\if@maketitlepage
+
+ \renewcommand{\thanks}[1]{\def\@thanks{#1}}
+ \thanks{}
+
+ \newcommand{\@makewordcount}{%
+ \ifthenelse{\equal{\@wordcount}{}}%
+ {}%
+ {%
+ \hspace*{\fill}
+ \vspace{-1\baselineskip}
+ \@wordcount\ words%
+ }
+ }
+ \renewcommand{\mytitlepage}{%
+ \vspace*{\stretch{1}}
+ \ifthenelse{\equal{\@subtitle}{}}%
+ {%
+ \uppercase\expandafter{\@title}\par%
+ }%
+ {%
+ \MakeUppercase{\@title}:\par
+ \MakeUppercase{\@subtitle}\par%
+ }
+ \vspace*{1in}
+ \vspace*{\stretch{1}}
+ \@author\par
+ \@thanks\par
+ \@course\par
+ \@institution\par
+ \@date\par
+ \vspace*{\stretch{1}}
+ \@makewordcount%
+ }
+ \renewcommand{\maketitle}{%
+ \clearpage
+ \newgeometry{margin=1in, ignoreall, noheadfoot}
+ \thispagestyle{empty}
+ {\normalfont\normalsize\centering\singlespacing
+ \vspace*{-1\baselineskip}
+ \mytitlepage}
+ \clearpage
+ \restoregeometry
+ \setcounter{page}{1}
+ }
+\fi
+
+
+% Block quotations/quotes formatting
+
+\RequirePackage{quoting}
+
+\renewcommand*{\quotingfont}{\singlespace}
+\quotingsetup{%
+ vskip=0pt,
+ leftmargin=0.5in,
+ rightmargin=0.5in}
+
+\if@optraggedright
+ \quotingsetup{rightmargin=0in}
+\fi
+
+\renewcommand{\quotation}{\quoting}
+\renewcommand{\quote}{\quoting}
+
+
+% Tables and Figures: float positioning
+
+\renewcommand\fps@table{!htp}
+\renewcommand\fps@figure{!htp}
+
+\setlength{\textfloatsep}{1\baselineskip}
+\setlength{\intextsep}{0.5\baselineskip}
+
+\RequirePackage{flafter}
+
+
+% Tables and Figures: caption formatting
+
+\setlength{\abovecaptionskip}{0pt}
+\setlength{\belowcaptionskip}{0pt}
+
+\RequirePackage{caption}
+
+\captionsetup{%
+ format=plain,
+ font=small,
+ singlelinecheck=false,
+ justification=justified,
+ labelsep=period,
+ skip=0.167\baselineskip}
+
+\captionsetup[table]{%
+ position=top}
+
+\captionsetup[figure]{%
+ position=bottom}
+
+
+% Tables: source and note formatting commands
+
+\newcommand{\tablesource}[1]{\vspace{1\baselineskip}#1\par}
+
+\newcommand{\tablenote}[1]{\vspace{1\baselineskip}#1\par}
+
+
+% endnotes: formatting support
+% Note: Error when cite keys contain “_”
+
+\newcommand{\@turabianendnoteformat}{%
+ \@ifpackageloaded{endnotes}%
+ {%
+ \renewcommand{\enoteformat}{%
+ \if@optraggedright
+ \raggedright%
+ \fi
+ \setlength{\parindent}{\footnotemargin}
+ \vspace*{1\baselineskip}
+ \theenmark.\,\,%
+ }
+ \preto{\theendnotes}{%
+ \clearpage
+ \begingroup
+ \singlespacing
+ \def\enotesize{\normalsize}
+ \setlength{\parskip}{0pt}
+ }
+ \appto{\theendnotes}{%
+ \endgroup
+ }
+ }%
+ {}
+}
+
+
+% biblatex-chicago: references formatting
+
+\PassOptionsToPackage{%
+ notes, isbn=false, autolang=other, backend=biber}{biblatex-chicago}
+
+\newcommand{\@turabianbibformat}{%
+ \@ifpackageloaded{biblatex-chicago}%
+ {%
+ \@ifclassloaded{article}%
+ {%
+ \defbibheading{bibliography}[\bibname]{%
+ \clearpage
+ \section*{##1}
+ \singlespacing}
+
+ \defbibheading{subbibliography}[\bibname]{%
+ \subsection*{##1}
+ \singlespacing}
+ }%
+ {%
+ \defbibheading{bibliography}[\bibname]{%
+ \chapter{##1}
+ \singlespacing}
+
+ \defbibheading{subbibliography}[\bibname]{%
+ \section{##1}
+ \singlespacing}
+ }
+ \renewcommand{\bibitemsep}{1\baselineskip}
+ \renewcommand{\bibhang}{0.5in}
+ }%
+ {}
+}
+
+
+% Append references reformatting at end of preamble (noappends option)
+
+\AtEndPreamble{%
+ \if@appendrefformat
+ \@turabianfnmarkformat
+ \@turabianbibformat
+ \@turabianendnoteformat
+ \fi
+}
+
+