├── .gitignore ├── LICENSE ├── README.md ├── compile.sh ├── lab_logo ├── CDL_Avatar.pdf └── CDL_Avatar_Cropped.png ├── lab_manual.pdf ├── lab_manual.tex ├── resources ├── cheatsheets │ ├── command-line-cheatsheet.pdf │ ├── git-cheatsheet.pdf │ └── workflow-of-version-control.pdf └── cluster-tutorials │ └── intro-slides.pdf ├── tufte-book.cls ├── tufte-common.def └── tufte-handout.cls /.gitignore: -------------------------------------------------------------------------------- 1 | *.aux 2 | *.idx 3 | *.log 4 | *.out 5 | *.synctex.gz 6 | *.toc 7 | .DS_Store 8 | lab_manual.tex 9 | lab_manual.fls 10 | lab_manual.ilg 11 | lab_manual.fdb_latexmk 12 | lab_manual.ind 13 | lab_manual.blg 14 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2019 Contextual Dynamics Laboratory 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Overview 2 | 3 | This repository contains the lab manual (and associated source code) for the [Contextual Dynamics Laboratory (CDL)](http://www.context-lab.com) at [Dartmouth College](https://www.dartmouth.edu). The lab manual describes the rights and responsibilities of all CDL members, and it introduces our general research approach and lab policies. 4 | 5 | All new lab members are required to read (and modify!) this repository *prior* to joining the lab. New lab members are also required to complete a list of basic tasks (and signify that they have done so via a checklist at the end of the manual). The tasks are intended to ensure that every lab member is on the same page with respect to expectations and that every lab member has acquired a minimum viable set of skills needed to do research in the lab. 6 | 7 | A PDF of the latest version of the lab manual may always be found [here](https://github.com/ContextLab/lab-manual/blob/master/lab_manual.pdf). 8 | 9 | ## Building the PDF 10 | To compile a PDF of the lab manual, you need to first install a working distribution of [LaTeX](https://www.latex-project.org/get/). If you're on a mac with [homebrew](https://brew.sh/), you can run `brew install --cask mactex`. 11 | 12 | Once you've made (and saved) your changes to `lab_manual.tex`, run the `compile.sh` script in your Terminal: 13 | ```bash 14 | ./compile.sh 15 | ``` 16 | 17 | If everything works correctly, you should see a bunch of text, along with the last two lines that look something like 18 | ```bash 19 | Output written on lab_manual.pdf (42 pages, 232572 bytes). 20 | Transcript written on lab_manual.log. 21 | ``` 22 | 23 | Before committing your changes to the lab manual (see below), double check that the PDF looks correct: 24 | - Make sure you haven't introduced new typos or formatting issues 25 | - Make sure the table of contents (page 3) looks correct, and that the links in the table of contents still point to the correct sections 26 | - Check that the margin notes haven't been moved to strange locations (e.g., spanning multiple pages) 27 | 28 | 29 | 30 | # Why are we sharing this repository with the public? 31 | Our lab manual is, in one sense, intended to provide information that is specific to the CDL. So it's possible it'll be useful only to CDL lab members. However, we hope that others might find some aspects of the manual useful. For example, perhaps you like the look of the [LaTeX template](https://ctan.org/pkg/tufte-latex?lang=en) we used. Or perhaps you like some of the contents and want to incorporate something like it into your own operating manual. Or maybe you *don't* like something, and you want to use our manual as a counterexample! Whatever you'd like to do with the contents, we offer this repository freely and in the spirit of openness and collaboration. By the same token, we make no claims as to the accuracy of the documentation or code herein, so we invite you to proceed at your own risk. 32 | 33 | # Contributing 34 | The way we develop collaborative documents and code in the CDL is to have a central repository for each project (e.g. [this page](https://github.com/ContextLab/lab-manual)) that everyone on the project has read access to. This repository is public, so everyone with an Internet connection has access to the contents of this repository, and anyone can (in principle) submit a pull request to change the contents. In practice, however, any substantial (e.g. beyond simple typo and grammar corrections) changes will need to be discussed by CDL lab members in person (e.g. during our weekly lab meetings). (So: feel free to contribute whatever you'd like, but before taking the time to do so please recognize that if you are not affiliated with the CDL, or planning to become affiliated, then it's unlikely that we'd incorporate major changes into the manual without having discussed it with you first.) 35 | 36 | In order to modify the central code repository, you need to fork this repository, add your content to your fork, and then submit a pull request to incorporate your changes (from your fork) into the central repository. This allows us to maintain a stable working version in the central repository that everyone can access and rely on, while also allowing individual contributors to maintain (unstable) working versions. If these terms (forking, pulling, pushing, etc.) are unfamiliar or confusing, you should read through [these Git Tutorials](https://try.github.io/) before proceeding. 37 | 38 | To set up your fork: 39 | 1. Press the "fork" button in the upper right corner of the repository's website (link above). 40 | 2. Clone your fork to your local machine (`git clone https://github.com//lab-manual.git`). 41 | 3. Set the central repository as an upstream remote: `git remote add upstream https://github.com/ContextLab/lab-manual.git`. 42 | 4. Each time you want to make changes to your local copy, sync it with the central repository by running `git pull upstream master`. 43 | 5. When you're done making changes, type `git commit -a -m "` and then `git push`. 44 | 6. Repeat steps 4 and 5 until you have something to share with the world. Note: you can push broken code to your local fork without damaging anything in the central repository, so we encourage frequent committing and pushing (even of broken code) to your local fork. This will ensure that (a) you always have a recent online backup of your work and (b) there is a clear record of what you did and the path you took to accomplish it. 45 | 7. When you're ready to share your code with the world, go back to your fork's web page (`https://github.com//lab-manual`), navigate to the "pull requests" tab (upper left), and press the "New pull request" button in the upper right. Describe what you did and submit your pull request by filling out the prompts. Then someone from the CDL will review the changes and merge them in, and everyone will have access to your changes. -------------------------------------------------------------------------------- /compile.sh: -------------------------------------------------------------------------------- 1 | latex -interaction=nonstopmode -halt-on-error lab_manual 2 | latex -interaction=nonstopmode -halt-on-error lab_manual 3 | latex -interaction=nonstopmode -halt-on-error lab_manual 4 | latex -interaction=nonstopmode -halt-on-error lab_manual 5 | latex -interaction=nonstopmode -halt-on-error lab_manual 6 | pdflatex -interaction=nonstopmode -halt-on-error lab_manual 7 | rm *.log *.aux *.fdb_latexmk *.fls *.idx *.ilg *.ind *.out *.bbl *.blg *.run.xml -------------------------------------------------------------------------------- /lab_logo/CDL_Avatar.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ContextLab/lab-manual/9d7bb7484b128e6be12f46088d2c3091a9453a2f/lab_logo/CDL_Avatar.pdf -------------------------------------------------------------------------------- /lab_logo/CDL_Avatar_Cropped.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ContextLab/lab-manual/9d7bb7484b128e6be12f46088d2c3091a9453a2f/lab_logo/CDL_Avatar_Cropped.png -------------------------------------------------------------------------------- /lab_manual.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ContextLab/lab-manual/9d7bb7484b128e6be12f46088d2c3091a9453a2f/lab_manual.pdf -------------------------------------------------------------------------------- /lab_manual.tex: -------------------------------------------------------------------------------- 1 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 2 | % Tufte-Style Book (Minimal Template) 3 | % LaTeX Template 4 | % Version 1.0 (5/1/13) 5 | % 6 | % This template has been downloaded from: 7 | % http://www.LaTeXTemplates.com 8 | % 9 | % License: 10 | % CC BY-NC-SA 3.0 (http://creativecommons.org/licenses/by-nc-sa/3.0/) 11 | % 12 | % IMPORTANT NOTE: 13 | % In addition to running BibTeX to compile the reference list from the .bib 14 | % file, you will need to run MakeIndex to compile the index at the end of the 15 | % document. 16 | % 17 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 18 | 19 | %---------------------------------------------------------------------------------------- 20 | % PACKAGES AND OTHER DOCUMENT CONFIGURATIONS 21 | %---------------------------------------------------------------------------------------- 22 | 23 | \PassOptionsToPackage{nobottomtitles}{titlesec} 24 | \documentclass{tufte-book} % Use the tufte-book class which in turn 25 | % uses the tufte-common class 26 | 27 | \definecolor{dartmouthgreen}{RGB}{0, 105, 62} 28 | 29 | \hypersetup{colorlinks=true,linkcolor=dartmouthgreen} % Comment this line if you don't wish to have colored links 30 | 31 | \usepackage{microtype} % Improves character and word spacing 32 | 33 | %\usepackage{lipsum} % Inserts dummy text 34 | 35 | \usepackage{booktabs} % Better horizontal rules in tables 36 | 37 | \usepackage{graphicx} % Needed to insert images into the document 38 | \graphicspath{{graphics/}} % Sets the default location of pictures 39 | \setkeys{Gin}{width=\linewidth,totalheight=\textheight,keepaspectratio} 40 | % Improves figure scaling 41 | 42 | \usepackage[export]{adjustbox} 43 | 44 | \usepackage{fancyvrb} % Allows customization of verbatim environments 45 | \fvset{fontsize=\normalsize} % The font size of all verbatim text can be changed here 46 | 47 | \newcommand{\hangp}[1]{\makebox[0pt][r]{(}#1\makebox[0pt][l]{)}} % New command to create parentheses around text in tables which take up no horizontal space - this improves column spacing 48 | \newcommand{\hangstar}{\makebox[0pt][l]{*}} % New command to create asterisks in tables which take up no horizontal space - this improves column spacing 49 | 50 | \usepackage{xspace} % Used for printing a trailing space better than 51 | % using a tilde (~) using the \xspace command 52 | 53 | \usepackage{hyperref} %web links/URLs 54 | 55 | \usepackage{enumitem,amssymb} 56 | \newlist{todolist}{itemize}{2} 57 | \setlist[todolist]{label=$\square$} 58 | 59 | \newcommand{\monthyear}{\ifcase\month\or January\or February\or March\or April\or May\or June\or July\or August\or September\or October\or November\or December\fi,\space\number\year} % A command to print the current month and year 60 | 61 | \newcommand{\openepigraph}[2]{ % This block sets up a command for printing an epigraph with 2 arguments - the quote and the author 62 | \begin{fullwidth} 63 | \sffamily%\large 64 | \begin{doublespace} 65 | \noindent\allcaps{#1}\\ % The quote 66 | \noindent\allcaps{#2} % The author 67 | \end{doublespace} 68 | \end{fullwidth} 69 | } 70 | 71 | \newcommand{\ourschool}{Dartmouth College} 72 | 73 | \newcommand{\blankpage}{\newpage\hbox{}\thispagestyle{empty}\newpage} % Command to insert a blank page 74 | 75 | \usepackage{makeidx} % Used to generate the index 76 | \makeindex % Generate the index which is printed at the end of the document 77 | 78 | %---------------------------------------------------------------------------------------- 79 | % BOOK META-INFORMATION 80 | %---------------------------------------------------------------------------------------- 81 | 82 | \title{Lab Manual} % Title of the book 83 | 84 | \author{Jeremy R. Manning, Ph.D.} % Author 85 | 86 | \publisher{Contextual Dynamics Lab, \ourschool} % Publisher 87 | 88 | %---------------------------------------------------------------------------------------- 89 | 90 | \begin{document} 91 | \frontmatter 92 | 93 | %---------------------------------------------------------------------------------------- 94 | % EPIGRAPH 95 | %---------------------------------------------------------------------------------------- 96 | 97 | \thispagestyle{empty} 98 | %\openepigraph{Quotation 1}{Author, {\itshape Source}} 99 | %\vfill 100 | %\openepigraph{Quotation 2}{Author} 101 | %\vfill 102 | %\openepigraph{Quotation 3}{Author} 103 | 104 | %---------------------------------------------------------------------------------------- 105 | 106 | \maketitle % Print the title page 107 | %---------------------------------------------------------------------------------------- 108 | % COPYRIGHT PAGE 109 | %---------------------------------------------------------------------------------------- 110 | 111 | \newpage 112 | \begin{fullwidth} 113 | ~\vfill 114 | \thispagestyle{empty} 115 | \setlength{\parindent}{0pt} 116 | \setlength{\parskip}{\baselineskip} 117 | 118 | \includegraphics[width=0.3in,left]{./lab_logo/CDL_Avatar_Cropped.png}\\\vspace{0.2in} 119 | 120 | Copyright \copyright\ \the\year\ \thanklessauthor 121 | 122 | \par\smallcaps{Published by the \thanklesspublisher} 123 | 124 | \par\smallcaps{\url{http://www.context-lab.com}} 125 | 126 | %\par License information.\index{license} 127 | 128 | \par\textit{Current as of \monthyear} 129 | \end{fullwidth} 130 | 131 | %---------------------------------------------------------------------------------------- 132 | 133 | \setcounter{tocdepth}{1} 134 | \tableofcontents % Print the table of contents 135 | 136 | %---------------------------------------------------------------------------------------- 137 | 138 | %\listoffigures % Print a list of figures 139 | 140 | %---------------------------------------------------------------------------------------- 141 | 142 | %\listoftables % Print a list of tables 143 | 144 | %---------------------------------------------------------------------------------------- 145 | % DEDICATION PAGE 146 | %---------------------------------------------------------------------------------------- 147 | 148 | % \cleardoublepage 149 | % ~\vfill 150 | % \begin{doublespace} 151 | % \noindent\fontsize{18}{22}\selectfont\itshape 152 | % \nohyphenation 153 | % Dedicated to my family and friends. 154 | % \end{doublespace} 155 | % \vfill 156 | % \vfill 157 | 158 | %---------------------------------------------------------------------------------------- 159 | % INTRODUCTION 160 | %---------------------------------------------------------------------------------------- 161 | 162 | \newcommand{\director}{Jeremy} 163 | \newcommand{\coordinator}{\director} 164 | \newcommand{\labmeetingtime}{Mondays at 1:15pm} 165 | \newcommand{\meeting}{\href{https:context-lab.youcanbook.me}{YouCanBook.me}} 166 | 167 | \cleardoublepage 168 | \chapter{Introduction}\label{ch:intro} % Adding an asterisk leaves out this chapter from the table of contents 169 | This lab manual is intended to provide a crash course in doing 170 | research in the Contextual Dynamics Lab. It describes your rights and 171 | responsibilities as a member of the lab. The manual also introduces 172 | our general research approach and lab policies. 173 | 174 | \newthought{Who is this lab manual for?} 175 | 176 | \noindent \marginnote{\texttt{TASK:} Upon reading through this lab 177 | manual for the first time, please update the document to include 178 | your name in the \hyperref[sec:curr_members]{Lab members} 179 | section. Importantly, be sure to fork the 180 | \href{https://github.com/ContextLab/lab-manual}{GitHub repository}, 181 | make your edit on your personal fork, and submit a pull request with 182 | your update. Be sure to recompile the \texttt{.tex} file after you 183 | make your changes so that the \texttt{.pdf} file is updated and the 184 | \LaTeX~compiler catches any errors you may have made. Also, feel 185 | free to make any additional changes you think would benefit other 186 | current or future lab members. You could correct a typo, clarify 187 | something that’s unclear, add a comment or reference to a useful 188 | tool, etc. If you'd like to get feedback on your idea first, create 189 | a \href{https://github.com/ContextLab/lab-manual/issues}{GitHub 190 | issue} describing your proposed change; you can use the existing 191 | issues to help decide what to focus on for your own edits if you'd 192 | like.} Every new lab member should read the latest version of this 193 | lab manual in detail and reference it later as needed. Periodically 194 | throughout the document, you will see margin notes with listed 195 | \texttt{TASK} items. Completing your read through entails: (a) 196 | reading the contents of the manual, (b) asking current lab members 197 | about any confusing aspects, and (c) completing the relevant 198 | \texttt{TASK} items. You will also see non-task \texttt{NOTE} items; 199 | these provide helpful tips and additional commentary on the nearby 200 | text. 201 | 202 | This lab manual is meant to be a ``living document.'' All lab members 203 | are welcome (and encouraged!) to submit edits that improve the 204 | content, clarity, and overall helpfulness of this document at any 205 | point throughout their tenure in the lab. 206 | 207 | \newthought{What should you do if you don't understand something?} 208 | 209 | \noindent \marginnote{\texttt{TASK:} If you haven't used \LaTeX~before 210 | (i.e., the document formatting language in which this manual is 211 | written), you'll want to 212 | \href{https://www.latex-project.org/get/}{download \LaTeX} and take 213 | a look at 214 | \href{https://www.latex-tutorial.com/tutorials/quick-start/}{this 215 | ``quick start'' tutorial}.} If you don't understand something you 216 | read in this manual, it is important that you \textit{ask another lab 217 | member for help}. Every member of the lab brings their own unique 218 | knowledge base, training, life experiences, and perspectives. 219 | Respecting and celebrating those differences drives the science we do. 220 | If you're new to the lab or new to a particular technique, you might 221 | feel like a newbie today---but chances are good that if you stick 222 | around for a bit someone else will be seeking your expert opinion 223 | before you know it. In addition to learning, there's another good 224 | reason for asking for help: if you don't understand something, there's 225 | a reasonable chance that you've discovered a mistake or a logical 226 | inconsistency! 227 | 228 | \marginnote{\texttt{TASK:} When you are done reading this manual and 229 | carrying out all required tasks, please fill out the signature page, 230 | sign it (electronically), and email a PDF (of just the signature 231 | page) to 232 | \href{mailto:contextualdynamics@gmail.com}{contextualdynamics@gmail.com}. 233 | \textbf{You are officially a lab member once you have completed all 234 | tasks in this manual and receipt of your signed and filled-out 235 | signature page and checklist has been acknowledged by \director.}} 236 | 237 | \newthought{Why is it worth my time to read through the manual?} 238 | 239 | Aside from pursuing your own curiosity, a major reason that you've 240 | decided to join an academic research lab is probably because you want 241 | to gain training or career-advancing experiences. This manual briefly 242 | summarizes the collective wisdom of past and present lab members in a 243 | way that we think will best allow you to achieve your objectives. 244 | \textit{Learn from it}, \textit{challenge it}, and \textit{add to it}. 245 | 246 | \newthought{What ``isn't'' this lab manual?} 247 | 248 | \noindent This lab manual is \textit{not} intended to provide a 249 | comprehensive overview of everything you need to know to do your 250 | research projects. As described next, you may not even \textit{know} 251 | what you need to know to do your projects! Nevertheless, you need 252 | somewhere to start, and this is that place. 253 | 254 | We also maintain a repository of 255 | \href{https://github.com/ContextLab/CDL-tutorials}{lab tutorials} that 256 | provide guidance on specific tasks. If you are looking for help on a 257 | particular task (or understanding a particular concept) that isn't 258 | covered by the existing set of tutorials, please consider contributing 259 | a tutorial of your own once you've figured things out! 260 | 261 | 262 | \chapter{Bill of rights and responsibilities}\label{ch:billofrights} 263 | \marginnote{\texttt{TASK:} Read 264 | \href{https://www.sciencemag.org/careers/2018/11/what-can-we-learn-dartmouth}{this 265 | letter} about defining and characterizing boundaries between lab 266 | members and noticing unhealthy norms.} As a member of the 267 | Contextual Dynamics Lab, you are entitled to certain rights, and you 268 | agree to take on certain responsibilities. 269 | 270 | \newthought{Your rights as a lab member} 271 | 272 | \begin{enumerate} 273 | \item You are entitled to a safe work environment free from 274 | harassment, abuse, violence, and discrimination in any form. 275 | \item You are entitled to be supported and respected by all lab 276 | members. 277 | \item You are entitled to openly share your scientific ideas and 278 | constructive feedback with all lab members. 279 | \item You are entitled to appropriate credit (e.g.\ authorship, 280 | acknowledgement, letter of recommendation) for your work and 281 | ideas. 282 | \end{enumerate} 283 | 284 | \newthought{Your responsibilities as a lab member} 285 | \begin{enumerate} 286 | \item You agree to contribute to a safe work environment and to refrain 287 | from behaviors that harass, abuse, expose to violence, or 288 | discriminate. 289 | \item You agree to support and respect all lab members, including 290 | yourself. 291 | \item You agree to openly share your scientific ideas and constructive 292 | feedback with other lab members. 293 | \item You agree to clearly communicate and document your 294 | contributions to each research project (e.g.\ through GitHub 295 | commits and issues, reports, updates on Slack, etc.). 296 | \item You agree to establish open lines of communication between 297 | yourself and other lab members, and to address concerns or issues 298 | promptly and directly with the relevant parties (to the extent 299 | that you feel safe doing so). 300 | \item You agree to carry out your work with integrity and diligence, 301 | adhering to the highest possible standards of scientific 302 | excellence. 303 | \item You agree to utilize lab resources (including equipment, 304 | money, time, etc.) responsibly and sustainably. 305 | \item You agree to maintain a clean workspace free from clutter, 306 | including both personal spaces (e.g.\ desks) and shared 307 | areas (couch, sink, testing rooms, etc.). 308 | \end{enumerate} 309 | 310 | \newthought{Recourse} 311 | 312 | \noindent If you feel your rights as a lab member have been, or are in 313 | danger of being, violated, it is your duty to report those violations 314 | immediately to a senior staff member (e.g.\ \director, Department 315 | Chair, Deans, police, Title IX coordinator, ombudsman, etc.). 316 | Similarly, if you notice others endangering others' rights, or 317 | neglecting their responsibilities, it is your duty to report those 318 | violations to a senior staff member. 319 | 320 | \chapter{Official lab practices and policies}\label{ch:policy} 321 | Our lab's practices and policies are intended to provide a framework 322 | for \textit{maximizing efficiency}. Achieving our peak efficiency as 323 | a lab means we are being as scientifically productive as possible, in 324 | terms of knowledge discovery (learning new stuff) and dissemination 325 | (papers, talks, conference presentations, publicly released datasets, 326 | software, etc.). It also means that our fellow lab members are 327 | achieving their training and career objectives. To achieve peak 328 | efficiency, we need to succeed on three fronts: 329 | \begin{itemize} 330 | \item \textbf{Communication.} We want to foster an environment where 331 | everyone feels comfortable contributing to the collective dialogue. 332 | Our lab meets regularly to discuss logistical (e.g.\ scheduling, financial, 333 | sociological) and technical issues. We also use a variety of 334 | software packages to synchronize and facilitate communication within 335 | our lab and between our lab and the broader scientific community. 336 | \item \textbf{Resource allocation.} \marginnote{\texttt{NOTE:} 337 | resources, links, and discussions related to grants and other 338 | funding opportunities may be found in the \#grants Slack channel. 339 | All senior lab personel (and any interested junior personel) should join this channel to participate in 340 | discussions pertaining to lab resources.} Our lab resources (e.g.\ 341 | equipment, time, money, attention) are finite. We want to foster an 342 | environment where lab resources are used as efficiently as possible 343 | to achieve our collective goals. We also want to foster 344 | sustainable use of resources by regularly pursuing research funding opportunities. 345 | \item \textbf{Adaptability.} The whole point of \textit{research} is that we 346 | don't already know the answers to the questions we're exploring or 347 | how to create the tools we're working on. That means that we won't 348 | necessarily be able to plan out everything in advance. We often need to 349 | be focused and efficient \textit{without knowing the end goal}! 350 | \end{itemize} 351 | Your job as a contributing lab member is to help us to achieve our 352 | collective peak efficiency (as a lab) while also maximizing your own 353 | training and career potential. To do this, the Contextual Dynamics 354 | Lab practices \textbf{agile research}, as described in the next section. 355 | 356 | \newthought{Doing agile research} 357 | 358 | \noindent The agile approach to research we use in the Contextual 359 | Dynamics Lab is inspired by the 360 | \href{http://scrumtrainingseries.com/}{Agile Movement} in the software 361 | development world. The idea is to create learning, adaptable teams to 362 | work on very small bite-sized tasks. Specifically, project teams are 363 | designed to respond to unpredictability in research through 364 | incremental, iterative work ``sprints.'' Each sprint lasts 365 | approximately 1--2 weeks, and results in a demonstrable research 366 | product (e.g.\ a draft of a paper, a draft of a grant, a completed 367 | analysis or figure, a poster, a software tool, etc.). 368 | 369 | This is different from traditional approaches that you may have 370 | encountered in other labs or work environments, where a research team 371 | might try to plan out every part of a project in advance in a series 372 | of small steps. We still try to break projects into tiny bite-sized 373 | chunks, but the key insight of the agile approach is that we only need 374 | to know what the \textit{next} chunk is, rather than attempting to 375 | forecast out over an extended timeline. Although it's often helpful 376 | to have a general (if vague) sense of where things are going, we never 377 | actually need to know where a project will ultimately end up. The 378 | goals and process are constantly evolving. Perhaps the best 379 | justification for this approach is that \textbf{the first day of a new 380 | research project is when you're the most clueless about what you'll 381 | find}. So how could that possibly be the ideal time to plan out the 382 | entire project?\marginnote{\texttt{NOTE:} Our adapted approach also 383 | draws inspiration from 384 | \href{http://technocalifornia.blogspot.com/2008/06/agile-research.html}{this 385 | blog}.} 386 | 387 | Our \href{http://agilemanifesto.org/}{agile research manifesto} has three key 388 | tenets: 389 | \begin{enumerate} 390 | \item Value \textbf{individuals and interactions} over 391 | \textit{processes and tools}. To be clear, processes and tools are 392 | important. But we must always keep the user or consumer in mind. 393 | In practice, this means that a simpler (but potentially less 394 | comprehensive) tool or approach may be preferable in that it could 395 | be easier for a reader or user to make sense of. 396 | \item Value \textbf{working, intuitive tools and research products} 397 | over \textit{comprehensive documentation}. Documentation is 398 | important! But if our research products are designed in an 399 | intuitive way, they can (in some sense) serve as their own 400 | documentation. An intuitive tool or research product with decent 401 | documentation is always preferable to an unintuitive tool or 402 | research product with comprehensive documentation. 403 | \item Value \textbf{responding to change} over \textit{following a 404 | plan}. Each new step of the research process brings new insights 405 | and potentially uncovers mistakes or inefficiencies. Those 406 | discoveries may imply that a new direction is better than a 407 | previously planned one. These are opportunities that should be 408 | leveraged and embraced as part of the scientific process. 409 | \end{enumerate} 410 | While there is value to the \textit{italicized} items, we value the 411 | \textbf{bolded} items more. There are 412 | \href{http://www.agilemanifesto.org/principles.html}{twelve 413 | principles} we use to achieve these tenets: 414 | \begin{enumerate} 415 | \item Our highest priority is to benefit the research community 416 | through the early and continuous delivery of scientific outputs 417 | (ideas, presentations, papers, tutorials, tools, devices, etc.). 418 | 419 | \item We welcome changing goals and requirements, even late in the 420 | process. Doing awesome science means keeping an open mind. Your 421 | original goals and plans may no longer apply as your project 422 | progresses. Your original hypotheses may be proven false. Your 423 | assumptions may be incompatible with your data. Learn from these 424 | challenges and grow with them. Avoid getting ``stuck'' by refusing 425 | to change, and allow your questions to follow where your data lead, 426 | rather than be constrained by your initial ideas. 427 | 428 | \item We deliver research products frequently, in intervals ranging 429 | from a couple of weeks to a couple of months, with a preference for 430 | shorter timescales. Before you have a concrete manifestation of 431 | your work (a figure, a statistic, a presentation, a paper draft, a 432 | dataset, a GitHub commit, etc.) you have nothing you can show the 433 | world for your efforts. Produce research products, even if they're 434 | small and seemingly insignificant, as often as possible. You can 435 | always improve on an already produced research product. 436 | 437 | \item The product itself (software, paper, poster, presentation, 438 | grant) is the primary measure of progress. Before you've 439 | incorporated your latest efforts into a shareable or communicable 440 | research product, it (effectively) doesn't exist. 441 | 442 | \item Continuous attention to technical excellence and good design 443 | enhances agility. Getting research products out regularly requires 444 | avoiding the temptation of aiming for perfection. Nevertheless, 445 | there are often several almost-as-efficient ways to accomplishing 446 | tasks that vary in their design quality. For example, consider 447 | whether the solution to a problem you're working on might also apply 448 | to other similar problems in the lab (that you or others are working 449 | on or have discussed). Can you make your solution general enough to 450 | cover those cases? Or, after completing a draft of a research 451 | product, you will likely have some insights into alternative 452 | (potentially better) approaches. Can you tweak the product to 453 | leverage those insights? 454 | 455 | \item Simplicity---the art of maximizing the amount of work not 456 | done---is essential. Keep in mind the scope of your task. What's 457 | the minimum viable set of accomplishments that will allow you to 458 | complete that task? Get those done first and ``release'' your 459 | product (e.g.\ commit to GitHub, share via Slack, etc.). You can 460 | always define a new set of goals for your next task centered around 461 | extending your just-released research product. This will help to 462 | avoid aimless drift, whereby you spend large amounts of time on 463 | tasks that are, in retrospect, tangential to the main scope of work. 464 | 465 | \item Aim to get some amount of work done \textit{every single day} on 466 | your project. Commit your changes to GitHub, or document your 467 | progress in Slack or a Google Doc. Maintain careful records and 468 | logs so that someone can pick up your work in the future (and that 469 | future someone might be you!). Remember that your greatest 470 | collaborator is your past self, but they don't respond to emails or 471 | Slack messages! Help ``future you'' maintain peak efficiency 472 | through methodical and well-documented work. (Note: don't spend 473 | \textit{too} much time on documentation; e.g. GitHub commits are 474 | themselves often sufficient for documentation, since one can always 475 | compare different versions of a particular file.) 476 | 477 | \item Build projects around motivated individuals. Give them the 478 | environment and support they need, and trust them to get the job 479 | done. Each day, ask yourself: ``am I motivated to do my best work 480 | on my project today?'' If the answer is ``no,'' try to understand 481 | why. Is it lack of resources? Lack of support? Distractions? 482 | Ambiguous goals or research directions? Talk to your fellow lab 483 | members and see how they'd approach the challenges you're facing. 484 | 485 | \item The best architectures, requirements, and designs emerge from 486 | self-organizing teams. Have you been chatting with a fellow lab 487 | member and you're excited about what they're working on? Or do you 488 | have ideas for building on that work? Or has a new potential team 489 | project emerged from a spontaneous conversation? Think about how 490 | you can leverage these opportunities into research products that 491 | you're excited to work on! 492 | 493 | \item The most effective and efficient method of conveying information within a 494 | research team is face-to-face conversation. We use the \hyperref[sec: 495 | scheduling]{CDL Google calendar} to coordinate formal meetings between lab 496 | members. You can also sign up for meetings with \director~via~\meeting. We also 497 | use Slack to coordinate, share notes/data, etc. But the \textit{ideal} form of 498 | communication in the lab is face-to-face (or over Zoom), and it often involves 499 | a whiteboard. 500 | 501 | \item Agile research is sustainable research. Researchers should be 502 | able to maintain a constant pace indefinitely. To be sure, we 503 | sometimes have crunch times where we absolutely must meet a deadline 504 | (e.g.\ a grant submission, project milestone, etc.). However, it is 505 | far more efficient to make steady progress over an extended 506 | timeframe than to fluctuate between periods of high and low 507 | productivity. By distributing your workload you'll help yourself 508 | avoid burnout, preserve your mental and physical health, and allow 509 | yourself time to ``step back'' and think about the big picture 510 | (effectively getting stuff done between your work sessions!). 511 | Sustainable work habits also promote good communication and 512 | coordination between project team members. 513 | 514 | \item At regular intervals, the team reflects on how to become more effective, 515 | then tunes and adjusts its behavior accordingly. At minimum, all active lab 516 | members need to reflect on their projects once each week in your \textit{Weekly 517 | Snippet} (defined below). You should also schedule regular meetings with your 518 | project team and/or~\director~(via~\meeting) to discuss progress, goals, 519 | roadblocks, and project logistics. 520 | 521 | \end{enumerate} 522 | 523 | \newthought{Papers} 524 | 525 | \noindent Research papers are the primary research output of our lab. 526 | Publications are the ``currency of academia,'' in that they are 527 | central to career advancement. With each allocation of lab resources 528 | (equipment, money, time) we should be asking ourselves how this 529 | contributes to a paper. 530 | 531 | \subsection{General procedure} 532 | All lab papers should be coordinated with \director. A paper starts 533 | with a discussion of: 534 | \begin{enumerate} 535 | \item What the paper is going to be about 536 | \item What the key results are 537 | \item What the overall ``story'' is 538 | \item The current status of various components of the project 539 | (e.g.\ data collection, analyses, figures, interpretation, 540 | literature review, etc.) 541 | \item Who the potential candidates for authorship on the paper are 542 | \end{enumerate} 543 | 544 | We draft papers in \LaTeX, either on GitHub or on 545 | \href{https://www.overleaf.com/}{Overleaf} (an online platform that 546 | supports text editing and compiling PDFs in the browser). Progress 547 | should be shared regularly via Slack. 548 | 549 | \subsection{Authorship guidelines} 550 | \marginnote{\texttt{TASK:} Review the 551 | \href{https://oir.nih.gov/sites/default/files/uploads/sourcebook/documents/ethical_conduct/guidelines-authorship_contributions.pdf}{NIH 552 | Guidelines for Authorship}.} The Contextual Dynamics Lab follows 553 | the 554 | \href{https://oir.nih.gov/sites/default/files/uploads/sourcebook/documents/ethical_conduct/guidelines-authorship_contributions.pdf}{NIH 555 | Guidelines for Authorship} in considering whether your contribution 556 | to a project merits authorship on the paper. If you have made a 557 | non-trivial contribution to a project but did not meet the 558 | requirements for authorship, you will instead receive a citation in 559 | the acknowledgements section of the paper. In general, you likely 560 | meet the requirements for authorship if you contributed in any of the 561 | following ways: 562 | \begin{enumerate} 563 | \item Drafted the manuscript (this warrants first authorship) 564 | \item Came up with the idea or made other substantial intellectual 565 | contributions that meaningfully shaped the trajectory of the project 566 | \item Carried out an original experimental study (e.g.\ that you 567 | designed or implemented) 568 | \item Carried out non-trivial data analyses (e.g.\ more complicated 569 | than $t$-tests) 570 | \item Contributed novel tools or resources to the project that haven't 571 | been published yet 572 | \end{enumerate} 573 | 574 | \marginnote{\texttt{NOTE:} Conference posters and abstracts generally 575 | have substantially less stringent authorship requirements than 576 | formal papers. The general rule of thumb for posters is that all 577 | project team members should be co-authors.} You are unlikely to 578 | meet the requirements for authorship if your contributions were 579 | limited to the following: 580 | \begin{enumerate} 581 | \item Running experimental participants for an already-designed and 582 | coded-up study 583 | \item Running trivial data analyses (e.g.\ $t$-tests or similar) 584 | \item Getting trained by one of the other project members on a 585 | project-related task 586 | \item Training another project member on a project-related task 587 | \item Sharing already-published tools or resources 588 | \item Editing or commenting on a draft of the manuscript 589 | \end{enumerate} 590 | 591 | The final determination for who will be an author on each lab paper 592 | (and in what order) will be made by \director, following open 593 | discussions with project team members. 594 | 595 | \newthought{Making mistakes} 596 | 597 | \noindent The work we do is complicated, and mistakes happen. When 598 | you notice a mistake (a bug, misinterpretation, mislabeling, or any 599 | other error), it is critical that you report the mistake immediately. 600 | Whereas mistakes are unavoidable in science, negative impacts can be 601 | minimized by fostering a workplace where reporting mistakes is 602 | celebrated and accepted as part of the natural course of getting 603 | things done. Mistakes are opportunities to learn and grow, and 604 | identifying or noticing mistakes should be celebrated as part of our 605 | growth as scientists. However, real harm can come from failing to 606 | report mistakes soon enough. There is a proverb that says ``the best 607 | time to plant a tree was 20 years ago; the second best time is now.'' 608 | Analogously, the best time to identify and correct a mistake may have 609 | been in the past-- but the second best time is right now! 610 | 611 | Example scenarios (not an exhaustive list): 612 | \begin{enumerate} 613 | \item You've shared a figure, statistic, or other result, and 614 | you've realized there's a bug in your code. 615 | \item You tried to collect some data and the experiment crashed or 616 | yielded corrupted data. 617 | \item You're re-reading a paper that you shared, and you notice a 618 | mistake or typo. 619 | \item You made a plan with your project team and you realized it's 620 | flawed in some way, or that there's potentially a better solution 621 | or approach. 622 | \item You released a software package and you've found a bug or error. 623 | \end{enumerate} 624 | 625 | Appropriate actions for each of the above scenarios (this should 626 | happen immediately after you notice the mistake): 627 | \begin{enumerate} 628 | \item Double check, to the best of your ability, that the mistake is 629 | real. This may involve checking over code, rebooting a computer and 630 | restarting an experiment, re-reading reference text, etc. 631 | \item Create a GitHub issue describing the problem. Provide 632 | information about how to reproduce the problem (if applicable), the 633 | expected behavior, and the observed behavior. Also, provide any 634 | relevant system or environment information that may be necessary for 635 | reproducing the problem (e.g. details of the computing environment). 636 | \item Coordinate over Slack with your project team to formulate an 637 | action plan. 638 | \item Ask other lab members for help if the course of action isn't 639 | clear. Also, try Google and/or Stack Exchange. 640 | \end{enumerate} 641 | 642 | \noindent \textit{If you think you might have caught a mistake but aren't 643 | sure, consult with another lab member! It never hurts to be safe!} 644 | 645 | 646 | 647 | \newthought{Project roles} 648 | 649 | \noindent Every project has four possible roles. You will play one or more of 650 | these roles on your project: 651 | \begin{enumerate} 652 | \item \textbf{Project Owner.} This is the person responsible for 653 | maximizing ``return on investment'' of the project effort. The project owner: 654 | \begin{enumerate} 655 | \item Is responsible for project vision 656 | \item Constantly re-prioritizes the research backlog, adjusting any 657 | long-term expectations such as publication and release plans 658 | \item Acts as the final arbiter of requirements questions 659 | \item Accepts or rejects each project increment 660 | \item Decides whether to publish/ship the project 661 | \item Decides whether to continue development 662 | \item Considers interests of funding bodies (e.g. NIH, NSF, DARPA, 663 | private organizations) and the scientific community 664 | \item May contribute as a team member 665 | \item Has a leadership role 666 | \item Will usually be \director 667 | \end{enumerate} 668 | 669 | \item \textbf{Team Member.} Team members are responsible for carrying 670 | out the project work. Team members: 671 | \begin{enumerate} 672 | \item Are cross-functional: includes members with development skills 673 | (write code or papers/grants), testing skills (e.g.\ data 674 | collection, test software, proofread papers/grants), and/or domain 675 | expertise (e.g.\ knowledge or interest in a relevant research area) 676 | \item Are self-organizing and self-managing without externally assigned 677 | roles 678 | \item Negotiate commitments with the Project Owner, one ``sprint'' at 679 | a time 680 | \item Have autonomy regarding how to reach commitments 681 | \item Are intensely collaborative 682 | \item Are (ideally) located in one team room (usually this will be the lab) 683 | \item Are (ideally) committed to long-term, consistent lab membership 684 | \item Are (ideally) focused on a single team/project at a time 685 | \item Have a leadership role 686 | \end{enumerate} 687 | 688 | \item \textbf{Project Coordinator.} The Project Coordinator facilitates 689 | the agile research process both directly and indirectly. The Project Coordinator: 690 | \begin{enumerate} 691 | \item Helps to resolve impediments \marginnote{\texttt{NOTE:} The lab 692 | coordinator role is currently vacant. The necessary functions of 693 | the Project Coordinator role will need to be satisfied by other 694 | project team members during this time.} 695 | \item Creates an environment conducive to team self-organization 696 | \item Captures empirical data to adjust forecasts (e.g.\ weekly Slack 697 | reports summarizing progress) 698 | \item Shields the team from external interference and distraction to 699 | keep it ``in the zone'' 700 | \item Enforces timelines 701 | \item Has no management authority over the team (anyone with authority 702 | over the team is by definition not its Project 703 | Coordinator) 704 | \item Has a leadership role 705 | \item Will usually be either the Lab Coordinator (note: this position is currently vacant) or \director. %(\href{mailto:contextualdynamics@gmail.com}{\coordinator}) 706 | \end{enumerate} 707 | 708 | \item \textbf{Collaborator.} Collaborators are not formally part of 709 | the project team and generally will not attend regular meetings as 710 | part of the team. Importantly, collaborators do \textit{not} have a leadership role in 711 | the project. They may carry out one or more of the 712 | following roles: 713 | \begin{enumerate} 714 | \item Provide data or share equipment \marginnote{\texttt{NOTE:} A 715 | project may never be held up by a collaborator. If the 716 | collaborator fails to provide a promised service, the project team 717 | must adapt. If the collaborator fails to meet a non-critical 718 | deadline, the project will proceed without that component of the 719 | project. Involvement as a collaborator is fluid.} 720 | \item Provide occasional consulting services 721 | \item Provide occasional feedback on project results 722 | \item Carry out minor analyses 723 | \item Proofread documents 724 | \item Help with administrative tasks such as scheduling 725 | \item Help with information technology tasks such as computer 726 | maintenance 727 | 728 | \end{enumerate} 729 | By definition, collaborators play a minor role in the project, and they are not 730 | responsible for managing any aspect of the project. They may become Team 731 | Members if their involvement increases. Generally, collaborators will 732 | be included in a paper's acknowledgement section, but collaborators 733 | are not normally co-authors. 734 | \end{enumerate} 735 | 736 | 737 | \newthought{Meetings} 738 | 739 | \noindent Our lab has largely been operating in a ``hybrid'' mode of 740 | work (i.e., partially remote and partially in-person), and in recent 741 | years our meeting schedule and requirements have reflected this 742 | reality. Moving forward, we are now gradually starting to incorporate 743 | more in-person interactions and meetings to facilitate more 744 | ``spontaneous'' interactions, discussions, and collaborations. 745 | 746 | Effective lab communication requires forums for communicating. As 747 | described below, we use \href{http://www.slack.com}{Slack} to 748 | facilitate non-in-person communications. We also encourage 749 | in-person interactions as often as possible---ideally several times a 750 | week for group projects. We'll have the following regularly scheduled 751 | meetings: 752 | 753 | \begin{itemize} 754 | \item \textbf{Lab meetings.} Starting in the winter, 2024 term, we will be re-instating weekly lab 755 | meetings, to be held on Tuesdays from 1:30 -- 2:30 PM (Hanover time) 756 | in our main lab space (Moore Hall, Room 416). If you are an active 757 | lab member, you are expected to attend our lab meetings unless you 758 | let \director~know that you have a conflict (e.g., a course that meets 759 | at the same time, another commitment that comes up, etc.). It is 760 | important to prioritize lab meeting attendance so that we can build 761 | and maintain a lab culture of collaboration and ongoing participation. 762 | 763 | You are also expected to \textbf{present} at one lab meeting per 764 | term. Possible presentation topics include (but are not limited to): 765 | \begin{itemize} 766 | \item A half-baked idea you have 767 | \item An interesting paper you read 768 | \item An interesting tool or software package you learned about 769 | \item A tutorial 770 | \item A (brief) hackathon 771 | \item Something you're confused about that you want help with from 772 | other lab members 773 | \item A practice presentation (poster, talk, etc.) you'd like 774 | feedback on 775 | \item Lead a discussion about some topic you think would be of 776 | interest to the group 777 | \end{itemize} 778 | Each presenter can choose their own format (e.g., informal discussion, 779 | slide-based presentation, whiteboard-led discussion, interpretive 780 | song or dance, a creative artwork--- it's up to you!). We recommend 781 | that you start off by setting the ``topic and tone'' for 782 | that day's meeting. For example: 783 | \begin{itemize} 784 | \item Quickly introduce yourself (name and current role in the 785 | lab) 786 | \item Say a sentence about what you're going to be doing with your 787 | time 788 | \item Set any ``ground rules'' you'd like others to follow and 789 | make it clear what your ``goals'' are. For 790 | example, do you want people to jump in with questions or random 791 | thoughts as they arise? Take notes and wait until the end to 792 | ask more in-depth questions? What sorts of feedback would be 793 | most helpful to you? What are you hoping people will take away? 794 | (Not all of these will apply to every type of presentation or 795 | discussion, and there may be other elements you'd like to 796 | consider; just use your best judgement!) 797 | \end{itemize} 798 | 799 | You can take up to an hour for your presentation or discussion, 800 | although taking less than an hour is great too. You can also share 801 | a meeting slot with one or more other lab members if you wish. (A 802 | presentation with another lab member can still ``count'' as a 803 | presentation for the given term.) \director~will send out a Google Sheets 804 | link where you can add yourself to the meeting schedule at the start 805 | of each term. 806 | 807 | 808 | 809 | \item \textbf{Project meetings.} Several of our collaborative 810 | projects involve regular coordination within the lab and/or with external lab members. 811 | These are organized on an ad-hoc basis for each project. 812 | Attendees: all project team members and any other interested active 813 | lab members. 814 | 815 | \item \textbf{Hackathons.} We occasionally organize hackathon 816 | style events whereby spontaneously organized groups work towards 817 | one or more very short term projects or goals. These are 818 | scheduled on an \textit{ad hoc} basis. Attendees: all interested 819 | lab members, any interested member of the Dartmouth community, and 820 | external collaborators. 821 | 822 | \marginnote{\texttt{NOTE:} Department talks and colloquia are 823 | listed on the \hyperref[sec: scheduling]{PBS Department Events} 824 | calendar.} 825 | \item \textbf{Department talks and colloquia.} Each week the 826 | Department of Psychological and Brain Sciences invites internal and 827 | external researchers to present on a wide variety of research 828 | topics. You are encouraged to attend any that seem interesting. 829 | Attendees: all interested lab and non-lab Dartmouth community 830 | members. 831 | 832 | \item \textbf{Weekly snippets.} Each week, all 833 | paid employees must fill out a ``weekly snippet'' 834 | with brief answers to the following questions: 835 | \begin{enumerate} 836 | \item What did you work on over this past week? 837 | \item What are you planning to work on this coming week? 838 | \item What is impeding your progress (if anything)? 839 | \item Anything else you'd like to add? 840 | \end{enumerate} 841 | 842 | Reminders to fill out your weekly snippet are automatically sent out (via 843 | Slack) each Monday at 9 AM. Whereas weekly snippets are required for all paid 844 | employees, they are optional for all other lab members. If you are an unpaid 845 | employee but are likely to request a letter of recommendation, weekly snippets 846 | are a good way for me to maintain a detailed sense of what you are working on 847 | from week to week and how you are progressing over time. I'll also refer to 848 | your snippets during check-in meetings (e.g., to discuss project progress and 849 | contributions, letters of recommendation, annual reviews or other evaluations, 850 | etc.) You should submit your snippet using the ``Fill out your snippet!'' 851 | workflow on Slack. You can access this workflow in the \texttt{\#general} 852 | channel through the Workflows menu (usually near the top left of the window). 853 | (Virtual) attendees: all paid lab members and any other lab members who want to 854 | participate. 855 | \end{itemize} 856 | 857 | %\newpage 858 | \newthought{Getting started in the lab} 859 | 860 | \noindent 861 | The very first thing you need to do is to get set up on the following 862 | platforms, which will enable you to interact with the rest of the lab, 863 | download and use the lab's software packages, and accomplish various 864 | necessary administrative tasks: \marginnote{\texttt{TASK:} Create 865 | (free) Google and GitHub accounts. Also initiate a request to join our slack workspace via 866 | \href{https://dartmouth.enterprise.slack.com/workspace/T0W0TEQNA}{this 867 | link}.} 868 | \begin{enumerate} 869 | \item \href{https://context-lab.slack.com}{\textbf{Slack.}} This is where 870 | almost all not-in-person lab communications take place. It provides 871 | an interface for asking questions, storing notes, and sharing 872 | ideas. If you have a~\ourschool~NetID you should be able to join the workspace by clicking the link. 873 | If you do \textit{not} have a NetID, you'll need to \href{https://services.dartmouth.edu/TDClient/1806/Portal/Requests/ServiceDet?ID=30581}{request one here}. 874 | \marginnote{\texttt{TASK:} When you join our Slack workspace, initiate our onboarding process using the ``Join the lab!'' workflow. You can access this workflow in the \texttt{\#general} channel 875 | through the Workflows menu (usually near the top left of the window). Once you initiate the workflow, you'll be guided through the onboarding process.} 876 | 877 | \item \href{https://www.github.com}{\textbf{GitHub.}} 878 | \marginnote{\texttt{TASK:} If you've never used GitHub (Git) before, 879 | please work through these \href{https://try.github.io/}{GitHub 880 | Tutorials}. You may also find it useful to refer to this 881 | \href{https://github.com/ContextLab/lab-manual/blob/master/resources/cheatsheets/git-cheatsheet.pdf}{Git 882 | cheat sheet} and this 883 | \href{https://github.com/ContextLab/lab-manual/blob/master/resources/cheatsheets/workflow-of-version-control.pdf}{Git 884 | workflow} sheet when using Git/GitHub at first. We also maintain a \href{https://www.youtube.com/playlist?list=PLjQYT8Fwp984zMjN5rJChfdI5Z8jtaWww}{set of GitHub tutorials on YouTube}.} This is used 885 | to manage all code, papers, grants, presentations, and posters. In 886 | other words, anything where it'd be useful to track multiple 887 | versions, anything that we might ultimately want to release to the 888 | public, and/or anything that multiple lab members will be 889 | collaborating on. Each project has one or more GitHub repositories. You should treat GitHub as a digital version of a ``lab notebook'' 890 | that contains a formal record of every contribution you make to your projects. We use GitHub logs to assign credit for ideas, code or writing contributions, 891 | determine authorship order, and more. It is therefore critical that you regularly check in (commit) your work via GitHub so that you receive appropriate credit for your 892 | ideas and maintain a continuous traceable log for your project. 893 | \item \href{https://1password.com/}{\textbf{1Password.}} 894 | \marginnote{\texttt{TASK:} If you are a senior lab member, request a 895 | 1Password invite from \director.} This platform is used by senior 896 | lab members to manage secure notes and passwords (e.g.\ shared 897 | software licenses, card numbers and chart strings, etc.). 898 | 899 | \end{enumerate} 900 | 901 | Once you've created those accounts, you can ask any questions through 902 | Slack (use the 903 | \href{https://context-lab.slack.com/messages/general/}{\#general} 904 | channel or the channel specific your project). Depending on your role 905 | in the lab, you may be added on Slack as a single-channel guest 906 | (access to only one channel) or a full member (access to all lab 907 | channels). This generally depends on how long you've been in the lab 908 | and/or how many projects you are expecting to interface with. If you 909 | feel you don't have the appropriate account type, please communicate 910 | your concerns to \director. 911 | 912 | \newthought{CITI training} 913 | 914 | \noindent Our lab's work seeks to answer questions about human memory. 915 | As such, our research frequently involves interacting with (and 916 | analyzing data collected from) human subjects. It is essential to 917 | understand how to ethically and responsibly maintain the safety, 918 | comfort and privacy of participants when conducting research with 919 | human subjects. Before beginning work on any lab projects, you'll need 920 | to complete an online tutorial through the 921 | \href{https://about.citiprogram.org} {Collaborative Institutional 922 | Training Initiative (CITI) Program}. 923 | 924 | \noindent All lab members are required to complete CITI's 925 | \textbf{Group 2: Social/Behavioral Basic Course} module. To complete 926 | the module, you will need to: 927 | \begin{enumerate} 928 | \marginnote{\texttt{NOTE:} If you have previously conducted research 929 | through a class or another lab, you may already have completed the 930 | \textbf{Group 2: Social/Behavioral Basic Course} module. If your 931 | certificate is valid (i.e., it is less than 3 years old), you may 932 | send it to \coordinator~without completing the module again.} 933 | \item Create an account on \href{https://about.citiprogram.org}{CITI's 934 | website}. If you are a Dartmouth student or employee, choose 935 | Dartmouth College as your organization affiliation and use your 936 | \textit{@Dartmouth.edu} email address to create your account. 937 | Dartmouth will cover your registration fee. 938 | \item Continue the registration process until you reach step 7. Select 939 | Human Subjects Research. Then select \textbf{Group 2: 940 | Social/Behavioral Basic Course} as your registration course. If 941 | you also need to complete the biomedical module, you will be able to 942 | add it after completing the social/behavioral module. 943 | \item There are 16 required modules that need to be 944 | completed. Read/watch the material and complete the quiz at the 945 | end of each module. You will need to achieve a score of at least an 946 | 80\% to pass. Quizzes may be reviewed and retaken. 947 | \end{enumerate} 948 | \marginnote{\texttt{NOTE:} If you will be working on a project where 949 | data is collected from DHMC patients, you may need to complete the 950 | \textbf{Group 1: Biomedical Basic Course} module \textit{in 951 | addition} to the social/behavioral module. If you will be working 952 | on a NSF-funded project, you may also need to complete the 953 | \textbf{Responsible Conduct of Research (RCR)} module.} 954 | 955 | \noindent Once you have finished the training module, send your 956 | \textbf{Completion Certificate} to \coordinator. To access your 957 | certificate: 958 | \begin{enumerate} 959 | \item Sign into your CITI account and select \textbf{Records} at the 960 | top of your home page. 961 | \item Select \textbf{View-Print-Share} under \textbf{Completion 962 | Record}. 963 | \item Under \textbf{Completion Certificate}, select \textbf{View / 964 | Print}. You do not need to share your Completion Report. 965 | \item Download the PDF and send it to 966 | \href{mailto:contextualdynamics@gmail.com} 967 | {contextualdynamics@gmail.com}. 968 | \end{enumerate} 969 | 970 | \newthought{Miscellaneous administrata} 971 | 972 | \noindent You can pick up a lab key from Michelle Powers (Moore Hall 973 | administrative office) by 974 | \href{mailto:Michelle.A.Powers@dartmouth.edu}{emailing her} and cc'ing 975 | \director. You will need to pay a \$5 deposit, which will be returned 976 | to you when you return your key at the end of your tenure in the lab. 977 | If you are the last one in the lab for the day, please be sure to lock 978 | the door when you leave. 979 | 980 | \newthought{Starting a new project} 981 | 982 | \noindent 983 | Our lab uses a number of project management tools and policies to 984 | promote continuity across projects and lab members. First, make sure 985 | that your project doesn't already exist (generally this involves 986 | asking \director). 987 | 988 | 989 | The general steps to starting a project are: 990 | \begin{enumerate} 991 | 992 | \item Create a Slack channel or decide on existing channel appropriate 993 | for project use. \marginnote{\texttt{NOTE:} If you create a new 994 | Slack channel for your project, invite \director~and other team 995 | members to join.} 996 | \item Coordinate with \director~to set up a 997 | \href{https://get.slack.help/hc/en-us/articles/232289568-GitHub-for-Slack}{GitHub 998 | for Slack} integration between your project and channel by sending 999 | a link to the GitHub repo in the project's Slack channel with a note 1000 | asking to set up a Slack integration. 1001 | \item If your project involves testing human participants, verify with 1002 | \director~that your project is covered under an existing active IRB 1003 | protocol, and that you are listed on the protocol. 1004 | \hyperref[ch:irb]{(A list of active IRB protocols appears at the end 1005 | of this lab manual.)} Depending on the protocol, you may need to 1006 | complete one or more online training courses to become certified to 1007 | run your experiment. If no existing protocol is appropriate for 1008 | your study, discuss with \director~whether it would be more 1009 | appropriate to create a new protocol or submit an amendment for an 1010 | existing protocol. 1011 | \item Create an initial set of short-term action items for kicking off 1012 | your project and post them to your project's Slack channel. 1013 | \end{enumerate} 1014 | 1015 | 1016 | %\newpage 1017 | \newthought{Joining a project} 1018 | 1019 | \noindent To join a project, simply subscribe to the project's Slack 1020 | channel and GitHub repository. All project communications should 1021 | either be summarized on Slack or occur through Slack, whenever 1022 | possible. This keeps notes searchable and visible to all team members 1023 | (except direct messages, which are useful for non-project-related 1024 | private communications between one or more team members). 1025 | 1026 | Note that, as a general rule, \textbf{you should focus the majority of your 1027 | efforts on one project at a time}. This doesn't mean you need to do 1028 | the same thing every day (each project has many components and, as 1029 | described above, the focus of lab projects will change over time), but 1030 | it gives some sense of how you should be allocating your work time. 1031 | 1032 | If you are a part-time employee of the lab, prior experience has shown 1033 | that you will most likely be able to make a meaningful contribution to 1034 | only a single project at a time. If you are a full-time employee, you 1035 | may choose to devote some of your time to a secondary project (with 1036 | the understanding that you will always prioritize your primary 1037 | project). If you want to change which project is your primary 1038 | project, or if you want to divide your time across multiple projects, 1039 | you should coordinate this with \director~and your team members. 1040 | 1041 | 1042 | \newthought{Scheduling} 1043 | \label{sec: scheduling} 1044 | 1045 | \noindent Our lab's scheduling practices and 1046 | policies are intended to facilitate lab member interactions between 1047 | ourselves, our collaborators, and our experimental participants. 1048 | There are three basic tools the lab uses to organize and schedule 1049 | events: 1050 | \begin{itemize} 1051 | \item \href{http://calendar.google.com}{Google Calendar}: 1052 | \begin{itemize} 1053 | \item We use the 1054 | \href{https://calendar.google.com/calendar/embed?src=5ta50cfv4uih0a0k8m2di9dhjo%40group.calendar.google.com&ctz=America%2FNew_York}{main 1055 | lab calendar} (``Contextual Dynamics Lab'') to keep track of lab-wide events including lab 1056 | meetings, conferences, and activities. Note: write access is 1057 | granted only to senior lab members-- i.e., lab staff and graduate students. 1058 | \item We use the 1059 | \href{https://calendar.google.com/calendar/embed?src=dgcv8l8a8s10hfg2s5h0qec0q0%40group.calendar.google.com&ctz=America%2FNew_York}{CDL 1060 | resources calendar} to coordinate the use of shared rooms and 1061 | equipment, such as testing rooms, our EEG systems, eye-tracker, 1062 | hospital equipment, software licenses, etc. Request write access 1063 | if you may require use of lab equipment. 1064 | \item We use the 1065 | \href{https://calendar.google.com/calendar/embed?src=h1j06dohcg7v1g2o5tkb7ijhvs%40group.calendar.google.com&ctz=America%2FNew_York}{out-of-lab 1066 | calendar} to keep track of known absences (e.g. illness, travel, 1067 | holidays, etc.). All 1068 | full-time lab members should request write access. 1069 | \item We use the \href{https://calendar.google.com/calendar/embed?src=j6noo2tqahpsoq9na1h16paf3s%40group.calendar.google.com&ctz=America%2FNew_York}{DHMC meetings 1070 | calendar} to keep track of important events and meetings at DHMC. 1071 | \item We use the \href{https://calendar.google.com/calendar/embed?src=c_31ckainhaqlmhk4hkc633fs9ho%40group.calendar.google.com&ctz=America%2FNew_York}{PBS department events calendar} to keep track of talks and events happening in the department. 1072 | \item You may also choose to create project-specific Google 1073 | Calendars, inviting project team members. 1074 | \item When you add an event (in any lab calendar), it is important 1075 | to include the following information as a comment (this does not 1076 | apply to ``out-of-lab'' events): 1077 | \begin{itemize} 1078 | \item Key contact names and contact information (email or phone) 1079 | \item Physical address (where the event will take place) 1080 | \item A brief description of the event and/or other relevant 1081 | information 1082 | \item Attach any relevant documents via Google Docs 1083 | \end{itemize} 1084 | \end{itemize} 1085 | \item \href{http://www.doodle.com}{Doodle}, 1086 | \href{http://www.when2meet.com}{When2Meet}, and 1087 | \meeting. We use 1088 | Doodle and When2Meet to converge on mutually good meeting times that 1089 | fit (as well as possible) with everyone's busy schedules. Doodle is 1090 | most useful for selecting a date from a large number of options, and 1091 | When2Meet is most useful for selecting a specific time on a 1092 | relatively small number of dates. \meeting~is used to sign up 1093 | for meeting slots with \director. You can book a meeting in a free 1094 | slot through YouCanBook.Me at any time if you would like to meet 1095 | with \director. Most meetings with \director~happen on Thursdays. 1096 | \end{itemize} 1097 | 1098 | \newthought{Attendance policy} 1099 | 1100 | \noindent In general, we expect full time employees to be in the lab 1101 | during ``standard'' working hours---roughly between 9 AM and 5 PM. 1102 | The precise range of hours you work is less important to us than 1103 | putting in an effort to help form a cohesive lab culture where lab 1104 | members can interact in person to share ideas, leverage expertise, 1105 | solve problems, etc. Therefore, even if you end up deciding to shift 1106 | your hours, we'd like you to make a strong effort to be physically 1107 | present in the lab between 1 and 4 PM (prior arrangements 1108 | notwithstanding; e.g. if you have a long commute and we've agreed 1109 | that you won't come in every day, or if you need to occasionally 1110 | schedule an appointment during the 1--4 PM window). Similarly, if 1111 | you are a part time employee, we'd like you to try to put in your 1112 | in-the-lab hours during the 1--4 PM time window as often as possible. 1113 | (This is in addition to weekly lab meetings.) 1114 | 1115 | The lab also abides by Dartmouth's standard paid time off policies 1116 | for benefits-eligible (full-time, non-student) employees. If you are 1117 | a salaried employee, you can find the official policy 1118 | \href{http://www.dartmouth.edu/~hrs/pdfs/paid_time_off_salaried.pdf}{here}, 1119 | and if you are an hourly employee, you can find the official policy 1120 | \href{http://www.dartmouth.edu/~hrs/pdfs/Paid_Time_Off_Hourly.pdf}{here}. 1121 | If you are a student employee, you are generally ineligible for paid 1122 | time off (you can take time off, but you won't normally be paid for 1123 | it). 1124 | 1125 | If you know that you'll be unable to meet any of these general 1126 | attendance guidelines, please coordinate with \director~to make 1127 | appropriate arrangements. \textbf{With the above in mind, we abide 1128 | by a ``common sense'' attendance policy that relies on an honor 1129 | system.}\marginnote{\texttt{TASK:} If you are a (paid) hourly 1130 | employee, you'll need to track your hours using the Kronos system. 1131 | \coordinator~can help get you set up with that system.} If you 1132 | cannot attend a lab event or meeting, your privacy will be respected: 1133 | you do not (generally speaking) need to provide a reason for your 1134 | absence (although you are honor bound not to abuse this system!) but 1135 | you are expected to responsibly manage your schedule so that you get 1136 | your work done and minimize inconvenience to others to the extent 1137 | possible. The one exception is that if you seem to be abusing this 1138 | system (e.g.\ as determined by your project owner, project 1139 | coordinator, or fellow team members), you may be asked to provide 1140 | additional information (in a way that does not invade your 1141 | privacy---and if you are worried that this policy is overly 1142 | intrusive, please bring your concerns to \director). Here's the 1143 | official lab attendance policy: 1144 | \begin{itemize} 1145 | \item It is your responsibility to provide notice, well in advance, to 1146 | anyone your absence will affect (e.g. \director, people you're 1147 | scheduled to meet with, etc.). The best way to do this is via email 1148 | or Slack, along with adding your absence to the 1149 | \hyperref[sec: scheduling]{out-of-lab calendar}. 1150 | \begin{itemize} 1151 | \item You are responsible for accounting for your planned absences 1152 | when we discuss project schedules and goals. If you agree to take 1153 | on work or to meet a deadline, you're responsible for it until you 1154 | make alternative plans with your team! 1155 | \item Prolonged (more than 1 day, excluding weekends and 1156 | lab-related absences) planned 1157 | absences should be scheduled at least 1 week in advance, and ideally 1158 | 2 weeks in advance. 1159 | \item Brief (one day) absences (excluding weekends, and lab-related 1160 | absences) should be scheduled as far in advance as possible, but at 1161 | least at the beginning of the week, emergencies notwithstanding. 1162 | \end{itemize} 1163 | 1164 | \item If you are feeling sick, \textit{do not come into the lab}. We 1165 | can arrange virtual meetings (if you are feeling well enough) or 1166 | re-schedule as needed. Your recovery, and the health and safety of 1167 | the lab, are the top priorities. 1168 | 1169 | \item If you need to be out of the lab for an unexpected 1170 | non-illness-related emergency, simply give as much notice and 1171 | information as possible. 1172 | 1173 | \item You are expected to attend all lab-related meetings and other regularly 1174 | scheduled meetings that are directly relevant to your work in the 1175 | lab (assuming you are feeling well and have not made prior arrangements to the contrary). 1176 | 1177 | \item If you are scheduled to present at a conference (i.e., you 1178 | submit an abstract and it is accepted as a talk or poster), you are 1179 | expected to attend the conference to present your work. In the 1180 | extremely rare event that an emergency situation arises that would 1181 | prevent you from presenting as scheduled, you are expected to make 1182 | alternative arrangements (e.g., by arranging for a co-author to 1183 | present in your place). 1184 | 1185 | \item You are encouraged (but never required) to attend 1186 | relevant journal clubs, PBS talks, DHMC meetings and talks, thesis 1187 | defenses, and other relevant lab and/or Dartmouth-affiliated events. 1188 | If you are overwhelmed with other work, have a conflicting meeting, 1189 | are running an experimental participant, or are out of the lab for 1190 | other reasons, you do not need to provide a reason for your absence 1191 | (unless you're presenting or are otherwise playing a key role). 1192 | \end{itemize} 1193 | 1194 | \newthought{Compensation and benefits} 1195 | 1196 | \noindent 1197 | If you are a non-student full-time on-campus employee, it's likely 1198 | that you're eligible for Dartmouth benefits, such as medical 1199 | insurance, dental insurance, life insurance, etc. You can read more 1200 | about the comprehensive benefits package 1201 | \href{http://www.dartmouth.edu/~hrs/benefits/}{here}. 1202 | 1203 | Dartmouth also sponsors various health-benefits programs (for all members of 1204 | the Dartmouth community). For example, you are likely eligible to get a free 1205 | (or subsidized) fitness tracker, fitness equipment, race fees, gym membership, 1206 | etc. You can also earn cash (up to \$400/year) for meeting your fitness goals. 1207 | Go \href{http://join.virginpulse.com/dartmouth/}{here} to learn more or sign up 1208 | for this program. 1209 | 1210 | If you are an undergraduate student employee, you may be paid or unpaid (i.e., volunteer). 1211 | \ourschool~offers several options for funding your work. The most commonly used 1212 | funding mechanisms are through the 1213 | \href{https://students.dartmouth.edu/ugar/}{Undergraduate Advising \& Research 1214 | (UGAR)} program. The program provides funding for undergraduate researchers to 1215 | carry out part-time research while enrolled in courses at~\ourschool, or to 1216 | carry out full-time research during off-terms (while not taking courses). The 1217 | \href{https://neukom.dartmouth.edu/}{Neukom Institute} also provides several 1218 | funding opportunities for part-time and full-time research. If you wish to 1219 | apply for funding through any of these programs (or through other programs), 1220 | please coordinate your application with~\director. It is your responsibility to 1221 | stay on top of application deadlines, program requirements, and so on. 1222 | 1223 | If you are a Master's student employee, you are likely to work in the lab for 1224 | course credit as part of your training program. This work is generally unpaid. 1225 | 1226 | If you are a doctoral student, you will likely receive an annual stipend and 1227 | tuition waiver that is intended to compensate you (in part) for your work in 1228 | the lab. If this applies to you, you should receive information about your 1229 | compensation and benefits when you enter our PhD program. Although doctoral 1230 | students' stipends are normally guaranteed for five years, all students are 1231 | expected monitor the \texttt{\#grants} channel on Slack and/or seek out other 1232 | funding opportunities independently. 1233 | 1234 | In general: we value all lab members' efforts and contributions, and you should 1235 | expect to be compensated for your work. Your compensation may take the form of 1236 | course credit, wages, benefits, use of resources, mentorship, etc. By the same 1237 | token, you should be proactive about seeking out opportunities for compensation 1238 | (financial, academic, or otherwise)-- we are a small lab with limited 1239 | resources, and as a member of the team you are expected to help out by doing 1240 | your part to secure funding to cover your expenses. If you have comments, 1241 | questions, or concerns about your compensation, please discuss them with 1242 | \director. 1243 | 1244 | \newthought{Interpersonal issues} 1245 | \noindent 1246 | If you are experiencing an interpersonal issue with another lab member 1247 | or community member and are having trouble resolving it on your own 1248 | (or feel unsafe resolving it on your own), please seek out assistance 1249 | from \director, your Project Owner, your Project Coordinator, or one 1250 | of the Dartmouth community resources described below as early as 1251 | possible. 1252 | 1253 | All lab members, regardless of position or status, are protected by 1254 | (and must abide by) Dartmouth's human resources policies. This means 1255 | behaving professionally and respectfully towards others (including, 1256 | but not limited to, your fellow lab members). On (hopefully) rare 1257 | occasions, despite your best efforts, you may find yourself in an 1258 | interpersonal situation that you feel unable to resolve on your own. 1259 | You have many resources at your disposal to help get you back on 1260 | track. 1261 | 1262 | The \href{http://www.dartmouth.edu/~hrs/}{Office of Human Resources} provides 1263 | assistance and resources to all faculty, staff, retirees, and prospective 1264 | employees. The \href{http://www.dartmouth.edu/~seo/}{Student Employment Office} 1265 | provides a similar suite of services to student employees. The 1266 | \href{http://www.dartmouth.edu/~ombuds/}{Dartmouth Ombuds Office} also provides 1267 | confidential and informal assistance in resolving concerns related to 1268 | interpersonal issues. Please also see the section on 1269 | \hyperref[sec:interpersonal]{resources for resolving interpersonal issues}. 1270 | \ourschool's 1271 | \href{https://sexual-respect.dartmouth.edu/compliance/title-ix/about-title-ix}{Title 1272 | IX Office} provides resources pertaining to issues related to sex or 1273 | gender-based discrimination. 1274 | 1275 | 1276 | \newthought{Lab resources} 1277 | 1278 | \noindent As with most academic research labs, we (sadly!) must 1279 | conduct our research within a limited research budget. In practice, 1280 | the important thing is to communicate with \director~before you spend 1281 | (or commit to spending) lab funds. 1282 | 1283 | Generally, the lab's financial policy is the following: we will do 1284 | whatever is possible to ensure you have the equipment and resources 1285 | you \textit{need} to do your best work. If you can adequately 1286 | justify an expense and sufficient funds are available, then we will 1287 | spend what it takes to get the job done. If you cannot justify an 1288 | expense, or if the lab does not have sufficient funds, then we will 1289 | need to get creative by figuring out how to get the job done anyway 1290 | on a seemingly too-small budget. Usually we'll find ourselves 1291 | somewhere in the middle of this continuum, which will help us to 1292 | stretch our limited budget as far as possible while not making 1293 | ourselves crazy or losing too much productivity in the process. 1294 | 1295 | Some of our projects are intended to be self-funded and/or to support 1296 | other projects (e.g.\ StockProphet). Any use of project-generated 1297 | funds should be discussed with \director. 1298 | 1299 | \subsection{Computers} 1300 | 1301 | All lab members need a computer to get their work done. We generally 1302 | prefer to use Macs, as this maximizes compatibility across lab 1303 | members. Depending on your expected role in the lab and the 1304 | specifics of your project, the lab may provide a computer to you, or 1305 | you may be expected to use your personal computer to complete your 1306 | work. Any equipment purchased by the lab, including personal 1307 | computers, is the official property of the Contextual Dynamics Lab 1308 | and should be treated as such. All equipment must be returned to the 1309 | lab when your association with the lab is complete. 1310 | 1311 | In addition to personal computers, we also maintain a lab account on 1312 | Dartmouth's \href{http://techdoc.dartmouth.edu/discovery/}{Discovery 1313 | Supercomputing Cluster}. In addition to having access to the 1314 | compute nodes shared amongst the entire Dartmouth community, we have 1315 | purchased several dedicated servers and a powerful head node that is 1316 | shared with the \href{http://www.cosanlab.com/}{COSAN Lab} and the 1317 | \href{http://www.dartmouth.edu/~bil/}{Dartmouth Brain Imaging Lab}. 1318 | When you link your Discovery account with the lab, you will 1319 | automatically have access to those additional computing resources. 1320 | We use Discovery for our most computationally intensive work. 1321 | \href{https://rc.dartmouth.edu/index.php/discovery-overview/accessing-the-cluster}{This 1322 | link} contains instructions for creating an account and 1323 | accessing the Discovery cluster. Our suggested workflow is to do non-intensive 1324 | computations and analyses on your personal desktop or laptop 1325 | computer, and to offload more intensive analyses to Discovery. The 1326 | lab's code repository includes 1327 | \href{https://github.com/ContextLab/cluster-tools-dartmouth}{sample 1328 | Python scripts} for running analyses on Discovery. 1329 | 1330 | Separate from the Discovery Supercomputing Cluster, our lab also uses two 1331 | \href{https://lambdalabs.com/}{Lambda Labs} ``Scalar'' GPU servers with a 1332 | total of 16 A6000 GPUs and 64 computing cores. Each server has roughly 3~TB of 1333 | storage, which is shared by the entire lab. Let \director~know if you'd like 1334 | access to our GPU servers (and send your NetID) so that we can set up your 1335 | account. 1336 | 1337 | \subsection{Other research equipment} 1338 | Many research projects require specialized research equipment (e.g.\ 1339 | for neuroimaging using fMRI, EEG, ECoG, etc.). Some of the necessary 1340 | research equipment is owned by the Contextual Dynamics Lab, and other 1341 | equipment is shared with other labs affiliated with PBS or DHMC. All 1342 | equipment should be treated with care and respect. Any malfunctions 1343 | should be reported immediately. 1344 | 1345 | \subsection{Repository of shared lab papers and books} 1346 | Our lab maintains a Dropbox repository of PDFs for internal use by lab 1347 | members and affiliates. Contact \director~for a link (not to be shared 1348 | publicly). 1349 | 1350 | \subsection{Travel policy} 1351 | \marginnote{\texttt{NOTE:} To obtain funding for a scientific 1352 | conference, \textit{prior to submitting your abstract}, you must 1353 | (a) briefly describe or discuss how attending the conference fits 1354 | in with your goals and/or plans, (b) provide confirmation that you 1355 | have applied for some form of external funding, and (c) provide an 1356 | approximate travel budget, including all registration fees, 1357 | tickets, meals, etc. Your budget should not include lab events 1358 | (e.g.\ lab dinners), which are covered by a separate mechanism. 1359 | Your budget must be approved by \director~prior to submitting an 1360 | abstract in order for the lab to cover your expenses. (Your 1361 | expenses will be covered up the agreed-upon amount, at which point 1362 | you are responsible for making your travel plans accordingly, 1363 | submitting receipts, etc.) To initiate a request for travel 1364 | funding, join the \texttt{\#receipts} channel on Slack and use the 1365 | workflow (lightning bolt in the lower left) menu to start a 1366 | ``Conference \$ request''.}A major component of doing scientific 1367 | research is communicating with other scientists. The Contextual 1368 | Dynamics Lab regularly presents at several international scientific 1369 | conferences. If you are presenting your work from the lab (i.e., you 1370 | are the presenting author for a talk or poster), then your travel 1371 | expenses and conference registration fees will be guaranteed by the 1372 | lab, \textit{under the assumption that you will also make reasonable 1373 | efforts to seek out alternative sources of travel funding} (e.g.\ 1374 | through PBS, other internal Dartmouth sources, applying for travel 1375 | awards, using personal grants like NRSAs or NSF fellowships, etc.). 1376 | You are also expected to keep costs low (e.g.\ fly economy class, 1377 | seek out cheaper tickets, stay in reasonably priced hotels, share a 1378 | room with other lab members, etc.). By the same token, we also want 1379 | to be cognizant of your comfort and time, and it is not always 1380 | necessary to use the cheapest option. More specific travel 1381 | guidelines will be given on a per-conference or per-trip basis. 1382 | 1383 | If you are not presenting your work (or if you're presenting non-lab 1384 | work), but you are a senior lab member, then the lab may cover your 1385 | travel expenses to a limited number of conferences each year. These 1386 | should be discussed on a case-by-case basis with \director. 1387 | 1388 | If you are a junior lab member not presenting your work, the lab will 1389 | generally not pay for you to attend conferences. However, if you are 1390 | interested in attending a conference, and you aren't able to secure 1391 | funding through non-lab sources, you should discuss your options with 1392 | \director. 1393 | 1394 | \subsection{Making a poster} 1395 | \marginnote{\texttt{NOTE:} If you commit to presenting a poster at a 1396 | scientific conference, you agree to prepare a complete draft of 1397 | your poster \textit{at least two weeks in advance} of the 1398 | conference, and to complete a final draft of your poster (that 1399 | incorporates feedback from \director) \textit{at least one week in 1400 | advance} of the conference. If you do not meet these deadlines, 1401 | you may be required to withdraw your submission and/or cover any 1402 | conference-related expenses that you incurred, at \director's 1403 | discretion.} The preferred methods for creating posters are to use 1404 | \href{https://github.com/deselaers/latex-beamerposter}{LaTeX 1405 | BeamerPoster}, Adobe Illustrator, or 1406 | \href{https://inkscape.org/en/}{Inkscape}. The lab has several 1407 | example poster templates on file, but these are not organized well 1408 | yet. Your best bet is to ask \director~for an old poster and modify 1409 | it. You can also create a file from scratch. Ensure that any images 1410 | are either vector graphics, or bitmaps (.png, .jpeg, .tiff, etc.) at 1411 | sufficiently high resolutions (at least 300 dpi). 1412 | 1413 | 1414 | \subsection{Poster printing} 1415 | \marginnote{\texttt{NOTE:} Be sure to coordinate with 1416 | \director~regarding the funding source covering your poster 1417 | printing cost prior to going to print your poster.} There are two 1418 | on-campus poster printers. One is in the Map Room of Baker Library. 1419 | More information may be found 1420 | \href{http://www.dartmouth.edu/~library/maproom/printingfaq.html}{here}. 1421 | The Map Room printer should be used in most cases. It is important 1422 | to schedule your printing time as far in advance as possible, 1423 | particularly before conferences when many people will want to print. 1424 | Advanced planning can help us avoid the additional costs associated 1425 | with off-campus printers. The Department of Psychological and Brain 1426 | Sciences covers conference poster printing costs for PBS labs and 1427 | students (coordinate with \coordinator~to obtain the PBS Chart String 1428 | for poster printing). 1429 | 1430 | 1431 | \subsection{Publication costs} 1432 | All costs related to lab publications will be fully covered by the 1433 | lab. \coordinator~can help facilitate these payments. 1434 | 1435 | \subsection{Subject compensation} 1436 | Most in-lab experimental subjects will be compensated via t-points. 1437 | Coordinate with \coordinator~in order to receive a t-point allocation 1438 | well in advance of the start of the term you wish to run 1439 | participants. 1440 | 1441 | \marginnote{\texttt{NOTE:}In some cases, external funding sources may 1442 | be available to cover cash subject payments 1443 | (e.g. \href{https://students.dartmouth.edu/ugar/research/programs/honors-thesis-grant}{undergraduate 1444 | Honors Thesis Grants} or 1445 | \href{http://neukom.dartmouth.edu/programs/neukom-scholars.html}{Neukom 1446 | Scholars grants}). Coordinate with \director~to determine whether 1447 | alternative funding sources are available for your project.} Cash 1448 | subject payments for lab research projects will in most cases be 1449 | fully covered by the lab (see the \texttt{NOTE}). Subject payment 1450 | guidelines are generally found in the IRB approval documentation 1451 | relevant to your project. For Mechanical Turk (or other online) experiments, a subject 1452 | payments budget should be approved prior to beginning the experiment. 1453 | Cash payments may be made via petty cash, which is managed by 1454 | \coordinator. 1455 | 1456 | 1457 | \newthought{Who to go to with questions} 1458 | 1459 | \noindent This section contains guidelines of where to direct 1460 | questions related to technical and interpersonal issues that may 1461 | arise, or any issues you encounter not already listed in the sections 1462 | below. In general, resolving \textit{technical} issues within the lab 1463 | saves time, but there will inevitably be some we cannot resolve on our 1464 | own. In general, interpersonal issues should be resolved in accordance 1465 | with your comfort, but it is important to be aware of the below 1466 | resources should you encounter a situation in which you want to use 1467 | them. 1468 | 1469 | \subsection{Tech issues} 1470 | \begin{itemize} 1471 | \item For issues related to our lab's fileserver, seek assistance from 1472 | \director. 1473 | 1474 | \item For issues related to Slack, send a direct message to \texttt{@Ryan Sokol}. 1475 | 1476 | \item For issues with other lab-owned equipment (e.g.~computers, 1477 | research equipment, etc.) \coordinator~or the senior lab member 1478 | actively using the equipment should be your first-sought resource. 1479 | 1480 | \item For issues related to the Discovery computing cluster, or for general \ourschool-specific IT questions or issues, contact 1481 | \href{mailto:help@dartmouth.edu}{open a ticket} with the Information, 1482 | Technology, and Consulting office. 1483 | 1484 | \item For issues related to the Tensor GPU cluster, contact \href{mailto:Bonnie.J.Scott@dartmouth.edu}{Bonnie Scott}. 1485 | \end{itemize} 1486 | 1487 | \subsection{Lab documents} 1488 | \begin{itemize} 1489 | \item For questions about non-paper documents (e.g. receipts, consent 1490 | forms, IRB protocols, the lab website, etc.), talk to \coordinator. 1491 | 1492 | \item For questions on papers or posters, talk to \director. 1493 | \end{itemize} 1494 | 1495 | \subsection{Lab policy} 1496 | \begin{itemize} 1497 | \item If you have a question about the lab's policies, first try to 1498 | find the answer in the 1499 | \href{https://github.com/ContextLab/lab-manual/tree/master/lab_manual.pdf}{Lab 1500 | Manual}. 1501 | 1502 | \item If you feel your question is not adequately answered in the Lab 1503 | Manual, post your question on Slack (or, if it's a private issue, 1504 | talk to \director). 1505 | 1506 | \item If you think your question is likely to be of general interest, 1507 | update the lab manual to reflect the answer. 1508 | \end{itemize} 1509 | 1510 | \subsection{Specific methods} 1511 | \begin{itemize} 1512 | \item If you have questions about specific methods related to a 1513 | project, ask a senior lab member working on the project. 1514 | 1515 | \item It may also be helpful to check the 1516 | \href{https://github.com/contextLab/cdl-tutorials}{CDL tutorials} 1517 | repo, and contact the author(s) or contributors of a related 1518 | tutorial. 1519 | 1520 | \item You can also post your question in the 1521 | \href{https://context-lab.slack.com/messages/computrons/}{\#computrons} 1522 | channel on Slack. 1523 | 1524 | \item Remember, \href{https://www.google.com/}{Google} and 1525 | \href{https://stackoverflow.com/}{Stack Overflow} are your friends! 1526 | Often other people have encountered (and solved!) similar problems, 1527 | and sometimes they even share the answers online! 1528 | 1529 | \item If you still cannot find an answer to your question, reach out to \director. 1530 | \end{itemize} 1531 | 1532 | \subsection{Interpersonal issues}\label{sec:interpersonal} 1533 | \begin{itemize} 1534 | \item Clear, direct communication is often the best way to address 1535 | interpersonal issues. However, if you are having trouble resolving 1536 | something (or feel uncomfortable doing so on your own) you should 1537 | reach out to one of the following resources: 1538 | 1539 | \item Senior lab members (e.g. your immediate supervisor) 1540 | 1541 | \item \director 1542 | 1543 | \item The \href{https://pbs.dartmouth.edu/people}{PBS department chair} 1544 | 1545 | \item The 1546 | \href{https://students.dartmouth.edu/undergraduate-deans/}{Undergraduate 1547 | Deans Office} or the 1548 | \href{mailto:Graduate.and.Advanced.Studies@Dartmouth.edu}{Graduate 1549 | and Professional Schools Deans Office} 1550 | 1551 | \item Dartmouth's \href{https://www.dartmouth.edu/~hrs/}{Office of 1552 | Human Resources} 1553 | 1554 | \item Dartmouth's 1555 | \href{https://www.dartmouth.edu/~eap/}{Faculty/Employee Assistance 1556 | Program} 1557 | 1558 | \item Dartmouth's \href{https://sexual-respect.dartmouth.edu/}{Title 1559 | IX office} (for concerns about sexual misconduct, harassment, or 1560 | assault) 1561 | 1562 | \item 1563 | \href{https://www.hanovernh.org/hanover-police-department}{Hanover 1564 | Police} (if criminal activity is involved) 1565 | 1566 | \item WISE, a 24-hour crisis hotline for free and confidential 1567 | services to address domestic and sexual violence and stalking 1568 | (\href{tel:18884970516}{866-348-9473}) 1569 | 1570 | \end{itemize} 1571 | 1572 | \subsection{Ethics issues and reporting} 1573 | \begin{itemize} 1574 | 1575 | \item Dartmouth's 1576 | \href{https://www.dartmouth.ethicspoint.com}{Compliance and Ethics 1577 | Hotline} (\href{tel:18884970516}{888-497-0516}) 1578 | \item Safety and Security's 1579 | \href{https://www.dartmouth.edu/~security/services/forms/anonreport.html}{anonymous 1580 | reporting form} 1581 | 1582 | \end{itemize} 1583 | 1584 | 1585 | \chapter{Internal Review Board (IRB) approvals}\label{ch:irb} 1586 | Experimental \marginnote{\texttt{NOTE:} prior to running any 1587 | non-lab-member participants in your study, you must coordinate with 1588 | \coordinator~to verify that (a) your experiment has been approved by 1589 | the IRB and (b) your name is specifically listed on the associated 1590 | protocol.} protocols and IRB approval forms are maintained and 1591 | coordinated through \href{https://rapport.dartmouth.edu/}{RAPPORT}. 1592 | Typically this system is accessed directly by \director, but if you 1593 | feel you need access to RAPPORT then let \director~know. 1594 | 1595 | \newthought{List of active protocols} 1596 | 1597 | \begin{enumerate} 1598 | \item \textbf{Efficient Learning (STUDY00029685).} Used for all 1599 | behavioral learning and memory experiments for participants run in 1600 | the lab or via Amazon Mechanical Turk. The protocol also covers 1601 | fitness-related studies (e.g.\ incorporating fitness tracker data 1602 | and other on-body and remote biosensors including scalp EEG and 1603 | eye-trackers, and/or performing physical tasks like riding on a 1604 | stationary bicycle or running in place). 1605 | \item \textbf{fMRI Efficient Learning (STUDY00030020).} Analog of 1606 | the Efficient Learning protocol, but allows for fMRI data 1607 | collection. 1608 | \item \textbf{Electrophysiological Localization of Human Brain 1609 | Function (STUDY00012495).} Hospital protocol used for 1610 | studying electrocorticographic activity in epilepsy patients. 1611 | \item \textbf{Network dynamics in human epilepsy (STUDY00029400).} 1612 | Hospital protocol used for studying network dynamics inferred 1613 | via electrocorticographic activity in epilepsy patients. 1614 | \item \textbf{Perceptual and Memory Dynamics (STUDY00031514).} 1615 | Used for studies investigating the relationship between 1616 | perceptual and memory metrics and symptoms associated with 1617 | common psychiatric disorders. 1618 | 1619 | \end{enumerate} 1620 | 1621 | \newthought{List of inactive protocols} 1622 | \begin{enumerate} 1623 | \item \textbf{EEG Efficient Learning (STUDY00029881).} Analog of the 1624 | Efficient Learning protocol, but allows for scalp EEG data 1625 | collection. This protocol is redundant with the revised 1626 | Efficiently Learning protocol, which now allows for scalp EEG data 1627 | collection as well. 1628 | \end{enumerate} 1629 | 1630 | \newthought{Testing procedure} 1631 | 1632 | \noindent 1633 | When you run an experimental participant, you must have them sign a 1634 | consent form. After each day of testing (or more frequently), you 1635 | should give all signed consent forms to \coordinator. Consent 1636 | forms are kept in a locked file cabinet in \director's office. 1637 | 1638 | All experimental data must be stored securely, as per IRB 1639 | guidelines. All lab computers employ disk encryption and password 1640 | protection. If you need to copy unpublished data onto a non-lab 1641 | computer, you need to verify (by checking in with \director) that 1642 | your computer satisfies our data security requirements. \textit{No 1643 | personally identifiable data about our participants may ever be 1644 | shared outside of the lab.} 1645 | 1646 | \chapter{Lab members and alumni}\label{ch:members} 1647 | \begin{fullwidth} 1648 | \subsection{Current lab members}\label{sec:curr_members} 1649 | \newthought{PI} 1650 | \bigskip 1651 | 1652 | \enskip Jeremy R. Manning (2015 -- ) 1653 | 1654 | \newthought{Postdoctoral Researchers} 1655 | \begin{multicols}{2}\raggedcolumns 1656 | \begin{list}{\quad}{} 1657 | \item Hung-Tu Chen (2024 -- ) 1658 | \end{list} 1659 | \end{multicols} 1660 | 1661 | \newthought{Graduate Students} 1662 | \begin{multicols}{2}\raggedcolumns 1663 | \begin{list}{\quad}{} 1664 | \item Paxton Fitzpatrick (2021 -- ) 1665 | \item Xinming Xu (2021 -- ) 1666 | \end{list} 1667 | \end{multicols} 1668 | 1669 | 1670 | % \newthought{Research Assistants} 1671 | % \begin{multicols}{2}\raggedcolumns 1672 | % \begin{list}{\quad}{} 1673 | 1674 | % \end{list} 1675 | % \end{multicols} 1676 | 1677 | 1678 | \newthought{Undergraduate RAs} 1679 | \begin{multicols}{2}\raggedcolumns 1680 | \begin{list}{\quad}{} 1681 | \item Ansh Patel (2021 -- ) 1682 | \item Megan Liu (2023 -- ) 1683 | \item Yue Zhuo (2023 -- ) 1684 | \item Maura F. Hough (2023 -- ) 1685 | \item Aaryan Agrawal (2023 -- ) 1686 | \item Grady Redding (2023 -- ) 1687 | \item DJ Matusz (2023 -- ) 1688 | \item Sarah Parigela (2023 -- ) 1689 | \item Jake McDermid (2023 -- ) 1690 | \item Emma Reeder (2023 -- ) 1691 | \item Michael Chen (2023 -- ) 1692 | \item Andrew Cao (2024 -- ) 1693 | \item Jacob Bacus (2024 -- ) 1694 | \item Rohan Goyal (2024 -- ) 1695 | \item Everett Tai (2024 -- ) 1696 | \item Chelsea Joe (2024 -- ) 1697 | \item Matthew Givens (2024 -- ) 1698 | \item Can Kam (2024 -- ) 1699 | \item Miel Wewerka (2024 -- ) 1700 | \item Rodrigo Vega Ayllon (2025 -- ) 1701 | \item Evan McDermid (2025 -- ) 1702 | \item Owen Phillips (2025 -- ) 1703 | \item Colson Duncan (2025 -- ) 1704 | \end{list} 1705 | \end{multicols} 1706 | 1707 | \newpage 1708 | 1709 | \subsection{Lab alumni} 1710 | \newthought{Postdoctoral Researchers} 1711 | \begin{multicols}{2}\raggedcolumns 1712 | \begin{list}{\quad}{} 1713 | \item Andrew Heusser (2016 -- 2018) 1714 | \item Gina Notaro (2017 -- 2018) 1715 | \end{list} 1716 | \end{multicols} 1717 | 1718 | \newthought{Graduate Students} 1719 | \begin{multicols}{2}\raggedcolumns 1720 | \begin{list}{\quad}{} 1721 | \item Lucy Owen (2016 -- 2021) 1722 | \item Caroline Lee (2019 -- 2021) 1723 | \item Kirsten Ziman (2017 -- 2021) 1724 | \end{list} 1725 | \end{multicols} 1726 | 1727 | \newthought{Lab Managers} 1728 | \begin{multicols}{2}\raggedcolumns 1729 | \begin{list}{\quad}{} 1730 | \item Kirsten Ziman (2016 -- 2017) 1731 | \item Emily Whitaker (2017 -- 2018) 1732 | \item Paxton Fitzpatrick (2018 -- 2021) 1733 | 1734 | \end{list} 1735 | \end{multicols} 1736 | 1737 | 1738 | \newthought{Research Assistants} 1739 | \begin{multicols}{2}\raggedcolumns 1740 | \begin{list}{\quad}{} 1741 | \item Max Bluestone (2018 -- 2019) 1742 | \item Maddy Lee (2020 -- 2021) 1743 | \item Xinming Xu (2019 -- 2021) 1744 | \end{list} 1745 | \end{multicols} 1746 | 1747 | 1748 | \newthought{Undergraduate RAs} 1749 | \begin{multicols}{2}\raggedcolumns 1750 | \begin{list}{\quad}{} 1751 | \item Jessica Tin (2016) 1752 | \item Gal Perlman (2016) 1753 | \item Peter Tran (2016) 1754 | \item Sheherzad Mohydin (2016) 1755 | \item Joseph Finkelstein (2016) 1756 | \item Aman Agarwal (2016) 1757 | \item Clara Silvanic (2016) 1758 | \item Jake Rost (2016) 1759 | \item Aamuktha Porika (2016 -- 2017) 1760 | \item Allison Frantz (2016 -- 2017) 1761 | \item Marisol Tracy (2016 -- 2017) 1762 | \item Wei Liang Samuel Ching (2016 -- 2017) 1763 | \item Armando Ortiz (2017) 1764 | \item Christina Lu (2017) 1765 | \item Campbell Field (2016 -- 2018) 1766 | \item Bryan Bollinger (2017 -- 2018) 1767 | \item Stephen Satterthwaite (2017 -- 2018) 1768 | \item Ann Carpenter (2018) 1769 | \item Kirsten Soh (2018) 1770 | \item Rachael Chacko (2018) 1771 | \item Darya Romanova (2018) 1772 | \item Iain Sheerin (2018) 1773 | \item Mustafa Nasir-Moin (2018) 1774 | \item Seung Ju Lee (2018) 1775 | \item Paxton Fitzpatrick (2017 -- 2019) 1776 | \item Maddy Lee (2016 -- 2020) 1777 | \item Alex Martinez (2018 -- 2020) 1778 | \item William Chen (2019 -- 2020) 1779 | \item Aaron Lee (2019 -- 2020) 1780 | \item Shane Hewitt (2019 -- 2020) 1781 | \item Sarah Park (2019 -- 2020) 1782 | \item Austin Zhang (2020) 1783 | \item Vivian Tran (2020) 1784 | \item Luca Lit (2020) 1785 | \item Kelly Rutherford (2020) 1786 | \item Helen Lu (2020) 1787 | \item Kunal Jha (2020) 1788 | \item Will Baxley (2018 -- 2021) 1789 | \item Daniel Ha (2021) 1790 | \item Shane Park (2019 -- 2021) 1791 | \item Tehut Biru (2020 -- 2021) 1792 | \item Tudor Muntianu (2019 -- 2021) 1793 | \item Chelsea Uddenberg (2020 -- 2021) 1794 | \item Greg Han (2020 -- 2021) 1795 | \item Esme Chen (2020 -- 2021) 1796 | \item Chris Long (2020 -- 2021) 1797 | \item Ethan Adner (2020 -- 2021) 1798 | \item Chris Jun (2020 -- 2021) 1799 | \item Chris Suh (2020 -- 2021) 1800 | \item Tyler Chen (2020 -- 2021) 1801 | \item Darren Gu (2020 -- 2021) 1802 | \item Aidan Adams (2021) 1803 | \item Damini Kohli (2021) 1804 | \item Natalie Schreder (2021) 1805 | \item Swestha Jain (2021) 1806 | \item Will McCall (2021) 1807 | \item Anna Mikhailova (2021) 1808 | \item Thomas Corrado (2021) 1809 | \item Brian Chiang (2021) 1810 | \item Kevin Cao (2022) 1811 | \item Goutham Veeramachaneni (2022) 1812 | \item Zachary Somma (2022) 1813 | \item Dawson Haddox (2022) 1814 | \item Alexander Marcoux (2022) 1815 | \item Jessna Brar (2022) 1816 | \item Wenhua Liang (2022) 1817 | \item Molly McQuoid (2022) 1818 | \item Mark Taylor (2021 -- 2022) 1819 | \item Francisca O. Fadairo (2023) 1820 | \item Ameer Talha Yasser (2023) 1821 | \item Daniel Carstensen (2021 -- 2024) 1822 | 1823 | \end{list} 1824 | \end{multicols} 1825 | \end{fullwidth} 1826 | 1827 | 1828 | \chapter{Checklist and signature page} 1829 | 1830 | By signing below, I certify that I have completed the following tasks: 1831 | \begin{todolist} 1832 | \item I have joined the lab's Slack account and worked through the 1833 | orientation workflow to share my accounts and information with 1834 | \director. (Click the Workflows menu in 1835 | the \#general channel and select `Join the lab!' to start the 1836 | onboarding process.) 1837 | \item I agree to check Slack 1838 | regularly (at \textit{least} once per normal business day, excluding days I 1839 | mark on the out-of-lab calendar) and to respond to messages and 1840 | requests in a timely manner (within a few hours during normal 1841 | business hours, or early the next business day if messages are 1842 | received after hours). 1843 | \item I have created a GitHub account and have been added to the appropriate lab 1844 | GitHub group(s). If I am unfamiliar with Git, I have gone through 1845 | the GitHub tutorials. 1846 | \item I am proficient in \LaTeX, allowing me to edit and understand 1847 | this lab manual's source code. 1848 | \item I have submitted a pull request to the 1849 | \href{https://github.com/ContextLab/lab-manual}{GitHub repository} 1850 | that adds my name to the \hyperref[sec:curr_members]{lab members} 1851 | section, along with any other updates I think would be helpful. I 1852 | have also recompiled the PDF of the lab manual by running 1853 | \texttt{pdflatex} \textbf{twice}, and have ensured that (a) the PDF compiled 1854 | without errors, and (b) the table of contents was generated correctly. 1855 | \item I have access to the following lab calendars: 1856 | Contextual Dynamics Lab, Out of lab, CDL Resources, DHMC Meetings (if 1857 | applicable), and PBS department events. 1858 | \item I have been added to the lab's 1password account if I am a 1859 | senior lab member, or I have not been added because I am a junior 1860 | lab member. 1861 | \item I have completed the required CITI program module(s) and have 1862 | sent my Completion Certificate(s) to \coordinator. 1863 | \item I am an unpaid or salaried employee, or I am an hourly 1864 | employee and have gotten myself set up on Kronos to track my paid 1865 | hours. 1866 | \item If I am a paid employee (including graduate students), or if 1867 | I would like to be paid, I agree to regularly seek out and 1868 | coordinate with \director~about relevant funding opportunities 1869 | that could help support me and/or my research. 1870 | \item I have submitted a photograph (of myself, or a representative 1871 | scene or object) along with a brief (2-3 sentence), professionally 1872 | worded biography, to be included on the lab website. 1873 | Alternatively, I indicated (via Slack message to \coordinator) my 1874 | preference to not be included on the lab website. 1875 | \item I agree to regularly attend lab meetings (unless I have a 1876 | course conflict and have informed \director). 1877 | \item I agree to send \director~regular updates regarding my 1878 | progress and work, including weekly snippets, meetings, Slack 1879 | discussions, and/or GitHub updates. 1880 | \item If/when I decide to end my affiliation with the lab, I 1881 | will notify \director~and any other project members that may 1882 | be affected by my departure. I will also coordinate with 1883 | \director~and other relevant lab members to facilitate a smooth 1884 | transfer of your project-related roles and responsibilities to 1885 | other lab members. This includes a discussion about potential 1886 | authorship on future publications related to the work. 1887 | \item I have read 1888 | \href{https://www.sciencemag.org/careers/2018/11/what-can-we-learn-dartmouth}{Leah 1889 | Somerville's commentary} on speaking out in toxic or abusive 1890 | environments. 1891 | \item I have reviewed the 1892 | \href{https://oir.nih.gov/sites/default/files/uploads/sourcebook/documents/ethical_conduct/guidelines-authorship_contributions.pdf}{NIH 1893 | guidelines for authorship}. 1894 | \item I agree to abide by the lab's bill of rights and 1895 | responsibilities, and to follow official lab practices and 1896 | policies. 1897 | \item I have carefully read through the entire lab manual, and I 1898 | have checked off all of the above items to indicate that I have 1899 | carried out the indicated tasks. 1900 | \item I will send a digital copy (PDF) of the final two pages of 1901 | this manual, including checked-off list items, my digital 1902 | signature, and today's date, to 1903 | \href{mailto:contextualdynamics@gmail.com}{contextualdynamics@gmail.com}. 1904 | \end{todolist} 1905 | 1906 | \vspace{0.25in} 1907 | \begin{tabular}{@{}p{3in}p{1in}@{}} 1908 | \hrulefill & \hrulefill \\ 1909 | Signature & Date\\ 1910 | \end{tabular} 1911 | 1912 | 1913 | % Citation example \cite{Tufte2001}, notice how the citation is in the margin. This is an example of how to add something to the index at the end of the document.\index{citation} 1914 | 1915 | % \newthought{Example of} the \texttt{newthought} command for starting new sections. Typography examples: \allcaps{all caps} and \smallcaps{small caps}. 1916 | 1917 | %------------------------------------------------ 1918 | 1919 | % \section{Figures} 1920 | 1921 | % \lipsum[1] 1922 | 1923 | % \begin{marginfigure} 1924 | % \includegraphics[width=\linewidth]{helix} 1925 | % \caption{This is a margin figure. The helix is defined by $x = \cos(2\pi z)$, $y = \sin(2\pi z)$, and $z = [0, 2.7]$. The figure was drawn using Asymptote (\url{http://asymptote.sf.net/}).} 1926 | % \label{fig:marginfig} 1927 | % \end{marginfigure} 1928 | 1929 | % \lipsum[2] 1930 | 1931 | % \begin{figure*}[h] 1932 | % \includegraphics[width=\linewidth]{sine.pdf} 1933 | % \caption{This graph shows $y = \sin x$ from about $x = [-10, 10]$. 1934 | % \emph{Notice that this figure takes up the full page width.}} 1935 | % \label{fig:fullfig} 1936 | % \end{figure*} 1937 | 1938 | % \lipsum[3] 1939 | 1940 | % %------------------------------------------------ 1941 | 1942 | % \section{Tables} \marginnote{This is a random margin note. Notice that there isn't a number preceding the note, and there is no number in the main text where this note was written. Use \texttt{sidenote} to use a number.} 1943 | 1944 | % \lipsum[4] 1945 | 1946 | % \begin{table} % Add the following just after the closing bracket on this line to specify a position for the table on the page: [h], [t], [b] or [p] - these mean: here, top, bottom and on a separate page, respectively 1947 | % \centering % Centers the table on the page, comment out to left-justify 1948 | % \begin{tabular}{l c c c c c} % The final bracket specifies the number of columns in the table along with left and right borders which are specified using vertical bars (|); each column can be left, right or center-justified using l, r or c. To specify a precise width, use p{width}, e.g. p{5cm} 1949 | % \toprule % Top horizontal line 1950 | % & \multicolumn{5}{c}{Growth Media} \\ % Amalgamating several columns into one cell is done using the \multicolumn command as seen on this line 1951 | % \cmidrule(l){2-6} % Horizontal line spanning less than the full width of the table - you can add (r) or (l) just before the opening curly bracket to shorten the rule on the left or right side 1952 | % Strain & 1 & 2 & 3 & 4 & 5\\ % Column names row 1953 | % \midrule % In-table horizontal line 1954 | % GDS1002 & 0.962 & 0.821 & 0.356 & 0.682 & 0.801\\ % Content row 1 1955 | % NWN652 & 0.981 & 0.891 & 0.527 & 0.574 & 0.984\\ % Content row 2 1956 | % PPD234 & 0.915 & 0.936 & 0.491 & 0.276 & 0.965\\ % Content row 3 1957 | % JSB126 & 0.828 & 0.827 & 0.528 & 0.518 & 0.926\\ % Content row 4 1958 | % JSB724 & 0.916 & 0.933 & 0.482 & 0.644 & 0.937\\ % Content row 5 1959 | % \midrule % In-table horizontal line 1960 | % \midrule % In-table horizontal line 1961 | % Average Rate & 0.920 & 0.882 & 0.477 & 0.539 & 0.923\\ % Summary/total row 1962 | % \bottomrule % Bottom horizontal line 1963 | % \end{tabular} 1964 | % \caption{Table caption text} % Table caption, can be commented out if no caption is required 1965 | % \label{tab:template} % A label for referencing this table elsewhere, references are used in text as \ref{label} 1966 | % \end{table} 1967 | 1968 | %---------------------------------------------------------------------------------------- 1969 | 1970 | \mainmatter 1971 | 1972 | %---------------------------------------------------------------------------------------- 1973 | % CHAPTER 1 1974 | %---------------------------------------------------------------------------------------- 1975 | 1976 | %\chapter{Chapter 1 Title} 1977 | %\label{ch:1} 1978 | 1979 | %------------------------------------------------ 1980 | 1981 | % \section{Section 1 - Fullwidth Environment Example} 1982 | 1983 | % \begin{fullwidth} 1984 | % \lipsum[5] 1985 | % \end{fullwidth} 1986 | 1987 | % \subsection{Subsection 1} 1988 | 1989 | % \lipsum[6-7] 1990 | 1991 | % \subsection{Subsection 2} 1992 | 1993 | % \lipsum[7-8] 1994 | 1995 | 1996 | 1997 | %---------------------------------------------------------------------------------------- 1998 | 1999 | \backmatter 2000 | 2001 | %---------------------------------------------------------------------------------------- 2002 | % BIBLIOGRAPHY 2003 | %---------------------------------------------------------------------------------------- 2004 | 2005 | %\bibliography{bibliography} % Use the bibliography.bib file for the bibliography 2006 | %\bibliographystyle{plainnat} % Use the plainnat style of referencing 2007 | 2008 | %---------------------------------------------------------------------------------------- 2009 | 2010 | \printindex % Print the index at the very end of the document 2011 | 2012 | 2013 | \end{document} 2014 | -------------------------------------------------------------------------------- /resources/cheatsheets/command-line-cheatsheet.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ContextLab/lab-manual/9d7bb7484b128e6be12f46088d2c3091a9453a2f/resources/cheatsheets/command-line-cheatsheet.pdf -------------------------------------------------------------------------------- /resources/cheatsheets/git-cheatsheet.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ContextLab/lab-manual/9d7bb7484b128e6be12f46088d2c3091a9453a2f/resources/cheatsheets/git-cheatsheet.pdf -------------------------------------------------------------------------------- /resources/cheatsheets/workflow-of-version-control.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ContextLab/lab-manual/9d7bb7484b128e6be12f46088d2c3091a9453a2f/resources/cheatsheets/workflow-of-version-control.pdf -------------------------------------------------------------------------------- /resources/cluster-tutorials/intro-slides.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ContextLab/lab-manual/9d7bb7484b128e6be12f46088d2c3091a9453a2f/resources/cluster-tutorials/intro-slides.pdf -------------------------------------------------------------------------------- /tufte-book.cls: -------------------------------------------------------------------------------- 1 | \NeedsTeXFormat{LaTeX2e}[1994/06/01] 2 | 3 | \ProvidesClass{tufte-book}[2009/12/11 v3.5.0 Tufte-book class] 4 | 5 | %% 6 | % Declare we're tufte-book 7 | \newcommand{\@tufte@class}{book}% the base LaTeX class (defaults to the article/handout style) 8 | \newcommand{\@tufte@pkgname}{tufte-book}% the name of the package (defaults to tufte-handout) 9 | 10 | %% 11 | % Load the common style elements 12 | \input{tufte-common.def} 13 | 14 | 15 | %% 16 | % Set up any book-specific stuff now 17 | 18 | %% 19 | % The front matter in Tufte's /Beautiful Evidence/ contains everything up 20 | % to the opening page of Chapter 1. The running heads, when they appear, 21 | % contain only the (arabic) page number in the outside corner. 22 | %\newif\if@mainmatter \@mainmattertrue 23 | \renewcommand\frontmatter{% 24 | \cleardoublepage% 25 | \@mainmatterfalse% 26 | \pagenumbering{arabic}% 27 | %\pagestyle{plain}% 28 | \fancyhf{}% 29 | \ifthenelse{\boolean{@tufte@twoside}}% 30 | {\fancyhead[LE,RO]{\thepage}}% 31 | {\fancyhead[RE,RO]{\thepage}}% 32 | } 33 | 34 | 35 | %% 36 | % The main matter in Tufte's /Beautiful Evidence/ doesn't restart the page 37 | % numbering---it continues where it left off in the front matter. 38 | \renewcommand\mainmatter{% 39 | \cleardoublepage% 40 | \@mainmattertrue% 41 | \fancyhf{}% 42 | \ifthenelse{\boolean{@tufte@twoside}}% 43 | {% two-side 44 | \renewcommand{\chaptermark}[1]{\markboth{##1}{}}% 45 | \fancyhead[LE]{\thepage\quad\smallcaps{\newlinetospace{\plaintitle}}}% book title 46 | \fancyhead[RO]{\smallcaps{\newlinetospace{\leftmark}}\quad\thepage}% chapter title 47 | }% 48 | {% one-side 49 | \fancyhead[RE,RO]{\smallcaps{\newlinetospace{\plaintitle}}\quad\thepage}% book title 50 | }% 51 | } 52 | 53 | 54 | %% 55 | % The back matter contains appendices, indices, glossaries, endnotes, 56 | % biliographies, list of contributors, illustration credits, etc. 57 | \renewcommand\backmatter{% 58 | \if@openright% 59 | \cleardoublepage% 60 | \else% 61 | \clearpage% 62 | \fi% 63 | \@mainmatterfalse% 64 | } 65 | 66 | %% 67 | % Only show the chapter titles in the table of contents 68 | \setcounter{tocdepth}{0} 69 | 70 | %% 71 | % If there is a `tufte-book-local.sty' file, load it. 72 | 73 | \IfFileExists{tufte-book-local.tex} 74 | {\input{tufte-book-local} 75 | \TufteInfoNL{Loading tufte-book-local.tex}} 76 | {} 77 | 78 | %% 79 | % End of file 80 | \endinput 81 | -------------------------------------------------------------------------------- /tufte-common.def: -------------------------------------------------------------------------------- 1 | %% 2 | %% This file contains the code that is common to the Tufte-LaTeX document classes. 3 | %% 4 | 5 | \ProvidesFile{tufte-common.def}[2015/06/21 v3.5.2 Common code for the Tufte-LaTeX styles] 6 | 7 | %% 8 | % The `xkeyval' package simplifies the user interface for the document class options 9 | \RequirePackage{xkeyval} 10 | 11 | %% 12 | % We use the `xifthen' package to handle our package option switches 13 | \RequirePackage{xifthen} 14 | 15 | %% 16 | % Define some shortcut macros for error/warning/info logging. 17 | \RequirePackage{hardwrap} 18 | \GenerateClassLogMacros[@tufte]{\@tufte@pkgname} 19 | \newcommand{\@tufte@debug@info}[1]{\ifthenelse{\boolean{@tufte@debug}}{\@tufte@info{#1}}{}} 20 | \newcommand{\@tufte@debug@info@noline}[1]{\ifthenelse{\boolean{@tufte@debug}}{\@tufte@info@noline{#1}}{}} 21 | 22 | %% 23 | % `debug' option -- provides more information in the .log file for use in 24 | % troubleshooting problems 25 | \newboolean{@tufte@debug} 26 | \DeclareOptionX[tufte]{debug}{\setboolean{@tufte@debug}{true}} 27 | 28 | %% 29 | % `nofonts' option -- doesn't load any fonts 30 | % `fonts' option -- tries to load fonts 31 | \newboolean{@tufte@loadfonts}\setboolean{@tufte@loadfonts}{true} 32 | \DeclareOptionX[tufte]{fonts}{\setboolean{@tufte@loadfonts}{true}} 33 | \DeclareOptionX[tufte]{nofonts}{\setboolean{@tufte@loadfonts}{false}} 34 | 35 | %% 36 | % `nols' option -- doesn't configure letterspacing 37 | % `ls' option -- configures letterspacing 38 | \newboolean{@tufte@letterspace}\setboolean{@tufte@letterspace}{true} 39 | \DeclareOptionX[tufte]{ls}{\setboolean{@tufte@letterspace}{true}} 40 | \DeclareOptionX[tufte]{nols}{\setboolean{@tufte@letterspace}{false}} 41 | 42 | %% 43 | % `nobib' option -- doesn't load natbib or adjust the \cite command 44 | \newboolean{@tufte@loadnatbib}\setboolean{@tufte@loadnatbib}{true} 45 | \DeclareOptionX[tufte]{nobib}{\setboolean{@tufte@loadnatbib}{false}} 46 | 47 | %% 48 | % `titlepage' option -- creates a full title page with \maketitle 49 | 50 | \newboolean{@tufte@titlepage} 51 | \DeclareOptionX[tufte]{titlepage}{\setboolean{@tufte@titlepage}{true}} 52 | \DeclareOptionX[tufte]{notitlepage}{\setboolean{@tufte@titlepage}{false}} 53 | 54 | %% 55 | % `a4paper' option 56 | 57 | \newboolean{@tufte@afourpaper} 58 | \DeclareOptionX[tufte]{a4paper}{\setboolean{@tufte@afourpaper}{true}} 59 | 60 | %% 61 | % `b5paper' option 62 | 63 | \newboolean{@tufte@bfivepaper} 64 | \DeclareOptionX[tufte]{b5paper}{\setboolean{@tufte@bfivepaper}{true}} 65 | 66 | %% 67 | % `sfsidenotes' option -- typesets sidenotes in sans serif typeface 68 | 69 | \newboolean{@tufte@sfsidenotes} 70 | \DeclareOptionX[tufte]{sfsidenotes}{\setboolean{@tufte@sfsidenotes}{true}} 71 | 72 | %% 73 | % `symmetric' option -- puts marginpar space to the outside edge of the page 74 | % Note: this option forces the twoside option (see the .cls files) 75 | 76 | \newboolean{@tufte@symmetric} 77 | \DeclareOptionX[tufte]{symmetric}{ 78 | \setboolean{@tufte@symmetric}{true} 79 | \@tufte@info@noline{The `symmetric' option implies `twoside'} 80 | \ExecuteOptionsX[tufte]{twoside} 81 | } 82 | 83 | %% 84 | % `twoside' option -- alternates running heads 85 | 86 | \newboolean{@tufte@twoside} 87 | \DeclareOptionX[tufte]{twoside}{% 88 | \setboolean{@tufte@twoside}{true} 89 | \@tufte@info@noline{Passing the `twoside' option to the `\@tufte@class' class} 90 | \PassOptionsToClass{twoside}{\@tufte@class} 91 | } 92 | 93 | %% 94 | % `notoc' option -- suppresses the Tufte-style table of contents 95 | 96 | \newboolean{@tufte@toc} 97 | \setboolean{@tufte@toc}{true} 98 | \DeclareOptionX[tufte]{notoc}{\setboolean{@tufte@toc}{false}} 99 | \DeclareOptionX[tufte]{toc}{\setboolean{@tufte@toc}{true}} 100 | 101 | %% 102 | % `justified' option -- uses fully justified text (flush left and flush 103 | % right) instead of ragged right. 104 | 105 | \newboolean{@tufte@justified} 106 | \DeclareOptionX[tufte]{justified}{\setboolean{@tufte@justified}{true}} 107 | 108 | %% 109 | % `bidi' option -- loads the bidi package for bi-directional text 110 | 111 | \newboolean{@tufte@loadbidi} 112 | \DeclareOptionX[tufte]{bidi}{\setboolean{@tufte@loadbidi}{true}} 113 | \DeclareOptionX[tufte]{nobidi}{\setboolean{@tufte@loadbidi}{false}} 114 | 115 | %% 116 | % `nohyper' option -- suppresses loading of the hyperref package 117 | 118 | \newboolean{@tufte@loadhyper} 119 | \setboolean{@tufte@loadhyper}{true} 120 | \DeclareOptionX[tufte]{hyper}{\setboolean{@tufte@loadhyper}{true}} 121 | \DeclareOptionX[tufte]{nohyper}{\setboolean{@tufte@loadhyper}{false}} 122 | 123 | %% 124 | % `sidenote', `marginnote', `caption', `citation', `marginals' options 125 | % Each allows one of {justified,raggedleft,raggedright,raggedouter,auto}. 126 | 127 | \newcommand*{\@tufte@sidenote@justification}{\@tufte@justification@autodetect} 128 | \define@choicekey*+[tufte]{common}{sidenote}[\@tufte@kvtext\@tufte@kvnum]{justified,raggedleft,raggedright,raggedouter,auto}[auto]{% 129 | \ifcase\@tufte@kvnum\relax 130 | \renewcommand*{\@tufte@sidenote@justification}{\justifying}% justified 131 | \or 132 | \renewcommand*{\@tufte@sidenote@justification}{\RaggedLeft}% ragged left 133 | \or 134 | \renewcommand*{\@tufte@sidenote@justification}{\RaggedRight}% ragged right 135 | \or 136 | \renewcommand*{\@tufte@sidenote@justification}{\@tufte@justification@outer}% ragged outer (flush right on verso pages, flush left on recto pages) 137 | \or 138 | \renewcommand*{\@tufte@sidenote@justification}{\@tufte@justification@autodetect}% autodetects best justification mode based on all class options 139 | \fi 140 | }{% 141 | \@tufte@warning@noline{Invalid option `#1' for sidenote key. Must be one of: justified, raggedleft, raggedright, raggedouter, auto} 142 | \renewcommand*{\@tufte@sidenote@justification}{\@tufte@justification@autodetect}% autodetects best justification mode based on all class options 143 | } 144 | 145 | \newcommand*{\@tufte@marginnote@justification}{\@tufte@justification@autodetect} 146 | \define@choicekey*+[tufte]{common}{marginnote}[\@tufte@kvtext\@tufte@kvnum]{justified,raggedleft,raggedright,raggedouter,auto}[auto]{% 147 | \ifcase\@tufte@kvnum\relax 148 | \renewcommand*{\@tufte@marginnote@justification}{\justifying}% justified 149 | \or 150 | \renewcommand*{\@tufte@marginnote@justification}{\RaggedLeft}% ragged left 151 | \or 152 | \renewcommand*{\@tufte@marginnote@justification}{\RaggedRight}% ragged right 153 | \or 154 | \renewcommand*{\@tufte@marginnote@justification}{\@tufte@justification@outer}% ragged outer (flush right on verso pages, flush left on recto pages) 155 | \or 156 | \renewcommand*{\@tufte@marginnote@justification}{\@tufte@justification@autodetect}% autodetects best justification mode based on all class options 157 | \fi 158 | }{% 159 | \@tufte@warning@noline{Invalid option `#1' for marginnote key. Must be one of: justified, raggedleft, raggedright, raggedouter, auto} 160 | \renewcommand*{\@tufte@marginnote@justification}{\@tufte@justification@autodetect}% autodetects best justification mode based on all class options 161 | } 162 | 163 | \newcommand*{\@tufte@caption@justification}{\@tufte@justification@autodetect} 164 | \define@choicekey*+[tufte]{common}{caption}[\@tufte@kvtext\@tufte@kvnum]{justified,raggedleft,raggedright,raggedouter,auto}[auto]{% 165 | \ifcase\@tufte@kvnum\relax 166 | \renewcommand*{\@tufte@caption@justification}{\justifying}% justified 167 | \or 168 | \renewcommand*{\@tufte@caption@justification}{\RaggedLeft}% ragged left 169 | \or 170 | \renewcommand*{\@tufte@caption@justification}{\RaggedRight}% ragged right 171 | \or 172 | \renewcommand*{\@tufte@caption@justification}{\@tufte@justification@caption@outer}% ragged outer (flush right on verso pages, flush left on recto pages) 173 | \or 174 | \renewcommand*{\@tufte@caption@justification}{\@tufte@justification@autodetect}% autodetects best justification mode based on all class options 175 | \fi 176 | }{% 177 | \@tufte@warning@noline{Invalid option `#1' for caption key. Must be one of: justified, raggedleft, raggedright, raggedouter, auto} 178 | \renewcommand*{\@tufte@caption@justification}{\@tufte@justification@autodetect}% autodetects best justification mode based on all class options 179 | } 180 | 181 | \newcommand*{\@tufte@citation@justification}{\@tufte@justification@autodetect} 182 | \define@choicekey*+[tufte]{common}{citation}[\@tufte@kvtext\@tufte@kvnum]{justified,raggedleft,raggedright,raggedouter,auto}[auto]{% 183 | \ifcase\@tufte@kvnum\relax 184 | \renewcommand*{\@tufte@citation@justification}{\justifying}% justified 185 | \or 186 | \renewcommand*{\@tufte@citation@justification}{\RaggedLeft}% ragged left 187 | \or 188 | \renewcommand*{\@tufte@citation@justification}{\RaggedRight}% ragged right 189 | \or 190 | \renewcommand*{\@tufte@citation@justification}{\@tufte@justification@outer}% ragged outer (flush right on verso pages, flush left on recto pages) 191 | \or 192 | \renewcommand*{\@tufte@citation@justification}{\@tufte@justification@autodetect}% autodetects best justification mode based on all class options 193 | \fi 194 | }{% 195 | \@tufte@warning@noline{Invalid option `#1' for citation key. Must be one of: justified, raggedleft, raggedright, raggedouter, auto} 196 | \renewcommand*{\@tufte@citation@justification}{\@tufte@justification@autodetect}% autodetects best justification mode based on all class options 197 | } 198 | 199 | % The ``marginals'' key simultaneously sets the same justification for all marginal material 200 | \define@choicekey*+[tufte]{common}{marginals}[\@tufte@kvtext\@tufte@kvnum]{justified,raggedleft,raggedright,raggedouter,auto}[auto]{% 201 | \ifcase\@tufte@kvnum\relax 202 | \ExecuteOptionsX[tufte]{citation=justified,sidenote=justified,caption=justified,marginnote=justified}% justified 203 | \or 204 | \ExecuteOptionsX[tufte]{citation=raggedleft,sidenote=raggedleft,caption=raggedleft,marginnote=raggedleft}% ragged left 205 | \or 206 | \ExecuteOptionsX[tufte]{citation=raggedright,sidenote=raggedright,caption=raggedright,marginnote=raggedright}% ragged right 207 | \or 208 | \ExecuteOptionsX[tufte]{citation=raggedouter,sidenote=raggedouter,caption=raggedouter,marginnote=raggedouter}% ragged outer (flush right on verso pages, flush left on recto pages) 209 | \or 210 | \ExecuteOptionsX[tufte]{citation=auto,sidenote=auto,caption=auto,marginnote=auto}% autodetects best justification mode based on all class options 211 | \fi 212 | }{% 213 | \@tufte@warning@noline{Invalid option `#1' for marginals key. Must be one of: justified, raggedleft, raggedright, raggedouter, auto} 214 | \ExecuteOptionsX[tufte]{citation=auto,sidenote=auto,caption=auto,marginnote=auto}% autodetects best justification mode based on all class options 215 | } 216 | 217 | 218 | %% 219 | % Unsupported options 220 | 221 | \newcommand{\@tufte@unsupported@option}[1]{\@tufte@warning@noline{Option `#1' is not supported -- ignoring option}\OptionNotUsed} 222 | 223 | \DeclareOptionX[tufte]{10pt}{\@tufte@unsupported@option{\CurrentOption}} 224 | \DeclareOptionX[tufte]{11pt}{\@tufte@unsupported@option{\CurrentOption}} 225 | \DeclareOptionX[tufte]{12pt}{\@tufte@unsupported@option{\CurrentOption}} 226 | \DeclareOptionX[tufte]{a5paper}{\@tufte@unsupported@option{\CurrentOption}} 227 | \DeclareOptionX[tufte]{executivepaper}{\@tufte@unsupported@option{\CurrentOption}} 228 | \DeclareOptionX[tufte]{legalpaper}{\@tufte@unsupported@option{\CurrentOption}} 229 | \DeclareOptionX[tufte]{landscape}{\@tufte@unsupported@option{\CurrentOption}} 230 | \DeclareOptionX[tufte]{onecolumn}{\@tufte@unsupported@option{\CurrentOption}} 231 | \DeclareOptionX[tufte]{twocolumn}{\@tufte@unsupported@option{\CurrentOption}} 232 | 233 | %% 234 | % Default `book' and `handout' options 235 | 236 | \ifthenelse{\equal{\@tufte@pkgname}{tufte-book}} 237 | {\ExecuteOptionsX[tufte]{titlepage}} 238 | {\ExecuteOptionsX[tufte]{notitlepage}} 239 | 240 | 241 | \DeclareOptionX*{% 242 | \@tufte@info@noline{Passing \CurrentOption\space to the `\@tufte@class' class.}% 243 | \PassOptionsToClass{\CurrentOption}{\@tufte@class}% 244 | } 245 | \ProcessOptionsX*[tufte]\relax 246 | 247 | %% 248 | % Load the appropriate base class 249 | \@tufte@info@noline{Loading the base class `\@tufte@class'} 250 | \LoadClass{\@tufte@class} 251 | 252 | %% 253 | % Detect whether we're in two-side mode or not. (Used to set up running 254 | % heads later.) 255 | 256 | \ifthenelse{\boolean{@twoside}} 257 | {\setboolean{@tufte@twoside}{true}} 258 | {} 259 | 260 | 261 | 262 | %% 263 | % Detect if we're using pdfLaTeX 264 | 265 | \newboolean{@tufte@pdf} 266 | \IfFileExists{ifpdf.sty}{% 267 | \RequirePackage{ifpdf} 268 | \ifthenelse{\boolean{pdf}} 269 | {\setboolean{@tufte@pdf}{true}} 270 | {\setboolean{@tufte@pdf}{false}} 271 | }{% assume we're not using pdfTex? 272 | \setboolean{@tufte@pdf}{false} 273 | } 274 | 275 | %% 276 | % Detect if we're using XeLaTeX 277 | 278 | \newboolean{@tufte@xetex} 279 | \IfFileExists{ifxetex.sty}{% 280 | \RequirePackage{ifxetex} 281 | \ifthenelse{\boolean{xetex}} 282 | {\setboolean{@tufte@xetex}{true}} 283 | {\setboolean{@tufte@xetex}{false}} 284 | }{% not using xelatex 285 | \setboolean{@tufte@xetex}{false} 286 | } 287 | 288 | \ifthenelse{\boolean{@tufte@xetex}}{% 289 | \RequirePackage{xltxtra}% xltxtra loads xunicode and fontspec; must be loaded before bidi 290 | }{} 291 | 292 | %% 293 | % Detect if we're using LuaTeX 294 | 295 | \newboolean{@tufte@luatex} 296 | \IfFileExists{ifluatex.sty}{% 297 | \RequirePackage{ifluatex} 298 | \ifthenelse{\boolean{luatex}} 299 | {\setboolean{@tufte@luatex}{true}} 300 | {\setboolean{@tufte@luatex}{false}} 301 | }{% not using luatex 302 | \setboolean{@tufte@luatex}{false} 303 | } 304 | 305 | \ifthenelse{\boolean{@tufte@luatex}}{% 306 | \RequirePackage{fontspec} 307 | \RequirePackage[osf,sc]{mathpazo} 308 | \setmainfont[Renderer=Basic, Numbers=OldStyle, Scale = 1.0]{TeX Gyre Pagella} 309 | \setsansfont[Renderer=Basic, Scale=0.90]{TeX Gyre Heros} 310 | \setmonofont[Renderer=Basic]{TeX Gyre Cursor} 311 | }{} 312 | 313 | %% 314 | % Globally sets the length 315 | 316 | \newcommand*{\gsetlength}[2]{% 317 | \setlength{#1}{#2}% 318 | \global#1=#1\relax% 319 | } 320 | 321 | %% 322 | % Globally sets a boolean 323 | 324 | \newcommand*{\gsetboolean}[2]{% based on code from ifthen pkg 325 | \lowercase{\def\@tempa{#2}}% 326 | \@ifundefined{@tempswa\@tempa}% 327 | {\PackageError{ifthen}{You can only set a boolean to `true' or `false'}\@ehc}% 328 | {\@ifundefined{#1\@tempa}% 329 | {\PackageError{ifthen}{Boolean #1 undefined}\@ehc}% 330 | {\global\csname#1\@tempa\endcsname}% 331 | }% 332 | } 333 | 334 | %% 335 | % The titlesec and titletoc packages are used to change the style of the 336 | % section headings. These packages should be loaded before the hyperref 337 | % package. 338 | 339 | \RequirePackage{titlesec,titletoc} 340 | 341 | %%% 342 | %% Loads the hyperref package and sets some default options. 343 | 344 | \newcommand{\TufteLoadHyperref}{% 345 | \ifthenelse{\boolean{@tufte@xetex}} 346 | {\RequirePackage[unicode,hyperfootnotes=false,xetex]{hyperref}} 347 | {\RequirePackage[unicode,hyperfootnotes=false]{hyperref}} 348 | \hypersetup{% 349 | pdfborder = {0 0 0}, 350 | bookmarksdepth = section, 351 | citecolor = DarkGreen, 352 | linkcolor = DarkBlue, 353 | urlcolor = DarkGreen, 354 | }% 355 | } 356 | 357 | %%% 358 | %% Load the `hyperref' package. 359 | 360 | \ifthenelse{\boolean{@tufte@loadhyper}}{% 361 | \TufteLoadHyperref% 362 | }{% hyperfootnotes override our modifications to the \footnote* and \@footnote* commands. 363 | \PassOptionsToPackage{hyperfootnotes=false}{hyperref} 364 | } 365 | 366 | %% 367 | % Set the font sizes and baselines to match Tufte's books 368 | \renewcommand\normalsize{% 369 | \@setfontsize\normalsize\@xpt{14}% 370 | \abovedisplayskip 10\p@ \@plus2\p@ \@minus5\p@ 371 | \abovedisplayshortskip \z@ \@plus3\p@ 372 | \belowdisplayshortskip 6\p@ \@plus3\p@ \@minus3\p@ 373 | \belowdisplayskip \abovedisplayskip 374 | \let\@listi\@listI} 375 | \normalbaselineskip=14pt 376 | \normalsize 377 | \renewcommand\small{% 378 | \@setfontsize\small\@ixpt{12}% 379 | \abovedisplayskip 8.5\p@ \@plus3\p@ \@minus4\p@ 380 | \abovedisplayshortskip \z@ \@plus2\p@ 381 | \belowdisplayshortskip 4\p@ \@plus2\p@ \@minus2\p@ 382 | \def\@listi{\leftmargin\leftmargini 383 | \topsep 4\p@ \@plus2\p@ \@minus2\p@ 384 | \parsep 2\p@ \@plus\p@ \@minus\p@ 385 | \itemsep \parsep}% 386 | \belowdisplayskip \abovedisplayskip 387 | } 388 | \renewcommand\footnotesize{% 389 | \@setfontsize\footnotesize\@viiipt{10}% 390 | \abovedisplayskip 6\p@ \@plus2\p@ \@minus4\p@ 391 | \abovedisplayshortskip \z@ \@plus\p@ 392 | \belowdisplayshortskip 3\p@ \@plus\p@ \@minus2\p@ 393 | \def\@listi{\leftmargin\leftmargini 394 | \topsep 3\p@ \@plus\p@ \@minus\p@ 395 | \parsep 2\p@ \@plus\p@ \@minus\p@ 396 | \itemsep \parsep}% 397 | \belowdisplayskip \abovedisplayskip 398 | } 399 | \renewcommand\scriptsize{\@setfontsize\scriptsize\@viipt\@viiipt} 400 | \renewcommand\tiny{\@setfontsize\tiny\@vpt\@vipt} 401 | \renewcommand\large{\@setfontsize\large\@xipt{15}} 402 | \renewcommand\Large{\@setfontsize\Large\@xiipt{16}} 403 | \renewcommand\LARGE{\@setfontsize\LARGE\@xivpt{18}} 404 | \renewcommand\huge{\@setfontsize\huge\@xxpt{30}} 405 | \renewcommand\Huge{\@setfontsize\Huge{24}{36}} 406 | 407 | \setlength\leftmargini {1pc} 408 | \setlength\leftmarginii {1pc} 409 | \setlength\leftmarginiii {1pc} 410 | \setlength\leftmarginiv {1pc} 411 | \setlength\leftmarginv {1pc} 412 | \setlength\leftmarginvi {1pc} 413 | \setlength\labelsep {.5pc} 414 | \setlength\labelwidth {\leftmargini} 415 | \addtolength\labelwidth{-\labelsep} 416 | 417 | %% 418 | % \RaggedRight allows hyphenation 419 | 420 | \setlength{\parindent}{1.0pc}% 421 | \setlength{\parskip}{0pt}% 422 | \RequirePackage{ragged2e} 423 | \setlength{\RaggedRightRightskip}{\z@ plus 0.08\hsize} 424 | 425 | % Paragraph indentation and separation for normal text 426 | \newcommand{\@tufte@reset@par}{% 427 | \setlength{\RaggedRightParindent}{1.0pc}% 428 | \setlength{\JustifyingParindent}{1.0pc}% 429 | \setlength{\parindent}{1pc}% 430 | \setlength{\parskip}{0pt}% 431 | } 432 | \@tufte@reset@par 433 | 434 | % Paragraph indentation and separation for marginal text 435 | \newcommand{\@tufte@margin@par}{% 436 | \setlength{\RaggedRightParindent}{0.5pc}% 437 | \setlength{\JustifyingParindent}{0.5pc}% 438 | \setlength{\parindent}{0.5pc}% 439 | \setlength{\parskip}{0pt}% 440 | } 441 | 442 | 443 | %% 444 | % Set page layout geometry 445 | 446 | \RequirePackage[letterpaper,left=1in,top=1in,headsep=2\baselineskip,textwidth=26pc,marginparsep=2pc,marginparwidth=12pc,textheight=44\baselineskip,headheight=\baselineskip]{geometry} 447 | 448 | \ifthenelse{\boolean{@tufte@afourpaper}} 449 | {\geometry{a4paper,left=24.8mm,top=27.4mm,headsep=2\baselineskip,textwidth=107mm,marginparsep=8.2mm,marginparwidth=49.4mm,textheight=49\baselineskip,headheight=\baselineskip}} 450 | {} 451 | 452 | \ifthenelse{\boolean{@tufte@bfivepaper}} 453 | {\geometry{paperwidth=176mm,paperheight=250mm,left=14.66mm,top=13.88mm,textwidth=102.66mm,marginparsep=7.33mm,marginparwidth=36.66mm,textheight=38\baselineskip,includehead}} 454 | {} 455 | 456 | \ifthenelse{\boolean{@tufte@symmetric}} 457 | {} 458 | {\geometry{asymmetric}}% forces internal LaTeX `twoside' 459 | 460 | 461 | %% 462 | % Separation marginpars by a line's worth of space. 463 | 464 | \setlength\marginparpush{10pt} 465 | 466 | %% 467 | % Font for margin items 468 | 469 | \ifthenelse{\boolean{@tufte@sfsidenotes}} 470 | {\newcommand{\@tufte@marginfont}{\normalfont\footnotesize\sffamily}} 471 | {\newcommand{\@tufte@marginfont}{\normalfont\footnotesize}} 472 | 473 | \newcommand*{\@tufte@sidenote@font}{\@tufte@marginfont} 474 | \newcommand*{\@tufte@caption@font}{\@tufte@marginfont} 475 | \newcommand*{\@tufte@marginnote@font}{\@tufte@marginfont} 476 | \newcommand*{\@tufte@citation@font}{\@tufte@marginfont} 477 | 478 | \newcommand*{\setsidenotefont}[1]{\renewcommand*{\@tufte@sidenote@font}{#1}} 479 | \newcommand*{\setcaptionfont}[1]{\renewcommand*{\@tufte@caption@font}{#1}} 480 | \newcommand*{\setmarginnotefont}[1]{\renewcommand*{\@tufte@marginnote@font}{#1}} 481 | \newcommand*{\setcitationfont}[1]{\renewcommand*{\@tufte@citation@font}{#1}} 482 | 483 | %% 484 | % Set the justification baesed on the `justified' class option 485 | 486 | \newcommand{\@tufte@justification}{% 487 | \ifthenelse{\boolean{@tufte@justified}}% 488 | {\justifying}% 489 | {\RaggedRight}% 490 | } 491 | 492 | %% 493 | % Turn off section numbering 494 | 495 | \setcounter{secnumdepth}{-1} 496 | 497 | %% 498 | % Tighten up space between displays (e.g., a figure or table) and make symmetric 499 | 500 | \setlength\abovedisplayskip{6pt plus 2pt minus 4pt} 501 | \setlength\belowdisplayskip{6pt plus 2pt minus 4pt} 502 | 503 | %% 504 | % To implement full-width display environments 505 | 506 | \newboolean{@tufte@changepage} 507 | \IfFileExists{changepage.sty}{% 508 | \@tufte@debug@info@noline{Found changepage.sty} 509 | \RequirePackage[strict]{changepage} 510 | \setboolean{@tufte@changepage}{true} 511 | }{% 512 | \@tufte@debug@info@noline{Found chngpage.sty} 513 | \RequirePackage[strict]{chngpage} 514 | \setboolean{@tufte@changepage}{false} 515 | } 516 | 517 | % Write our own aliases for the \checkoddpage and \ifoddpage or \ifcpoddpage commands 518 | \newboolean{@tufte@odd@page} 519 | \setboolean{@tufte@odd@page}{true} 520 | \newcommand*{\@tufte@checkoddpage}{% 521 | \checkoddpage% 522 | \ifthenelse{\boolean{@tufte@changepage}}{% 523 | \ifoddpage% 524 | \setboolean{@tufte@odd@page}{true}% 525 | \else% 526 | \setboolean{@tufte@odd@page}{false}% 527 | \fi% 528 | }{% 529 | \ifcpoddpage% 530 | \setboolean{@tufte@odd@page}{true}% 531 | \else% 532 | \setboolean{@tufte@odd@page}{false}% 533 | \fi% 534 | }% 535 | } 536 | 537 | %% 538 | % Compute lengths used for full-width displays 539 | 540 | \newlength{\@tufte@overhang}% used by the fullwidth environment and the running heads 541 | \newlength{\@tufte@fullwidth} 542 | \newlength{\@tufte@caption@fill} 543 | 544 | \newcommand{\TufteRecalculate}{% 545 | \setlength{\@tufte@overhang}{\marginparwidth} 546 | \addtolength{\@tufte@overhang}{\marginparsep} 547 | 548 | \setlength{\@tufte@fullwidth}{\textwidth} 549 | \addtolength{\@tufte@fullwidth}{\marginparsep} 550 | \addtolength{\@tufte@fullwidth}{\marginparwidth} 551 | 552 | \setlength{\@tufte@caption@fill}{\textwidth} 553 | \addtolength{\@tufte@caption@fill}{\marginparsep} 554 | } 555 | 556 | \AtBeginDocument{\TufteRecalculate} 557 | 558 | %% 559 | % Modified \title, \author, and \date commands. These store the 560 | % (footnote-less) values in \plaintitle, \plainauthor, and \thedate, respectively. 561 | 562 | \newcommand{\plaintitle}{}% plain-text-only title 563 | \newcommand{\plainauthor}{}% plain-text-only author 564 | \newcommand{\plainpublisher}{}% plain-text-only publisher 565 | 566 | \newcommand{\thanklesstitle}{}% full title text minus \thanks{} 567 | \newcommand{\thanklessauthor}{}% full author text minus \thanks{} 568 | \newcommand{\thanklesspublisher}{}% full publisher minus \thanks{} 569 | 570 | \newcommand{\@publisher}{}% full publisher with \thanks{} 571 | \newcommand{\thedate}{\today} 572 | 573 | % TODO Fix it so that \thanks is not spaced out (with `soul') and can be 574 | % used in \maketitle when the `sfsidenotes' option is provided. 575 | \renewcommand{\thanks}[1]{\NoCaseChange{\footnote{#1}}} 576 | 577 | \renewcommand{\title}[2][]{% 578 | \gdef\@title{#2}% 579 | \begingroup% 580 | % TODO store contents of \thanks command 581 | \renewcommand{\thanks}[1]{}% swallow \thanks contents 582 | \protected@xdef\thanklesstitle{#2}% 583 | \endgroup% 584 | \ifthenelse{\isempty{#1}}% 585 | {\renewcommand{\plaintitle}{\thanklesstitle}}% use thankless title 586 | {\renewcommand{\plaintitle}{#1}}% use provided plain-text title 587 | \ifthenelse{\isundefined{\hypersetup}}% 588 | {}% hyperref is not loaded; do nothing 589 | {\hypersetup{pdftitle={\plaintitle}}}% set the PDF metadata title 590 | } 591 | 592 | \let\@author\@empty% suppress default latex.ltx ``no author'' warning 593 | \renewcommand{\author}[2][]{% 594 | \ifthenelse{\isempty{#2}}{}{\gdef\@author{#2}}% 595 | \begingroup% 596 | % TODO store contents of \thanks command 597 | \renewcommand{\thanks}[1]{}% swallow \thanks contents 598 | \protected@xdef\thanklessauthor{#2}% 599 | \endgroup% 600 | \ifthenelse{\isempty{#1}}% 601 | {\renewcommand{\plainauthor}{\thanklessauthor}}% use thankless author 602 | {\renewcommand{\plainauthor}{#1}}% use provided plain-text author 603 | \ifthenelse{\isundefined{\hypersetup}}% 604 | {}% hyperref is not loaded; do nothing 605 | {\hypersetup{pdfauthor={\plainauthor}}}% set the PDF metadata author 606 | } 607 | 608 | \renewcommand{\date}[1]{% 609 | \gdef\@date{#1}% 610 | \begingroup% 611 | % TODO store contents of \thanks command 612 | \renewcommand{\thanks}[1]{}% swallow \thanks contents 613 | \protected@xdef\thedate{#1}% 614 | \endgroup% 615 | } 616 | 617 | %% 618 | % Provides a \publisher command to set the publisher 619 | 620 | \newcommand{\publisher}[2][]{% 621 | \gdef\@publisher{#2}% 622 | \begingroup% 623 | \renewcommand{\thanks}[1]{}% swallow \thanks contents 624 | \protected@xdef\thanklesspublisher{#2}% 625 | \endgroup% 626 | \ifthenelse{\isempty{#1}} 627 | {\renewcommand{\plainpublisher}{\thanklesspublisher}}% use thankless publisher 628 | {\renewcommand{\plainpublisher}{#1}}% use provided plain-text publisher 629 | } 630 | 631 | % TODO: Test \hypersetup{pdfauthor,pdftitle} with DVI and XeTeX 632 | 633 | %% 634 | % Require paralist package for tighter lists 635 | 636 | \RequirePackage{paralist} 637 | 638 | % Add rightmargin to compactenum 639 | 640 | \def\@compactenum@{% 641 | \expandafter\list\csname label\@enumctr\endcsname{% 642 | \usecounter{\@enumctr}% 643 | \rightmargin=2em% added this 644 | \parsep\plparsep 645 | \itemsep\plitemsep 646 | \topsep\pltopsep 647 | \partopsep\plpartopsep 648 | \def\makelabel##1{\hss\llap{##1}}}} 649 | 650 | %% 651 | % Improved letterspacing of small caps and all-caps text. 652 | % 653 | % First, try to use the `microtype' package, if it's available. 654 | % Failing that, try to use the `soul' package, if it's available. 655 | % Failing that, well, I give up. 656 | 657 | \DeclareTextFontCommand{\textsmallcaps}{\scshape} 658 | 659 | \RequirePackage{textcase} % provides \MakeTextUppercase and \MakeTextLowercase 660 | \def\allcapsspacing{\@tufte@warning{Proper spacing of ALL-CAPS letters has not been set up.}} 661 | \def\smallcapsspacing{\@tufte@warning{Proper spacing of small-caps letters has not been set up.}} 662 | \newcommand{\allcaps}[1]{\allcapsspacing{\MakeTextUppercase{#1}}} 663 | \newcommand{\smallcaps}[1]{\smallcapsspacing{\MakeTextLowercase{#1}}} 664 | 665 | % If we're using pdfLaTeX v1.40+, use the letterspace package. 666 | % If we're using pdfLaTex < v1.40, use the soul package. 667 | % If we're using XeLaTeX, use XeLaTeX letterspacing options. 668 | % Otherwise fall back on the soul package. 669 | 670 | \ifthenelse{\boolean{@tufte@pdf}} 671 | {\@tufte@debug@info@noline{ifpdf = true}} 672 | {\@tufte@debug@info@noline{ifpdf = false}} 673 | 674 | \ifthenelse{\boolean{@tufte@xetex}} 675 | {\@tufte@debug@info@noline{ifxetex = true}} 676 | {\@tufte@debug@info@noline{ifxetex = false}} 677 | 678 | % Check pdfLaTeX version 679 | \def\@tufte@pdftexversion{0} 680 | \ifx\normalpdftexversion\@undefined \else 681 | \let\pdftexversion \normalpdftexversion 682 | \let\pdftexrevision\normalpdftexrevision 683 | \let\pdfoutput \normalpdfoutput 684 | \fi 685 | \ifx\pdftexversion\@undefined \else 686 | \ifx\pdftexversion\relax \else 687 | \def\@tufte@pdftexversion{6} 688 | \ifnum\pdftexversion < 140 689 | \def\@tufte@pdftexversion{5} 690 | \fi 691 | \fi 692 | \fi 693 | 694 | \newboolean{@tufte@letterspace@pkg@prereqs} 695 | \setboolean{@tufte@letterspace@pkg@prereqs}{true} 696 | \ifnum\@tufte@pdftexversion<6 697 | \setboolean{@tufte@letterspace@pkg@prereqs}{false} 698 | \fi 699 | 700 | 701 | \newcommand{\@tufte@letterspacing@soul}{% 702 | \RequirePackage{soul}% 703 | \sodef\allcapsspacing{}{0.15em}{0.65em}{0.6em}% 704 | \sodef\smallcapsspacing{}{0.075em}{0.5em}{0.6em}% 705 | \sodef\sotextsc{\scshape}{0.075em}{0.5em}{0.6em}% 706 | \renewcommand{\allcaps}[1]{\allcapsspacing{\MakeTextUppercase{##1}}}% 707 | \renewcommand{\smallcaps}[1]{\smallcapsspacing{\scshape\MakeTextLowercase{##1}}}% 708 | \renewcommand{\textsc}[1]{\sotextsc{##1}}% 709 | } 710 | 711 | \newcommand{\@tufte@letterspacing@letterspace}{% 712 | \@tufte@debug@info@noline{Modern version of pdfTeX detected. Using `letterspace' package}% 713 | \RequirePackage{letterspace}% 714 | % Set up letterspacing (using microtype package) -- requires pdfTeX v1.40+ 715 | \renewcommand{\allcapsspacing}[1]{\textls[200]{##1}}% 716 | \renewcommand{\smallcapsspacing}[1]{\textls[50]{##1}}% 717 | \renewcommand{\allcaps}[1]{\allcapsspacing{\MakeTextUppercase{##1}}}% 718 | \renewcommand{\smallcaps}[1]{\smallcapsspacing{\scshape\MakeTextLowercase{##1}}}% 719 | \renewcommand{\textsc}[1]{\smallcapsspacing{\textsmallcaps{##1}}}% 720 | } 721 | 722 | \ifthenelse{\boolean{@tufte@letterspace}}{% 723 | \ifthenelse{\boolean{@tufte@pdf}\AND\boolean{@tufte@letterspace@pkg@prereqs}\AND\NOT\boolean{@tufte@xetex}}{% 724 | % load letterspace pkg 725 | \IfFileExists{letterspace.sty}{% 726 | \@tufte@letterspacing@letterspace 727 | }{}% 728 | }{}% 729 | % load soul pkg 730 | \@ifpackageloaded{letterspace}{}{% 731 | \IfFileExists{soul.sty}{% 732 | \@tufte@letterspacing@soul 733 | }{% 734 | \@tufte@warning@noline{Couldn't locate `soul' package}% 735 | }% soul not installed... giving up. 736 | }% 737 | }{} 738 | 739 | %\ifthenelse{\boolean{@tufte@letterspace}}{% 740 | %\ifthenelse{\boolean{pdf}}{% 741 | %\ifthenelse{\NOT\boolean{@tufte@letterspace@pkg@prereqs}}{% 742 | %% pdfLaTeX version is too old or not using pdfLaTeX 743 | %\ifthenelse{\boolean{@tufte@xetex}}{% 744 | %% TODO use xetex letterspacing 745 | %\@tufte@debug@info@noline{XeTeX detected. Reverting to `soul' package for letterspacing}% 746 | %\@tufte@loadsoul% 747 | %}{% 748 | %% use `soul' package for letterspacing 749 | %\@tufte@debug@info@noline{Old version of pdfTeX detected. Reverting to `soul' package for letterspacing}% 750 | %\@tufte@loadsoul% 751 | %} 752 | %}{% 753 | %\IfFileExists{letterspace.sty}{% 754 | %\@tufte@debug@info@noline{Modern version of pdfTeX detected. Using `letterspace' package} 755 | %\RequirePackage{letterspace} 756 | %% Set up letterspacing (using microtype package) -- requires pdfTeX v1.40+ 757 | %\renewcommand{\allcapsspacing}[1]{\textls[200]{##1}} 758 | %\renewcommand{\smallcapsspacing}[1]{\textls[50]{##1}} 759 | %\renewcommand{\allcaps}[1]{\textls[200]{\MakeTextUppercase{##1}}} 760 | %\renewcommand{\smallcaps}[1]{\smallcapsspacing{\MakeTextLowercase{##1}}} 761 | %\renewcommand{\textsc}[1]{\smallcapsspacing{\textsmallcaps{##1}}} 762 | %}{% microtype failed, check for soul 763 | %\@tufte@debug@info@noline{Modern version of pdfTeX detected, but `letterspace' package not installed. Reverting to `soul' package for letterspacing} 764 | %\@tufte@loadsoul 765 | %}% 766 | %}% 767 | %}{% 768 | %\@tufte@debug@info@noline{Plain LaTeX detected. Using `soul' package for letterspacing} 769 | %\@tufte@loadsoul 770 | %} 771 | %}{% 772 | %% we're not to load letterspacing, so do nothing 773 | %} 774 | 775 | 776 | %% 777 | % An environment for paragraph-style section 778 | 779 | \providecommand\newthought[1]{% 780 | \tuftebreak 781 | \noindent\textsc{#1}% 782 | } 783 | 784 | %% 785 | % Redefine the display environments (quote, quotation, etc.) 786 | 787 | \renewenvironment{verse} 788 | {\let\\\@centercr 789 | \list{}{\itemsep \z@ 790 | \itemindent -1pc% 791 | \listparindent\itemindent 792 | \rightmargin \leftmargin 793 | \advance\leftmargin 1pc}% 794 | \small% 795 | \item\relax} 796 | {\endlist} 797 | \renewenvironment{quotation} 798 | {\list{}{\listparindent 1pc% 799 | \itemindent \listparindent 800 | \rightmargin \leftmargin 801 | \parsep \z@ \@plus\p@}% 802 | \small% 803 | \item\relax\noindent\ignorespaces} 804 | {\endlist} 805 | \renewenvironment{quote} 806 | {\list{}{\rightmargin\leftmargin}% 807 | \small% 808 | \item\relax} 809 | {\endlist} 810 | 811 | %% 812 | % Italicize description run-in headings (instead of the default bold) 813 | 814 | \renewcommand*\descriptionlabel[1]{\hspace\labelsep\normalfont\em #1} 815 | 816 | 817 | %% 818 | % Used for doublespacing, and other linespacing 819 | 820 | \RequirePackage{setspace} 821 | 822 | %% 823 | % Color 824 | \RequirePackage[usenames,dvipsnames,svgnames]{xcolor}% load before bidi 825 | 826 | %% 827 | % Load the bidi package if instructed to do so. This package must be loaded 828 | % prior to our redefining the \footnote and \cite commands. 829 | 830 | \ifthenelse{\boolean{@tufte@loadbidi}}{% 831 | \AtBeginDocument{% 832 | \RequirePackage{bidi} 833 | \@tufte@pkghook@post@bidi% 834 | }% 835 | }{} 836 | 837 | 838 | %% 839 | % A function that removes leading and trailling spaces from the supplied macro. 840 | % Based on code written by Michael Downes (See ``Around the Bend'', #15.) 841 | % Executing \@tufte@trim@spaces\xyzzy will result in the contents of \xyzzy 842 | % being trimmed of leading and trailing white space. 843 | 844 | \catcode`\Q=3 845 | \def\@tufte@trim@spaces#1{% 846 | % Use grouping to emulate a multi-token afterassignment queue 847 | \begingroup% 848 | % Put `\toks 0 {' into the afterassignment queue 849 | \aftergroup\toks\aftergroup0\aftergroup{% 850 | % Apply \trimb to the replacement text of #1, adding a leading 851 | % \noexpand to prevent brace stripping and to serve another purpose 852 | % later. 853 | \expandafter\@tufte@trim@b\expandafter\noexpand#1Q Q}% 854 | % Transfer the trimmed text back into #1. 855 | \edef#1{\the\toks0}% 856 | } 857 | 858 | % \trimb removes a trailing space if present, then calls \@tufte@trim@c to 859 | % clean up any leftover bizarre Qs, and trim a leading space. In 860 | % order for \trimc to work properly we need to put back a Q first. 861 | \def\@tufte@trim@b#1 Q{\@tufte@trim@c#1Q} 862 | 863 | % Execute \vfuzz assignment to remove leading space; the \noexpand 864 | % will now prevent unwanted expansion of a macro or other expandable 865 | % token at the beginning of the trimmed text. The \endgroup will feed 866 | % in the \aftergroup tokens after the \vfuzz assignment is completed. 867 | \def\@tufte@trim@c#1Q#2{\afterassignment\endgroup \vfuzz\the\vfuzz#1} 868 | \catcode`\Q=11 869 | 870 | %% 871 | % Citations should go in the margin as sidenotes 872 | 873 | \ifthenelse{\boolean{@tufte@loadnatbib}}{% 874 | \RequirePackage{natbib}% 875 | \RequirePackage{bibentry}% allows bibitems to be typeset outside thebibliography environment 876 | % Redefine the \BR@b@bibitem command to fix a bug with bibentry+chicago style 877 | \renewcommand\BR@b@bibitem[2][]{% 878 | \ifthenelse{\isempty{#1}}% 879 | {\BR@bibitem{#2}}% 880 | {\BR@bibitem[#1]{#2}}% 881 | \BR@c@bibitem{#2}% 882 | }% 883 | \nobibliography*% pre-loads the bibliography keys 884 | \providecommand{\doi}[1]{\textsc{doi:} #1}% pre-defining this so it may be used before the \bibliography command it issued 885 | }{} 886 | 887 | %% 888 | % Normal \cite behavior 889 | \newcounter{@tufte@num@bibkeys}% 890 | \newcommand{\@tufte@normal@cite}[2][0pt]{% 891 | % Snag the last bibentry in the list for later comparison 892 | \let\@temp@last@bibkey\@empty% 893 | \@for\@temp@bibkey:=#2\do{\let\@temp@last@bibkey\@temp@bibkey}% 894 | \sidenote[][#1]{% 895 | % Loop through all the bibentries, separating them with semicolons and spaces 896 | \normalsize\normalfont\@tufte@citation@font% 897 | \setcounter{@tufte@num@bibkeys}{0}% 898 | \@for\@temp@bibkeyx:=#2\do{% 899 | \ifthenelse{\equal{\@temp@last@bibkey}{\@temp@bibkeyx}}% 900 | {\ifthenelse{\equal{\value{@tufte@num@bibkeys}}{0}}{}{and\ }% 901 | \@tufte@trim@spaces\@temp@bibkeyx% trim spaces around bibkey 902 | \bibentry{\@temp@bibkeyx}}% 903 | {\@tufte@trim@spaces\@temp@bibkeyx% trim spaces around bibkey 904 | \bibentry{\@temp@bibkeyx};\ }% 905 | \stepcounter{@tufte@num@bibkeys}% 906 | }% 907 | }% 908 | } 909 | 910 | 911 | %% 912 | % Macros for holding the list of cite keys until after the \sidenote 913 | 914 | \gdef\@tufte@citations{}% list of cite keys 915 | \newcommand\@tufte@add@citation[1]{\relax% adds a new bibkey to the list of cite keys 916 | \ifx\@tufte@citations\@empty\else 917 | \g@addto@macro\@tufte@citations{,}% separate by commas 918 | \fi 919 | \g@addto@macro\@tufte@citations{#1} 920 | } 921 | 922 | \newcommand{\@tufte@print@citations}[1][0pt]{% puts the citations in a margin note 923 | % Snag the last bibentry in the list for later comparison 924 | \let\@temp@last@bibkey\@empty% 925 | \@for\@temp@bibkey:=\@tufte@citations\do{\let\@temp@last@bibkey\@temp@bibkey}% 926 | \marginpar{% 927 | \hbox{}\vspace*{#1}% 928 | \@tufte@citation@font% 929 | \@tufte@citation@justification% 930 | \@tufte@margin@par% use parindent and parskip settings for marginal text 931 | \vspace*{-1\baselineskip}% 932 | % Loop through all the bibentries, separating them with semicolons and spaces 933 | \setcounter{@tufte@num@bibkeys}{0}% 934 | \@for\@temp@bibkeyx:=\@tufte@citations\do{% 935 | \ifthenelse{\equal{\@temp@last@bibkey}{\@temp@bibkeyx}}% 936 | {\ifthenelse{\equal{\value{@tufte@num@bibkeys}}{0}}{}{and\ }% 937 | \@tufte@trim@spaces\@temp@bibkeyx% trim spaces around bibkey 938 | \bibentry{\@temp@bibkeyx}}% 939 | {\@tufte@trim@spaces\@temp@bibkeyx% trim spaces around bibkey 940 | \bibentry{\@temp@bibkeyx};\ }% 941 | \stepcounter{@tufte@num@bibkeys}% 942 | }% 943 | }% 944 | } 945 | 946 | %% 947 | % \cite behavior when executed within a sidenote 948 | 949 | \newcommand{\@tufte@sidenote@citations}{}% contains list of \cites in sidenote 950 | \newcommand{\@tufte@infootnote@cite}[1]{% 951 | \@tufte@add@citation{#1} 952 | } 953 | 954 | %% 955 | % Set the default \cite style. This is set and reset by the \sidenote command. 956 | 957 | \ifthenelse{\boolean{@tufte@loadnatbib}}{% 958 | \let\cite\@tufte@normal@cite 959 | }{} 960 | 961 | %% 962 | % Transform existing \footnotes into \sidenotes 963 | % Sidenote: ``Where God meant footnotes to go.'' ---Tufte 964 | 965 | \RequirePackage{optparams}% for our new sidenote commands -- provides multiple optional arguments for commands 966 | 967 | \providecommand{\footnotelayout}{\@tufte@sidenote@font\@tufte@sidenote@justification} 968 | \renewcommand{\footnotelayout}{\@tufte@sidenote@font\@tufte@sidenote@justification} 969 | 970 | % Override footmisc's definition to set the sidenote marks (numbers) inside the 971 | % sidenote's text block. 972 | \long\def\@makefntext#1{\@textsuperscript{\@tufte@sidenote@font\tiny\@thefnmark}\,\footnotelayout#1} 973 | 974 | % Set the in-text footnote mark in the same typeface as the body text itself. 975 | \def\@makefnmark{\hbox{\@textsuperscript{\normalfont\footnotesize\@thefnmark}}} 976 | 977 | \providecommand*{\multiplefootnotemarker}{3sp} 978 | \providecommand*{\multfootsep}{,} 979 | 980 | \renewcommand{\@footnotemark}{% 981 | \leavevmode% 982 | \ifhmode% 983 | \edef\@x@sf{\the\spacefactor}% 984 | \@tufte@check@multiple@sidenotes% 985 | \nobreak% 986 | \fi% 987 | \@makefnmark% 988 | \ifhmode\spacefactor\@x@sf\fi% 989 | \relax% 990 | } 991 | 992 | \newcommand{\@tufte@check@multiple@sidenotes}{% 993 | \ifdim\lastkern=\multiplefootnotemarker\relax% 994 | \edef\@x@sf{\the\spacefactor}% 995 | \unkern% 996 | \textsuperscript{\multfootsep}% 997 | \spacefactor\@x@sf\relax% 998 | \fi 999 | } 1000 | 1001 | \renewcommand\@footnotetext[2][0pt]{% 1002 | \marginpar{% 1003 | \hbox{}\vspace*{#1}% 1004 | \def\baselinestretch {\setspace@singlespace}% 1005 | \reset@font\footnotesize% 1006 | \@tufte@margin@par% use parindent and parskip settings for marginal text 1007 | \vspace*{-1\baselineskip}\noindent% 1008 | \protected@edef\@currentlabel{% 1009 | \csname p@footnote\endcsname\@thefnmark% 1010 | }% 1011 | \color@begingroup% 1012 | \@makefntext{% 1013 | \ignorespaces#2% 1014 | }% 1015 | \color@endgroup% 1016 | }% 1017 | }% 1018 | 1019 | % Ensure this is run after the bidi package has been loaded 1020 | \def\@tufte@pkghook@post@bidi{}% 1021 | \g@addto@macro{\@tufte@pkghook@post@bidi}{% 1022 | \renewcommand\@footnotetext[2][0pt]{% 1023 | \marginpar{% 1024 | \hbox{}\vspace*{#1}% 1025 | \def\baselinestretch {\setspace@singlespace}% 1026 | \if@rl@footnote\@rltrue\else\@rlfalse\fi% 1027 | \reset@font\footnotesize% 1028 | \@tufte@margin@par% use parindent and parskip settings for marginal text 1029 | \vspace*{-1\baselineskip}\noindent% 1030 | \protected@edef\@currentlabel{% 1031 | \csname p@footnote\endcsname\@thefnmark% 1032 | }% 1033 | \color@begingroup% 1034 | \@makefntext{% 1035 | \ignorespaces#2% 1036 | }% 1037 | \color@endgroup% 1038 | }% 1039 | }% 1040 | }% 1041 | 1042 | % 1043 | % Define \sidenote command. Can handle \cite. 1044 | 1045 | \newlength{\@tufte@sidenote@vertical@offset} 1046 | \setlength{\@tufte@sidenote@vertical@offset}{0pt} 1047 | 1048 | % #1 = footnote num, #2 = vertical offset, #3 = footnote text 1049 | \long\def\@tufte@sidenote[#1][#2]#3{% 1050 | \ifthenelse{\boolean{@tufte@loadnatbib}}{% 1051 | \let\cite\@tufte@infootnote@cite% use the in-sidenote \cite command 1052 | }{}% 1053 | \gdef\@tufte@citations{}% clear out any old citations 1054 | \ifthenelse{\NOT\isempty{#2}}{% 1055 | \gsetlength{\@tufte@sidenote@vertical@offset}{#2}% 1056 | }{% 1057 | \gsetlength{\@tufte@sidenote@vertical@offset}{0pt}% 1058 | }% 1059 | \ifthenelse{\isempty{#1}}{% 1060 | % no specific footnote number provided 1061 | \stepcounter\@mpfn% 1062 | \protected@xdef\@thefnmark{\thempfn}% 1063 | \@footnotemark\@footnotetext[\@tufte@sidenote@vertical@offset]{#3}% 1064 | }{% 1065 | % specific footnote number provided 1066 | \begingroup% 1067 | \csname c@\@mpfn\endcsname #1\relax% 1068 | \unrestored@protected@xdef\@thefnmark{\thempfn}% 1069 | \endgroup% 1070 | \@footnotemark\@footnotetext[\@tufte@sidenote@vertical@offset]{#3}% 1071 | }% 1072 | \@tufte@print@citations% print any citations 1073 | \ifthenelse{\boolean{@tufte@loadnatbib}}{% 1074 | \let\cite\@tufte@normal@cite% go back to using normal in-text \cite command 1075 | }{}% 1076 | \unskip\ignorespaces% remove extra white space 1077 | \kern-\multiplefootnotemarker% remove \kern left behind by sidenote 1078 | \kern\multiplefootnotemarker\relax% add new \kern here to replace the one we yanked 1079 | } 1080 | 1081 | \newcommand{\sidenote}{\optparams{\@tufte@sidenote}{[][0pt]}} 1082 | \renewcommand{\footnote}{\optparams{\@tufte@sidenote}{[][0pt]}} 1083 | 1084 | %% 1085 | % Sidenote without the footnote mark 1086 | 1087 | \newcommand\marginnote[2][0pt]{% 1088 | \ifthenelse{\boolean{@tufte@loadnatbib}}{% 1089 | \let\cite\@tufte@infootnote@cite% use the in-sidenote \cite command 1090 | }{}% 1091 | \gdef\@tufte@citations{}% clear out any old citations 1092 | \marginpar{\hbox{}\vspace*{#1}\@tufte@marginnote@font\@tufte@marginnote@justification\@tufte@margin@par\vspace*{-1\baselineskip}\noindent #2}% 1093 | \@tufte@print@citations% print any citations 1094 | \ifthenelse{\boolean{@tufte@loadnatbib}}{% 1095 | \let\cite\@tufte@normal@cite% go back to using normal in-text \cite command 1096 | }{}% 1097 | } 1098 | 1099 | 1100 | %% 1101 | % The placeins package provides the \FloatBarrier command. This forces 1102 | % LaTeX to place all of the floats before proceeding. We'll use this to 1103 | % keep the float (figure and table) numbers in sequence. 1104 | \RequirePackage{placeins} 1105 | 1106 | %% 1107 | % Margin float environment 1108 | 1109 | \newsavebox{\@tufte@margin@floatbox} 1110 | \newenvironment{@tufte@margin@float}[2][-1.2ex]% 1111 | {\FloatBarrier% process all floats before this point so the figure/table numbers stay in order. 1112 | \begin{lrbox}{\@tufte@margin@floatbox}% 1113 | \begin{minipage}{\marginparwidth}% 1114 | \@tufte@caption@font% 1115 | \def\@captype{#2}% 1116 | \hbox{}\vspace*{#1}% 1117 | \@tufte@caption@justification% 1118 | \@tufte@margin@par% 1119 | \noindent% 1120 | } 1121 | {\end{minipage}% 1122 | \end{lrbox}% 1123 | \marginpar{\usebox{\@tufte@margin@floatbox}}% 1124 | } 1125 | 1126 | 1127 | %% 1128 | % Margin figure environment 1129 | 1130 | \newenvironment{marginfigure}[1][-1.2ex]% 1131 | {\begin{@tufte@margin@float}[#1]{figure}} 1132 | {\end{@tufte@margin@float}} 1133 | 1134 | 1135 | %% 1136 | % Margin table environment 1137 | 1138 | \newenvironment{margintable}[1][-1.2ex]% 1139 | {\begin{@tufte@margin@float}[#1]{table}} 1140 | {\end{@tufte@margin@float}} 1141 | 1142 | 1143 | %% 1144 | % Auto-detects the proper text alignment based on the various class options 1145 | 1146 | \newcommand*{\@tufte@justification@autodetect}{% 1147 | \ifthenelse{\boolean{@tufte@justified}}% 1148 | {\justifying}% 1149 | {\RaggedRight}% 1150 | } 1151 | 1152 | %% 1153 | % Forces the outer edge of the caption to be set ragged. 1154 | % Therefore, on verso pages it's ragged left, and on recto pages it's ragged right. 1155 | 1156 | \newcommand*{\@tufte@justification@caption@outer}{% 1157 | \ifthenelse{\boolean{@tufte@float@recto}}% 1158 | {\RaggedRight}% 1159 | {\RaggedLeft}% 1160 | } 1161 | 1162 | \newcommand*{\@tufte@justification@outer}{% 1163 | \@tufte@checkoddpage% 1164 | \ifthenelse{\boolean{@tufte@odd@page}}% 1165 | {\RaggedRight}% 1166 | {\RaggedLeft}% 1167 | } 1168 | 1169 | 1170 | 1171 | %% 1172 | % A collection of macros to be used with the new Tufte-style float environments. 1173 | % \setfloatalignment forces the caption placement to be treated as top, bottom, etc. 1174 | % \forcerectofloat forces the float to be treated as if it were appearing on a recto page. 1175 | % \forceversofloat does the same, but for verso pages. 1176 | 1177 | \newcommand{\@tufte@float@debug@info}{}% contains debug info generated as the float is processed 1178 | \newcommand{\@tufte@float@debug}[1]{% adds debug info to the queue for output 1179 | \ifthenelse{\equal{\@tufte@float@debug@info}{}}% 1180 | {\def\@tufte@float@debug@info{#1}}% 1181 | {\g@addto@macro\@tufte@float@debug@info{\MessageBreak#1}}% 1182 | } 1183 | 1184 | \newcommand{\floatalignment}{x}% holds the current float alignment (t, b, h, p) 1185 | \newcommand{\setfloatalignment}[1]{\global\def\floatalignment{#1}\@tufte@float@debug{Forcing position: [#1]}}% manually sets the float alignment 1186 | \newboolean{@tufte@float@recto} 1187 | \newcommand{\forcerectofloat}{\gsetboolean{@tufte@float@recto}{true}\@tufte@float@debug{Forcing page: [recto]}} 1188 | \newcommand{\forceversofloat}{\gsetboolean{@tufte@float@recto}{false}\@tufte@float@debug{Forcing page: [verso]}} 1189 | 1190 | % Boxes to temporarily store our float and caption 1191 | \newsavebox{\@tufte@figure@box} 1192 | \newsavebox{\@tufte@caption@box} 1193 | 1194 | % Save original LaTeX float environment 1195 | \let\@tufte@orig@float\@float 1196 | \let\@tufte@orig@endfloat\end@float 1197 | 1198 | % New length for tweaking float captions 1199 | \newlength{\@tufte@caption@vertical@offset} 1200 | \setlength{\@tufte@caption@vertical@offset}{0pt} 1201 | 1202 | % Store the caption and label contents 1203 | \newcommand{\@tufte@stored@shortcaption}{} 1204 | \newcommand{\@tufte@stored@caption}{} 1205 | \newcommand{\@tufte@stored@label}{} 1206 | 1207 | \long\def\@tufte@caption[#1][#2]#3{% 1208 | \ifthenelse{\isempty{#1}}% 1209 | {\gdef\@tufte@stored@shortcaption{#3}}% 1210 | {\gdef\@tufte@stored@shortcaption{#1}}% 1211 | \gsetlength{\@tufte@caption@vertical@offset}{-#2}% we want a positive offset to lower captions 1212 | \gdef\@tufte@stored@caption{#3}% 1213 | } 1214 | 1215 | \newcommand{\@tufte@label}[1]{% 1216 | \gdef\@tufte@stored@label{#1}% 1217 | } 1218 | 1219 | \newcommand{\@tufte@fps}{} 1220 | 1221 | \newboolean{@tufte@float@star} 1222 | \newlength{\@tufte@float@contents@width} 1223 | 1224 | %% 1225 | % Define a float environment to place the captions in the margin space 1226 | 1227 | \newenvironment{@tufte@float}[3][htbp]% 1228 | {% begin @tufte@float 1229 | % Should this float be full-width or just text-width? 1230 | \ifthenelse{\equal{#3}{star}}% 1231 | {\gsetboolean{@tufte@float@star}{true}}% 1232 | {\gsetboolean{@tufte@float@star}{false}}% 1233 | % Check page side (recto/verso) and store detected value -- can be overriden in environment contents 1234 | \@tufte@checkoddpage% 1235 | \ifthenelse{\boolean{@tufte@odd@page}}% 1236 | {\gsetboolean{@tufte@float@recto}{true}\@tufte@float@debug{Detected page: [recto/odd]}}% 1237 | {\gsetboolean{@tufte@float@recto}{false}\@tufte@float@debug{Detected page: [verso/even]}}% 1238 | % If the float placement specifier is 'b' and only 'b', then bottom-align the mini-pages, otherwise top-align them. 1239 | \renewcommand{\@tufte@fps}{#1}% 1240 | \@tufte@float@debug{Allowed positions: [#1]}% 1241 | \ifthenelse{\equal{#1}{b}\OR\equal{#1}{B}}% 1242 | {\renewcommand{\floatalignment}{b}\@tufte@float@debug{Presumed position: [bottom]}}% 1243 | {\renewcommand{\floatalignment}{t}\@tufte@float@debug{Presumed position: [top]}}% 1244 | % Capture the contents of the \caption and \label commands to use later 1245 | \global\let\@tufte@orig@caption\caption% 1246 | \global\let\@tufte@orig@label\label% 1247 | \renewcommand{\caption}{\optparams{\@tufte@caption}{[][0pt]}}% 1248 | \renewcommand{\label}[1]{\@tufte@label{##1}}% 1249 | % Handle subfigure package compatibility 1250 | \ifthenelse{\boolean{@tufte@packages@subfigure}}{% 1251 | % don't move the label while inside a \subfigure or \subtable command 1252 | \global\let\label\@tufte@orig@label% 1253 | }{}% subfigure package is not loaded 1254 | \@tufte@orig@float{#2}[#1]% 1255 | \ifthenelse{\boolean{@tufte@float@star}}% 1256 | {\setlength{\@tufte@float@contents@width}{\@tufte@fullwidth}}% 1257 | {\setlength{\@tufte@float@contents@width}{\textwidth}}% 1258 | \begin{lrbox}{\@tufte@figure@box}% 1259 | \begin{minipage}[\floatalignment]{\@tufte@float@contents@width}\hbox{}% 1260 | }{% end @tufte@float 1261 | \par\hbox{}\vspace{-\baselineskip}\ifthenelse{\prevdepth>0}{\vspace{-\prevdepth}}{}% align baselines of boxes 1262 | \end{minipage}% 1263 | \end{lrbox}% 1264 | % build the caption box 1265 | \begin{lrbox}{\@tufte@caption@box}% 1266 | \begin{minipage}[\floatalignment]{\marginparwidth}\hbox{}% 1267 | \ifthenelse{\NOT\equal{\@tufte@stored@caption}{}}{\@tufte@orig@caption[\@tufte@stored@shortcaption]{\@tufte@stored@caption}}{}% 1268 | \ifthenelse{\NOT\equal{\@tufte@stored@label}{}}{\@tufte@orig@label{\@tufte@stored@label}}{}% 1269 | \par\vspace{-\prevdepth}%% TODO: DOUBLE-CHECK FOR SAFETY 1270 | \end{minipage}% 1271 | \end{lrbox}% 1272 | % now typeset the stored boxes 1273 | \begin{fullwidth}% 1274 | \begin{minipage}[\floatalignment]{\linewidth}% 1275 | \ifthenelse{\boolean{@tufte@float@star}}% 1276 | {\@tufte@float@fullwidth[\@tufte@caption@vertical@offset]{\@tufte@figure@box}{\@tufte@caption@box}}% 1277 | {\@tufte@float@textwidth[\@tufte@caption@vertical@offset]{\@tufte@figure@box}{\@tufte@caption@box}}% 1278 | \end{minipage}% 1279 | \end{fullwidth}% 1280 | \@tufte@orig@endfloat% end original LaTeX float environment 1281 | % output debug info 1282 | \ifthenelse{\boolean{@tufte@debug}}{% 1283 | \typeout{^^J^^J----------- Tufte-LaTeX float information ----------}% 1284 | \ifthenelse{\equal{\@tufte@stored@label}{}}% 1285 | {\typeout{Warning: Float unlabeled!}}% 1286 | {\typeout{Float label: [\@tufte@stored@label]}}% 1287 | \typeout{Page number: [\thepage]}% 1288 | \def\MessageBreak{^^J}% 1289 | \typeout{\@tufte@float@debug@info}% 1290 | \ifthenelse{\boolean{@tufte@symmetric}}% 1291 | {\typeout{Symmetric: [true]}}% 1292 | {\typeout{Symmetric: [false]}}% 1293 | \typeout{----------------------------------------------------^^J^^J}% 1294 | }{}% 1295 | % reset commands and temp boxes and captions 1296 | \gdef\@tufte@float@debug@info{}% 1297 | \let\caption\@tufte@orig@caption% 1298 | \let\label\@tufte@orig@label% 1299 | \begin{lrbox}{\@tufte@figure@box}\hbox{}\end{lrbox}% 1300 | \begin{lrbox}{\@tufte@caption@box}\hbox{}\end{lrbox}% 1301 | \gdef\@tufte@stored@shortcaption{}% 1302 | \gdef\@tufte@stored@caption{}% 1303 | \gdef\@tufte@stored@label{}% 1304 | \gsetlength{\@tufte@caption@vertical@offset}{0pt}% reset caption offset 1305 | } 1306 | 1307 | \newcommand{\@tufte@float@textwidth}[3][0pt]{% 1308 | \ifthenelse{\NOT\boolean{@tufte@symmetric}\OR\boolean{@tufte@float@recto}}{% 1309 | % asymmetric or page is odd, so caption is on the right 1310 | \hbox{% 1311 | \usebox{#2}% 1312 | \hspace{\marginparsep}% 1313 | \smash{\raisebox{#1}{\usebox{#3}}}% 1314 | }% 1315 | \@tufte@float@debug{Caption position: [right]}% 1316 | }{% symmetric pages and page is even, so caption is on the left 1317 | \hbox{% 1318 | \smash{\raisebox{#1}{\usebox{#3}}}% 1319 | \hspace{\marginparsep}% 1320 | \usebox{#2}% 1321 | }% 1322 | \@tufte@float@debug{Caption position: [left]}% 1323 | }% 1324 | } 1325 | 1326 | \newcommand{\@tufte@float@fullwidth}[3][0pt]{% 1327 | \ifthenelse{\equal{\floatalignment}{b}}% 1328 | {% place caption above figure 1329 | \ifthenelse{\NOT\boolean{@tufte@symmetric}\OR\boolean{@tufte@float@recto}}% 1330 | {\hfill\smash{\raisebox{#1}{\usebox{#3}}}\par\usebox{#2}\@tufte@float@debug{Caption position: [above right]}}% caption on the right 1331 | {\smash{\raisebox{#1}{\usebox{#3}}}\hfill\par\usebox{#2}\@tufte@float@debug{Caption position: [above left]}}% caption on the left 1332 | }{% place caption below figure 1333 | \ifthenelse{\NOT\boolean{@tufte@symmetric}\OR\boolean{@tufte@float@recto}}% 1334 | {\usebox{#2}\par\hfill\smash{\raisebox{#1}{\usebox{#3}}}\@tufte@float@debug{Caption position: [below right]}}% caption on the right 1335 | {\usebox{#2}\par\smash{\raisebox{#1}{\usebox{#3}}}\hfill\@tufte@float@debug{Caption position: [below left]}}% caption on the left 1336 | }% 1337 | } 1338 | 1339 | 1340 | %% 1341 | % Redefine the figure environment to place the captions in the margin space 1342 | 1343 | \renewenvironment{figure}[1][htbp]% 1344 | {\ifvmode\else\unskip\fi\begin{@tufte@float}[#1]{figure}{}} 1345 | {\end{@tufte@float}} 1346 | 1347 | 1348 | %% 1349 | % Redefine the table environment to place the captions in the margin space 1350 | 1351 | \renewenvironment{table}[1][htbp] 1352 | {\ifvmode\else\unskip\fi\begin{@tufte@float}[#1]{table}{}} 1353 | {\end{@tufte@float}} 1354 | 1355 | 1356 | %% 1357 | % Full-width figure 1358 | 1359 | \renewenvironment{figure*}[1][htbp]% 1360 | {\ifvmode\else\unskip\fi\begin{@tufte@float}[#1]{figure}{star}} 1361 | {\end{@tufte@float}} 1362 | 1363 | 1364 | %% 1365 | % Full-width table 1366 | 1367 | \renewenvironment{table*}[1][htbp]% 1368 | {\ifvmode\else\unskip\fi\begin{@tufte@float}[#1]{table}{star}} 1369 | {\end{@tufte@float}} 1370 | 1371 | 1372 | %% 1373 | % Full-page-width area 1374 | 1375 | \newenvironment{fullwidth} 1376 | {\ifthenelse{\boolean{@tufte@symmetric}}% 1377 | {\ifthenelse{\boolean{@tufte@changepage}}{\begin{adjustwidth*}{}{-\@tufte@overhang}}{\begin{adjustwidth}[]{}{-\@tufte@overhang}}}% 1378 | {\begin{adjustwidth}{}{-\@tufte@overhang}}% 1379 | }% 1380 | {\ifthenelse{\boolean{@tufte@symmetric}}% 1381 | {\ifthenelse{\boolean{@tufte@changepage}}{\end{adjustwidth*}}{\end{adjustwidth}}}% 1382 | {\end{adjustwidth}}% 1383 | } 1384 | 1385 | %% 1386 | % Format the captions in a style similar to the sidenotes 1387 | 1388 | \long\def\@caption#1[#2]#3{% 1389 | \par% 1390 | \addcontentsline{\csname ext@#1\endcsname}{#1}% 1391 | {\protect\numberline{\csname the#1\endcsname}{\ignorespaces #2}}% 1392 | \begingroup% 1393 | \@parboxrestore% 1394 | \if@minipage% 1395 | \@setminipage% 1396 | \fi% 1397 | \@tufte@caption@font\@tufte@caption@justification% 1398 | \noindent\csname fnum@#1\endcsname: \ignorespaces#3\par% 1399 | %\@makecaption{\csname fnum@#1\endcsname}{\ignorespaces #3}\par 1400 | \endgroup} 1401 | 1402 | %% 1403 | % If we're NOT using XeLaTeX and the `nofonts' class option was NOT provided, 1404 | % we should load the Palatino, Helvetica, and Bera Mono fonts (if they are 1405 | % installed.) 1406 | 1407 | \ifthenelse{\boolean{@tufte@loadfonts}\AND\NOT\boolean{@tufte@xetex}\AND\NOT\boolean{@tufte@luatex}}{% 1408 | \IfFileExists{mathpazo.sty}{\RequirePackage[osf,sc]{mathpazo}}{} 1409 | \IfFileExists{helvet.sty}{\RequirePackage[scaled=0.90]{helvet}}{} 1410 | \IfFileExists{beramono.sty}{\RequirePackage[scaled=0.85]{beramono}}{} 1411 | \RequirePackage[T1]{fontenc} 1412 | \RequirePackage{textcomp} 1413 | }{} 1414 | 1415 | 1416 | %% 1417 | % Turns newlines into spaces. Based on code from the `titlesec' package. 1418 | 1419 | \DeclareRobustCommand{\@tufte@newlinetospace}{% 1420 | \@ifstar{\@tufte@newlinetospace@i}{\@tufte@newlinetospace@i}% 1421 | } 1422 | 1423 | \def\@tufte@newlinetospace@i{% 1424 | \ifdim\lastskip>\z@\else\space\fi 1425 | \ignorespaces% 1426 | } 1427 | 1428 | \DeclareRobustCommand{\newlinetospace}[1]{% 1429 | \let\@tufte@orig@cr\\% save the original meaning of \\ 1430 | \def\\{\@tufte@newlinetospace}% turn \\ and \\* into \space 1431 | \let\newline\\% turn \newline into \space 1432 | #1% 1433 | \let\\\@tufte@orig@cr% revert to original meaning of \\ 1434 | } 1435 | 1436 | 1437 | %% 1438 | % Sets up the running heads and folios. 1439 | 1440 | \RequirePackage{fancyhdr} 1441 | 1442 | % Set the default page style to 'fancy' 1443 | \pagestyle{fancy} 1444 | 1445 | % Set the header/footer width to be the body text block plus the margin 1446 | % note area. 1447 | \AtBeginDocument{% 1448 | \ifthenelse{\boolean{@tufte@symmetric}} 1449 | {\fancyhfoffset[LE,RO]{\@tufte@overhang}} 1450 | {\fancyhfoffset[RE,RO]{\@tufte@overhang}} 1451 | } 1452 | 1453 | % The running heads/feet don't have rules 1454 | \renewcommand{\headrulewidth}{0pt} 1455 | \renewcommand{\footrulewidth}{0pt} 1456 | 1457 | % The 'fancy' page style is the default style for all pages. 1458 | \fancyhf{} % clear header and footer fields 1459 | \ifthenelse{\boolean{@tufte@twoside}} 1460 | {\fancyhead[LE]{\thepage\quad\smallcaps{\newlinetospace{\plainauthor}}}% 1461 | \fancyhead[RO]{\smallcaps{\newlinetospace{\plaintitle}}\quad\thepage}} 1462 | {\fancyhead[RE,RO]{\smallcaps{\newlinetospace{\plaintitle}}\quad\thepage}} 1463 | 1464 | 1465 | % The `plain' page style is used on chapter opening pages. 1466 | % In Tufte's /Beautiful Evidence/ he never puts page numbers at the 1467 | % bottom of pages -- the folios are unexpressed. 1468 | \fancypagestyle{plain}{ 1469 | \fancyhf{} % clear header and footer fields 1470 | % Uncomment the following five lines of code if you want the opening page 1471 | % of the chapter to express the folio in the lower outside corner. 1472 | %\ifthenelse{\boolean{@tufte@twoside}} 1473 | % {\fancyfoot[LE,RO]{\thepage}} 1474 | % {\fancyfoot[RE,RO]{\thepage}} 1475 | } 1476 | 1477 | % The `empty' page style suppresses all headers and footers. 1478 | % It's used on title pages and `intentionally blank' pages. 1479 | \fancypagestyle{empty}{ 1480 | \fancyhf{} % clear header and footer fields 1481 | } 1482 | 1483 | 1484 | %% 1485 | % Set raggedright and paragraph indentation for document 1486 | 1487 | \AtBeginDocument{\@tufte@justification} 1488 | 1489 | 1490 | %% 1491 | % Prints the list of class options and their states. 1492 | 1493 | \newcommand{\typeoutbool}[2]{% 1494 | \ifthenelse{\boolean{#2}} 1495 | {\typeout{\space\space#1: true}} 1496 | {\typeout{\space\space#1: false}} 1497 | } 1498 | 1499 | \newcommand{\typeoutstr}[2]{% 1500 | \typeout{\space\space#1: #2} 1501 | } 1502 | 1503 | \newcommand{\PrintTufteSettings}{% 1504 | \typeout{-------------------- Tufte-LaTeX settings ----------} 1505 | \typeout{Class: \@tufte@pkgname} 1506 | \typeout{} 1507 | \typeout{Class options:} 1508 | \typeoutbool{a4paper}{@tufte@afourpaper} 1509 | \typeoutbool{b5paper}{@tufte@bfivepaper} 1510 | \typeoutbool{load fonts}{@tufte@loadfonts} 1511 | \typeoutbool{fully-justified}{@tufte@justified} 1512 | \typeoutbool{letterspacing}{@tufte@letterspace} 1513 | \typeoutbool{sans-serif sidenotes}{@tufte@sfsidenotes} 1514 | \typeoutbool{symmetric margins}{@tufte@symmetric} 1515 | \typeoutbool{titlepage}{@tufte@titlepage} 1516 | \typeoutbool{twoside}{@tufte@twoside} 1517 | \typeoutbool{debug}{@tufte@debug} 1518 | \typeout{} 1519 | \typeout{Internal variables:} 1520 | \typeoutbool{[twoside]}{@twoside} 1521 | \typeoutbool{pdflatex}{@tufte@pdf} 1522 | \typeoutbool{xelatex}{@tufte@xetex} 1523 | \typeout{----------------------------------------------------} 1524 | } 1525 | 1526 | %% 1527 | % Amount of space to skip before \newthought or after title block 1528 | 1529 | \newskip\tufteskipamount 1530 | \tufteskipamount=1.0\baselineskip plus 0.5ex minus 0.2ex 1531 | 1532 | \newcommand{\tuftebreak}{\par\ifdim\lastskip<\tufteskipamount 1533 | \removelastskip\penalty-100\tufteskip\fi} 1534 | 1535 | \newcommand{\tufteskip}{\vspace\tufteskipamount} 1536 | 1537 | 1538 | %% 1539 | % Produces a full title page 1540 | 1541 | \newcommand{\maketitlepage}[0]{% 1542 | \cleardoublepage% 1543 | {% 1544 | \sffamily% 1545 | \begin{fullwidth}% 1546 | \fontsize{18}{20}\selectfont\par\noindent\textcolor{darkgray}{\allcaps{\thanklessauthor}}% 1547 | \vspace{11.5pc}% 1548 | \fontsize{36}{40}\selectfont\par\noindent\textcolor{darkgray}{\allcaps{\thanklesstitle}}% 1549 | \vfill% 1550 | \fontsize{14}{16}\selectfont\par\noindent\allcaps{\thanklesspublisher}% 1551 | \end{fullwidth}% 1552 | } 1553 | \thispagestyle{empty}% 1554 | \clearpage% 1555 | } 1556 | 1557 | %% 1558 | % Title block 1559 | 1560 | \renewcommand{\maketitle}{% 1561 | \newpage 1562 | \global\@topnum\z@% prevent floats from being placed at the top of the page 1563 | \begingroup 1564 | \setlength{\parindent}{0pt}% 1565 | \setlength{\parskip}{4pt}% 1566 | \let\@@title\@empty 1567 | \let\@@author\@empty 1568 | \let\@@date\@empty 1569 | \ifthenelse{\boolean{@tufte@sfsidenotes}}{% 1570 | \gdef\@@title{\sffamily\LARGE\allcaps{\@title}\par}% 1571 | \gdef\@@author{\sffamily\Large\allcaps{\@author}\par}% 1572 | \gdef\@@date{\sffamily\Large\allcaps{\@date}\par}% 1573 | }{% 1574 | \gdef\@@title{\LARGE\itshape\@title\par}% 1575 | \gdef\@@author{\Large\itshape\@author\par}% 1576 | \gdef\@@date{\Large\itshape\@date\par}% 1577 | }% 1578 | \@@title 1579 | \@@author 1580 | \@@date 1581 | \endgroup 1582 | \thispagestyle{plain}% suppress the running head 1583 | \tuftebreak% add some space before the text begins 1584 | \@afterindentfalse\@afterheading% suppress indentation of the next paragraph 1585 | } 1586 | 1587 | 1588 | %% 1589 | % Title page (if the `titlepage' option was passed to the tufte-handout 1590 | % class.) 1591 | 1592 | \ifthenelse{\boolean{@tufte@titlepage}} 1593 | {\renewcommand{\maketitle}{\maketitlepage}} 1594 | {} 1595 | 1596 | %% 1597 | % When \cleardoublepage is called, produce a blank (empty) page -- i.e., 1598 | % without headers and footers 1599 | \def\cleardoublepage{\clearpage\if@twoside\ifodd\c@page\else 1600 | \hbox{} 1601 | %\vspace*{\fill} 1602 | %\begin{center} 1603 | % This page intentionally contains only this sentence. 1604 | %\end{center} 1605 | %\vspace{\fill} 1606 | \thispagestyle{empty} 1607 | \newpage 1608 | \if@twocolumn\hbox{}\newpage\fi\fi\fi} 1609 | 1610 | %% 1611 | % Make Tuftian-style section headings and TOC formatting 1612 | 1613 | \titleformat{\chapter}% 1614 | [display]% shape 1615 | {\relax\ifthenelse{\NOT\boolean{@tufte@symmetric}}{\begin{fullwidth}}{}}% format applied to label+text 1616 | {\itshape\huge\thechapter}% label 1617 | {0pt}% horizontal separation between label and title body 1618 | {\huge\rmfamily\itshape}% before the title body 1619 | [\ifthenelse{\NOT\boolean{@tufte@symmetric}}{\end{fullwidth}}{}]% after the title body 1620 | 1621 | \titleformat{\section}% 1622 | [hang]% shape 1623 | {\normalfont\Large\itshape}% format applied to label+text 1624 | {\thesection}% label 1625 | {1em}% horizontal separation between label and title body 1626 | {}% before the title body 1627 | []% after the title body 1628 | 1629 | \titleformat{\subsection}% 1630 | [hang]% shape 1631 | {\normalfont\large\itshape}% format applied to label+text 1632 | {\thesubsection}% label 1633 | {1em}% horizontal separation between label and title body 1634 | {}% before the title body 1635 | []% after the title body 1636 | 1637 | \titleformat{\paragraph}% 1638 | [runin]% shape 1639 | {\normalfont\itshape}% format applied to label+text 1640 | {\theparagraph}% label 1641 | {1em}% horizontal separation between label and title body 1642 | {}% before the title body 1643 | []% after the title body 1644 | 1645 | \titlespacing*{\chapter}{0pt}{50pt}{40pt} 1646 | \titlespacing*{\section}{0pt}{3.5ex plus 1ex minus .2ex}{2.3ex plus .2ex} 1647 | \titlespacing*{\subsection}{0pt}{3.25ex plus 1ex minus .2ex}{1.5ex plus.2ex} 1648 | 1649 | % Subsubsection and following section headings shouldn't be used. 1650 | % See Bringhurst's _The Elements of Typography_, section 4.2.2. 1651 | \renewcommand\subsubsection{% 1652 | \@tufte@error{\string\subsubsection is undefined by this class. 1653 | See Robert Bringhurst's _The Elements of 1654 | Typographic Style_, section 4.2.2. 1655 | \string\subsubsection was used} 1656 | {From Bringhurst's _The Elements of Typographic Style_, section 4.2.2: Use as 1657 | many levels of headings as you need, no more and no fewer. Also see the many 1658 | related threads on Ask E.T. at http://www.edwardtufte.com/.} 1659 | } 1660 | 1661 | \renewcommand\subparagraph{% 1662 | \@tufte@error{\string\subparagraph is undefined by this class.% 1663 | See Robert Bringhurst's _The Elements of 1664 | Typographic Style_, section 4.2.2. 1665 | \string\subparagraph was used} 1666 | {From Bringhurst's _The Elements of Typographic Style_, section 4.2.2: Use as 1667 | many levels of headings as you need, no more and no fewer. Also see the many 1668 | related threads on Ask E.T. at http://www.edwardtufte.com/.} 1669 | } 1670 | 1671 | 1672 | % Formatting for main TOC (printed in front matter) 1673 | % {section} [left] {above} {before w/label} {before w/o label} {filler + page} [after] 1674 | \ifthenelse{\boolean{@tufte@toc}}{% 1675 | \titlecontents{part}% FIXME 1676 | [0em] % distance from left margin 1677 | {\vspace{1.5\baselineskip}\begin{fullwidth}\LARGE\rmfamily\itshape} % above (global formatting of entry) 1678 | {\contentslabel{2em}} % before w/label (label = ``II'') 1679 | {} % before w/o label 1680 | {\rmfamily\upshape\qquad\thecontentspage} % filler + page (leaders and page num) 1681 | [\end{fullwidth}] % after 1682 | \titlecontents{chapter}% 1683 | [0em] % distance from left margin 1684 | {\vspace{1.5\baselineskip}\begin{fullwidth}\LARGE\rmfamily\itshape} % above (global formatting of entry) 1685 | {\hspace*{0em}\contentslabel{2em}} % before w/label (label = ``2'') 1686 | {\hspace*{0em}} % before w/o label 1687 | {\rmfamily\upshape\qquad\thecontentspage} % filler + page (leaders and page num) 1688 | [\end{fullwidth}] % after 1689 | \titlecontents{section}% FIXME 1690 | [0em] % distance from left margin 1691 | {\vspace{0\baselineskip}\begin{fullwidth}\Large\rmfamily\itshape} % above (global formatting of entry) 1692 | {\hspace*{2em}\contentslabel{2em}} % before w/label (label = ``2.6'') 1693 | {\hspace*{2em}} % before w/o label 1694 | {\rmfamily\upshape\qquad\thecontentspage} % filler + page (leaders and page num) 1695 | [\end{fullwidth}] % after 1696 | \titlecontents{subsection}% FIXME 1697 | [0em] % distance from left margin 1698 | {\vspace{0\baselineskip}\begin{fullwidth}\large\rmfamily\itshape} % above (global formatting of entry) 1699 | {\hspace*{4em}\contentslabel{4em}} % before w/label (label = ``2.6.1'') 1700 | {\hspace*{4em}} % before w/o label 1701 | {\rmfamily\upshape\qquad\thecontentspage} % filler + page (leaders and page num) 1702 | [\end{fullwidth}] % after 1703 | \titlecontents{paragraph}% FIXME 1704 | [0em] % distance from left margin 1705 | {\vspace{0\baselineskip}\begin{fullwidth}\normalsize\rmfamily\itshape} % above (global formatting of entry) 1706 | {\hspace*{6em}\contentslabel{2em}} % before w/label (label = ``2.6.0.0.1'') 1707 | {\hspace*{6em}} % before w/o label 1708 | {\rmfamily\upshape\qquad\thecontentspage} % filler + page (leaders and page num) 1709 | [\end{fullwidth}] % after 1710 | }{} 1711 | 1712 | %% 1713 | % Format lists of figures/tables 1714 | 1715 | \renewcommand\listoffigures{% 1716 | \ifthenelse{\equal{\@tufte@class}{book}}% 1717 | {\chapter*{\listfigurename}}% 1718 | {\section*{\listfigurename}}% 1719 | % \begin{fullwidth}% 1720 | \@starttoc{lof}% 1721 | % \end{fullwidth}% 1722 | } 1723 | 1724 | \renewcommand\listoftables{% 1725 | \ifthenelse{\equal{\@tufte@class}{book}}% 1726 | {\chapter*{\listtablename}}% 1727 | {\section*{\listtablename}}% 1728 | % \begin{fullwidth}% 1729 | \@starttoc{lot}% 1730 | % \end{fullwidth}% 1731 | } 1732 | 1733 | \newcommand{\@tufte@lof@line}[2]{% 1734 | % #1 is the figure/table number and its caption text 1735 | % #2 is the page number on which the figure/table appears 1736 | \leftskip 0.0em 1737 | \rightskip 0em 1738 | \parfillskip 0em plus 1fil 1739 | \parindent 0.0em 1740 | \@afterindenttrue 1741 | \interlinepenalty\@M 1742 | \leavevmode 1743 | \@tempdima 2.0em 1744 | \advance\leftskip\@tempdima 1745 | \null\nobreak\hskip -\leftskip 1746 | {#1}\nobreak\qquad\nobreak#2% 1747 | \par% 1748 | } 1749 | 1750 | \renewcommand*\l@figure{\@tufte@lof@line} 1751 | \let\l@table\l@figure 1752 | 1753 | 1754 | %% 1755 | % A handy command to disable hyphenation for short bits of text. 1756 | % Borrowed from Peter Wilson's `hyphenat' package. 1757 | 1758 | \AtBeginDocument{% 1759 | \@ifpackageloaded{hyphenat}{}{% 1760 | \newlanguage\langwohyphens% define a language without hyphenation rules 1761 | \providecommand{\nohyphens}[1]{{\language\langwohyphens #1}}% used for short bits of text 1762 | \providecommand{\nohyphenation}{\language\langwohyphens}% can be used inside environments for longer text 1763 | }% 1764 | } 1765 | 1766 | %% 1767 | % Redefine \bibsection to not mark the running heads. 1768 | % (Code modified from natbib.sty.) 1769 | 1770 | \ifthenelse{\boolean{@tufte@loadnatbib}}{% 1771 | \@ifundefined{chapter}{% 1772 | \renewcommand\bibsection{\section*{\refname}}% 1773 | }{% 1774 | \@ifundefined{NAT@sectionbib}{% 1775 | \renewcommand\bibsection{\chapter{\bibname}}% 1776 | }{% 1777 | \renewcommand\bibsection{\section*{\bibname}}% 1778 | }% 1779 | }% 1780 | } 1781 | 1782 | %% 1783 | % An index environment to mimic Tufte's indexes 1784 | 1785 | \RequirePackage{multicol} 1786 | \renewenvironment{theindex}{% 1787 | \ifthenelse{\equal{\@tufte@class}{book}}% 1788 | {\chapter{\indexname}}% 1789 | {\section*{\indexname}}% 1790 | \begin{fullwidth}% 1791 | \small% 1792 | \parskip0pt% 1793 | \parindent0pt% 1794 | \let\item\@idxitem% 1795 | \begin{multicols}{3}% 1796 | }{% 1797 | \end{multicols}% 1798 | \end{fullwidth}% 1799 | } 1800 | \renewcommand\@idxitem{\par\hangindent 2em} 1801 | \renewcommand\subitem{\par\hangindent 3em\hspace*{1em}} 1802 | \renewcommand\subsubitem{\par\hangindent 4em\hspace*{2em}} 1803 | \renewcommand\indexspace{\par\addvspace{1.0\baselineskip plus 0.5ex minus 0.2ex}\relax}% 1804 | \newcommand{\lettergroup}[1]{}% swallow the letter heading in the index 1805 | 1806 | 1807 | %% 1808 | % A couple commands to incresae the number of floats you can use at a time. 1809 | 1810 | \def\morefloats{% provides a total of 52 floats 1811 | \ifthenelse{\isundefined{\bx@S}}{% 1812 | \@tufte@debug@info@noline{Adding 34 more float slots.} 1813 | \newinsert\bx@S 1814 | \newinsert\bx@T 1815 | \newinsert\bx@U 1816 | \newinsert\bx@V 1817 | \newinsert\bx@W 1818 | \newinsert\bx@X 1819 | \newinsert\bx@Y 1820 | \newinsert\bx@Z 1821 | \newinsert\bx@a 1822 | \newinsert\bx@b 1823 | \newinsert\bx@c 1824 | \newinsert\bx@d 1825 | \newinsert\bx@e 1826 | \newinsert\bx@f 1827 | \newinsert\bx@g 1828 | \newinsert\bx@h 1829 | \newinsert\bx@i 1830 | \newinsert\bx@j 1831 | \newinsert\bx@k 1832 | \newinsert\bx@l 1833 | \newinsert\bx@m 1834 | \newinsert\bx@n 1835 | \newinsert\bx@o 1836 | \newinsert\bx@p 1837 | \newinsert\bx@q 1838 | \newinsert\bx@r 1839 | \newinsert\bx@s 1840 | \newinsert\bx@t 1841 | \newinsert\bx@u 1842 | \newinsert\bx@v 1843 | \newinsert\bx@w 1844 | \newinsert\bx@x 1845 | \newinsert\bx@y 1846 | \newinsert\bx@z 1847 | \gdef\@freelist{\@elt\bx@A\@elt\bx@B\@elt\bx@C\@elt\bx@D\@elt\bx@E 1848 | \@elt\bx@F\@elt\bx@G\@elt\bx@H\@elt\bx@I\@elt\bx@J 1849 | \@elt\bx@K\@elt\bx@L\@elt\bx@M\@elt\bx@N 1850 | \@elt\bx@O\@elt\bx@P\@elt\bx@Q\@elt\bx@R 1851 | \@elt\bx@S\@elt\bx@T\@elt\bx@U\@elt\bx@V 1852 | \@elt\bx@W\@elt\bx@X\@elt\bx@Y\@elt\bx@Z 1853 | \@elt\bx@a\@elt\bx@b\@elt\bx@c\@elt\bx@d\@elt\bx@e 1854 | \@elt\bx@f\@elt\bx@g\@elt\bx@h\@elt\bx@i\@elt\bx@j 1855 | \@elt\bx@k\@elt\bx@l\@elt\bx@m\@elt\bx@n 1856 | \@elt\bx@o\@elt\bx@p\@elt\bx@q\@elt\bx@r 1857 | \@elt\bx@s\@elt\bx@t\@elt\bx@u\@elt\bx@v 1858 | \@elt\bx@w\@elt\bx@x\@elt\bx@y\@elt\bx@z}% 1859 | }{% we've already added another 34 floats, so we'll add 26 more, but that's it! 1860 | \ifthenelse{\isundefined{\bx@AA}}{% 1861 | \@tufte@debug@info@noline{Adding 26 more float slots.} 1862 | \newinsert\bx@AA 1863 | \newinsert\bx@BB 1864 | \newinsert\bx@CC 1865 | \newinsert\bx@DD 1866 | \newinsert\bx@EE 1867 | \newinsert\bx@FF 1868 | \newinsert\bx@GG 1869 | \newinsert\bx@HH 1870 | \newinsert\bx@II 1871 | \newinsert\bx@JJ 1872 | \newinsert\bx@KK 1873 | \newinsert\bx@LL 1874 | \newinsert\bx@MM 1875 | \newinsert\bx@NN 1876 | \newinsert\bx@OO 1877 | \newinsert\bx@PP 1878 | \newinsert\bx@QQ 1879 | \newinsert\bx@RR 1880 | \newinsert\bx@SS 1881 | \newinsert\bx@TT 1882 | \newinsert\bx@UU 1883 | \newinsert\bx@VV 1884 | \newinsert\bx@WW 1885 | \newinsert\bx@XX 1886 | \newinsert\bx@YY 1887 | \newinsert\bx@ZZ 1888 | \gdef\@freelist{\@elt\bx@A\@elt\bx@B\@elt\bx@C\@elt\bx@D\@elt\bx@E 1889 | \@elt\bx@F\@elt\bx@G\@elt\bx@H\@elt\bx@I\@elt\bx@J 1890 | \@elt\bx@K\@elt\bx@L\@elt\bx@M\@elt\bx@N 1891 | \@elt\bx@O\@elt\bx@P\@elt\bx@Q\@elt\bx@R 1892 | \@elt\bx@S\@elt\bx@T\@elt\bx@U\@elt\bx@V 1893 | \@elt\bx@W\@elt\bx@X\@elt\bx@Y\@elt\bx@Z 1894 | \@elt\bx@a\@elt\bx@b\@elt\bx@c\@elt\bx@d\@elt\bx@e 1895 | \@elt\bx@f\@elt\bx@g\@elt\bx@h\@elt\bx@i\@elt\bx@j 1896 | \@elt\bx@k\@elt\bx@l\@elt\bx@m\@elt\bx@n 1897 | \@elt\bx@o\@elt\bx@p\@elt\bx@q\@elt\bx@r 1898 | \@elt\bx@s\@elt\bx@t\@elt\bx@u\@elt\bx@v 1899 | \@elt\bx@w\@elt\bx@x\@elt\bx@y\@elt\bx@z 1900 | \@elt\bx@AA\@elt\bx@BB\@elt\bx@CC\@elt\bx@DD\@elt\bx@EE 1901 | \@elt\bx@FF\@elt\bx@GG\@elt\bx@HH\@elt\bx@II\@elt\bx@JJ 1902 | \@elt\bx@KK\@elt\bx@LL\@elt\bx@MM\@elt\bx@NN 1903 | \@elt\bx@OO\@elt\bx@PP\@elt\bx@QQ\@elt\bx@RR 1904 | \@elt\bx@SS\@elt\bx@TT\@elt\bx@UU\@elt\bx@VV 1905 | \@elt\bx@WW\@elt\bx@XX\@elt\bx@YY\@elt\bx@ZZ}% 1906 | }{% 1907 | \@tufte@error{You may only call \string\morefloats\space twice. See the Tufte-LaTeX documentation for other workarounds} 1908 | {There are already 78 float slots allocated. Try using \string\FloatBarrier\space or \string\clearpage\space to place some floats before creating more.} 1909 | }% 1910 | }% 1911 | } 1912 | 1913 | 1914 | %% 1915 | % Detect if the subfigure package has been loaded 1916 | 1917 | \newboolean{@tufte@packages@subfigure} 1918 | \setboolean{@tufte@packages@subfigure}{false} 1919 | \AtBeginDocument{% 1920 | \@ifpackageloaded{subfigure} 1921 | {\gsetboolean{@tufte@packages@subfigure}{true}} 1922 | {\gsetboolean{@tufte@packages@subfigure}{false}}% 1923 | } 1924 | 1925 | 1926 | %% 1927 | % Detect of the float package has been loaded 1928 | 1929 | \AtBeginDocument{% 1930 | \@ifpackageloaded{float}{% 1931 | % Save the redefined float environment (instead of the LaTeX float environment) 1932 | \let\@tufte@orig@float\@float 1933 | \let\@tufte@orig@endfloat\end@float 1934 | 1935 | % Define Tuftian float styles (with the caption in the margin) 1936 | \newcommand{\floatc@tufteplain}[2]{% 1937 | \begin{lrbox}{\@tufte@caption@box}% 1938 | \begin{minipage}[\floatalignment]{\marginparwidth}\hbox{}% 1939 | \@tufte@caption@font{\@fs@cfont #1:} #2\par% 1940 | \end{minipage}% 1941 | \end{lrbox}% 1942 | \smash{\hspace{\@tufte@caption@fill}\usebox{\@tufte@caption@box}}% 1943 | } 1944 | \newcommand{\fs@tufteplain}{% 1945 | \def\@fs@cfont{\@tufte@caption@font}% 1946 | \let\@fs@capt\floatc@tufteplain% 1947 | \def\@fs@pre{}% 1948 | \def\@fs@post{}% 1949 | \def\@fs@mid{}% 1950 | \let\@fs@iftopcapt\iftrue% 1951 | } 1952 | \let\fs@tufteplaintop=\fs@tufteplain 1953 | \let\floatc@tufteplaintop=\floatc@tufteplain 1954 | \newcommand\floatc@tufteruled[2]{% 1955 | {\@fs@cfont #1} #2\par% 1956 | } 1957 | \newcommand\fs@tufteruled{% 1958 | \def\@fs@cfont{\@tufte@caption@font}% 1959 | \let\@fs@capt\floatc@tufteplain% 1960 | \def\@fs@pre{\hrule height.8pt depth0pt width\textwidth \kern2pt}% 1961 | \def\@fs@post{\kern2pt\hrule width\textwidth\relax}% 1962 | \def\@fs@mid{}% 1963 | \let\@fs@iftopcapt\iftrue% 1964 | } 1965 | \newcommand\fs@tufteboxed{% 1966 | \def\@fs@cfont{}% 1967 | \let\@fs@capt\floatc@tufteplain% 1968 | \def\@fs@pre{% 1969 | \setbox\@currbox\vbox{\hbadness10000 1970 | \moveleft3.4pt\vbox{\advance\hsize by6.8pt 1971 | \hrule \hbox to\hsize{\vrule\kern3pt 1972 | \vbox{\kern3pt\box\@currbox\kern3pt}\kern3pt\vrule}\hrule}} 1973 | }% 1974 | \def\@fs@mid{\kern2pt}% 1975 | \def\@fs@post{}% 1976 | \let\@fs@iftopcapt\iftrue% 1977 | } 1978 | }{% 1979 | % Nothing to do 1980 | } 1981 | } 1982 | 1983 | \AtBeginDocument{% 1984 | \@ifpackageloaded{algorithm}{% 1985 | % Set the float style to the Tuftian version 1986 | \ifthenelse{\equal{\ALG@floatstyle}{plain}\OR\equal{\ALG@floatstyle}{ruled}\OR\equal{\ALG@floatstyle}{boxed}}{% 1987 | \@tufte@info@noline{Switching algorithm float style from \ALG@floatstyle\space to tufte\ALG@floatstyle}% 1988 | \floatstyle{tufte\ALG@floatstyle}% 1989 | \restylefloat{algorithm}% 1990 | }{}% 1991 | }{% 1992 | % Nothing to do 1993 | } 1994 | } 1995 | 1996 | 1997 | %% 1998 | % For compatibility with the subfig package, we'll set captions=false so that 1999 | % it doesn't load the caption package (which modifies our own caption 2000 | % formatting). 2001 | 2002 | \PassOptionsToPackage{caption=false}{subfig} 2003 | 2004 | 2005 | %% 2006 | % If debugging is enabled, print the Tufte-LaTeX options and the list of 2007 | % files. 2008 | 2009 | \ifthenelse{\boolean{@tufte@debug}} 2010 | {\PrintTufteSettings\listfiles} 2011 | {} 2012 | 2013 | 2014 | %% 2015 | % If there is a `tufte-common-local.tex' file, load it up. 2016 | 2017 | \IfFileExists{tufte-common-local.tex} 2018 | {\input{tufte-common-local.tex}% 2019 | \@tufte@info@noline{Loading tufte-common-local.tex}} 2020 | {} 2021 | 2022 | 2023 | %% 2024 | % End of file 2025 | \endinput 2026 | 2027 | -------------------------------------------------------------------------------- /tufte-handout.cls: -------------------------------------------------------------------------------- 1 | \NeedsTeXFormat{LaTeX2e}[1994/06/01] 2 | 3 | \ProvidesClass{tufte-handout}[2015/06/21 v3.5.2 Tufte-handout class] 4 | 5 | %% 6 | % Declare we're tufte-handout 7 | \newcommand{\@tufte@class}{article}% the base LaTeX class (defaults to the article/handout style) 8 | \newcommand{\@tufte@pkgname}{tufte-handout}% the name of the package (defaults to tufte-handout) 9 | 10 | %% 11 | % Load the common style elements 12 | \input{tufte-common.def} 13 | 14 | 15 | %% 16 | % Set up any handout-specific stuff now 17 | 18 | %% 19 | % Abstract 20 | 21 | % TODO The abstract should be printed on its own page of the `titlepage' 22 | % option was specified. 23 | \renewenvironment{abstract} 24 | {\begin{quotation}\if@tufte@sfsidenotes\begin{sffamily}\fi} 25 | {\if@tufte@sfsidenotes\end{sffamily}\fi\end{quotation}} 26 | 27 | 28 | %% 29 | % If there is a `tufte-handout-local.tex' file, load it. 30 | 31 | \IfFileExists{tufte-handout-local.tex}{% 32 | \input{tufte-handout-local}% 33 | \@tufte@info@noline{Loading tufte-handout-local.tex}% 34 | }{} 35 | 36 | 37 | %% 38 | % End of file 39 | \endinput 40 | --------------------------------------------------------------------------------