commit b34164f829a846af424868aff7fb21e863daa884 Author: Daniel Bauer Date: Mon Jan 10 15:58:05 2022 +0100 inital commit diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..b6ffd42 --- /dev/null +++ b/.gitignore @@ -0,0 +1,250 @@ +## Custom exclusions +article-template.pdf +book-template.pdf + +## Core latex/pdflatex auxiliary files: +*.aux +*.lof +*.log +*.lot +*.fls +*.out +*.toc +*.fmt +*.fot +*.cb +*.cb2 +.*.lb + +## Intermediate documents: +*.dvi +*.xdv +*-converted-to.* +# these rules might exclude image files for figures etc. +# *.ps +# *.eps +# *.pdf + +## Generated if empty string is given at "Please type another file name for output:" +.pdf + +## Bibliography auxiliary files (bibtex/biblatex/biber): +*.bbl +*.bcf +*.blg +*-blx.aux +*-blx.bib +*.run.xml + +## Build tool auxiliary files: +*.fdb_latexmk +*.synctex +*.synctex(busy) +*.synctex.gz +*.synctex.gz(busy) +*.pdfsync + +## Auxiliary and intermediate files from other packages: +# algorithms +*.alg +*.loa + +# achemso +acs-*.bib + +# amsthm +*.thm + +# beamer +*.nav +*.pre +*.snm +*.vrb + +# changes +*.soc + +# cprotect +*.cpt + +# elsarticle (documentclass of Elsevier journals) +*.spl + +# endnotes +*.ent + +# fixme +*.lox + +# feynmf/feynmp +*.mf +*.mp +*.t[1-9] +*.t[1-9][0-9] +*.tfm + +#(r)(e)ledmac/(r)(e)ledpar +*.end +*.?end +*.[1-9] +*.[1-9][0-9] +*.[1-9][0-9][0-9] +*.[1-9]R +*.[1-9][0-9]R +*.[1-9][0-9][0-9]R +*.eledsec[1-9] +*.eledsec[1-9]R +*.eledsec[1-9][0-9] +*.eledsec[1-9][0-9]R +*.eledsec[1-9][0-9][0-9] +*.eledsec[1-9][0-9][0-9]R + +# glossaries +*.acn +*.acr +*.glg +*.glo +*.gls +*.glsdefs + +# gnuplottex +*-gnuplottex-* + +# gregoriotex +*.gaux +*.gtex + +# htlatex +*.4ct +*.4tc +*.idv +*.lg +*.trc +*.xref + +# hyperref +*.brf + +# knitr +*-concordance.tex +# TODO Comment the next line if you want to keep your tikz graphics files +*.tikz +*-tikzDictionary + +# listings +*.lol + +# makeidx +*.idx +*.ilg +*.ind +*.ist + +# minitoc +*.maf +*.mlf +*.mlt +*.mtc[0-9]* +*.slf[0-9]* +*.slt[0-9]* +*.stc[0-9]* + +# minted +_minted* +*.pyg + +# morewrites +*.mw + +# nomencl +*.nlg +*.nlo +*.nls + +# pax +*.pax + +# pdfpcnotes +*.pdfpc + +# sagetex +*.sagetex.sage +*.sagetex.py +*.sagetex.scmd + +# scrwfile +*.wrt + +# sympy +*.sout +*.sympy +sympy-plots-for-*.tex/ + +# pdfcomment +*.upa +*.upb + +# pythontex +*.pytxcode +pythontex-files-*/ + +# thmtools +*.loe + +# TikZ & PGF +*.dpth +*.md5 +*.auxlock + +# todonotes +*.tdo + +# easy-todo +*.lod + +# xmpincl +*.xmpi + +# xindy +*.xdy + +# xypic precompiled matrices +*.xyc + +# endfloat +*.ttt +*.fff + +# Latexian +TSWLatexianTemp* + +## Editors: +# WinEdt +*.bak +*.sav + +# Texpad +.texpadtmp + +# Kile +*.backup + +# KBibTeX +*~[0-9]* + +# auto folder when using emacs and auctex +./auto/* +*.el + +# expex forward references with \gathertags +*-tags.tex + +# standalone packages +*.sta + +# generated if using elsarticle.cls +*.spl +.snakemake + +thesis_stats* +*.sec diff --git a/.latexmkrc b/.latexmkrc new file mode 100644 index 0000000..935e3e4 --- /dev/null +++ b/.latexmkrc @@ -0,0 +1,8 @@ +add_cus_dep('glo', 'gls', 0, 'makeglossaries'); +add_cus_dep('acn', 'acr', 0, 'makeglossaries'); + +sub makeglossaries { + system "makeglossaries $_[0]"; +} + +$pdflatex=q/xelatex -synctex=1 %O %S/ diff --git a/README.md b/README.md new file mode 100644 index 0000000..071b938 --- /dev/null +++ b/README.md @@ -0,0 +1,28 @@ +# A tufte-derived Dissertation/Thesis LaTeX-template +A LaTeX-template that can be used for dissertations. I developed +this template while writing my own PhD thesis. You can see the template in use +here: [Example](https://tuprints.ulb.tu-darmstadt.de/18611/) + +### Requirements: +- texlive-full +- biber (for biblatex) +- latexmk, xelatex +- Fonts: Vollkorn (http://vollkorn-typeface.com), Gillius ADF No2 (https://blogfonts.com/gillius-adf-no2.font) + +### Compilation + +Compile with `xlatexmk` (there is a `.latexmkrc`): +```bash +latexmk thesis.tex -pdf +``` + +or use ninja: +```bash +ninja thesis.pdf +``` + +### License +Copyright 2017–2021 by Daniel Bauer. + +This template uses a modified version of the original [tufte-latex](https://github.com/Tufte-LaTeX/tufte-latex) +template which was published under the Apache 2.0 License, so this work will also use it. \ No newline at end of file diff --git a/abstract.tex b/abstract.tex new file mode 100644 index 0000000..4cacb6c --- /dev/null +++ b/abstract.tex @@ -0,0 +1,6 @@ +%!TEX root = thesis.tex +\chapter{Abstract} +\blindtext[4] +\glsresetall +\chapter{Zusammenfassung} +\blindtext[4] \ No newline at end of file diff --git a/acknowledgements.tex b/acknowledgements.tex new file mode 100644 index 0000000..ce8ddb5 --- /dev/null +++ b/acknowledgements.tex @@ -0,0 +1,9 @@ +% -*- Mode:TeX -*- +%!TEX root = thesis.tex +\chapter*{Acknowledgements} +\addcontentsline{toc}{chapter}{Acknowledgements} +\doublespacing +A page to put acknowledgements. +\begin{flushright} +\textit{Thank you!} +\end{flushright} \ No newline at end of file diff --git a/acronyms.tex b/acronyms.tex new file mode 100644 index 0000000..c890c56 --- /dev/null +++ b/acronyms.tex @@ -0,0 +1,68 @@ +%!TEX root = thesis.tex + +\makeglossaries +\newacronym{MD}{MD}{molecular dynamics} +\newacronym{LJ}{LJ}{Lennard-Jones} +\newacronym{PME}{PME}{particle-mesh Ewald} +\newacronym{HCN}{HCN}{hyperpolarization-activated cyclic nucleotide-gated} +\newacronym{VSD}{VSD}{voltage sensor domain} +\newacronym{LBD}{LBD}{ligand-binding domain} +\newacronym{PD}{PD}{pore domain} +\newacronym{SF}{SF}{selectivity filter} +\newacronym{TPCs}{TPCs}{two-pore channels} +\newacronym{KTN}{KTN}{nucleotide-binding domain} +\newacronym{Na}{Na\textsuperscript{+}}{sodium} +\newacronym{K}{K\textsuperscript{+}}{potassium} +\newacronym{Cl}{Cl\textsuperscript{-}}{chloride} +\newacronym{Ca}{Ca\textsuperscript{2+}}{calcium} +\newacronym[firstplural=voltage-gated ion channels (VGICs)]{VGIC}{VGIC}{voltage-gated ion channel} +\newacronym{If}{I\textsubscript{f}}{funny current} +\newacronym[firstplural=transmembrane helices (TMHs)]{TMH}{TMH}{transmembrane helix} +\newacronym{Kv}{K\textsubscript{V}}{voltage-gated potassium channel} +\newacronym{Kchannel}{K\textsuperscript{+}~channel}{potassium channel} +\newacronym{SAN}{SAN}{sinoatrial node} +\newacronym{CNBD}{CNBD}{cyclic-nucleotide binding-domain} +\newacronym{cAMP}{cAMP}{cyclic-adenosine monophosphate} +\newacronym{cGMP}{cGMP}{cyclic-guanosine monophosphate} +\newacronym{TRIP8b}{TRIP8b}{tetratricopeptide repeat-containing Rab8b-interacting protein} +\newacronym{HCND}{HCND}{HCN domain} +\newacronym{AA}{AA}{amino acid} +\newacronym{PBC}{PBC}{periodic boundary conditions} +\newacronym{PMF}{PMF}{potential of mean force} +\newacronym{CV}{CV}{collective variable} +\newacronym{MFEP}{MFEP}{minimal free energy pathway} +\newacronym{FES}{FES}{free energy surface} +\newacronym{US}{US}{umbrella sampling} +\newacronym{WHAM}{WHAM}{Weighted Histogram Analysis Method} +\newacronym{TEA}{TEA\textsuperscript{+}}{tetraethylazanium} +\newacronym{POPC}{POPC}{palmitoyloleoylphosphatidylcholine} +\newacronym{VdW}{VdW}{Van der Waals} +\newacronym{RDF}{RDF}{radial distribution function} +\newacronym{COM}{COM}{center-of-mass} +\newacronym{CF}{CF}{cystic fibrosis} +\newacronym{CFTR}{CFTR}{cystic fibrosis transmembrane conductance regulator} +\newacronym{NEB}{NEB}{nudged elastic band} +\newacronym{TST}{TST}{transition state theory} +\newacronym{wt}{wt}{wildtype} + +\newcommand{\K}{\gls{K}\xspace} +\newcommand{\Na}{\gls{Na}\xspace} +\newcommand{\Cl}{\gls{Cl}\xspace} +\newcommand{\Ca}{\gls{Ca}\xspace} +\newcommand{\Calpha}{C\subs{$\alpha$}\xspace} +\newcommand{\s}[1]{s\textsubscript{#1}\xspace} +\newcommand{\p}[1]{p\textsubscript{#1}\xspace} +\newcommand{\z}[1]{z\textsubscript{#1}\xspace} +\newcommand{\Kchannel}{\K~channel\xspace} +\newcommand{\Kchannels}{\K~channels\xspace} +\newcommand{\KK}{\gls{K}/\gls{K}\xspace} +\newcommand{\NaNa}{\gls{Na}/\gls{Na}\xspace} +\newcommand{\KNa}{\gls{K}/\gls{Na}\xspace} +\newcommand{\NaK}{\gls{Na}/\gls{K}\xspace} +\newcommand{\KKK}{\gls{K}/\gls{K}/\gls{K}\xspace} +\newcommand{\NaNaNa}{\gls{Na}/\gls{Na}/\gls{Na}\xspace} +\newcommand{\KNaNa}{\gls{K}/\gls{Na}/\gls{Na}\xspace} +\newcommand{\NaKK}{\gls{Na}/\gls{K}/\gls{K}\xspace} + +\glsaddall + diff --git a/appendix.tex b/appendix.tex new file mode 100644 index 0000000..a159609 --- /dev/null +++ b/appendix.tex @@ -0,0 +1,26 @@ +%!TEX root = thesis.tex +\chapter{Abbreviations} +\vspace{-0.5cm} +\begin{tcolorbox}[ + enhanced, + enforce breakable, + check odd page, + toggle left and right, + grow to right by=\marginparwidth+\marginparsep-0.4cm, + toggle enlargement=evenpage, + notitle after break, + vfill before first, + nobeforeafter, + sharp corners, + top=0pt, + before upper={\let\clearpage\relax}, + opacityback=0, + opacityframe=0, +] + +\renewcommand{\glossarysection}[2][]{} % no glossary title +\printglossaries +\end{tcolorbox} + +\chapter{Additional Data} +\blindtext diff --git a/athene.png b/athene.png new file mode 100644 index 0000000..3703eaa Binary files /dev/null and b/athene.png differ diff --git a/biblio.bib b/biblio.bib new file mode 100644 index 0000000..08cdbd8 --- /dev/null +++ b/biblio.bib @@ -0,0 +1,58 @@ + +@article{Abraham2015, + title = {{{GROMACS}}: {{High}} Performance Molecular Simulations through Multi-Level Parallelism from Laptops to Supercomputers}, + author = {Abraham, Mark James and Murtola, Teemu and Schulz, Roland and Páll, Szilárd and Smith, Jeremy C. and Hess, Berk and Lindahl, Erik}, + date = {2015}, + journaltitle = {SoftwareX}, + volume = {1}, + pages = {19--25}, + issn = {23527110}, + doi = {10.1016/j.softx.2015.06.001}, + abstract = {GROMACS is one of the most widely used open-source and free software codes in chemistry, used primarily for dynamical simulations of biomolecules. It provides a rich set of calculation types, preparation and analysis tools. Several advanced techniques for free-energy calculations are supported. In version 5, it reaches new performance heights, through several new and enhanced parallelization algorithms. These work on every level; SIMD registers inside cores, multithreading, heterogeneous CPU–GPU acceleration, state-of-the-art 3D domain decomposition, and ensemble-level parallelization through built-in replica exchange and the separate Copernicus framework. The latest best-in-class compressed trajectory storage format is supported.}, + keywords = {\#nosource}, + file = {/home/bauer/Zotero/storage/W2EN24B4/Abraham et al_2015_GROMACS.pdf} +} + +@article{Alam2009, + title = {High-Resolution Structure of the Open {{NaK}} Channel}, + author = {Alam, Amer and Jiang, Youxing}, + date = {2009-01-21}, + journaltitle = {Nature Structural \& Molecular Biology}, + volume = {16}, + number = {1}, + pages = {30--34}, + issn = {1545-9993}, + doi = {10.1038/nsmb.1531}, + abstract = {We report the crystal structure of the nonselective cation channel NaK from Bacillus cereus at a resolution of 1.6 Å . The structure reveals the intracellular gate in an open state, as opposed to the closed form reported previously, making NaK the only channel for which the three-dimensional structures of both conformations are known. Channel opening follows a conserved mechanism of inner helix bending using a flexible glycine residue, the gating hinge, seen in MthK and most other tetrameric cation channels. Additionally, distinct inter and intrasubunit rearrangements involved in channel gating are seen and characterized for the first time along with inner helix twisting motions. Furthermore, we identify a residue deeper within the cavity of the channel pore, Phe92, which is likely to form a constriction point within the open pore, restricting ion flux through the channel. Mutating this residue to alanine causes a subsequent increase in ion-conduction rates as measured by 86 Rb flux assays. The structures of both the open and closed conformations of the NaK channel correlate well with those of equivalent K + channel conformations, namely MthK and KcsA, respectively. The opening and closing of ion channel pores in response to external stimuli such as voltage or ligand binding is a process of extreme importance to ion channel physiology 1 . Until now, our knowledge of the open and closed conformations of tetrameric cation channel pores comes predominantly from the crystal structures of various K + channels, among which the structures of KcsA and MthK have been generally accepted as reasonable models for the closed and open conformations of tetrameric cation channel pores, respectively 2–9 . The closed conformation is characterized by near-straight inner helices and the subsequent bundle crossing that is formed by interactions between their C-terminal residues. In the open conformation seen in the MthK structure, the inner helices seem to bend at a conserved glycine residue, the gating hinge also seen in most other cation channels, resulting in the disruption of the bundle crossing. However, structural information on both states from the same channel has so far been lacking. In the process of studying the ion-selectivity properties of the NaK channel, which shares overall sequence and structural similarities with KcsA, except in the selectivity filter region, and conducts both Na + and K + (refs. 10,11), we crystallized a truncated construct (NaKND19) lacking its N-terminal M0 helix and determined its structure at a resolution of 1.6 Å . Unexpectedly, the NaKND19 structure reveals the intracellular gate in an open conformation. Combined with the closed conformation structure of NaK, the new structure provides a unique opportunity to analyze in detail the structural features underlying pore opening and closing within the same channel. We observe both inner helix twisting and bending at the glycine gating hinge upon pore opening. Our data clearly demonstrate the conservation of central sequence and structural motifs involved in channel opening, while also offering insight into the intricate rearrangements of interactions within and between channel subunits upon undergoing gating transi-tions. In addition, the high-resolution structures also allow us to carry out an analysis of the molecular details of ion binding in the NaK selectivity filter, which we report in our companion paper 12 .}, + keywords = {\#nosource}, + file = {/home/bauer/Zotero/storage/L33BLVLV/Alam_Jiang_2009_High-resolution structure of the open NaK channel.pdf} +} + +@article{Biggin2000, + ids = {biggin2000}, + title = {Potassium Channel Structure: Domain by Domain}, + author = {Biggin, Phil C. and Roosild, Tarmo and Choe, Senyon}, + date = {2000-08}, + journaltitle = {Current Opinion in Structural Biology}, + volume = {10}, + number = {4}, + eprint = {10981635}, + eprinttype = {pmid}, + pages = {456--461}, + issn = {0959-440X}, + doi = {10.1016/S0959-440X(00)00114-7}, + abstract = {Since the determination of the structure of a bacterial potassium channel, the ion channel community has managed to gain momentum in the quest for a complete picture. The information is coming at a steady flow, on a domain by domain basis. Recent discoveries are starting to reveal clues to the complex manner in which potassium channels show enormous diversity of function and also to their methods of regulation. Currently, the structures of four domains are known, with the most recent addition being the Kv?? structure. As efforts continue in the study of the transmembrane domains, especially the voltage-sensing apparatus, there has been a new realization with respect to the identification and role of the cytoplasmic domains in protein-protein interactions in particular. An additional discovery, considerably aided by recent genomic analysis, is that potassium channels comprising subunits with two pore regions and four transmembrane helices combined in a dimeric fashion are abundant and are probable targets for local anesthetics.}, + isbn = {0959-440X (Print)}, + keywords = {Anesthetics,Beta subunit,BTB/POZ,Domains,KcsA,NAD,Potassium channels,Protein-protein interaction,Structure,T1}, + file = {/home/bauer/Zotero/storage/5KMKYJVX/Biggin et al_2000_Potassium channel structure.pdf;/home/bauer/Zotero/storage/KI98GGZ7/Biggin et al_2000_Potassium channel structure.pdf;/home/bauer/Zotero/storage/PG8BRYFT/S0959440X00001147.html} +} + +@book{book:1314973, + title = {Handbook of Ion Channels}, + author = {Trudeau, Matthew C. and Zheng, Jie}, + date = {2015}, + edition = {1}, + publisher = {{CRC Press}}, + isbn = {978-1-4665-5142-8 1-4665-5142-9}, + file = {/home/bauer/Zotero/storage/A2UIWBQT/Trudeau_2015_Handbook of ion channels.pdf} +} diff --git a/biblio.tex b/biblio.tex new file mode 100644 index 0000000..7a25750 --- /dev/null +++ b/biblio.tex @@ -0,0 +1,52 @@ +%!TEX root = thesis.tex + +% This is how the bibliography looks like without treatment +% Pretty ugly because there is a lot of wasted space +%\bibliography{testbib}{} +%\bibliographystyle{plain} + + +% Try to eliminate margins by putting bibliography into a tcolorbox + + +% \tcolorboxenvironment{thebibliography}{ +% enhanced, +% breakable, +% check odd page, +% toggle left and right, +% grow to right by=\marginparwidth+\marginparsep, +% toggle enlargement=evenpage, +% notitle after break, +% nobeforeafter, +% sharp corners, +% top=0pt, +% before upper={\let\clearpage\relax}, +% fontupper=\Huge} +\chapter{References} +\vspace{-0.5cm} +\begin{tcolorbox}[ + enhanced, + enforce breakable, + check odd page, + toggle left and right, + grow to right by=\marginparwidth+\marginparsep-0.4cm, + toggle enlargement=evenpage, + notitle after break, + vfill before first, + nobeforeafter, + sharp corners, + top=0pt, + left=0pt, + bottom=0pt, + right=0pt, + before upper={\let\clearpage\relax}, + fontupper=\Huge, + opacityback=0, + opacityframe=0, +] +% \begin{thebibliography} +% bibliography +% \addcontentsline{toc}{chapter}{References} +\printbibliography[heading=none] %bibintoc,title={References}] + +\end{tcolorbox} \ No newline at end of file diff --git a/build.ninja b/build.ninja new file mode 100644 index 0000000..8c6c423 --- /dev/null +++ b/build.ninja @@ -0,0 +1,5 @@ +rule latex + command = latexmk -pdf -interaction=nonstopmode $tex + +build thesis.pdf: latex abstract.tex acknowledgements.tex acronyms.tex appendix.tex biblio.tex config.tex frontpages.tex thesis.tex biblio.bib tufte-common.def tufte-book.cls + tex = thesis.tex diff --git a/cat.jpg b/cat.jpg new file mode 100644 index 0000000..0efe8d7 Binary files /dev/null and b/cat.jpg differ diff --git a/config.tex b/config.tex new file mode 100644 index 0000000..f2266c0 --- /dev/null +++ b/config.tex @@ -0,0 +1,477 @@ +%!TEX root = thesis.tex + +\usepackage[english]{babel} % Load characters and hyphenation +\usepackage{csquotes} % English quotes mess with biblatex quotes +\usepackage{ccicons} +\usepackage{todonotes} +\usepackage{blindtext} +\usepackage{amsmath,amssymb} +\usepackage{textgreek} +\usepackage{tikz} +\usepackage{tocloft} +\usepackage{siunitx} +\usepackage{float} +\usepackage{microtype} +\usepackage{booktabs} +\usepackage{texshade} +\usepackage{morefloats} +\usepackage{hyperref} +\usepackage{hypcap} +\usepackage{enumitem} +\usepackage{xspace} +\usepackage{hyphenat} +\usepackage[most]{tcolorbox} +\usepackage[noabbrev,nameinlink]{cleveref} + +% required for certain inkscape exports +\usepackage{xcolor} + +\xspaceaddexceptions{]\}} + +\usetikzlibrary{shapes,arrows,shapes.multipart} + + +\sisetup{separate-uncertainty,range-units=single,group-separator = {,}} + +% show a black bar when overfull +% \overfullrule=2cm + +% nonbreaking namerefs +% \AtBeginDocument{ +% \let\oldnameref\nameref +% \renewcommand\nameref[1]{\ref{#1}~\oldnameref{#1}} +% } + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% Disable warnings +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +\usepackage{silence} +\WarningFilter{biblatex}{Patching footnotes} +\WarningFilter{biblatex}{Name format 'last-first' deprecated} +\WarningFilter{latex}{Marginpar on page} +\WarningFilter{latexfont}{Font shape} +\WarningFilter{latexfont}{Some font} +\WarningFilter{latexfont}{Font shape} +\WarningFilter{biblatex}{No driver for entry type 'software'} +\WarningFilter{latex}{`!h' float specifier changed to `!ht'} + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% Acronyms +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +\usepackage[nogroupskip,nopostdot,acronym,style=super,nonumberlist,nohypertypes={acronym},automake]{glossaries} +\renewcommand*{\glsnamefont}[1]{#1} + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% fonts +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +\usepackage{fontspec} +% \setmainfont{TeX Gyre Pagella} +% \usepackage[libertine,cmintegrals,cmbraces,vvarbb]{newtxmath} +% \setmainfont{ETBembo}[ + % SmallCapsFont={Bembo Small Caps & Oldstyle Fig} +% ] +\setmainfont{Vollkorn} +\setsansfont{Gillius ADF No2} +% \setmonofont + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% hyperlinks +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +\definecolor{hyperrefcolor}{rgb}{0.2, 0.5, 0.8} % matches pymol slate +\hypersetup{ +colorlinks, +allcolors=hyperrefcolor, +} + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% TOC Style +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% hide something from toc +\newcommand{\changelocaltocdepth}[1]{% + \addtocontents{toc}{\protect\setcounter{tocdepth}{#1}}% + \setcounter{tocdepth}{#1}% +} + +% allows to specifically place chapters outside of parts +\makeatletter +\newcommand{\ChaptersOutsidePart}{% + \addtocontents{toc}{\bigskip} + \def\toclevel@chapter{-1}\def\toclevel@section{0}\def\toclevel@subsection{1}} +\newcommand{\ChaptersInsidePart}{% + \def\toclevel@chapter{0}\def\toclevel@section{1}\def\toclevel@subsection{2}} +\makeatother + +% TOC style +\setlength{\cftbeforechapskip}{0pt} +\setlength{\cftbeforepartskip}{10pt} +\renewcommand\cftpartfont{\sc\bfseries} +\renewcommand\cftchapfont{\small\sc} +\renewcommand\cftsecfont{\small} +\renewcommand\cftsubsecfont{\small} +\renewcommand\cftsubsubsecfont{\small} + +% \renewcommand\cftpartafterpnum{\vspace{-10pt}} + +% Titles of TOC, LOF, LOT +\renewcommand\cfttoctitlefont{\vspace{-2.5cm}\relax\huge\rmfamily} +\renewcommand\cftaftertoctitle{\vspace{0.35em}} +\renewcommand\cftloftitlefont{\vspace{-2.5cm}\relax\huge\rmfamily} +\renewcommand\cftafterloftitle{\vspace{0.35em}} +\renewcommand\cftlottitlefont{\relax\huge\rmfamily} +\renewcommand\cftafterlottitle{\vspace{0.35em}} + + +\hypersetup{linktocpage} % TOC link on page number + +\setcounter{tocdepth}{1} % number of sections in the toc + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% biblatex +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +\usepackage{hyphenat} % required bc. biblatex uses \nohyphenations +\usepackage[ + backend=biber, + style=authoryear, + maxnames=3, + minbibnames=6, + maxbibnames=6, + sorting=nyt, + isbn=false, + doi=true, + url=false, + backref, + giveninits=true, % initials for first names + uniquelist=true, + uniquename=init, + dashed=false, % do not use dashes for same author names +]{biblatex} +\addbibresource{biblio.bib} +\addbibresource{publications.bib} + +% environment with supressed letters after the year for my reference section +% https://tex.stackexchange.com/questions/63500/suppress-year-label-letter-in-biblatex-author-year-styles-on-a-per-bibliography +\defbibenvironment{nodis} + {\list + {} + {\setlength{\leftmargin}{\bibhang}% + \setlength{\itemindent}{-\leftmargin}% + \setlength{\itemsep}{\bibitemsep}% + \setlength{\parsep}{\bibparsep}}} + {\endlist} + {\clearfield{extradate}\item} + + +% my papers section settings +\DeclareRefcontext{mypaper}{sorting=none} + +% Reverse names for all authors +\DeclareNameAlias{sortname}{last-first} + +% Make title in bibliography link to the doi +\newbibmacro{string+doi}[1]{% + \iffieldundef{doi}{#1}{\href{http://dx.doi.org/\thefield{doi}}{#1}}} +% \DeclareFieldFormat{title}{\usebibmacro{string+doi}{\mkbibemph{#1}}} +\DeclareFieldFormat{title}{\usebibmacro{string+doi}{#1}} +\DeclareFieldFormat[article]{title}{\usebibmacro{string+doi}{#1}} + +% newline after author (year) +\DeclareDelimFormat[bib]{nametitledelim}{\newline\bibsentence} + +% spacing between entries +\setlength\bibitemsep{1.5\itemsep} + +% Only years for dates +\AtEveryBibitem{\clearfield{month}} +\AtEveryBibitem{\clearfield{day}} + +% No pmid +\AtEveryBibitem{\clearfield{eprint}} + +% No editors, translators, ... +\renewbibmacro*{byeditor+others}{} + +% Supress the in: in references +\renewbibmacro{in:}{} + +% Annotate authors +% last name +\renewcommand*{\mkbibnamefamily}[1]{ +\ifitemannotation{highlight} + {\textbf{#1}}% + {\ifitemannotation{highfirst} + {\textbf{#1}}% + {#1}% + } +}%% +% first name +\renewcommand*{\mkbibnamegiven}[1]{ +\ifitemannotation{highlight} + {\textbf{#1}}% + {\ifitemannotation{highfirst} + {\textbf{#1}}% + {#1} + }% +\ifitemannotation{first} + {*} + {\ifitemannotation{highfirst} + {\textbf{*}} + {} + }% +}%% + +% backreference string +\DefineBibliographyStrings{english}{% + backrefpage = {cited on p\adddot},% + backrefpages = {cited on pp\adddot}% +} + +% no header for bibleography +\defbibheading{secbib}[\bibname]{% + \section*{#1}% + \markboth{#1}{#1}} + +% marginnnote with a reduced citing format: +% Authors (year), Title. Year links to bibliography +\DeclareCiteCommand{\customcite} + {\boolfalse{citetracker}% precode + \boolfalse{pagetracker}% + \usebibmacro{prenote}} + {\ifciteindex % loopcode (the actual formatting) + {\indexnames{labelname}% + \indexfield{indextitle}} + {}% + \printtext{% + \printnames{labelname}% + \setunit{\addspace} + \printtext[parens]{\printfield[bibhyperref]{year}}% year links to references + % \setunit{\labelnamepunct}% + % \printfield[citetitle]{labeltitle}% + }% + } + {\multicitedelim} % sepcode: a comma usually + {\usebibmacro{postnote}\printtext{\adddot}} % endcode: finish with a dot + + +% marginnnote with a reduced citing format: +% Authors (year), Title. Year links to bibliography +\DeclareCiteCommand{\inlinecite} + {\boolfalse{citetracker}% precode + \boolfalse{pagetracker}% + \usebibmacro{prenote}} + {\ifciteindex % loopcode (the actual formatting) + {\indexnames{labelname}% + \indexfield{indextitle}} + {}% + \printtext{% + \printnames{labelname}% + \setunit{\addspace} + \printtext[parens]{\printfield[bibhyperref]{year}}% year links to references + % \setunit{\labelnamepunct}% + % \printfield[citetitle]{labeltitle}% + }% + } + {\multicitedelim} % sepcode: a comma usually + {\usebibmacro{postnote}\printtext{}} % endcode: finish with a dot + + +% normal citation -> margin +\renewcommand{\cite}[2][0pt]{\sidenote[][#1]{\customcite{#2}}} +% inline citation +\newcommand{\icite}[2][]{\customcite[#1]{#2}} + +% explanation of a word/phrase +\newcommand{\explanation}[2][0pt]{*\marginnote[#1]{*#2}} + +% easier sub and superscripts +\newcommand{\sups}[1]{\textsuperscript{#1}} +\newcommand{\subs}[1]{\textsubscript{#1}} + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% Utility functions +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +%% include tex with embedded pdf +\newcommand{\pdftex}[2][0.975\textwidth]{ +\scriptsize\sffamily\selectfont +\def\svgwidth{#1} +\input{#2} +} + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% headings +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% headline +\newcommand\HUGE{\fontsize{26}{26}\selectfont} +\newcommand\CHAPTERSIZE{\fontsize{16}{10}\selectfont} +\titleformat{\chapter}% + [display]% shape + {\vspace{-2.5cm}\relax\begin{fullwidth}}% format applied to label+text + {\CHAPTERSIZE \rmfamily\scshape Chapter \thechapter}% label + {-1em}% horizontal separation between label and title body + {\HUGE\rmfamily}% before the title body + [\end{fullwidth}\vspace{-2em}]% after the title body + +% Indent for section number number +\titlespacing*{\section}{0pt}{0pt}{0pt} +\titleformat{\section}% + [hang]% shape + {\normalfont\scshape}% format applied to label+text + {\thesection\hfill} + {1em}% horizontal separation between label and title body + {\normalfont\scshape}% before the title body + []% after the title body + +\titlespacing*{\subsection}{0pt}{0pt}{0pt} +\titleformat{\subsection}% + [hang]% shape + {\normalfont\scshape}% format applied to label+text + {\thesubsection\hfill}% label + {1em}% horizontal separation between label and title body + {\normalfont}% before the title body + []% after the title body + +\titleformat{\paragraph} + [hang] + {\normalfont} + {\thesubsubsection} + {0em} + {\normalfont} + [\vspace{-1em}] + +% number of sections that become a counter +\setcounter{secnumdepth}{2} + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% Ref Names +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +\creflabelformat{equation}{#2\textup{#1}#3} + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% Page Style +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% remove paragraph indentation +\makeatletter +% Paragraph indentation and separation for normal text +\renewcommand{\@tufte@reset@par}{% + \setlength{\RaggedRightParindent}{0.0pc}% + \setlength{\JustifyingParindent}{0.0pc}% + \setlength{\parindent}{0pc}% + \setlength{\parskip}{\baselineskip}% +} +\@tufte@reset@par + +% Paragraph indentation and separation for marginal text +\renewcommand{\@tufte@margin@par}{% + \setlength{\RaggedRightParindent}{0.0pc}% + \setlength{\JustifyingParindent}{0.0pc}% + \setlength{\parindent}{0.0pc}% + \setlength{\parskip}{10pt}% +} +\makeatother + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% Quick fix for xelatex (authors forgot it in tufte) +% see https://tex.stackexchange.com/questions/200722/xetex-seems-to-break-headers-in-tufte-handout +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +\ifxetex + \renewcommand{\textls}[2][5]{% + \begingroup\addfontfeatures{LetterSpace=#1}#2\endgroup + } + \renewcommand{\allcapsspacing}[1]{\textls[15]{#1}} + \renewcommand{\smallcapsspacing}[1]{\textls[10]{#1}} + \renewcommand{\allcaps}[1]{\textls[15]{\MakeTextUppercase{#1}}} + \renewcommand{\smallcaps}[1]{\smallcapsspacing{\scshape\MakeTextLowercase{#1}}} + \renewcommand{\textsc}[1]{\smallcapsspacing{\textsmallcaps{#1}}} +\fi + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% Custom title page +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +\makeatletter +\newcommand{\fb}[1]{ + \def\@fb{#1} +} +\newcommand{\university}[1]{ + \def\@university{#1} +} +\newcommand{\refereeA}[1]{ + \def\@refereeA{#1} +} +\newcommand{\refereeB}[1]{ + \def\@refereeB{#1} +} +\newcommand{\location}[1]{ + \def\@location{#1} +} + +\usepackage{linegoal}% http://ctan.org/pkg/linegoal +\usepackage{xparse}% http://ctan.org/pkg/xparse +\NewDocumentCommand{\centerrule}{O{0.5ex} O{0.4pt}}{% + \leavevmode\rule[#1]{\linegoal}{#2} +} + +\renewcommand{\maketitlepage}{ +\begin{fullwidth} +\sffamily +\centering +{% top + \includegraphics[width=3.5cm]{athene}\\ + \vspace{2pc} + \centerrule + \fontsize{24}{26}\selectfont\textcolor{darkgray}{\allcaps{\textrm{\thanklesstitle}}}\\ + \centerrule +} +\vspace{1pc} +\doublespacing +{% center + \fontsize{14}{14}\selectfont + \par + dem Fachbereich \@fb\\ + der \@university\\ + \vspace{1.5pc} + zur Erlangung des Grades\\ + Doctor rerum naturalium (Dr. rer. nat.)\\ + \vspace{2pc} + vorgelegte Dissertation von\\ + \vspace{1pc} + \Huge\selectfont\hspace{0.4cm}\textcolor{darkgray}{\allcaps{\textrm{\@author}}} +} +~\vfill +{% bottom +\begin{tabular}{ll} +\fontsize{14}{14}\selectfont\par\noindent{Erstgutachter:} & \fontsize{14}{14}\selectfont\par\noindent{\@refereeA} \\ +\fontsize{14}{14}\selectfont\par\noindent{Zweitgutachter:} & \fontsize{14}{14}\selectfont\par\noindent{\@refereeB} \\ +\end{tabular} +% \vspace{1pc} +\fontsize{14}{14}\selectfont\par\noindent\allcaps{\@location~\the\year} +} +\end{fullwidth} +\thispagestyle{empty} +\clearpage +} + +\newcommand{\plainsubtitle}{} +\newcommand{\subtitle}[1]{% + \gdef\@subtitle{#1}% + \renewcommand{\plainsubtitle}{#1}% use provided plain-text title + \ifthenelse{\isundefined{\hypersetup}}% + {}% hyperref is not loaded; do nothing + {\hypersetup{pdftitle={\plaintitle: \plainsubtitle{}}}}% set the PDF metadata title +} +\makeatother + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% My page style +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +\usepackage{fancyhdr} +% pagestyle that does not print anything +\fancypagestyle{nothing}{ + \lhead{} + \fancyhead[LE]{} + \fancyhead[RO]{} +} + +% no numbers on part pages +\patchcmd{\part}{\thispagestyle{plain}}{\thispagestyle{empty}} + {}{\errmessage{Cannot patch \string\part}} +\fancypagestyle{plain}{} \ No newline at end of file diff --git a/deadlines.png b/deadlines.png new file mode 100644 index 0000000..737b8b5 Binary files /dev/null and b/deadlines.png differ diff --git a/frontpages.tex b/frontpages.tex new file mode 100644 index 0000000..99a03a0 --- /dev/null +++ b/frontpages.tex @@ -0,0 +1,34 @@ +%!TEX root = thesis.tex +\maketitle + +% copyright stuff +\newpage +\pagestyle{empty} +~\vfill + +\begin{fullwidth} +\begin{flushleft} +This document was typeset with \href{http://xetex.sourceforge.net/}{Xe\TeX} +and a modified version of \href{https://tufte-latex.github.io/tufte-latex}{Tufte-LaTeX}. +The\\bibliography was managed with \href{https://www.zotero.org}{Zotero} +and processed by \href{https://github.com/plk/biblatex}{Biblatex}. +Used fonts were\\Vollkorn (serif), \textsf{Gillius~ADF~No2} (sans serif) and \texttt{TeX~Gyre~Cursor} (monospace).\\ +Figures and images were generated with \href{https://matplotlib.org}{Matplotlib}, +\href{https://pymol.org/2}{PyMOL}, and \href{https://chemaxon.com/products/marvin}{MarvinSketch}. + +\textcolor{red}{Hans Wurst}: \plaintitle \\ +Darmstadt, Technische Universit\"at Darmstadt,\\ +Jahr der Ver\"offentlichung der Dissertation auf TUprints: xxxx\\ +URN: \href{http://nbn-resolving.de/urn:nbn:de:tuda-tuprints-xxxxxx}{urn:nbn:de:tuda-tuprints-xxxxx}\\ +Tag der m\"undlichen Pr\"ufung: xx.xx.xx\\ +~\\ +\textbf{\ccbysa~CC BY-SA 4.0 International} \\ +Attribution - ShareAlike 4.0 International\\ +\url{https://creativecommons.org/licenses/by-sa/4.0/} +\end{flushleft} +\end{fullwidth} + +\input{abstract} + +\newpage +\cleardoublepage \ No newline at end of file diff --git a/publications.bib b/publications.bib new file mode 100644 index 0000000..b420c39 --- /dev/null +++ b/publications.bib @@ -0,0 +1,110 @@ +%!TEX root = thesis.tex + +@article{mypapermarini2018, + title = {{HCN}1 mutation spectrum: from neonatal epileptic encephalopathy to benign generalized epilepsy and beyond}, + volume = {141}, + rights = {All rights reserved}, + issn = {0006-8950}, + url = {https://academic.oup.com/brain/article/141/11/3160/5142623}, + doi = {10.1093/brain/awy263}, + shorttitle = {{HCN}1 mutation spectrum}, + pages = {3160--3178}, + number = {11}, + journaltitle = {Brain}, + shortjournal = {Brain}, + author = {Marini, Carla and Porro, Alessandro and Rastetter, Agnès and Dalle, Carine and Rivolta, Ilaria and Bauer, Daniel and Oegema, Renske and Nava, Caroline and Parrini, Elena and Mei, Davide and Mercer, Catherine and Dhamija, Radhika and Chambers, Chelsea and Coubes, Christine and Thévenon, Julien and Kuentz, Paul and Julia, Sophie and Pasquier, Laurent and Dubourg, Christèle and Carré, Wilfrid and Rosati, Anna and Melani, Federico and Pisano, Tiziana and Giardino, Maria and Innes, A. Micheil and Alembik, Yves and Scheidecker, Sophie and Santos, Manuela and Figueiroa, Sonia and Garrido, Cristina and Fusco, Carlo and Frattini, Daniele and Spagnoli, Carlotta and Binda, Anna and Granata, Tiziana and Ragona, Francesca and Freri, Elena and Franceschetti, Silvana and Canafoglia, Laura and Castellotti, Barbara and Gellera, Cinzia and Milanesi, Raffaella and Mancardi, Maria Margherita and Clark, Damien R. and Kok, Fernando and Helbig, Katherine L. and Ichikawa, Shoji and Sadler, Laurie and Neupauerová, Jana and Laššuthova, Petra and Štěrbová, Katalin and Laridon, Annick and Brilstra, Eva and Koeleman, Bobby and Lemke, Johannes R. and Zara, Federico and Striano, Pasquale and Soblet, Julie and Smits, Guillaume and Deconinck, Nicolas and Barbuti, Andrea and {DiFrancesco}, Dario and {LeGuern}, Eric and Guerrini, Renzo and Santoro, Bina and Hamacher, Kay and Thiel, Gerhard and Moroni, Anna and {DiFrancesco}, Jacopo C. and Depienne, Christel}, + urldate = {2019-12-05}, + date = {2018-11-01}, + langid = {english}, + keywords = {mypaper}, + author+an = {6=highlight} +} + +@article{mypaperporro2019, + title = {The {HCN} domain couples voltage gating and {cAMP} response in Hyperpolarization-activated Cyclic Nucleotide-gated channels}, + volume = {8}, + rights = {All rights reserved}, + issn = {2050-084X}, + url = {https://doi.org/10.7554/eLife.49672}, + doi = {10.7554/eLife.49672}, + pages = {e49672}, + journaltitle = {{eLife}}, + author = {Porro, Alessandro and Saponaro, Andrea and Gasparri, Federica and Bauer, Daniel and Gross, Christine and Pisoni, Matteo and Abbandonato, Gerardo and Hamacher, Kay and Santoro, Bina and Thiel, Gerhard and Moroni, Anna}, + editor = {Csanády, László}, + urldate = {2019-12-05}, + date = {2019-11-26}, + keywords = {mypaper}, + author+an = {4=highlight} +} + +@article{mypaperjenewein2020, + title = {The mutation L69P in the {PAS} domain of the {hERG} potassium channel results in {LQTS} by trafficking deficiency}, + rights = {All rights reserved}, + volume = {13}, + number = {1}, + issn = {1933-6950, 1933-6969}, + url = {https://www.tandfonline.com/doi/full/10.1080/19336950.2020.1751522}, + doi = {10.1080/19336950.2020.1751522}, + pages = {163--174}, + journaltitle = {Channels}, + shortjournal = {Channels}, + author = {Jenewein, Tina and Kanner, Scott A. and Bauer, Daniel and Hertel, Brigitte and Colecraft, Henry M. and Moroni, Anna and Thiel, Gerhard and Kauferstein, Silke}, + urldate = {2020-04-09}, + date = {2020-04-07}, + langid = {english}, + keywords = {mypaper}, + author+an = {3=highlight} +} + +@article{mypaperhauf2020, + title = {{GlyT}1 encephalopathy: Characterization of presumably disease causing {GlyT}1 mutations}, + volume = {139}, + rights = {All rights reserved}, + issn = {0197-0186}, + url = {http://www.sciencedirect.com/science/article/pii/S0197018620302047}, + doi = {10.1016/j.neuint.2020.104813}, + shorttitle = {{GlyT}1 encephalopathy}, + pages = {104813}, + journaltitle = {Neurochemistry International}, + shortjournal = {Neurochemistry International}, + author = {Hauf, K. and Barsch, L. and Bauer, D. and Buchert, R. and Armbruster, A. and Frauenfeld, L. and Grasshoff, U. and Eulenburg, V.}, + urldate = {2020-07-28}, + date = {2020-10-01}, + langid = {english}, + keywords = {Glycine, Encephalopathy, {GlyT}1, Neurotransmitter, Transporter, mypaper}, + author+an = {3=highlight} +} +@article{mypaperschmidt2021, + title = {Inferring functional units in ion channel pores via relative entropy}, + volume = {50}, + rights = {All rights reserved}, + issn = {1432-1017}, + doi = {10.1007/s00249-020-01480-7}, + pages = {37--57}, + number = {1}, + journaltitle = {European biophysics journal}, + shortjournal = {Eur Biophys J}, + author = {Schmidt, Michael and Schroeder, Indra and Bauer, Daniel and Thiel, Gerhard and Hamacher, Kay}, + date = {2021-01-01}, + pmcid = {PMC7872957}, + pmid = {33523249}, + keywords = {mypaper, Anisotropic network model, Mechanical coupling relative entropy, Potassium channel (pores)}, + author+an = {3=highlight} +} +@article{mypapersaponaro2021, + title = {Gating Movements and Ion Permeation in {HCN}4 Pacemaker Channels}, + volume = {81}, + number = {14}, + pages = {2929--2943.e6}, + rights = {{CC} {BY}-{NC}-{ND}}, + url = {https://www.cell.com/molecular-cell/fulltext/S1097-2765(21)00446-9}, + doi = {10.1016/j.molcel.2021.05.033}, + journaltitle = {Molecular Cell}, + shortjournal = {Mol. Cell.}, + author = {Saponaro, Andrea and Bauer, Daniel and Giese, M. Hunter and Swuec, Paolo and Porro, Alessandro and Gasparri, Federica and Sharifzadeh, Atiyeh Sadat and Chaves-Sanjuan, Antonio and Alberio, Laura and Parisi, Giacomo and Cerutti, Gabriele and Clarke, Oliver and Hamacher, Kay and Colecraft, Henry M. and Mancia, Filippo and Hendrickson, Wayne A. and Siegelbaum, Steven A. and {DiFrancesco}, Dario and Bolognesi, Martino and Thiel, Gerhard and Santoro, Bina and Moroni, Anna}, + date = {2021-07-01}, + langid = {english}, + doi = {10.1016/j.molcel.2021.05.033}, + keywords = {molecular dynamics, gating, cryo-{EM}, pacemaker, selectivity, pore, mypaper, {cAMP}, {HCN}4, permeation}, + author+an = {1=first; 2=highfirst; 3=first; 4=first} + } diff --git a/thesis.pdf b/thesis.pdf new file mode 100644 index 0000000..fcf7792 Binary files /dev/null and b/thesis.pdf differ diff --git a/thesis.tex b/thesis.tex new file mode 100644 index 0000000..1c2ecdc --- /dev/null +++ b/thesis.tex @@ -0,0 +1,183 @@ +% -*- Mode:TeX -*- +%!TEX TS-program = xelatex +%!TEX spellcheck = en-US +\documentclass[a4paper,justified,titlepage,twoside,nobib,symmetric]{tufte-book} +\usepackage{etoolbox} + +\include{config} + +\author[H. Wurst]{Hans Wurst} +\title[Short thesis title]{Long thesis title} +\subtitle{Thesis subtitle} +\fb{Biologie} +\university{Technischen Universit\"at Darmstadt} +\refereeA{Prof. Dr. Musterprof} +\refereeB{Prof. Dr. Musterprof2} +\location{Darmstadt} + +\DeclareSIUnit\ions{ions} +\DeclareSIUnit\molar{M} +\DeclareSIUnit\millimolar{mM} +\DeclareSIUnit\electrons{e\textsuperscript{-}} + +\include{acronyms} + +\begin{document} +\sloppy + +% front +\frontmatter +\changelocaltocdepth{-1} % hide from toc +\pagenumbering{roman} +\include{frontpages} +\phantomsection +\addcontentsline{toc}{chapter}{Contents} +\tableofcontents +\newpage +\phantomsection +\addcontentsline{toc}{chapter}{\listfigurename} +\listoffigures +\phantomsection +\addcontentsline{toc}{chapter}{\listtablename} +\listoftables +\changelocaltocdepth{1} + +% % main text +\mainmatter +\pagenumbering{arabic} + +\chapter{Prologue} +\marginnote{\begin{quote} +\textit{"... Ion channels are involved in \mbox{every} thought, +every perception, +every movement, every heartbeat."}\\ +\hspace*{\fill}- Clay M. Armstrong (1999) +\end{quote}} + +\blindtext +\section{Thesis Outline} +\blindtext +Finally, some text with citations here.\cite{Abraham2015,Alam2009} + +\section{Publications} +The following thesis draws on the ideas and writing of the following published +works. They are the result of my own research performed during my doctoral +studies together with several coworkers and collaborators: +\begin{refsection} +\nocite{mypapermarini2018,mypaperporro2019,mypaperjenewein2020,mypaperhauf2020,mypaperschmidt2021,mypapersaponaro2021} +\begin{refcontext}{mypaper} +\vspace{-0.5cm} +\printbibliography[keyword=mypaper,heading=none,env=nodis] +\end{refcontext} +\end{refsection} +\begin{flushright} +* indicates equal contribution. +\end{flushright} + +\chapter{Introduction} +\blindtext +\begin{figure} +\includegraphics[width=0.98\linewidth]{deadlines.png} +\caption{Taken from \href{https://www.phdcomics.com}{phdcomics.com}. +Here is an inline reference that has nothing to do with the graphic: \customcite{book:1314973}.} +\end{figure} +\section{Section 1} +\blindtext +\begin{marginfigure} +\includegraphics[width=0.98\linewidth]{cat.jpg} +\caption{A cat.} +\end{marginfigure} +\subsection{Subsection 1} +\blindtext +\subsection{Subsection 2} +\blindtext + +\chapter{Results} +\blindtext +\section{Section 1} +\blindtext +\subsection{Subsection 1} +\blindtext +\subsection{Subsection 2} +\blindtext + +\chapter{Discussion} +\blindtext +\section{Section 1} +\blindtext +\subsection{Subsection 1} +\blindtext +\subsection{Subsection 2} +\blindtext + + +\backmatter +% bibliography +\ChaptersOutsidePart +\include{biblio} +\ChaptersInsidePart + +\changelocaltocdepth{0} +\begin{appendix} +\part{Appendix} +\chapter{Abbreviations} +\vspace{-0.5cm} +\begin{tcolorbox}[ + enhanced, + enforce breakable, + check odd page, + toggle left and right, + grow to right by=\marginparwidth+\marginparsep-0.4cm, + toggle enlargement=evenpage, + notitle after break, + vfill before first, + nobeforeafter, + sharp corners, + top=0pt, + before upper={\let\clearpage\relax}, + opacityback=0, + opacityframe=0, +] + +\renewcommand{\glossarysection}[2][]{} % no glossary title +\printglossaries +\end{tcolorbox} +\chapter{Experimental details} +\section*{How to build a flux compensator} +\blindtext +\section*{Some other Technical Stuff} +\blindtext +\blindtext +\chapter{Additional data} +\blindtext +\end{appendix} + + +% Thanks, CV, Erklärung +\pagestyle{nothing} +\ChaptersOutsidePart +\begin{fullwidth} +\include{acknowledgements} +\chapter*{Ehrenwörtliche Erklärung} %Erklärung gemäß \S9(1) Promotionsordnung +\addcontentsline{toc}{chapter}{Ehrenwörtliche Erklärung} + +Ich erkläre hiermit, dass ich die vorliegende Arbeit +entsprechend den Regeln guter wissenschaftlicher Praxis selbstständig und ohne +unzulässige Hilfe Dritter angefertigt habe. + +Sämtliche aus fremden Quellen direkt oder indirekt übernommenen Gedanken sowie +sämtliche von Anderen direkt oder indirekt übernommenen Daten, Techniken und +Materialien sind als solche kenntlich gemacht. +Die Arbeit wurde bisher bei keiner anderen Hochschule zu Prüfungszwecken +eingereicht. + +Die eingereichte elektronische Version stimmt mit der schriftlichen Version +überein. + +\vspace{1cm} + +\par\noindent\rule{6cm}{0.4pt} \\ +\strut \footnotesize Datum und Unterschrift \\ +\end{fullwidth} +\ChaptersInsidePart +\end{document} diff --git a/tufte-book.cls b/tufte-book.cls new file mode 100644 index 0000000..f733ce2 --- /dev/null +++ b/tufte-book.cls @@ -0,0 +1,88 @@ +\NeedsTeXFormat{LaTeX2e}[1994/06/01] + +\ProvidesClass{tufte-book}[2015/06/30 v3.5.3 Tufte-book class] + +%% +% Declare we're tufte-book +\newcommand{\@tufte@class}{book}% the base LaTeX class (defaults to the book style) +\newcommand{\@tufte@pkgname}{tufte-book}% the name of the package (defaults to tufte-handout) + +%% +% Load the common style elements +\input{tufte-common.def} + + +%% +% Set up any book-specific stuff now + +%% +% The front matter in Tufte's /Beautiful Evidence/ contains everything up +% to the opening page of Chapter 1. The running heads, when they appear, +% contain only the (arabic) page number in the outside corner. +%\newif\if@mainmatter \@mainmattertrue +\renewcommand\frontmatter{% + \if@openright% + \cleardoublepage% + \else% + \clearpage% + \fi% + \@mainmatterfalse% + \pagenumbering{arabic}% + %\pagestyle{plain}% + \fancyhf{}% + \ifthenelse{\boolean{@tufte@twoside}}% + {\fancyhead[LE,RO]{\thepage}}% + {\fancyhead[RE,RO]{\thepage}}% +} + + +%% +% The main matter in Tufte's /Beautiful Evidence/ doesn't restart the page +% numbering---it continues where it left off in the front matter. +\renewcommand\mainmatter{% + \if@openright% + \cleardoublepage% + \else% + \clearpage% + \fi% + \@mainmattertrue% + \fancyhf{}% + \ifthenelse{\boolean{@tufte@twoside}}% + {% two-side + \renewcommand{\chaptermark}[1]{\markboth{##1}{}}% + \fancyhead[LE]{\thepage\quad\smallcaps{\newlinetospace{\plaintitle}}}% book title + \fancyhead[RO]{\smallcaps{\newlinetospace{\leftmark}}\quad\thepage}% chapter title + }% + {% one-side + \fancyhead[RE,RO]{\smallcaps{\newlinetospace{\plaintitle}}\quad\thepage}% book title + }% +} + + +%% +% The back matter contains appendices, indices, glossaries, endnotes, +% bibliographies, list of contributors, illustration credits, etc. +\renewcommand\backmatter{% + \if@openright% + \cleardoublepage% + \else% + \clearpage% + \fi% + \@mainmatterfalse% +} + +%% +% Only show the chapter titles in the table of contents +\setcounter{tocdepth}{0} + +%% +% If there is a `tufte-book-local.sty' file, load it. + +\IfFileExists{tufte-book-local.tex}{% + \@tufte@info@noline{Loading tufte-book-local.tex}% + \input{tufte-book-local}% +}{} + +%% +% End of file +\endinput diff --git a/tufte-common.def b/tufte-common.def new file mode 100644 index 0000000..eafdc27 --- /dev/null +++ b/tufte-common.def @@ -0,0 +1,2028 @@ +%% +%% This file contains the code that is common to the Tufte-LaTeX document classes. +%% + +\ProvidesFile{tufte-common.def}[2015/06/21 v3.5.2 Common code for the Tufte-LaTeX styles] + +%% +% The `xkeyval' package simplifies the user interface for the document class options +\RequirePackage{xkeyval} + +%% +% We use the `xifthen' package to handle our package option switches +\RequirePackage{xifthen} + +%% +% Define some shortcut macros for error/warning/info logging. +\RequirePackage{hardwrap} +\GenerateClassLogMacros[@tufte]{\@tufte@pkgname} +\newcommand{\@tufte@debug@info}[1]{\ifthenelse{\boolean{@tufte@debug}}{\@tufte@info{#1}}{}} +\newcommand{\@tufte@debug@info@noline}[1]{\ifthenelse{\boolean{@tufte@debug}}{\@tufte@info@noline{#1}}{}} + +%% +% `debug' option -- provides more information in the .log file for use in +% troubleshooting problems +\newboolean{@tufte@debug} +\DeclareOptionX[tufte]{debug}{\setboolean{@tufte@debug}{true}} + +%% +% `nofonts' option -- doesn't load any fonts +% `fonts' option -- tries to load fonts +\newboolean{@tufte@loadfonts}\setboolean{@tufte@loadfonts}{true} +\DeclareOptionX[tufte]{fonts}{\setboolean{@tufte@loadfonts}{true}} +\DeclareOptionX[tufte]{nofonts}{\setboolean{@tufte@loadfonts}{false}} + +%% +% `nols' option -- doesn't configure letterspacing +% `ls' option -- configures letterspacing +\newboolean{@tufte@letterspace}\setboolean{@tufte@letterspace}{true} +\DeclareOptionX[tufte]{ls}{\setboolean{@tufte@letterspace}{true}} +\DeclareOptionX[tufte]{nols}{\setboolean{@tufte@letterspace}{false}} + +%% +% `nobib' option -- doesn't load natbib or adjust the \cite command +\newboolean{@tufte@loadnatbib}\setboolean{@tufte@loadnatbib}{true} +\DeclareOptionX[tufte]{nobib}{\setboolean{@tufte@loadnatbib}{false}} + +%% +% `titlepage' option -- creates a full title page with \maketitle + +\newboolean{@tufte@titlepage} +\DeclareOptionX[tufte]{titlepage}{\setboolean{@tufte@titlepage}{true}} +\DeclareOptionX[tufte]{notitlepage}{\setboolean{@tufte@titlepage}{false}} + +%% +% `a4paper' option + +\newboolean{@tufte@afourpaper} +\DeclareOptionX[tufte]{a4paper}{\setboolean{@tufte@afourpaper}{true}} + +%% +% `b5paper' option + +\newboolean{@tufte@bfivepaper} +\DeclareOptionX[tufte]{b5paper}{\setboolean{@tufte@bfivepaper}{true}} + +%% +% `sfsidenotes' option -- typesets sidenotes in sans serif typeface + +\newboolean{@tufte@sfsidenotes} +\DeclareOptionX[tufte]{sfsidenotes}{\setboolean{@tufte@sfsidenotes}{true}} + +%% +% `symmetric' option -- puts marginpar space to the outside edge of the page +% Note: this option forces the twoside option (see the .cls files) + +\newboolean{@tufte@symmetric} +\DeclareOptionX[tufte]{symmetric}{ + \setboolean{@tufte@symmetric}{true} + \@tufte@info@noline{The `symmetric' option implies `twoside'} + \ExecuteOptionsX[tufte]{twoside} +} + +%% +% `twoside' option -- alternates running heads + +\newboolean{@tufte@twoside} +\DeclareOptionX[tufte]{twoside}{% + \setboolean{@tufte@twoside}{true} + \@tufte@info@noline{Passing the `twoside' option to the `\@tufte@class' class} + \PassOptionsToClass{twoside}{\@tufte@class} +} + +%% +% `notoc' option -- suppresses the Tufte-style table of contents + +\newboolean{@tufte@toc} +\setboolean{@tufte@toc}{true} +\DeclareOptionX[tufte]{notoc}{\setboolean{@tufte@toc}{false}} +\DeclareOptionX[tufte]{toc}{\setboolean{@tufte@toc}{true}} + +%% +% `justified' option -- uses fully justified text (flush left and flush +% right) instead of ragged right. + +\newboolean{@tufte@justified} +\DeclareOptionX[tufte]{justified}{\setboolean{@tufte@justified}{true}} + +%% +% `bidi' option -- loads the bidi package for bi-directional text + +\newboolean{@tufte@loadbidi} +\DeclareOptionX[tufte]{bidi}{\setboolean{@tufte@loadbidi}{true}} +\DeclareOptionX[tufte]{nobidi}{\setboolean{@tufte@loadbidi}{false}} + +%% +% `nohyper' option -- suppresses loading of the hyperref package + +\newboolean{@tufte@loadhyper} +\setboolean{@tufte@loadhyper}{true} +\DeclareOptionX[tufte]{hyper}{\setboolean{@tufte@loadhyper}{true}} +\DeclareOptionX[tufte]{nohyper}{\setboolean{@tufte@loadhyper}{false}} + +%% +% `sidenote', `marginnote', `caption', `citation', `marginals' options +% Each allows one of {justified,raggedleft,raggedright,raggedouter,auto}. + +\newcommand*{\@tufte@sidenote@justification}{\@tufte@justification@autodetect} +\define@choicekey*+[tufte]{common}{sidenote}[\@tufte@kvtext\@tufte@kvnum]{justified,raggedleft,raggedright,raggedouter,auto}[auto]{% + \ifcase\@tufte@kvnum\relax + \renewcommand*{\@tufte@sidenote@justification}{\justifying}% justified + \or + \renewcommand*{\@tufte@sidenote@justification}{\RaggedLeft}% ragged left + \or + \renewcommand*{\@tufte@sidenote@justification}{\RaggedRight}% ragged right + \or + \renewcommand*{\@tufte@sidenote@justification}{\@tufte@justification@outer}% ragged outer (flush right on verso pages, flush left on recto pages) + \or + \renewcommand*{\@tufte@sidenote@justification}{\@tufte@justification@autodetect}% autodetects best justification mode based on all class options + \fi +}{% + \@tufte@warning@noline{Invalid option `#1' for sidenote key. Must be one of: justified, raggedleft, raggedright, raggedouter, auto} + \renewcommand*{\@tufte@sidenote@justification}{\@tufte@justification@autodetect}% autodetects best justification mode based on all class options +} + +\newcommand*{\@tufte@marginnote@justification}{\@tufte@justification@autodetect} +\define@choicekey*+[tufte]{common}{marginnote}[\@tufte@kvtext\@tufte@kvnum]{justified,raggedleft,raggedright,raggedouter,auto}[auto]{% + \ifcase\@tufte@kvnum\relax + \renewcommand*{\@tufte@marginnote@justification}{\justifying}% justified + \or + \renewcommand*{\@tufte@marginnote@justification}{\RaggedLeft}% ragged left + \or + \renewcommand*{\@tufte@marginnote@justification}{\RaggedRight}% ragged right + \or + \renewcommand*{\@tufte@marginnote@justification}{\@tufte@justification@outer}% ragged outer (flush right on verso pages, flush left on recto pages) + \or + \renewcommand*{\@tufte@marginnote@justification}{\@tufte@justification@autodetect}% autodetects best justification mode based on all class options + \fi +}{% + \@tufte@warning@noline{Invalid option `#1' for marginnote key. Must be one of: justified, raggedleft, raggedright, raggedouter, auto} + \renewcommand*{\@tufte@marginnote@justification}{\@tufte@justification@autodetect}% autodetects best justification mode based on all class options +} + +\newcommand*{\@tufte@caption@justification}{\@tufte@justification@autodetect} +\define@choicekey*+[tufte]{common}{caption}[\@tufte@kvtext\@tufte@kvnum]{justified,raggedleft,raggedright,raggedouter,auto}[auto]{% + \ifcase\@tufte@kvnum\relax + \renewcommand*{\@tufte@caption@justification}{\justifying}% justified + \or + \renewcommand*{\@tufte@caption@justification}{\RaggedLeft}% ragged left + \or + \renewcommand*{\@tufte@caption@justification}{\RaggedRight}% ragged right + \or + \renewcommand*{\@tufte@caption@justification}{\@tufte@justification@caption@outer}% ragged outer (flush right on verso pages, flush left on recto pages) + \or + \renewcommand*{\@tufte@caption@justification}{\@tufte@justification@autodetect}% autodetects best justification mode based on all class options + \fi +}{% + \@tufte@warning@noline{Invalid option `#1' for caption key. Must be one of: justified, raggedleft, raggedright, raggedouter, auto} + \renewcommand*{\@tufte@caption@justification}{\@tufte@justification@autodetect}% autodetects best justification mode based on all class options +} + +\newcommand*{\@tufte@citation@justification}{\@tufte@justification@autodetect} +\define@choicekey*+[tufte]{common}{citation}[\@tufte@kvtext\@tufte@kvnum]{justified,raggedleft,raggedright,raggedouter,auto}[auto]{% + \ifcase\@tufte@kvnum\relax + \renewcommand*{\@tufte@citation@justification}{\justifying}% justified + \or + \renewcommand*{\@tufte@citation@justification}{\RaggedLeft}% ragged left + \or + \renewcommand*{\@tufte@citation@justification}{\RaggedRight}% ragged right + \or + \renewcommand*{\@tufte@citation@justification}{\@tufte@justification@outer}% ragged outer (flush right on verso pages, flush left on recto pages) + \or + \renewcommand*{\@tufte@citation@justification}{\@tufte@justification@autodetect}% autodetects best justification mode based on all class options + \fi +}{% + \@tufte@warning@noline{Invalid option `#1' for citation key. Must be one of: justified, raggedleft, raggedright, raggedouter, auto} + \renewcommand*{\@tufte@citation@justification}{\@tufte@justification@autodetect}% autodetects best justification mode based on all class options +} + +% The ``marginals'' key simultaneously sets the same justification for all marginal material +\define@choicekey*+[tufte]{common}{marginals}[\@tufte@kvtext\@tufte@kvnum]{justified,raggedleft,raggedright,raggedouter,auto}[auto]{% + \ifcase\@tufte@kvnum\relax + \ExecuteOptionsX[tufte]{citation=justified,sidenote=justified,caption=justified,marginnote=justified}% justified + \or + \ExecuteOptionsX[tufte]{citation=raggedleft,sidenote=raggedleft,caption=raggedleft,marginnote=raggedleft}% ragged left + \or + \ExecuteOptionsX[tufte]{citation=raggedright,sidenote=raggedright,caption=raggedright,marginnote=raggedright}% ragged right + \or + \ExecuteOptionsX[tufte]{citation=raggedouter,sidenote=raggedouter,caption=raggedouter,marginnote=raggedouter}% ragged outer (flush right on verso pages, flush left on recto pages) + \or + \ExecuteOptionsX[tufte]{citation=auto,sidenote=auto,caption=auto,marginnote=auto}% autodetects best justification mode based on all class options + \fi +}{% + \@tufte@warning@noline{Invalid option `#1' for marginals key. Must be one of: justified, raggedleft, raggedright, raggedouter, auto} + \ExecuteOptionsX[tufte]{citation=auto,sidenote=auto,caption=auto,marginnote=auto}% autodetects best justification mode based on all class options +} + + +%% +% Unsupported options + +\newcommand{\@tufte@unsupported@option}[1]{\@tufte@warning@noline{Option `#1' is not supported -- ignoring option}\OptionNotUsed} + +\DeclareOptionX[tufte]{10pt}{\@tufte@unsupported@option{\CurrentOption}} +\DeclareOptionX[tufte]{11pt}{\@tufte@unsupported@option{\CurrentOption}} +\DeclareOptionX[tufte]{12pt}{\@tufte@unsupported@option{\CurrentOption}} +\DeclareOptionX[tufte]{a5paper}{\@tufte@unsupported@option{\CurrentOption}} +\DeclareOptionX[tufte]{executivepaper}{\@tufte@unsupported@option{\CurrentOption}} +\DeclareOptionX[tufte]{legalpaper}{\@tufte@unsupported@option{\CurrentOption}} +\DeclareOptionX[tufte]{landscape}{\@tufte@unsupported@option{\CurrentOption}} +\DeclareOptionX[tufte]{onecolumn}{\@tufte@unsupported@option{\CurrentOption}} +\DeclareOptionX[tufte]{twocolumn}{\@tufte@unsupported@option{\CurrentOption}} + +%% +% Default `book' and `handout' options + +\ifthenelse{\equal{\@tufte@pkgname}{tufte-book}} + {\ExecuteOptionsX[tufte]{titlepage}} + {\ExecuteOptionsX[tufte]{notitlepage}} + + +\DeclareOptionX*{% + \@tufte@info@noline{Passing \CurrentOption\space to the `\@tufte@class' class.}% + \PassOptionsToClass{\CurrentOption}{\@tufte@class}% +} +\ProcessOptionsX*[tufte]\relax + +%% +% Load the appropriate base class +\@tufte@info@noline{Loading the base class `\@tufte@class'} +\LoadClass{\@tufte@class} + +%% +% Detect whether we're in two-side mode or not. (Used to set up running +% heads later.) + +\ifthenelse{\boolean{@twoside}} + {\setboolean{@tufte@twoside}{true}} + {} + + + +%% +% Detect if we're using pdfLaTeX + +\newboolean{@tufte@pdf} +\IfFileExists{ifpdf.sty}{% + \RequirePackage{ifpdf} + \ifthenelse{\boolean{pdf}} + {\setboolean{@tufte@pdf}{true}} + {\setboolean{@tufte@pdf}{false}} +}{% assume we're not using pdfTex? + \setboolean{@tufte@pdf}{false} +} + +%% +% Detect if we're using XeLaTeX + +\newboolean{@tufte@xetex} +\IfFileExists{ifxetex.sty}{% + \RequirePackage{ifxetex} + \ifthenelse{\boolean{xetex}} + {\setboolean{@tufte@xetex}{true}} + {\setboolean{@tufte@xetex}{false}} +}{% not using xelatex + \setboolean{@tufte@xetex}{false} +} + +% this breaks superscript and subscript for some fonts. +% xltxtra should not be neccessary anymore so I comment it out. +%\ifthenelse{\boolean{@tufte@xetex}}{% +% \RequirePackage{xltxtra}% xltxtra loads xunicode and fontspec; must be loaded before bidi +%}{} + +%% +% Detect if we're using LuaTeX + +\newboolean{@tufte@luatex} +\IfFileExists{ifluatex.sty}{% + \RequirePackage{ifluatex} + \ifthenelse{\boolean{luatex}} + {\setboolean{@tufte@luatex}{true}} + {\setboolean{@tufte@luatex}{false}} +}{% not using luatex + \setboolean{@tufte@luatex}{false} +} + +\ifthenelse{\boolean{@tufte@luatex}}{% + \RequirePackage{fontspec} + \RequirePackage[osf,sc]{mathpazo} + \setmainfont[Renderer=Basic, Numbers=OldStyle, Scale = 1.0]{TeX Gyre Pagella} + \setsansfont[Renderer=Basic, Scale=0.90]{TeX Gyre Heros} + \setmonofont[Renderer=Basic]{TeX Gyre Cursor} +}{} + +%% +% Globally sets the length + +\newcommand*{\gsetlength}[2]{% + \setlength{#1}{#2}% + \global#1=#1\relax% +} + +%% +% Globally sets a boolean + +\newcommand*{\gsetboolean}[2]{% based on code from ifthen pkg + \lowercase{\def\@tempa{#2}}% + \@ifundefined{@tempswa\@tempa}% + {\PackageError{ifthen}{You can only set a boolean to `true' or `false'}\@ehc}% + {\@ifundefined{#1\@tempa}% + {\PackageError{ifthen}{Boolean #1 undefined}\@ehc}% + {\global\csname#1\@tempa\endcsname}% + }% +} + +%% +% The titlesec and titletoc packages are used to change the style of the +% section headings. These packages should be loaded before the hyperref +% package. + +\RequirePackage{titlesec,titletoc} + +%%% +%% Loads the hyperref package and sets some default options. + +\newcommand{\TufteLoadHyperref}{% + \ifthenelse{\boolean{@tufte@xetex}} + {\RequirePackage[unicode,hyperfootnotes=false,xetex]{hyperref}} + {\RequirePackage[unicode,hyperfootnotes=false]{hyperref}} + \hypersetup{% + pdfborder = {0 0 0}, + bookmarksdepth = section, + citecolor = DarkGreen, + linkcolor = DarkBlue, + urlcolor = DarkGreen, + }% +} + +%%% +%% Load the `hyperref' package. + +\ifthenelse{\boolean{@tufte@loadhyper}}{% + \TufteLoadHyperref% +}{% hyperfootnotes override our modifications to the \footnote* and \@footnote* commands. + \PassOptionsToPackage{hyperfootnotes=false}{hyperref} +} + +%% +% Set the font sizes and baselines to match Tufte's books +\renewcommand\normalsize{% + \@setfontsize\normalsize\@xpt{14}% + \abovedisplayskip 10\p@ \@plus2\p@ \@minus5\p@ + \abovedisplayshortskip \z@ \@plus3\p@ + \belowdisplayshortskip 6\p@ \@plus3\p@ \@minus3\p@ + \belowdisplayskip \abovedisplayskip + \let\@listi\@listI} +\normalbaselineskip=14pt +\normalsize +\renewcommand\small{% + \@setfontsize\small\@ixpt{12}% + \abovedisplayskip 8.5\p@ \@plus3\p@ \@minus4\p@ + \abovedisplayshortskip \z@ \@plus2\p@ + \belowdisplayshortskip 4\p@ \@plus2\p@ \@minus2\p@ + \def\@listi{\leftmargin\leftmargini + \topsep 4\p@ \@plus2\p@ \@minus2\p@ + \parsep 2\p@ \@plus\p@ \@minus\p@ + \itemsep \parsep}% + \belowdisplayskip \abovedisplayskip +} +\renewcommand\footnotesize{% + \@setfontsize\footnotesize\@viiipt{10}% + \abovedisplayskip 6\p@ \@plus2\p@ \@minus4\p@ + \abovedisplayshortskip \z@ \@plus\p@ + \belowdisplayshortskip 3\p@ \@plus\p@ \@minus2\p@ + \def\@listi{\leftmargin\leftmargini + \topsep 3\p@ \@plus\p@ \@minus\p@ + \parsep 2\p@ \@plus\p@ \@minus\p@ + \itemsep \parsep}% + \belowdisplayskip \abovedisplayskip +} +\renewcommand\scriptsize{\@setfontsize\scriptsize\@viipt\@viiipt} +\renewcommand\tiny{\@setfontsize\tiny\@vpt\@vipt} +\renewcommand\large{\@setfontsize\large\@xipt{15}} +\renewcommand\Large{\@setfontsize\Large\@xiipt{16}} +\renewcommand\LARGE{\@setfontsize\LARGE\@xivpt{18}} +\renewcommand\huge{\@setfontsize\huge\@xxpt{30}} +\renewcommand\Huge{\@setfontsize\Huge{24}{36}} + +\setlength\leftmargini {1pc} +\setlength\leftmarginii {1pc} +\setlength\leftmarginiii {1pc} +\setlength\leftmarginiv {1pc} +\setlength\leftmarginv {1pc} +\setlength\leftmarginvi {1pc} +\setlength\labelsep {.5pc} +\setlength\labelwidth {\leftmargini} +\addtolength\labelwidth{-\labelsep} + +%% +% \RaggedRight allows hyphenation + +\setlength{\parindent}{1.0pc}% +\setlength{\parskip}{0pt}% +\RequirePackage{ragged2e} +\setlength{\RaggedRightRightskip}{\z@ plus 0.08\hsize} + +% Paragraph indentation and separation for normal text +\newcommand{\@tufte@reset@par}{% + \setlength{\RaggedRightParindent}{1.0pc}% + \setlength{\JustifyingParindent}{1.0pc}% + \setlength{\parindent}{1pc}% + \setlength{\parskip}{0pt}% +} +\@tufte@reset@par + +% Paragraph indentation and separation for marginal text +\newcommand{\@tufte@margin@par}{% + \setlength{\RaggedRightParindent}{0.5pc}% + \setlength{\JustifyingParindent}{0.5pc}% + \setlength{\parindent}{0.5pc}% + \setlength{\parskip}{0pt}% +} + + +%% +% Set page layout geometry + +\RequirePackage[letterpaper,left=1in,top=1in,headsep=2\baselineskip,textwidth=26pc,marginparsep=2pc,marginparwidth=12pc,textheight=44\baselineskip,headheight=\baselineskip]{geometry} + +\ifthenelse{\boolean{@tufte@afourpaper}} + {\geometry{a4paper,left=24.8mm,top=27.4mm,headsep=2\baselineskip,textwidth=107mm,marginparsep=8.2mm,marginparwidth=49.4mm,textheight=49\baselineskip,headheight=\baselineskip}} + {} + +\ifthenelse{\boolean{@tufte@bfivepaper}} + {\geometry{paperwidth=176mm,paperheight=250mm,left=14.66mm,top=13.88mm,textwidth=102.66mm,marginparsep=7.33mm,marginparwidth=36.66mm,textheight=38\baselineskip,includehead}} + {} + +\ifthenelse{\boolean{@tufte@symmetric}} + {} + {\geometry{asymmetric}}% forces internal LaTeX `twoside' + + +%% +% Separation marginpars by a line's worth of space. + +\setlength\marginparpush{10pt} + +%% +% Font for margin items + +\ifthenelse{\boolean{@tufte@sfsidenotes}} + {\newcommand{\@tufte@marginfont}{\normalfont\footnotesize\sffamily}} + {\newcommand{\@tufte@marginfont}{\normalfont\footnotesize}} + +\newcommand*{\@tufte@sidenote@font}{\@tufte@marginfont} +\newcommand*{\@tufte@caption@font}{\@tufte@marginfont} +\newcommand*{\@tufte@marginnote@font}{\@tufte@marginfont} +\newcommand*{\@tufte@citation@font}{\@tufte@marginfont} + +\newcommand*{\setsidenotefont}[1]{\renewcommand*{\@tufte@sidenote@font}{#1}} +\newcommand*{\setcaptionfont}[1]{\renewcommand*{\@tufte@caption@font}{#1}} +\newcommand*{\setmarginnotefont}[1]{\renewcommand*{\@tufte@marginnote@font}{#1}} +\newcommand*{\setcitationfont}[1]{\renewcommand*{\@tufte@citation@font}{#1}} + +%% +% Set the justification based on the `justified' class option + +\newcommand{\@tufte@justification}{% + \ifthenelse{\boolean{@tufte@justified}}% + {\justifying}% + {\RaggedRight}% +} + +%% +% Turn off section numbering + +\setcounter{secnumdepth}{-1} + +%% +% Tighten up space between displays (e.g., a figure or table) and make symmetric + +\setlength\abovedisplayskip{6pt plus 2pt minus 4pt} +\setlength\belowdisplayskip{6pt plus 2pt minus 4pt} + +%% +% To implement full-width display environments + +\newboolean{@tufte@changepage} +\IfFileExists{changepage.sty}{% + \@tufte@debug@info@noline{Found changepage.sty} + \RequirePackage[strict]{changepage} + \setboolean{@tufte@changepage}{true} +}{% + \@tufte@debug@info@noline{Found chngpage.sty} + \RequirePackage[strict]{chngpage} + \setboolean{@tufte@changepage}{false} +} + +% Write our own aliases for the \checkoddpage and \ifoddpage or \ifcpoddpage commands +\newboolean{@tufte@odd@page} +\setboolean{@tufte@odd@page}{true} +\newcommand*{\@tufte@checkoddpage}{% + \checkoddpage% + \ifthenelse{\boolean{@tufte@changepage}}{% + \ifoddpage% + \setboolean{@tufte@odd@page}{true}% + \else% + \setboolean{@tufte@odd@page}{false}% + \fi% + }{% + \ifcpoddpage% + \setboolean{@tufte@odd@page}{true}% + \else% + \setboolean{@tufte@odd@page}{false}% + \fi% + }% +} + +%% +% Compute lengths used for full-width displays + +\newlength{\@tufte@overhang}% used by the fullwidth environment and the running heads +\newlength{\@tufte@fullwidth} +\newlength{\@tufte@caption@fill} + +\newcommand{\TufteRecalculate}{% + \setlength{\@tufte@overhang}{\marginparwidth} + \addtolength{\@tufte@overhang}{\marginparsep} + + \setlength{\@tufte@fullwidth}{\textwidth} + \addtolength{\@tufte@fullwidth}{\marginparsep} + \addtolength{\@tufte@fullwidth}{\marginparwidth} + + \setlength{\@tufte@caption@fill}{\textwidth} + \addtolength{\@tufte@caption@fill}{\marginparsep} +} + +\AtBeginDocument{\TufteRecalculate} + +%% +% Modified \title, \author, and \date commands. These store the +% (footnote-less) values in \plaintitle, \plainauthor, and \thedate, respectively. + +\newcommand{\plaintitle}{}% plain-text-only title +\newcommand{\plainauthor}{}% plain-text-only author +\newcommand{\plainpublisher}{}% plain-text-only publisher + +\newcommand{\thanklesstitle}{}% full title text minus \thanks{} +\newcommand{\thanklessauthor}{}% full author text minus \thanks{} +\newcommand{\thanklesspublisher}{}% full publisher minus \thanks{} + +\newcommand{\@publisher}{}% full publisher with \thanks{} +\newcommand{\thedate}{\today} + +% TODO Fix it so that \thanks is not spaced out (with `soul') and can be +% used in \maketitle when the `sfsidenotes' option is provided. +\renewcommand{\thanks}[1]{\NoCaseChange{\footnote{#1}}} + +\renewcommand{\title}[2][]{% + \gdef\@title{#2}% + \begingroup% + % TODO store contents of \thanks command + \renewcommand{\thanks}[1]{}% swallow \thanks contents + \protected@xdef\thanklesstitle{#2}% + \endgroup% + \ifthenelse{\isempty{#1}}% + {\renewcommand{\plaintitle}{\thanklesstitle}}% use thankless title + {\renewcommand{\plaintitle}{#1}}% use provided plain-text title + \ifthenelse{\isundefined{\hypersetup}}% + {}% hyperref is not loaded; do nothing + {\hypersetup{pdftitle={\plaintitle}}}% set the PDF metadata title +} + +\let\@author\@empty% suppress default latex.ltx ``no author'' warning +\renewcommand{\author}[2][]{% + \ifthenelse{\isempty{#2}}{}{\gdef\@author{#2}}% + \begingroup% + % TODO store contents of \thanks command + \renewcommand{\thanks}[1]{}% swallow \thanks contents + \protected@xdef\thanklessauthor{#2}% + \endgroup% + \ifthenelse{\isempty{#1}}% + {\renewcommand{\plainauthor}{\thanklessauthor}}% use thankless author + {\renewcommand{\plainauthor}{#1}}% use provided plain-text author + \ifthenelse{\isundefined{\hypersetup}}% + {}% hyperref is not loaded; do nothing + {\hypersetup{pdfauthor={\plainauthor}}}% set the PDF metadata author +} + +\renewcommand{\date}[1]{% + \gdef\@date{#1}% + \begingroup% + % TODO store contents of \thanks command + \renewcommand{\thanks}[1]{}% swallow \thanks contents + \protected@xdef\thedate{#1}% + \endgroup% +} + +%% +% Provides a \publisher command to set the publisher + +\newcommand{\publisher}[2][]{% + \gdef\@publisher{#2}% + \begingroup% + \renewcommand{\thanks}[1]{}% swallow \thanks contents + \protected@xdef\thanklesspublisher{#2}% + \endgroup% + \ifthenelse{\isempty{#1}} + {\renewcommand{\plainpublisher}{\thanklesspublisher}}% use thankless publisher + {\renewcommand{\plainpublisher}{#1}}% use provided plain-text publisher +} + +% TODO: Test \hypersetup{pdfauthor,pdftitle} with DVI and XeTeX + +%% +% Require paralist package for tighter lists + +\RequirePackage{paralist} + +% Add rightmargin to compactenum + +\def\@compactenum@{% + \expandafter\list\csname label\@enumctr\endcsname{% + \usecounter{\@enumctr}% + \rightmargin=2em% added this + \parsep\plparsep + \itemsep\plitemsep + \topsep\pltopsep + \partopsep\plpartopsep + \def\makelabel##1{\hss\llap{##1}}}} + +%% +% Improved letterspacing of small caps and all-caps text. +% +% First, try to use the `microtype' package, if it's available. +% Failing that, try to use the `soul' package, if it's available. +% Failing that, well, I give up. + +\DeclareTextFontCommand{\textsmallcaps}{\scshape} + +\RequirePackage{textcase} % provides \MakeTextUppercase and \MakeTextLowercase +\def\allcapsspacing{\@tufte@warning{Proper spacing of ALL-CAPS letters has not been set up.}} +\def\smallcapsspacing{\@tufte@warning{Proper spacing of small-caps letters has not been set up.}} +\newcommand{\allcaps}[1]{\allcapsspacing{\MakeTextUppercase{#1}}} +\newcommand{\smallcaps}[1]{\smallcapsspacing{\MakeTextLowercase{#1}}} + +% If we're using pdfLaTeX v1.40+, use the letterspace package. +% If we're using pdfLaTex < v1.40, use the soul package. +% If we're using XeLaTeX, use XeLaTeX letterspacing options. +% Otherwise fall back on the soul package. + +\ifthenelse{\boolean{@tufte@pdf}} + {\@tufte@debug@info@noline{ifpdf = true}} + {\@tufte@debug@info@noline{ifpdf = false}} + +\ifthenelse{\boolean{@tufte@xetex}} + {\@tufte@debug@info@noline{ifxetex = true}} + {\@tufte@debug@info@noline{ifxetex = false}} + +% Check pdfLaTeX version +\def\@tufte@pdftexversion{0} +\ifx\normalpdftexversion\@undefined \else + \let\pdftexversion \normalpdftexversion + \let\pdftexrevision\normalpdftexrevision + \let\pdfoutput \normalpdfoutput +\fi +\ifx\pdftexversion\@undefined \else + \ifx\pdftexversion\relax \else + \def\@tufte@pdftexversion{6} + \ifnum\pdftexversion < 140 + \def\@tufte@pdftexversion{5} + \fi + \fi +\fi + +\newboolean{@tufte@letterspace@pkg@prereqs} +\setboolean{@tufte@letterspace@pkg@prereqs}{true} +\ifnum\@tufte@pdftexversion<6 + \setboolean{@tufte@letterspace@pkg@prereqs}{false} +\fi + + +\newcommand{\@tufte@letterspacing@soul}{% + \RequirePackage{soul}% + \sodef\allcapsspacing{}{0.15em}{0.65em}{0.6em}% + \sodef\smallcapsspacing{}{0.075em}{0.5em}{0.6em}% + \sodef\sotextsc{\scshape}{0.075em}{0.5em}{0.6em}% + \renewcommand{\allcaps}[1]{\allcapsspacing{\MakeTextUppercase{##1}}}% + \renewcommand{\smallcaps}[1]{\smallcapsspacing{\scshape\MakeTextLowercase{##1}}}% + \renewcommand{\textsc}[1]{\sotextsc{##1}}% +} + +\newcommand{\@tufte@letterspacing@letterspace}{% + \@tufte@debug@info@noline{Modern version of pdfTeX detected. Using `letterspace' package}% + \RequirePackage{letterspace}% + % Set up letterspacing (using microtype package) -- requires pdfTeX v1.40+ + \renewcommand{\allcapsspacing}[1]{\textls[200]{##1}}% + \renewcommand{\smallcapsspacing}[1]{\textls[50]{##1}}% + \renewcommand{\allcaps}[1]{\allcapsspacing{\MakeTextUppercase{##1}}}% + \renewcommand{\smallcaps}[1]{\smallcapsspacing{\scshape\MakeTextLowercase{##1}}}% + \renewcommand{\textsc}[1]{\smallcapsspacing{\textsmallcaps{##1}}}% +} + +\ifthenelse{\boolean{@tufte@letterspace}}{% + \ifthenelse{\boolean{@tufte@pdf}\AND\boolean{@tufte@letterspace@pkg@prereqs}\AND\NOT\boolean{@tufte@xetex}}{% + % load letterspace pkg + \IfFileExists{letterspace.sty}{% + \@tufte@letterspacing@letterspace + }{}% + }{}% + % load soul pkg + \@ifpackageloaded{letterspace}{}{% + \IfFileExists{soul.sty}{% + \@tufte@letterspacing@soul + }{% + \@tufte@warning@noline{Couldn't locate `soul' package}% + }% soul not installed... giving up. + }% +}{} + +%\ifthenelse{\boolean{@tufte@letterspace}}{% + %\ifthenelse{\boolean{pdf}}{% + %\ifthenelse{\NOT\boolean{@tufte@letterspace@pkg@prereqs}}{% + %% pdfLaTeX version is too old or not using pdfLaTeX + %\ifthenelse{\boolean{@tufte@xetex}}{% + %% TODO use xetex letterspacing + %\@tufte@debug@info@noline{XeTeX detected. Reverting to `soul' package for letterspacing}% + %\@tufte@loadsoul% + %}{% + %% use `soul' package for letterspacing + %\@tufte@debug@info@noline{Old version of pdfTeX detected. Reverting to `soul' package for letterspacing}% + %\@tufte@loadsoul% + %} + %}{% + %\IfFileExists{letterspace.sty}{% + %\@tufte@debug@info@noline{Modern version of pdfTeX detected. Using `letterspace' package} + %\RequirePackage{letterspace} + %% Set up letterspacing (using microtype package) -- requires pdfTeX v1.40+ + %\renewcommand{\allcapsspacing}[1]{\textls[200]{##1}} + %\renewcommand{\smallcapsspacing}[1]{\textls[50]{##1}} + %\renewcommand{\allcaps}[1]{\textls[200]{\MakeTextUppercase{##1}}} + %\renewcommand{\smallcaps}[1]{\smallcapsspacing{\MakeTextLowercase{##1}}} + %\renewcommand{\textsc}[1]{\smallcapsspacing{\textsmallcaps{##1}}} + %}{% microtype failed, check for soul + %\@tufte@debug@info@noline{Modern version of pdfTeX detected, but `letterspace' package not installed. Reverting to `soul' package for letterspacing} + %\@tufte@loadsoul + %}% + %}% + %}{% + %\@tufte@debug@info@noline{Plain LaTeX detected. Using `soul' package for letterspacing} + %\@tufte@loadsoul + %} +%}{% +%% we're not to load letterspacing, so do nothing +%} + + +%% +% An environment for paragraph-style section + +\providecommand\newthought[1]{% + \tuftebreak + \noindent\textsc{#1}% +} + +%% +% Redefine the display environments (quote, quotation, etc.) + +\renewenvironment{verse} + {\let\\\@centercr + \list{}{\itemsep \z@ + \itemindent -1pc% + \listparindent\itemindent + \rightmargin \leftmargin + \advance\leftmargin 1pc}% + \small% + \item\relax} + {\endlist} +\renewenvironment{quotation} + {\list{}{\listparindent 1pc% + \itemindent \listparindent + \rightmargin \leftmargin + \parsep \z@ \@plus\p@}% + \small% + \item\relax\noindent\ignorespaces} + {\endlist} +\renewenvironment{quote} + {\list{}{\rightmargin\leftmargin}% + \small% + \item\relax} + {\endlist} + +%% +% Italicize description run-in headings (instead of the default bold) + +\renewcommand*\descriptionlabel[1]{\hspace\labelsep\normalfont\em #1} + + +%% +% Used for doublespacing, and other linespacing + +\RequirePackage{setspace} + +%% +% Color +\RequirePackage[dvipsnames,svgnames]{xcolor}% load before bidi + +%% +% Load the bidi package if instructed to do so. This package must be loaded +% prior to our redefining the \footnote and \cite commands. + +\ifthenelse{\boolean{@tufte@loadbidi}}{% + \AtBeginDocument{% + \RequirePackage{bidi} + \@tufte@pkghook@post@bidi% + }% +}{} + + +%% +% A function that removes leading and trailing spaces from the supplied macro. +% Based on code written by Michael Downes (See ``Around the Bend'', #15.) +% Executing \@tufte@trim@spaces\xyzzy will result in the contents of \xyzzy +% being trimmed of leading and trailing white space. + +\catcode`\Q=3 +\def\@tufte@trim@spaces#1{% + % Use grouping to emulate a multi-token afterassignment queue + \begingroup% + % Put `\toks 0 {' into the afterassignment queue + \aftergroup\toks\aftergroup0\aftergroup{% + % Apply \trimb to the replacement text of #1, adding a leading + % \noexpand to prevent brace stripping and to serve another purpose + % later. + \expandafter\@tufte@trim@b\expandafter\noexpand#1Q Q}% + % Transfer the trimmed text back into #1. + \edef#1{\the\toks0}% +} + +% \trimb removes a trailing space if present, then calls \@tufte@trim@c to +% clean up any leftover bizarre Qs, and trim a leading space. In +% order for \trimc to work properly we need to put back a Q first. +\def\@tufte@trim@b#1 Q{\@tufte@trim@c#1Q} + +% Execute \vfuzz assignment to remove leading space; the \noexpand +% will now prevent unwanted expansion of a macro or other expandable +% token at the beginning of the trimmed text. The \endgroup will feed +% in the \aftergroup tokens after the \vfuzz assignment is completed. +\def\@tufte@trim@c#1Q#2{\afterassignment\endgroup \vfuzz\the\vfuzz#1} +\catcode`\Q=11 + +%% +% Citations should go in the margin as sidenotes + +\ifthenelse{\boolean{@tufte@loadnatbib}}{% + \RequirePackage{natbib}% + \RequirePackage{bibentry}% allows bibitems to be typeset outside thebibliography environment + % Redefine the \BR@b@bibitem command to fix a bug with bibentry+chicago style + \renewcommand\BR@b@bibitem[2][]{% + \ifthenelse{\isempty{#1}}% + {\BR@bibitem{#2}}% + {\BR@bibitem[#1]{#2}}% + \BR@c@bibitem{#2}% + }% + \nobibliography*% pre-loads the bibliography keys + \providecommand{\doi}[1]{\textsc{doi:} #1}% pre-defining this so it may be used before the \bibliography command it issued +}{} + +%% +% Normal \cite behavior +\newcounter{@tufte@num@bibkeys}% +\newcommand{\@tufte@normal@cite}[2][0pt]{% + % Snag the last bibentry in the list for later comparison + \let\@temp@last@bibkey\@empty% + \@for\@temp@bibkey:=#2\do{\let\@temp@last@bibkey\@temp@bibkey}% + \sidenote[][#1]{% + % Loop through all the bibentries, separating them with semicolons and spaces + \normalsize\normalfont\@tufte@citation@font% + \setcounter{@tufte@num@bibkeys}{0}% + \@for\@temp@bibkeyx:=#2\do{% + \ifthenelse{\equal{\@temp@last@bibkey}{\@temp@bibkeyx}}% + {\ifthenelse{\equal{\value{@tufte@num@bibkeys}}{0}}{}{and\ }% + \@tufte@trim@spaces\@temp@bibkeyx% trim spaces around bibkey + \bibentry{\@temp@bibkeyx}}% + {\@tufte@trim@spaces\@temp@bibkeyx% trim spaces around bibkey + \bibentry{\@temp@bibkeyx};\ }% + \stepcounter{@tufte@num@bibkeys}% + }% + }% +} + + +%% +% Macros for holding the list of cite keys until after the \sidenote + +\gdef\@tufte@citations{}% list of cite keys +\newcommand\@tufte@add@citation[1]{\relax% adds a new bibkey to the list of cite keys + \ifx\@tufte@citations\@empty\else + \g@addto@macro\@tufte@citations{,}% separate by commas + \fi + \g@addto@macro\@tufte@citations{#1} +} + +\newcommand{\@tufte@print@citations}[1][0pt]{% puts the citations in a margin note + % Snag the last bibentry in the list for later comparison + \let\@temp@last@bibkey\@empty% + \@for\@temp@bibkey:=\@tufte@citations\do{\let\@temp@last@bibkey\@temp@bibkey}% + \marginpar{% + \hbox{}\vspace*{#1}% + \@tufte@citation@font% + \@tufte@citation@justification% + \@tufte@margin@par% use parindent and parskip settings for marginal text + \vspace*{-1\baselineskip}% + % Loop through all the bibentries, separating them with semicolons and spaces + \setcounter{@tufte@num@bibkeys}{0}% + \@for\@temp@bibkeyx:=\@tufte@citations\do{% + \ifthenelse{\equal{\@temp@last@bibkey}{\@temp@bibkeyx}}% + {\ifthenelse{\equal{\value{@tufte@num@bibkeys}}{0}}{}{and\ }% + \@tufte@trim@spaces\@temp@bibkeyx% trim spaces around bibkey + \bibentry{\@temp@bibkeyx}}% + {\@tufte@trim@spaces\@temp@bibkeyx% trim spaces around bibkey + \bibentry{\@temp@bibkeyx};\ }% + \stepcounter{@tufte@num@bibkeys}% + }% + }% +} + +%% +% \cite behavior when executed within a sidenote + +\newcommand{\@tufte@sidenote@citations}{}% contains list of \cites in sidenote +\newcommand{\@tufte@infootnote@cite}[1]{% + \@tufte@add@citation{#1} +} + +%% +% Set the default \cite style. This is set and reset by the \sidenote command. + +\ifthenelse{\boolean{@tufte@loadnatbib}}{% + \let\cite\@tufte@normal@cite +}{} + +%% +% Transform existing \footnotes into \sidenotes +% Sidenote: ``Where God meant footnotes to go.'' ---Tufte + +\RequirePackage{optparams}% for our new sidenote commands -- provides multiple optional arguments for commands + +\providecommand{\footnotelayout}{\@tufte@sidenote@font\@tufte@sidenote@justification} +\renewcommand{\footnotelayout}{\@tufte@sidenote@font\@tufte@sidenote@justification} + +% Override footmisc's definition to set the sidenote marks (numbers) inside the +% sidenote's text block. +\long\def\@makefntext#1{\@textsuperscript{\@tufte@sidenote@font\tiny\@thefnmark}\,\footnotelayout#1} + +% Set the in-text footnote mark in the same typeface as the body text itself. +\def\@makefnmark{\hbox{\@textsuperscript{\normalfont\footnotesize\@thefnmark}}} + +\providecommand*{\multiplefootnotemarker}{3sp} +\providecommand*{\multfootsep}{,} + +\renewcommand{\@footnotemark}{% + \leavevmode% + \ifhmode% + \edef\@x@sf{\the\spacefactor}% + \@tufte@check@multiple@sidenotes% + \nobreak% + \fi% + \@makefnmark% + \ifhmode\spacefactor\@x@sf\fi% + \relax% +} + +\newcommand{\@tufte@check@multiple@sidenotes}{% + \ifdim\lastkern=\multiplefootnotemarker\relax% + \edef\@x@sf{\the\spacefactor}% + \unkern% + \textsuperscript{\multfootsep}% + \spacefactor\@x@sf\relax% + \fi +} + +\renewcommand\@footnotetext[2][0pt]{% + \marginpar{% + \hbox{}\vspace*{#1}% + \def\baselinestretch {\setspace@singlespace}% + \reset@font\footnotesize% + \@tufte@margin@par% use parindent and parskip settings for marginal text + \vspace*{-1\baselineskip}\noindent% + \protected@edef\@currentlabel{% + \csname p@footnote\endcsname\@thefnmark% + }% + \color@begingroup% + \@makefntext{% + \ignorespaces#2% + }% + \color@endgroup% + }% +}% + +% Ensure this is run after the bidi package has been loaded +\def\@tufte@pkghook@post@bidi{}% +\g@addto@macro{\@tufte@pkghook@post@bidi}{% + \renewcommand\@footnotetext[2][0pt]{% + \marginpar{% + \hbox{}\vspace*{#1}% + \def\baselinestretch {\setspace@singlespace}% + \if@rl@footnote\@rltrue\else\@rlfalse\fi% + \reset@font\footnotesize% + \@tufte@margin@par% use parindent and parskip settings for marginal text + \vspace*{-1\baselineskip}\noindent% + \protected@edef\@currentlabel{% + \csname p@footnote\endcsname\@thefnmark% + }% + \color@begingroup% + \@makefntext{% + \ignorespaces#2% + }% + \color@endgroup% + }% + }% +}% + +% +% Define \sidenote command. Can handle \cite. + +\newlength{\@tufte@sidenote@vertical@offset} +\setlength{\@tufte@sidenote@vertical@offset}{0pt} + +% #1 = footnote num, #2 = vertical offset, #3 = footnote text +\long\def\@tufte@sidenote[#1][#2]#3{% + \ifthenelse{\boolean{@tufte@loadnatbib}}{% + \let\cite\@tufte@infootnote@cite% use the in-sidenote \cite command + }{}% + \gdef\@tufte@citations{}% clear out any old citations + \ifthenelse{\NOT\isempty{#2}}{% + \gsetlength{\@tufte@sidenote@vertical@offset}{#2}% + }{% + \gsetlength{\@tufte@sidenote@vertical@offset}{0pt}% + }% + \ifthenelse{\isempty{#1}}{% + % no specific footnote number provided + \stepcounter\@mpfn% + \protected@xdef\@thefnmark{\thempfn}% + \@footnotemark\@footnotetext[\@tufte@sidenote@vertical@offset]{#3}% + }{% + % specific footnote number provided + \begingroup% + \csname c@\@mpfn\endcsname #1\relax% + \unrestored@protected@xdef\@thefnmark{\thempfn}% + \endgroup% + \@footnotemark\@footnotetext[\@tufte@sidenote@vertical@offset]{#3}% + }% + \@tufte@print@citations% print any citations + \ifthenelse{\boolean{@tufte@loadnatbib}}{% + \let\cite\@tufte@normal@cite% go back to using normal in-text \cite command + }{}% + \unskip\ignorespaces% remove extra white space + \kern-\multiplefootnotemarker% remove \kern left behind by sidenote + \kern\multiplefootnotemarker\relax% add new \kern here to replace the one we yanked +} + +\newcommand{\sidenote}{\optparams{\@tufte@sidenote}{[][0pt]}} +\renewcommand{\footnote}{\optparams{\@tufte@sidenote}{[][0pt]}} + +%% +% Sidenote without the footnote mark + +\newcommand\marginnote[2][0pt]{% + \ifthenelse{\boolean{@tufte@loadnatbib}}{% + \let\cite\@tufte@infootnote@cite% use the in-sidenote \cite command + }{}% + \gdef\@tufte@citations{}% clear out any old citations + \marginpar{\hbox{}\vspace*{#1}\@tufte@marginnote@font\@tufte@marginnote@justification\@tufte@margin@par\vspace*{-1\baselineskip}\noindent #2}% + \@tufte@print@citations% print any citations + \ifthenelse{\boolean{@tufte@loadnatbib}}{% + \let\cite\@tufte@normal@cite% go back to using normal in-text \cite command + }{}% +} + + +%% +% The placeins package provides the \FloatBarrier command. This forces +% LaTeX to place all of the floats before proceeding. We'll use this to +% keep the float (figure and table) numbers in sequence. +\RequirePackage{placeins} + +%% +% Margin float environment + +\newsavebox{\@tufte@margin@floatbox} +\newenvironment{@tufte@margin@float}[2][-1.2ex]% + {\FloatBarrier% process all floats before this point so the figure/table numbers stay in order. + \begin{lrbox}{\@tufte@margin@floatbox}% + \begin{minipage}{\marginparwidth}% + \@tufte@caption@font% + \def\@captype{#2}% + \hbox{}\vspace*{#1}% + \@tufte@caption@justification% + \@tufte@margin@par% + \noindent% + } + {\end{minipage}% + \end{lrbox}% + \marginpar{\usebox{\@tufte@margin@floatbox}}% + } + + +%% +% Margin figure environment + +\newenvironment{marginfigure}[1][-1.2ex]% + {\begin{@tufte@margin@float}[#1]{figure}} + {\end{@tufte@margin@float}} + + +%% +% Margin table environment + +\newenvironment{margintable}[1][-1.2ex]% + {\begin{@tufte@margin@float}[#1]{table}} + {\end{@tufte@margin@float}} + + +%% +% Auto-detects the proper text alignment based on the various class options + +\newcommand*{\@tufte@justification@autodetect}{% + \ifthenelse{\boolean{@tufte@justified}}% + {\justifying}% + {\RaggedRight}% +} + +%% +% Forces the outer edge of the caption to be set ragged. +% Therefore, on verso pages it's ragged left, and on recto pages it's ragged right. + +\newcommand*{\@tufte@justification@caption@outer}{% + \ifthenelse{\boolean{@tufte@float@recto}}% + {\RaggedRight}% + {\RaggedLeft}% +} + +\newcommand*{\@tufte@justification@outer}{% + \@tufte@checkoddpage% + \ifthenelse{\boolean{@tufte@odd@page}}% + {\RaggedRight}% + {\RaggedLeft}% +} + + + +%% +% A collection of macros to be used with the new Tufte-style float environments. +% \setfloatalignment forces the caption placement to be treated as top, bottom, etc. +% \forcerectofloat forces the float to be treated as if it were appearing on a recto page. +% \forceversofloat does the same, but for verso pages. + +\newcommand{\@tufte@float@debug@info}{}% contains debug info generated as the float is processed +\newcommand{\@tufte@float@debug}[1]{% adds debug info to the queue for output + \ifthenelse{\equal{\@tufte@float@debug@info}{}}% + {\def\@tufte@float@debug@info{#1}}% + {\g@addto@macro\@tufte@float@debug@info{\MessageBreak#1}}% +} + +\newcommand{\floatalignment}{x}% holds the current float alignment (t, b, h, p) +\newcommand{\setfloatalignment}[1]{\global\def\floatalignment{#1}\@tufte@float@debug{Forcing position: [#1]}}% manually sets the float alignment +\newboolean{@tufte@float@recto} +\newcommand{\forcerectofloat}{\gsetboolean{@tufte@float@recto}{true}\@tufte@float@debug{Forcing page: [recto]}} +\newcommand{\forceversofloat}{\gsetboolean{@tufte@float@recto}{false}\@tufte@float@debug{Forcing page: [verso]}} + +% Boxes to temporarily store our float and caption +\newsavebox{\@tufte@figure@box} +\newsavebox{\@tufte@caption@box} + +% Save original LaTeX float environment +\let\@tufte@orig@float\@float +\let\@tufte@orig@endfloat\end@float + +% New length for tweaking float captions +\newlength{\@tufte@caption@vertical@offset} +\setlength{\@tufte@caption@vertical@offset}{0pt} + +% Store the caption and label contents +\newcommand{\@tufte@stored@shortcaption}{} +\newcommand{\@tufte@stored@caption}{} +\newcommand{\@tufte@stored@label}{} + +\long\def\@tufte@caption[#1][#2]#3{% + \ifthenelse{\isempty{#1}}% + {\gdef\@tufte@stored@shortcaption{#3}}% + {\gdef\@tufte@stored@shortcaption{#1}}% + \gsetlength{\@tufte@caption@vertical@offset}{-#2}% we want a positive offset to lower captions + \gdef\@tufte@stored@caption{#3}% +} + +\newcommand{\@tufte@label}[1]{% + \gdef\@tufte@stored@label{#1}% +} + +\newcommand{\@tufte@fps}{} + +\newboolean{@tufte@float@star} +\newlength{\@tufte@float@contents@width} + +%% +% Define a float environment to place the captions in the margin space + +\newenvironment{@tufte@float}[3][htbp]% + {% begin @tufte@float + % Should this float be full-width or just text-width? + \ifthenelse{\equal{#3}{star}}% + {\gsetboolean{@tufte@float@star}{true}}% + {\gsetboolean{@tufte@float@star}{false}}% + % Check page side (recto/verso) and store detected value -- can be overriden in environment contents + \@tufte@checkoddpage% + \ifthenelse{\boolean{@tufte@odd@page}}% + {\gsetboolean{@tufte@float@recto}{true}\@tufte@float@debug{Detected page: [recto/odd]}}% + {\gsetboolean{@tufte@float@recto}{false}\@tufte@float@debug{Detected page: [verso/even]}}% + % If the float placement specifier is 'b' and only 'b', then bottom-align the mini-pages, otherwise top-align them. + \renewcommand{\@tufte@fps}{#1}% + \@tufte@float@debug{Allowed positions: [#1]}% + \ifthenelse{\equal{#1}{b}\OR\equal{#1}{B}}% + {\renewcommand{\floatalignment}{b}\@tufte@float@debug{Presumed position: [bottom]}}% + {\renewcommand{\floatalignment}{t}\@tufte@float@debug{Presumed position: [top]}}% + % Capture the contents of the \caption and \label commands to use later + \global\let\@tufte@orig@caption\caption% + \global\let\@tufte@orig@label\label% + \renewcommand{\caption}{\optparams{\@tufte@caption}{[][0pt]}}% + \renewcommand{\label}[1]{\@tufte@label{##1}}% + % Handle subfigure package compatibility + \ifthenelse{\boolean{@tufte@packages@subfigure}}{% + % don't move the label while inside a \subfigure or \subtable command + \global\let\label\@tufte@orig@label% + }{}% subfigure package is not loaded + \@tufte@orig@float{#2}[#1]% + \ifthenelse{\boolean{@tufte@float@star}}% + {\setlength{\@tufte@float@contents@width}{\@tufte@fullwidth}}% + {\setlength{\@tufte@float@contents@width}{\textwidth}}% + \begin{lrbox}{\@tufte@figure@box}% + \begin{minipage}[\floatalignment]{\@tufte@float@contents@width}\hbox{}% + }{% end @tufte@float + \par\hbox{}\vspace{-\baselineskip}\ifthenelse{\prevdepth>0}{\vspace{-\prevdepth}}{}% align baselines of boxes + \end{minipage}% + \end{lrbox}% + % build the caption box + \begin{lrbox}{\@tufte@caption@box}% + \begin{minipage}[\floatalignment]{\marginparwidth}\hbox{}% + \ifthenelse{\NOT\equal{\@tufte@stored@caption}{}}{\@tufte@orig@caption[\@tufte@stored@shortcaption]{\@tufte@stored@caption}}{}% + \ifthenelse{\NOT\equal{\@tufte@stored@label}{}}{\@tufte@orig@label{\@tufte@stored@label}}{}% + \par\vspace{-\prevdepth}%% TODO: DOUBLE-CHECK FOR SAFETY + \end{minipage}% + \end{lrbox}% + % now typeset the stored boxes + \begin{fullwidth}% + \begin{minipage}[\floatalignment]{\linewidth}% + \ifthenelse{\boolean{@tufte@float@star}}% + {\@tufte@float@fullwidth[\@tufte@caption@vertical@offset]{\@tufte@figure@box}{\@tufte@caption@box}}% + {\@tufte@float@textwidth[\@tufte@caption@vertical@offset]{\@tufte@figure@box}{\@tufte@caption@box}}% + \end{minipage}% + \end{fullwidth}% + \@tufte@orig@endfloat% end original LaTeX float environment + % output debug info + \ifthenelse{\boolean{@tufte@debug}}{% + \typeout{^^J^^J----------- Tufte-LaTeX float information ----------}% + \ifthenelse{\equal{\@tufte@stored@label}{}}% + {\typeout{Warning: Float unlabeled!}}% + {\typeout{Float label: [\@tufte@stored@label]}}% + \typeout{Page number: [\thepage]}% + \def\MessageBreak{^^J}% + \typeout{\@tufte@float@debug@info}% + \ifthenelse{\boolean{@tufte@symmetric}}% + {\typeout{Symmetric: [true]}}% + {\typeout{Symmetric: [false]}}% + \typeout{----------------------------------------------------^^J^^J}% + }{}% + % reset commands and temp boxes and captions + \gdef\@tufte@float@debug@info{}% + \let\caption\@tufte@orig@caption% + \let\label\@tufte@orig@label% + \begin{lrbox}{\@tufte@figure@box}\hbox{}\end{lrbox}% + \begin{lrbox}{\@tufte@caption@box}\hbox{}\end{lrbox}% + \gdef\@tufte@stored@shortcaption{}% + \gdef\@tufte@stored@caption{}% + \gdef\@tufte@stored@label{}% + \gsetlength{\@tufte@caption@vertical@offset}{0pt}% reset caption offset + } + +\newcommand{\@tufte@float@textwidth}[3][0pt]{% + \ifthenelse{\NOT\boolean{@tufte@symmetric}\OR\boolean{@tufte@float@recto}}{% + % asymmetric or page is odd, so caption is on the right + \hbox{% + \usebox{#2}% + \hspace{\marginparsep}% + \smash{\raisebox{#1}{\usebox{#3}}}% + }% + \@tufte@float@debug{Caption position: [right]}% + }{% symmetric pages and page is even, so caption is on the left + \hbox{% + \smash{\raisebox{#1}{\usebox{#3}}}% + \hspace{\marginparsep}% + \usebox{#2}% + }% + \@tufte@float@debug{Caption position: [left]}% + }% +} + +\newcommand{\@tufte@float@fullwidth}[3][0pt]{% + \ifthenelse{\equal{\floatalignment}{b}}% + {% place caption above figure + \ifthenelse{\NOT\boolean{@tufte@symmetric}\OR\boolean{@tufte@float@recto}}% + {\hfill\smash{\raisebox{#1}{\usebox{#3}}}\par\usebox{#2}\@tufte@float@debug{Caption position: [above right]}}% caption on the right + {\smash{\raisebox{#1}{\usebox{#3}}}\hfill\par\usebox{#2}\@tufte@float@debug{Caption position: [above left]}}% caption on the left + }{% place caption below figure + \ifthenelse{\NOT\boolean{@tufte@symmetric}\OR\boolean{@tufte@float@recto}}% + {\usebox{#2}\par\hfill\smash{\raisebox{#1}{\usebox{#3}}}\@tufte@float@debug{Caption position: [below right]}}% caption on the right + {\usebox{#2}\par\smash{\raisebox{#1}{\usebox{#3}}}\hfill\@tufte@float@debug{Caption position: [below left]}}% caption on the left + }% +} + + +%% +% Redefine the figure environment to place the captions in the margin space + +\renewenvironment{figure}[1][htbp]% + {\ifvmode\else\unskip\fi\begin{@tufte@float}[#1]{figure}{}} + {\end{@tufte@float}} + + +%% +% Redefine the table environment to place the captions in the margin space + +\renewenvironment{table}[1][htbp] + {\ifvmode\else\unskip\fi\begin{@tufte@float}[#1]{table}{}} + {\end{@tufte@float}} + + +%% +% Full-width figure + +\renewenvironment{figure*}[1][htbp]% + {\ifvmode\else\unskip\fi\begin{@tufte@float}[#1]{figure}{star}} + {\end{@tufte@float}} + + +%% +% Full-width table + +\renewenvironment{table*}[1][htbp]% + {\ifvmode\else\unskip\fi\begin{@tufte@float}[#1]{table}{star}} + {\end{@tufte@float}} + + +%% +% Full-page-width area + +\newenvironment{fullwidth} + {\ifthenelse{\boolean{@tufte@symmetric}}% + {\ifthenelse{\boolean{@tufte@changepage}}{\begin{adjustwidth*}{}{-\@tufte@overhang}}{\begin{adjustwidth}[]{}{-\@tufte@overhang}}}% + {\begin{adjustwidth}{}{-\@tufte@overhang}}% + }% + {\ifthenelse{\boolean{@tufte@symmetric}}% + {\ifthenelse{\boolean{@tufte@changepage}}{\end{adjustwidth*}}{\end{adjustwidth}}}% + {\end{adjustwidth}}% + } + +%% +% Format the captions in a style similar to the sidenotes + +\long\def\@caption#1[#2]#3{% + \par% + \addcontentsline{\csname ext@#1\endcsname}{#1}% + {\protect\numberline{\csname the#1\endcsname}{\ignorespaces #2}}% + \begingroup% + \@parboxrestore% + \if@minipage% + \@setminipage% + \fi% + \@tufte@caption@font\@tufte@caption@justification% + \noindent\csname fnum@#1\endcsname: \ignorespaces#3\par% + %\@makecaption{\csname fnum@#1\endcsname}{\ignorespaces #3}\par + \endgroup} + +%% +% If we're NOT using XeLaTeX and the `nofonts' class option was NOT provided, +% we should load the Palatino, Helvetica, and Bera Mono fonts (if they are +% installed.) + +\ifthenelse{\boolean{@tufte@loadfonts}\AND\NOT\boolean{@tufte@xetex}\AND\NOT\boolean{@tufte@luatex}}{% + \IfFileExists{mathpazo.sty}{\RequirePackage[osf,sc]{mathpazo}}{} + \IfFileExists{helvet.sty}{\RequirePackage[scaled=0.90]{helvet}}{} + \IfFileExists{beramono.sty}{\RequirePackage[scaled=0.85]{beramono}}{} + \RequirePackage[T1]{fontenc} + \RequirePackage{textcomp} +}{} + + +%% +% Turns newlines into spaces. Based on code from the `titlesec' package. + +\DeclareRobustCommand{\@tufte@newlinetospace}{% + \@ifstar{\@tufte@newlinetospace@i}{\@tufte@newlinetospace@i}% +} + +\def\@tufte@newlinetospace@i{% + \ifdim\lastskip>\z@\else\space\fi + \ignorespaces% +} + +\DeclareRobustCommand{\newlinetospace}[1]{% + \let\@tufte@orig@cr\\% save the original meaning of \\ + \def\\{\@tufte@newlinetospace}% turn \\ and \\* into \space + \let\newline\\% turn \newline into \space + #1% + \let\\\@tufte@orig@cr% revert to original meaning of \\ +} + + +%% +% Sets up the running heads and folios. + +\RequirePackage{fancyhdr} + +% Set the default page style to 'fancy' +\pagestyle{fancy} + +% Set the header/footer width to be the body text block plus the margin +% note area. +\AtBeginDocument{% + \ifthenelse{\boolean{@tufte@symmetric}} + {\fancyhfoffset[LE,RO]{\@tufte@overhang}} + {\fancyhfoffset[RE,RO]{\@tufte@overhang}} +} + +% The running heads/feet don't have rules +\renewcommand{\headrulewidth}{0pt} +\renewcommand{\footrulewidth}{0pt} + +% The 'fancy' page style is the default style for all pages. +\fancyhf{} % clear header and footer fields +\ifthenelse{\boolean{@tufte@twoside}} + {\fancyhead[LE]{\thepage\quad\smallcaps{\newlinetospace{\plainauthor}}}% + \fancyhead[RO]{\smallcaps{\newlinetospace{\plaintitle}}\quad\thepage}} + {\fancyhead[RE,RO]{\smallcaps{\newlinetospace{\plaintitle}}\quad\thepage}} + + +% The `plain' page style is used on chapter opening pages. +% In Tufte's /Beautiful Evidence/ he never puts page numbers at the +% bottom of pages -- the folios are unexpressed. +\fancypagestyle{plain}{ + \fancyhf{} % clear header and footer fields + % Uncomment the following five lines of code if you want the opening page + % of the chapter to express the folio in the lower outside corner. + %\ifthenelse{\boolean{@tufte@twoside}} + % {\fancyfoot[LE,RO]{\thepage}} + % {\fancyfoot[RE,RO]{\thepage}} +} + +% The `empty' page style suppresses all headers and footers. +% It's used on title pages and `intentionally blank' pages. +\fancypagestyle{empty}{ + \fancyhf{} % clear header and footer fields +} + + +%% +% Set raggedright and paragraph indentation for document + +\AtBeginDocument{\@tufte@justification} + + +%% +% Prints the list of class options and their states. + +\newcommand{\typeoutbool}[2]{% + \ifthenelse{\boolean{#2}} + {\typeout{\space\space#1: true}} + {\typeout{\space\space#1: false}} +} + +\newcommand{\typeoutstr}[2]{% + \typeout{\space\space#1: #2} +} + +\newcommand{\PrintTufteSettings}{% + \typeout{-------------------- Tufte-LaTeX settings ----------} + \typeout{Class: \@tufte@pkgname} + \typeout{} + \typeout{Class options:} + \typeoutbool{a4paper}{@tufte@afourpaper} + \typeoutbool{b5paper}{@tufte@bfivepaper} + \typeoutbool{load fonts}{@tufte@loadfonts} + \typeoutbool{fully-justified}{@tufte@justified} + \typeoutbool{letterspacing}{@tufte@letterspace} + \typeoutbool{sans-serif sidenotes}{@tufte@sfsidenotes} + \typeoutbool{symmetric margins}{@tufte@symmetric} + \typeoutbool{titlepage}{@tufte@titlepage} + \typeoutbool{twoside}{@tufte@twoside} + \typeoutbool{debug}{@tufte@debug} + \typeout{} + \typeout{Internal variables:} + \typeoutbool{[twoside]}{@twoside} + \typeoutbool{pdflatex}{@tufte@pdf} + \typeoutbool{xelatex}{@tufte@xetex} + \typeout{----------------------------------------------------} +} + +%% +% Amount of space to skip before \newthought or after title block + +\newskip\tufteskipamount +\tufteskipamount=1.0\baselineskip plus 0.5ex minus 0.2ex + +\newcommand{\tuftebreak}{\par\ifdim\lastskip<\tufteskipamount + \removelastskip\penalty-100\tufteskip\fi} + +\newcommand{\tufteskip}{\vspace\tufteskipamount} + + +%% +% Produces a full title page + +\newcommand{\maketitlepage}[0]{% + \cleardoublepage% + {% + \sffamily% + \begin{fullwidth}% + \fontsize{18}{20}\selectfont\par\noindent\textcolor{darkgray}{\allcaps{\thanklessauthor}}% + \vspace{11.5pc}% + \fontsize{36}{40}\selectfont\par\noindent\textcolor{darkgray}{\allcaps{\thanklesstitle}}% + \vfill% + \fontsize{14}{16}\selectfont\par\noindent\allcaps{\thanklesspublisher}% + \end{fullwidth}% + } + \thispagestyle{empty}% + \clearpage% +} + +%% +% Title block + +\renewcommand{\maketitle}{% + \newpage + \global\@topnum\z@% prevent floats from being placed at the top of the page + \begingroup + \setlength{\parindent}{0pt}% + \setlength{\parskip}{4pt}% + \let\@@title\@empty + \let\@@author\@empty + \let\@@date\@empty + \ifthenelse{\boolean{@tufte@sfsidenotes}}{% + \gdef\@@title{\sffamily\LARGE\allcaps{\@title}\par}% + \gdef\@@author{\sffamily\Large\allcaps{\@author}\par}% + \gdef\@@date{\sffamily\Large\allcaps{\@date}\par}% + }{% + \gdef\@@title{\LARGE\itshape\@title\par}% + \gdef\@@author{\Large\itshape\@author\par}% + \gdef\@@date{\Large\itshape\@date\par}% + }% + \@@title + \@@author + \@@date + \endgroup + \thispagestyle{plain}% suppress the running head + \tuftebreak% add some space before the text begins + \@afterindentfalse\@afterheading% suppress indentation of the next paragraph +} + + +%% +% Title page (if the `titlepage' option was passed to the tufte-handout +% class.) + +\ifthenelse{\boolean{@tufte@titlepage}} + {\renewcommand{\maketitle}{\maketitlepage}} + {} + +%% +% When \cleardoublepage is called, produce a blank (empty) page -- i.e., +% without headers and footers +\def\cleardoublepage{\clearpage\if@twoside\ifodd\c@page\else + \hbox{} + %\vspace*{\fill} + %\begin{center} + % This page intentionally contains only this sentence. + %\end{center} + %\vspace{\fill} + \thispagestyle{empty} + \newpage + \if@twocolumn\hbox{}\newpage\fi\fi\fi} + +%% +% Make Tuftian-style section headings and TOC formatting + +\titleformat{\chapter}% + [display]% shape + {\relax\ifthenelse{\NOT\boolean{@tufte@symmetric}}{\begin{fullwidth}}{}}% format applied to label+text + {\itshape\huge\thechapter}% label + {0pt}% horizontal separation between label and title body + {\huge\rmfamily\itshape}% before the title body + [\ifthenelse{\NOT\boolean{@tufte@symmetric}}{\end{fullwidth}}{}]% after the title body + +\titleformat{\section}% + [hang]% shape + {\normalfont\Large\itshape}% format applied to label+text + {\thesection}% label + {1em}% horizontal separation between label and title body + {}% before the title body + []% after the title body + +\titleformat{\subsection}% + [hang]% shape + {\normalfont\large\itshape}% format applied to label+text + {\thesubsection}% label + {1em}% horizontal separation between label and title body + {}% before the title body + []% after the title body + +\titleformat{\paragraph}% + [runin]% shape + {\normalfont\itshape}% format applied to label+text + {\theparagraph}% label + {1em}% horizontal separation between label and title body + {}% before the title body + []% after the title body + +\titlespacing*{\chapter}{0pt}{50pt}{40pt} +\titlespacing*{\section}{0pt}{3.5ex plus 1ex minus .2ex}{2.3ex plus .2ex} +\titlespacing*{\subsection}{0pt}{3.25ex plus 1ex minus .2ex}{1.5ex plus.2ex} + +% Subsubsection and following section headings shouldn't be used. +% See Bringhurst's _The Elements of Typography_, section 4.2.2. +\renewcommand\subsubsection{% + \@tufte@error{\string\subsubsection is undefined by this class. + See Robert Bringhurst's _The Elements of + Typographic Style_, section 4.2.2. + \string\subsubsection was used} + {From Bringhurst's _The Elements of Typographic Style_, section 4.2.2: Use as + many levels of headings as you need, no more and no fewer. Also see the many + related threads on Ask E.T. at http://www.edwardtufte.com/.} +} + +\renewcommand\subparagraph{% + \@tufte@error{\string\subparagraph is undefined by this class.% + See Robert Bringhurst's _The Elements of + Typographic Style_, section 4.2.2. + \string\subparagraph was used} + {From Bringhurst's _The Elements of Typographic Style_, section 4.2.2: Use as + many levels of headings as you need, no more and no fewer. Also see the many + related threads on Ask E.T. at http://www.edwardtufte.com/.} +} + + +% Formatting for main TOC (printed in front matter) +% {section} [left] {above} {before w/label} {before w/o label} {filler + page} [after] +\ifthenelse{\boolean{@tufte@toc}}{% + \titlecontents{part}% FIXME + [0em] % distance from left margin + {\vspace{1.5\baselineskip}\begin{fullwidth}\LARGE\rmfamily\itshape} % above (global formatting of entry) + {\contentslabel{2em}} % before w/label (label = ``II'') + {} % before w/o label + {\rmfamily\upshape\qquad\thecontentspage} % filler + page (leaders and page num) + [\end{fullwidth}] % after + \titlecontents{chapter}% + [0em] % distance from left margin + {\vspace{1.5\baselineskip}\begin{fullwidth}\LARGE\rmfamily\itshape} % above (global formatting of entry) + {\hspace*{0em}\contentslabel{2em}} % before w/label (label = ``2'') + {\hspace*{0em}} % before w/o label + {\rmfamily\upshape\qquad\thecontentspage} % filler + page (leaders and page num) + [\end{fullwidth}] % after + \titlecontents{section}% FIXME + [0em] % distance from left margin + {\vspace{0\baselineskip}\begin{fullwidth}\Large\rmfamily\itshape} % above (global formatting of entry) + {\hspace*{2em}\contentslabel{2em}} % before w/label (label = ``2.6'') + {\hspace*{2em}} % before w/o label + {\rmfamily\upshape\qquad\thecontentspage} % filler + page (leaders and page num) + [\end{fullwidth}] % after + \titlecontents{subsection}% FIXME + [0em] % distance from left margin + {\vspace{0\baselineskip}\begin{fullwidth}\large\rmfamily\itshape} % above (global formatting of entry) + {\hspace*{4em}\contentslabel{4em}} % before w/label (label = ``2.6.1'') + {\hspace*{4em}} % before w/o label + {\rmfamily\upshape\qquad\thecontentspage} % filler + page (leaders and page num) + [\end{fullwidth}] % after + \titlecontents{paragraph}% FIXME + [0em] % distance from left margin + {\vspace{0\baselineskip}\begin{fullwidth}\normalsize\rmfamily\itshape} % above (global formatting of entry) + {\hspace*{6em}\contentslabel{2em}} % before w/label (label = ``2.6.0.0.1'') + {\hspace*{6em}} % before w/o label + {\rmfamily\upshape\qquad\thecontentspage} % filler + page (leaders and page num) + [\end{fullwidth}] % after +}{} + +%% +% Format lists of figures/tables + +\renewcommand\listoffigures{% + \ifthenelse{\equal{\@tufte@class}{book}}% + {\chapter*{\listfigurename}}% + {\section*{\listfigurename}}% +% \begin{fullwidth}% + \@starttoc{lof}% +% \end{fullwidth}% +} + +\renewcommand\listoftables{% + \ifthenelse{\equal{\@tufte@class}{book}}% + {\chapter*{\listtablename}}% + {\section*{\listtablename}}% +% \begin{fullwidth}% + \@starttoc{lot}% +% \end{fullwidth}% +} + +\newcommand{\@tufte@lof@line}[2]{% + % #1 is the figure/table number and its caption text + % #2 is the page number on which the figure/table appears + \leftskip 0.0em + \rightskip 0em + \parfillskip 0em plus 1fil + \parindent 0.0em + \@afterindenttrue + \interlinepenalty\@M + \leavevmode + \@tempdima 2.0em + \advance\leftskip\@tempdima + \null\nobreak\hskip -\leftskip + {#1}\nobreak\qquad\nobreak#2% + \par% +} + +\renewcommand*\l@figure{\@tufte@lof@line} +\let\l@table\l@figure + + +%% +% A handy command to disable hyphenation for short bits of text. +% Borrowed from Peter Wilson's `hyphenat' package. + +\AtBeginDocument{% + \@ifpackageloaded{hyphenat}{}{% + \newlanguage\langwohyphens% define a language without hyphenation rules + \providecommand{\nohyphens}[1]{{\language\langwohyphens #1}}% used for short bits of text + \providecommand{\nohyphenation}{\language\langwohyphens}% can be used inside environments for longer text + }% +} + +%% +% Redefine \bibsection to not mark the running heads. +% (Code modified from natbib.sty.) + +\ifthenelse{\boolean{@tufte@loadnatbib}}{% + \@ifundefined{chapter}{% + \renewcommand\bibsection{\section*{\refname}}% + }{% + \@ifundefined{NAT@sectionbib}{% + \renewcommand\bibsection{\chapter{\bibname}}% + }{% + \renewcommand\bibsection{\section*{\bibname}}% + }% + }% +} + +%% +% An index environment to mimic Tufte's indexes + +\RequirePackage{multicol} +\renewenvironment{theindex}{% + \ifthenelse{\equal{\@tufte@class}{book}}% + {\chapter{\indexname}}% + {\section*{\indexname}}% + \begin{fullwidth}% + \small% + \parskip0pt% + \parindent0pt% + \let\item\@idxitem% + \begin{multicols}{3}% +}{% + \end{multicols}% + \end{fullwidth}% +} +\renewcommand\@idxitem{\par\hangindent 2em} +\renewcommand\subitem{\par\hangindent 3em\hspace*{1em}} +\renewcommand\subsubitem{\par\hangindent 4em\hspace*{2em}} +\renewcommand\indexspace{\par\addvspace{1.0\baselineskip plus 0.5ex minus 0.2ex}\relax}% +\newcommand{\lettergroup}[1]{}% swallow the letter heading in the index + + +%% +% A couple commands to increase the number of floats you can use at a time. + +\def\morefloats{% provides a total of 52 floats + \ifthenelse{\isundefined{\bx@S}}{% + \@tufte@debug@info@noline{Adding 34 more float slots.} + \newinsert\bx@S + \newinsert\bx@T + \newinsert\bx@U + \newinsert\bx@V + \newinsert\bx@W + \newinsert\bx@X + \newinsert\bx@Y + \newinsert\bx@Z + \newinsert\bx@a + \newinsert\bx@b + \newinsert\bx@c + \newinsert\bx@d + \newinsert\bx@e + \newinsert\bx@f + \newinsert\bx@g + \newinsert\bx@h + \newinsert\bx@i + \newinsert\bx@j + \newinsert\bx@k + \newinsert\bx@l + \newinsert\bx@m + \newinsert\bx@n + \newinsert\bx@o + \newinsert\bx@p + \newinsert\bx@q + \newinsert\bx@r + \newinsert\bx@s + \newinsert\bx@t + \newinsert\bx@u + \newinsert\bx@v + \newinsert\bx@w + \newinsert\bx@x + \newinsert\bx@y + \newinsert\bx@z + \gdef\@freelist{\@elt\bx@A\@elt\bx@B\@elt\bx@C\@elt\bx@D\@elt\bx@E + \@elt\bx@F\@elt\bx@G\@elt\bx@H\@elt\bx@I\@elt\bx@J + \@elt\bx@K\@elt\bx@L\@elt\bx@M\@elt\bx@N + \@elt\bx@O\@elt\bx@P\@elt\bx@Q\@elt\bx@R + \@elt\bx@S\@elt\bx@T\@elt\bx@U\@elt\bx@V + \@elt\bx@W\@elt\bx@X\@elt\bx@Y\@elt\bx@Z + \@elt\bx@a\@elt\bx@b\@elt\bx@c\@elt\bx@d\@elt\bx@e + \@elt\bx@f\@elt\bx@g\@elt\bx@h\@elt\bx@i\@elt\bx@j + \@elt\bx@k\@elt\bx@l\@elt\bx@m\@elt\bx@n + \@elt\bx@o\@elt\bx@p\@elt\bx@q\@elt\bx@r + \@elt\bx@s\@elt\bx@t\@elt\bx@u\@elt\bx@v + \@elt\bx@w\@elt\bx@x\@elt\bx@y\@elt\bx@z}% + }{% we've already added another 34 floats, so we'll add 26 more, but that's it! + \ifthenelse{\isundefined{\bx@AA}}{% + \@tufte@debug@info@noline{Adding 26 more float slots.} + \newinsert\bx@AA + \newinsert\bx@BB + \newinsert\bx@CC + \newinsert\bx@DD + \newinsert\bx@EE + \newinsert\bx@FF + \newinsert\bx@GG + \newinsert\bx@HH + \newinsert\bx@II + \newinsert\bx@JJ + \newinsert\bx@KK + \newinsert\bx@LL + \newinsert\bx@MM + \newinsert\bx@NN + \newinsert\bx@OO + \newinsert\bx@PP + \newinsert\bx@QQ + \newinsert\bx@RR + \newinsert\bx@SS + \newinsert\bx@TT + \newinsert\bx@UU + \newinsert\bx@VV + \newinsert\bx@WW + \newinsert\bx@XX + \newinsert\bx@YY + \newinsert\bx@ZZ + \gdef\@freelist{\@elt\bx@A\@elt\bx@B\@elt\bx@C\@elt\bx@D\@elt\bx@E + \@elt\bx@F\@elt\bx@G\@elt\bx@H\@elt\bx@I\@elt\bx@J + \@elt\bx@K\@elt\bx@L\@elt\bx@M\@elt\bx@N + \@elt\bx@O\@elt\bx@P\@elt\bx@Q\@elt\bx@R + \@elt\bx@S\@elt\bx@T\@elt\bx@U\@elt\bx@V + \@elt\bx@W\@elt\bx@X\@elt\bx@Y\@elt\bx@Z + \@elt\bx@a\@elt\bx@b\@elt\bx@c\@elt\bx@d\@elt\bx@e + \@elt\bx@f\@elt\bx@g\@elt\bx@h\@elt\bx@i\@elt\bx@j + \@elt\bx@k\@elt\bx@l\@elt\bx@m\@elt\bx@n + \@elt\bx@o\@elt\bx@p\@elt\bx@q\@elt\bx@r + \@elt\bx@s\@elt\bx@t\@elt\bx@u\@elt\bx@v + \@elt\bx@w\@elt\bx@x\@elt\bx@y\@elt\bx@z + \@elt\bx@AA\@elt\bx@BB\@elt\bx@CC\@elt\bx@DD\@elt\bx@EE + \@elt\bx@FF\@elt\bx@GG\@elt\bx@HH\@elt\bx@II\@elt\bx@JJ + \@elt\bx@KK\@elt\bx@LL\@elt\bx@MM\@elt\bx@NN + \@elt\bx@OO\@elt\bx@PP\@elt\bx@QQ\@elt\bx@RR + \@elt\bx@SS\@elt\bx@TT\@elt\bx@UU\@elt\bx@VV + \@elt\bx@WW\@elt\bx@XX\@elt\bx@YY\@elt\bx@ZZ}% + }{% + \@tufte@error{You may only call \string\morefloats\space twice. See the Tufte-LaTeX documentation for other workarounds} + {There are already 78 float slots allocated. Try using \string\FloatBarrier\space or \string\clearpage\space to place some floats before creating more.} + }% + }% +} + + +%% +% Detect if the subfigure package has been loaded + +\newboolean{@tufte@packages@subfigure} +\setboolean{@tufte@packages@subfigure}{false} +\AtBeginDocument{% + \@ifpackageloaded{subfigure} + {\gsetboolean{@tufte@packages@subfigure}{true}} + {\gsetboolean{@tufte@packages@subfigure}{false}}% +} + + +%% +% Detect of the float package has been loaded + +\AtBeginDocument{% + \@ifpackageloaded{float}{% + % Save the redefined float environment (instead of the LaTeX float environment) + \let\@tufte@orig@float\@float + \let\@tufte@orig@endfloat\end@float + + % Define Tuftian float styles (with the caption in the margin) + \newcommand{\floatc@tufteplain}[2]{% + \begin{lrbox}{\@tufte@caption@box}% + \begin{minipage}[\floatalignment]{\marginparwidth}\hbox{}% + \@tufte@caption@font{\@fs@cfont #1:} #2\par% + \end{minipage}% + \end{lrbox}% + \smash{\hspace{\@tufte@caption@fill}\usebox{\@tufte@caption@box}}% + } + \newcommand{\fs@tufteplain}{% + \def\@fs@cfont{\@tufte@caption@font}% + \let\@fs@capt\floatc@tufteplain% + \def\@fs@pre{}% + \def\@fs@post{}% + \def\@fs@mid{}% + \let\@fs@iftopcapt\iftrue% + } + \let\fs@tufteplaintop=\fs@tufteplain + \let\floatc@tufteplaintop=\floatc@tufteplain + \newcommand\floatc@tufteruled[2]{% + {\@fs@cfont #1} #2\par% + } + \newcommand\fs@tufteruled{% + \def\@fs@cfont{\@tufte@caption@font}% + \let\@fs@capt\floatc@tufteplain% + \def\@fs@pre{\hrule height.8pt depth0pt width\textwidth \kern2pt}% + \def\@fs@post{\kern2pt\hrule width\textwidth\relax}% + \def\@fs@mid{}% + \let\@fs@iftopcapt\iftrue% + } + \newcommand\fs@tufteboxed{% + \def\@fs@cfont{}% + \let\@fs@capt\floatc@tufteplain% + \def\@fs@pre{% + \setbox\@currbox\vbox{\hbadness10000 + \moveleft3.4pt\vbox{\advance\hsize by6.8pt + \hrule \hbox to\hsize{\vrule\kern3pt + \vbox{\kern3pt\box\@currbox\kern3pt}\kern3pt\vrule}\hrule}} + }% + \def\@fs@mid{\kern2pt}% + \def\@fs@post{}% + \let\@fs@iftopcapt\iftrue% + } + }{% + % Nothing to do + } +} + +\AtBeginDocument{% + \@ifpackageloaded{algorithm}{% + % Set the float style to the Tuftian version + \ifthenelse{\equal{\ALG@floatstyle}{plain}\OR\equal{\ALG@floatstyle}{ruled}\OR\equal{\ALG@floatstyle}{boxed}}{% + \@tufte@info@noline{Switching algorithm float style from \ALG@floatstyle\space to tufte\ALG@floatstyle}% + \floatstyle{tufte\ALG@floatstyle}% + \restylefloat{algorithm}% + }{}% + }{% + % Nothing to do + } +} + + +%% +% For compatibility with the subfig package, we'll set captions=false so that +% it doesn't load the caption package (which modifies our own caption +% formatting). + +\PassOptionsToPackage{caption=false}{subfig} + + +%% +% If debugging is enabled, print the Tufte-LaTeX options and the list of +% files. + +\ifthenelse{\boolean{@tufte@debug}} + {\PrintTufteSettings\listfiles} + {} + + +%% +% If there is a `tufte-common-local.tex' file, load it up. + +\IfFileExists{tufte-common-local.tex} + {\input{tufte-common-local.tex}% + \@tufte@info@noline{Loading tufte-common-local.tex}} + {} + + +%% +% End of file +\endinput +