Permalink
Branch: master
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
executable file 210 lines (179 sloc) 7.68 KB
\ProvidesPackage{mypackages}
%=================================================================
% packages that need to be loaded first
%=================================================================
\usepackage{calc}
\usepackage{ifthen}
\usepackage{ifpdf}
\newboolean{color}\setboolean{color}{true} % switch between color and black/white
\newboolean{show-comments}\setboolean{show-comments}{true} % show conditional comments (\ccom) on/off (e.g. for drafts)
%=================================================================
% fonts
%=================================================================
\usepackage[utf8]{inputenc} % does not work with ð and þ; use \eth and \thorn instead
\usepackage[T1]{fontenc} % scalable EC fonts
\usepackage{tipx}
\usepackage[bitstream-charter]{mathdesign}% math fonts matched for charter, garamond, times, utopia
\DeclareMathAlphabet{\mathsc}{T1}{mdbch}{m}{fsc} % define mathscript font
\usepackage{skull} % for a dangerous skull
\usepackage{bbding} % for checkmarks and failures
\usepackage{pifont}
\usepackage[normalem]{ulem}
% use microtype with pdflatex for optimized kerning, protrusion etc.
% see the microtype manual for additional options
\ifpdf
\usepackage[kerning=true, draft=false]{microtype}
\fi
%=================================================================
% bibliography
%=================================================================
\usepackage[backend=biber,
bibstyle=biblatex-sp-unified,
citestyle=sp-authoryear-comp,
natbib=true,
refsegment=chapter]
{biblatex}
% don't put "in" in front of journal names
\renewbibmacro{in:}{%
\ifentrytype{article}{}{\printtext{\bibstring{in}\intitlepunct}}}
% do not add any header for subbibliography;
% look at mycommands.sty for the literature-environment instead
\defbibheading{subbibliography}{}
% \usepackage{natbib}
% \usepackage[sectionbib]{natbib}
% \bibpunct[:]{(}{)}{;}{a}{}{,} % this command defines:
% pages delimiter, style for opening & closing bracket
% reference delimiter, counter, space, and year delimiter
% \usepackage{chapterbib}
%=================================================================
% glosses
%=================================================================
\makeatletter
\def\new@fontshape{}
\makeatother
\usepackage{gb4e}
\noautomath
\makeatletter
\@addtoreset{exx}{chapter}
\@addtoreset{exx}{chapter*}
\makeatother
%=================================================================
% graphics
%=================================================================
\ifpdf % load color with different settings for latex and pdflatex
\ifthenelse{\boolean{color}} % switch between color and black/white; set in myifthensettings.sty
{\usepackage[usenames,dvipsnames,svgnames,x11names]{xcolor}}
{\usepackage[usenames,dvipsnames,monochrome,svgnames,x11names]{xcolor}}
\else
\ifthenelse{\boolean{color}} % switch between color and black/white; set in myifthensettings.sty
{\usepackage[usenames,dvips]{color}}
{\usepackage[usenames,dvips,monochrome]{color}}
\fi
\ifpdf % load graphicx with different settings for latex and pdflatex
\usepackage[pdftex]{graphicx}
\DeclareGraphicsExtensions{.pdf,.png,.jpg,.mps}
\else
\usepackage[dvips]{graphicx}
\DeclareGraphicsExtensions{.eps}
\fi
\definecolor{theblue}{rgb}{0.02.,0.04,0.48}
\usepackage{framed} % for nice paragraph styles
\usepackage{tikz}
\usetikzlibrary{arrows,automata,backgrounds,calc,chains,decorations.pathmorphing,decorations.text,external,fadings,fit,matrix,scopes,shadows,shapes,spy,through,trees}
\tikzexternalize[optimize=false]
\tikzsetexternalprefix{./build/tikz/}
\usepackage[linguistics]{forest}
\usepackage{marginnote}
%=================================================================
% language
%=================================================================
\usepackage[english]{babel} % if you are using several languages, the last one is the default
\selectlanguage{english}
%=================================================================
% math typesetting
%=================================================================
\RequirePackage{mathtools} % revised version of amsmath
\RequirePackage{blkarray}
\RequirePackage[amsmath,hyperref,thmmarks]{ntheorem}
\RequirePackage{cancel}
\RequirePackage[algochapter,linesnumbered,vlined,ruled]{algorithm2e}
\RequirePackage{bussproofs}
%=================================================================
% misc
%=================================================================
\usepackage{booktabs}
\usepackage{wrapfig}
\usepackage{mdwlist}
\usepackage[titles]{tocloft}
\usepackage{multirow}
\usepackage{subcaption}
\usepackage{xspace}
\usepackage{shorttoc}
%=================================================================
% programming
%=================================================================
\usepackage[chapter]{minted}
%=================================================================
% references
%=================================================================
\usepackage{varioref}
%=================================================================
% packages that need to be loaded last
%=================================================================
\usepackage[letterpaper, top=2cm, bottom=2.5cm, left=2cm, right=6cm]{geometry}
\usepackage{fancyhdr}
\makeatletter
\def\cleardoublepage{\clearpage\if@twoside \ifodd\c@page\else
\hbox{}
\vspace*{\fill}
% \begin{center}
% This page intentionally left blank
% \end{center}
% \vspace{\fill}
\thispagestyle{empty}
\newpage
\if@twocolumn\hbox{}\newpage\fi\fi\fi}
\makeatother
% increase the header height to fit in all the text on the front page;
\addtolength{\headheight}{\baselineskip}
% set some basic parameters of the header layout
\newcommand{\HeaderFontSize}{\footnotesize}
\newcommand{\WPLheadrulewidth}{.6pt}
% headers don't have a separating line on a page consisting only of floats,
% else they use the separator defined by \@WPLheadrulewidth above;
% foots never have a separating line
\renewcommand{\headrulewidth}{\iffloatpage{0pt}{\WPLheadrulewidth}}
\renewcommand{\footrulewidth}{0pt}
% define the page headers for everything but the front page;
% first we remove the standard headers and footers
\fancyhf{}
\fancyheadoffset[RO,LE]{\marginparsep+\marginparwidth}
\fancyhead[C]{\HeaderFontSize \lastname\ - \coursename, \semester}
\fancyhead[RO,LE]{\bfseries \thepage}
\fancypagestyle{plain}{
\fancyhf{}
\renewcommand{\headrulewidth}{0pt}
}
\ifpdf % optionally load hyperref
\usepackage[pdftex,%
backref=false,% add link to section of citation to each item in bibliography
pagebackref=false,% add link to page of citation to each item in bibliography
unicode=true,% non-Latin characters in Acrobat’s bookmarks
breaklinks=true,% allow link texts to break across lines
pageanchor=true,% if set to false, the TOC will have no links
colorlinks=true,% false: boxed links; true: colored links
linkcolor=theblue,% color of internal links
citecolor=theblue,% color of links to bibliography
filecolor=theblue,% color of file links
urlcolor=theblue,% color of external links
pdfauthor={\theauthor},% as specified by you in main.tex
pdftitle={\coursename},% as specified by you in main.tex
pdfkeywords={\thekeywords}% as specified by you in main.tex
]{hyperref}%
%
% since hyperref links to captions, it links to the bottom of tables and figures;
% in order to fix this problem, the hypcap package redefines table, table*, figure, and figure*
% such that their caption is at the top;
% CAUTION: This means it will clash with any package that redefines \caption or \@caption
\usepackage[all]{hypcap}
\fi