Skip to content

Instantly share code, notes, and snippets.

@ericpgreen
Last active September 1, 2021 14:26
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ericpgreen/ef2ece63ecc3635495d14d13eb38700c to your computer and use it in GitHub Desktop.
Save ericpgreen/ef2ece63ecc3635495d14d13eb38700c to your computer and use it in GitHub Desktop.
\documentclass[justified,twoside,symmetric,]{tufte-book}
% ams
\usepackage{amssymb,amsmath}
\usepackage{ifxetex,ifluatex}
\usepackage{fixltx2e} % provides \textsubscript
\ifnum 0\ifxetex 1\fi\ifluatex 1\fi=0 % if pdftex
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\else % if luatex or xelatex
\makeatletter
\@ifpackageloaded{fontspec}{}{\usepackage{fontspec}}
\makeatother
\defaultfontfeatures{Ligatures=TeX,Scale=MatchLowercase}
\makeatletter
\@ifpackageloaded{soul}{
\renewcommand\allcapsspacing[1]{{\addfontfeature{LetterSpace=15}#1}}
\renewcommand\smallcapsspacing[1]{{\addfontfeature{LetterSpace=10}#1}}
}{}
\makeatother
\fi
% graphix
\usepackage{graphicx}
\setkeys{Gin}{width=\linewidth,totalheight=\textheight,keepaspectratio}
% booktabs
\usepackage{booktabs}
% url
\usepackage{url}
% hyperref
\usepackage{hyperref}
% units.
\usepackage{units}
\setcounter{secnumdepth}{2}
% citations
\usepackage{natbib}
\bibliographystyle{plainnat}
% pandoc syntax highlighting
% longtable
\usepackage{longtable,booktabs}
% multiplecol
\usepackage{multicol}
% strikeout
\usepackage[normalem]{ulem}
% morefloats
\usepackage{morefloats}
% tightlist macro required by pandoc >= 1.14
\providecommand{\tightlist}{%
\setlength{\itemsep}{0pt}\setlength{\parskip}{0pt}}
% title / author / date
\title{Global Health Research}
\author{Eric P. Green}
\date{2021-09-01}
\usepackage{booktabs}
\usepackage{mparhack} % https://tex.stackexchange.com/a/236380/30017
\usepackage{parskip}
% citations
\PassOptionsToPackage{round}{natbib}
\setcitestyle{super}
\renewcommand*{\citep}[1]{{\cite{#1}}}
\renewcommand*{\citet}[1]{{\cite{#1}}}
% fonts
\usepackage{fontspec}
\setmainfont{LibreBaskerville-Regular}
\setsansfont{SourceSansPro-Regular}
\setmonofont{Inconsolata}
\setsidenotefont{\fontspec{SourceSansPro-ExtraLight}[Scale=0.8]}
\setcaptionfont{\fontspec{SourceSansPro-ExtraLight}[Scale=0.8]}
\setmarginnotefont{\fontspec{SourceSansPro-ExtraLight}[Scale=0.8]}
\setcitationfont{\fontspec{SourceSansPro-ExtraLight}[Scale=0.8]\color{gray}}
% headers
\usepackage{fancyhdr}
\setlength{\headheight}{15pt}
\pagestyle{fancy}
\renewcommand{\chaptermark}[1]{ \markboth{#1}{} }
\renewcommand{\sectionmark}[1]{ \markright{#1} }
\fancyhf{}
\fancyhead[LE]{\thepage\space\space\space$\cdotp$\space\space\space\chaptername\space\thechapter}
\fancyhead[RO]{\leftmark\space\space\space$\cdotp$\space\space\space\thepage}
\fancypagestyle{plain}{ %
\fancyhf{} % remove everything
\renewcommand{\headrulewidth}{0pt} % remove lines as well
\renewcommand{\footrulewidth}{0pt}
}
% title page and level headings
\usepackage[svgnames]{xcolor}
\usepackage{titlesec}
\usepackage{xhfill}
\colorlet{rulecolor}{Gainsboro!40!Lavender}
\usepackage{lipsum}
\titleformat{\chapter}[display]
{\filcenter}{\mbox{}\xrfill[0.4ex]{3pt}[rulecolor]\bfseries\sffamily{\large\enspace\chaptername\space\thechapter}\enspace\xrfill[0.4ex]{3pt}[rulecolor]\mbox{}}{0.3ex} {{\color{rulecolor}\titlerule[1pt]}\vskip3ex\huge\bfseries\sffamily}[\medskip{\color{rulecolor}\titlerule[1pt]}]
\usepackage{titling}
\pretitle{\begin{flushleft}\huge\bfseries}
\posttitle{\par\end{flushleft}}
\preauthor{\begin{flushleft}\Large\bfseries}
\postauthor{\par\end{flushleft}}
\predate{\begin{flushleft}\large\mdseries}
\postdate{\par\end{flushleft}}
\titleformat*{\section}{\LARGE\bfseries\sffamily}
\titleformat*{\subsection}{\Large\bfseries\sffamily}
\usepackage[svgnames]{xcolor}
% table of contents
\usepackage{titletoc}
\contentsmargin[1cm]{0cm}
\titlecontents{chapter}[0em]{\vskip12pt\Large\bfseries\sffamily}
{\thecontentslabel\enspace}
{\hspace{1.05em}}
{ \hfill\contentspage}[\vskip 6pt]
\titlecontents{section}[1em]{\mdseries\sffamily}
{\thecontentslabel\enspace}
{}
{\titlerule*[1pc]{.}\quad\contentspage}[\vskip 4pt]
\titlecontents{subsection}[2.7em]{\mdseries\sffamily}
{\thecontentslabel\enspace}
{}
{\titlerule*[1pc]{.}\quad\contentspage}[\vskip 3pt]
\usepackage{etoolbox}
\pretocmd{\contentsname}{\sffamily}{}{}
% margins
% The default minimum amount of space between \marginnotes is 10 pt.
%\setlength\marginparpush{10pt}
\AtBeginEnvironment{marginfigure}{\linespread{0.5}}
\usepackage{booktabs}
\usepackage{longtable}
\usepackage{array}
\usepackage{multirow}
\usepackage{wrapfig}
\usepackage{float}
\usepackage{colortbl}
\usepackage{pdflscape}
\usepackage{tabu}
\usepackage{threeparttable}
\usepackage{threeparttablex}
\usepackage[normalem]{ulem}
\usepackage{makecell}
\usepackage{xcolor}
\begin{filecontents}{ghr.bib}
@article{green2018,
title={Developing and validating a perinatal depression screening tool in Kenya blending Western criteria with local idioms: a mixed methods study},
author={Green, Eric P and Tuli, Hawa and Kwobah, Edith and Menya, D and Chesire, Irene and Schmidt, Christina},
journal={Journal of Affective Disorders},
volume={228},
pages={49--59},
year={2018},
publisher={Elsevier}
}
\end{filecontents}
\begin{document}
\maketitle
{
\setcounter{tocdepth}{0}
\tableofcontents
}
\hypertarget{preface}{%
\chapter*{Preface}\label{preface}}
\addcontentsline{toc}{chapter}{Preface}
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
\begin{marginfigure}
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
\end{marginfigure}
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum \citep{green2018}.
\bibliography{ghr.bib}
\end{document}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment