This file is where I centralise my settings – when it is tangled, it produces a set of templates, each of which contains all of the settings spelled out. This makes each file independent and standalone, able to be tinkered with without going into lots of different files. This file is just my defaults.
jyf-macros.tex
shouldn’t be spelled out tho – it’s too long. I keep it in this
repo and allow latexmkrc
to find it there.
%===========%
% Fonts %
%===========%
\usepackage[T1]{fontenc} % For more font encoding options
\usepackage{lmodern} % For better quality fonts
\usepackage[normalem]{ulem} % For underlining (use \uline{...})
Without the ‘normalem’ option, \emph{…} = underlining not italics
Other commands:
- Underline: \uline{…}.
- Double underline: \uuline{…}
- Dashed underline: \dashuline{…}
- Dotted underline: \dotuline{…}
- For strikeout: cmd = \sout{…}
- To add a wavy underline, use \uwave{…}.
- For a strike-out (strikethrough), use \sout{…}.
- For a slash through each individual character \xout{…}.
\usepackage{charter} % Another font package
%===============%
% Layout %
%===============%
\usepackage{booktabs} % Better quality tables.
\usepackage{multirow} % Tabular cells spanning multiple rows
\usepackage{pbox} % Intelligent variable width parboxes
\usepackage[font=small, labelfont=bf]{caption} % Caption formatting
\renewcommand\refname{References} % Change the name of the bibliography
% My preferred formatting of the quote environment
\renewenvironment{quote}
{\list{}{\rightmargin\leftmargin}%
\item\relax\small}
{\endlist}
\frenchspacing % Single spacing after periods
booktabs
commands:
- \toprule
- \midrule
- \cmidrule
- \bottomrule
%====================%
% TikZ settings %
%====================%
\usepackage{tikz}
\usetikzlibrary{positioning,tikzmark,calc,arrows.meta}
%============================%
% Graphics and diagrams %
%============================%
\usepackage{graphicx}
\usepackage[dvipsnames]{xcolor} % for handling colours; allows referring to them by name
% These are used for some tree-drawing packages, but require latex > dvips > ps2pdf rather than pdflatex
\usepackage{pstricks}
\usepackage{pst-node}
%=============%
% Symbols %
%=============%
\usepackage{latexsym,amsmath,amssymb,wasysym}
% Also loads amsfonts.
\usepackage{marvosym} % Provies \MVAt
\usepackage{phonetic} % For \riota (turned iota)
\usepackage{centernot} % Properly centres \not command on following argument
\usepackage{mathtools} % Provides \coloneqq
\usepackage{stmaryrd} % Various symbols including semantic interpretation brackets \llbracket and \rrbracket
\usepackage{units} % non-stacked fractions and better unit spacing
\mathbb{...}
for blackboard bold.
%=================%
% Bibliography %
%=================%
\usepackage{natbib} % Author-year citations
\bibpunct{(}{)}{;}{a}{}{,}
\setcitestyle{notesep={:\ }} % Changes separator between year and page to colon
Arguments for \bibpunct:
- {opening bracket style}
- {closing bracket style}
- {punctuation between multiple citations}
- {n=numerical, s=superscript numerical, a=author year}
- {punctuation btwn author and year}
- {punctuation between years with shared author}
\usepackage[natbibapa]{apacite} % APA citation style
%==============%
% Hyperlinks %
%==============%
\usepackage[breaklinks,hidelinks]{hyperref} % hidelinks avoids boxes around links
\urlstyle{rm} % tt,rm,sf,same
\definecolor{hlinkcolor}{rgb}{.0,.2,.4} % A nice dark blue
%
\hypersetup{%
colorlinks=true,%
urlcolor=hlinkcolor,%
linkcolor = black,% For internal links
citecolor = black% For citation links
}
hyperref
package commands:
- \url{ADDRESS} – displays ADDRESS as link in URL font
- \nolinkurl{ADDRESS} – displays ADDRESS in URL font, but not as a hyperlink
- \href{ADDRESS}{TEXT} – displays TEXT as a link to ADDRESS
\usepackage[hyphenbreaks]{breakurl} % Old package for making long URLs linebreak nicely. The breaklinks option for hyperref does a good enough job though?
%==================%
% Linguistics %
%==================%
% IPA
\usepackage{tipa}
% OT tableaux
% \usepackage[round, medium]{OTtablx} %For OT tableaux.
% \usepackage{pifont} % for pointing hand
% Dependency trees
\usepackage{tikz-dependency}
% AVMs
\usepackage{avm}
\avmfont{\sc}
% \avmoptions{active} % Avoid having to type backslashes before every square bracket, but with limitations (e.g. doesn't work when the avm environment is inside the argument of another command)
% Numbered examples
\usepackage{linguex}
\let\eachwordtwo=\it % Italicises second line of gloss
\renewcommand{\firstrefdash}{} % Removes dash between example number and letter in references
% Proofs
\usepackage{prooftree}
% Syntax trees
% \usepackage{qtree}
% \qtreecenterfalse
\usepackage[linguistics]{forest}
\forestset{
default preamble={%
for tree={s sep=5mm, inner sep=1, l=0pt}}
}
\usepackage{mary-trees} % Mary's tree-drawing macros which use pstricks
% The LangSci AVM package is still in development, and I don't like the output as much as Chris Manning's avm.sty
\usepackage{langsci-avm}
\avmsetup{values=\scshape,columnsep=0.5ex,stretch=0.9,delimfall=0pt,delimfactor=1000}
<<font-settings>>
\usepackage{times}
<<layout-settings>>
\usepackage[margin=1in]{geometry}
<<graphics-settings>>
<<hyperlink-settings>>
\documentclass[
11pt,
draft,
a4paper
]{article}
%===============================================================================
% Preamble %
%===============================================================================
<<plain-settings>>
\usepackage{lipsum}
%==========%
% Macros %
%==========%
\input{jyf-macros}
%===========%
% Title %
%===========%
\title{Title over two \\ lines}
\author{Jamie Y. Findlay\\\small University of Oslo\\\small\email{[email protected]}}
\date{}
%===============================================================================
% Document start %
%===============================================================================
\begin{document}
\maketitle
\section{Section}
\lipsum
\end{document}
<<font-settings>>
\usepackage[sc,osf]{mathpazo} % Palatino font, w/ smallcaps & old-style figures
% \usepackage{times} % Times New Roman font
<<layout-settings>>
<<graphics-settings>>
<<tikz-settings>>
<<symbol-settings>>
<<bib-settings>>
<<hyperlink-settings>>
<<linguistics-settings>>
\documentclass[
11pt,
draft,
a4paper
]{article}
%===============================================================================
% Preamble %
%===============================================================================
<<article-settings>>
\usepackage{lipsum}
%==========%
% Macros %
%==========%
\input{jyf-macros}
%===========%
% Title %
%===========%
\title{Title over two \\ lines}
\author{Jamie Y. Findlay\\\small University of Oslo\\\small\email{[email protected]}}
\date{}
%===============================================================================
% Document start %
%===============================================================================
\begin{document}
\maketitle
\begin{abstract}%
This is an abstract: \lipsum[1]
\end{abstract}
\section{Section}
\lipsum
%===================%
% Bibliography %
%===================%
\bibliographystyle{jyf-sp} % My modified version of the Semantics & Pragmatics bibliography style
\bibliography{linguistics}
\end{document}
% <<font-settings>>
\usepackage{booktabs} % Better quality tables.
\usepackage{multirow} % Tabular cells spanning multiple rows
\usepackage{pbox} % Intelligent variable width parboxes
% \usepackage[font=small, labelfont=bf]{caption} % Caption formatting
\renewcommand\refname{References} % Change the name of the bibliography
% % My preferred formatting of the quote environment
% \renewenvironment{quote}
% {\list{}{\rightmargin\leftmargin}%
% \item\relax\small}
% {\endlist}
\frenchspacing % Single spacing after periods
<<graphics-settings>>
<<tikz-settings>>
\usepackage{graphicx} % allow embedded images
\setkeys{Gin}{width=\linewidth,totalheight=\textheight,keepaspectratio}
<<symbol-settings>>
% <<bib-settings>>
\bibpunct{(}{)}{;}{a}{}{,}
\setcitestyle{notesep={:\ }} % Changes separator between year and page to colon
% <<hyperlink-settings>>
<<linguistics-settings>>
% Taken from https://groups.google.com/g/tufte-latex/c/7iKZHKKT5u0 -- adding this after linguex has been loaded will restore the Tufte-LaTeX definition of footnotes (as sidenotes) but adds in the two lines of code used by the gb4e package (via linguex).
\makeatletter
\renewcommand\@footnotetext[2][0pt]{%
% \@noftnotefalse\setcounter{fnx}{0}% added by gb4e -- but not linguex? Commented out because otherwise latex complains there is no counter 'fnx'
\marginpar{%
\hbox{}\vspace*{#1}%
\def\baselinestretch {\setspace@singlespace}%
\reset@font\footnotesize%
\@tufte@margin@par% use parindent and parskip settings for marginal text
\vspace*{-1\baselineskip}\noindent%
\protected@edef\@currentlabel{%
\csname p@footnote\endcsname\@thefnmark%
}%
\color@begingroup%
\@makefntext{%
\ignorespaces#2%
}%
\color@endgroup%
}%
\@noftnotetrue% added by g4be
}%
\makeatother
% End of linguex compatibility fix
\documentclass[
a4paper
]{tufte-handout}
%===============================================================================
% Preamble %
%===============================================================================
<<tufte-handout-settings>>
\usepackage{lipsum}
%==========%
% Macros %
%==========%
\input{jyf-macros}
%===========%
% Title %
%===========%
\title{Title of the handout}
\author{Jamie Y. Findlay\thanks{\email{[email protected]}}}
\date{}
%===============================================================================
% Document start %
%===============================================================================
\begin{document}
\maketitle
\begin{abstract}%
This is an abstract: \lipsum[1]
\end{abstract}
\section{Section}
\lipsum[2]
\lipsum[3] \marginnote[-10ex]{We can have notes appearing in the margin that aren't numbered.}
\newthought{According to Tufte,} this is how you start new thoughts \dots.\footnote{Here's a footnote appearing in the margin.}
And here's an example of a reference appearing in the margin.\cite{dalrymple:lfgbook2}
\subsection{Margin diagrams/tables}
Figures and tables can appear in the margins. They can also just appear across the text width, or across the whole page.
\lipsum[4]
\begin{marginfigure}
\centering
\begin{forest}
[S [NP [Jules] ] [VP [V [laughed]]]]
\end{forest}
\caption{Here's a syntax tree in the margin}
\end{marginfigure}
\lipsum[5]
\begin{margintable}
\centering
\begin{tabular}{lll}
\toprule
foo & bar \\
100 & 66\\
\bottomrule
\end{tabular}
\caption{Here's a table in the margin -- the caption spacing isn't so great}
\end{margintable}
\lipsum[7]
\begin{figure}
\centering
\begin{forest}
[IP
[NP [This]]
[I$'$
[I [is]]
[VP [V [showing]]
[NP [Det [a]]
[N [AdjP [Adj [big]]]
[N [tree]]
]
]
]
]
]
\end{forest}
\caption{Here's a syntax tree limited to the text width}
\end{figure}
\begin{figure*}
\begin{avm}
\[ attr & \[ attr2 & \[ attr3 & \[ attr4 & \[ attr5 & \[ attr6 & \[ attr7 & \[ attr8 & \[ attr9 & \[ attr10 & val \]\]\]\]\]\]\]\]\]\]
\end{avm}
\caption{Here is an AVM which spans the whole page width} % If the caption needs adjusting, it now takes a second argument for offset, e.g. \caption[short caption][offset]{long caption}
\end{figure*}
%===================%
% Bibliography %
%===================%
\bibliographystyle{jyf-sp} % My modified version of the Semantics & Pragmatics bibliography style
\bibliography{linguistics}
\end{document}
\usetheme[%
numbering = fraction % none, counter (def)
% , section page = none % simple, progressbar (def)
%, progressbar = frametitle % none (def), head, foot
% , background = dark% light (def)
, block = fill % transparent (def)
]{metropolis}
\definecolor{nord.bg}{HTML}{2E3440}
% \definecolor{nord.fg}{HTML}{D8DEE9}
\definecolor{nord.fg}{HTML}{E5E9F0}
% \definecolor{nord.fg}{HTML}{ECEFF4}
\definecolor{nord.alert}{HTML}{5E81AC}
\setbeamercolor{normal text}{fg=nord.bg, bg=nord.fg}
\setbeamercolor{alerted text}{fg=nord.alert}
<<font-settings>>
\usepackage[sfdefault]{cabin}
<<layout-settings>>
\usepackage{appendixnumberbeamer}
%============================%
% Graphics and diagrams %
%============================%
\usepackage{graphicx}
<<tikz-settings>>
<<symbol-settings>>
<<bib-settings>>
%==============%
% Hyperlinks %
%==============%
\urlstyle{same} % tt,rm,sf,same
<<linguistics-settings>>
\PassOptionsToPackage{dvipsnames}{xcolor}
\documentclass[
11pt,
aspectratio=169, % comment out for standard Beamer 4:3 ratio
%handout,
]{beamer}
%===============================================================================
% Preamble %
%===============================================================================
<<conference-presentation-settings>>
%==========%
% Macros %
%==========%
\input{jyf-macros}
%===========%
% Title %
%===========%
\title{Title}
\author{Jamie Y. Findlay}
\institute[]{Department of Linguistics and Scandinavian Studies, University of Oslo}
\date{01 Jan 2000}
\titlegraphic{\includegraphics[width=2cm]{logos/uio-crest}}
%===============================================================================
% Document start %
%===============================================================================
\begin{document}
\begin{frame}[plain,noframenumbering]
\titlepage
% \begin{tikzpicture}[overlay, remember picture]
% \node[above right=0.8cm and .8cm of current page.south west] {\includegraphics[width=2cm]{logos/uio-crest}};
% \end{tikzpicture}
\end{frame}
\section{Fonts and layout}
\begin{frame}{Fonts and layout}
Here is some text: \textbf{bold}, \emph{italic}, \textsc{small caps}, \alert{alert}
\begin{block}{Basic block}
With some text
\end{block}
\begin{alertblock}{Alert block}
With some text
\end{alertblock}
\begin{exampleblock}{Example block}
With some text
\end{exampleblock}
\end{frame}
\begin{frame}[standout]
This is a standout frame, to highlight an important message.
\end{frame}
\section{Syntax}
\begin{frame}
\frametitle{Syntax}
Here is a tree:
\ex.
\begin{forest}
[S [NP [Adam]] [VP [V [loves] ] [NP [Steve]]]]
\end{forest}
\end{frame}
\section{Semantics}
\begin{frame}
\frametitle{Semantics}
Here's a semantic expression:
\ex.
$\denotes{loves} = \lambda x \lambda y. \exists e[\prd{love}(e) \land \prd{experiencer}(e,x) \land \prd{source}(e,y)] : e_{\up{subj}} \li e_{\up{obj}} \li t$
\end{frame}
%===================%
% Bibliography %
%===================%
\bibliographystyle{jyf-sp} % My modified version of the Semantics & Pragmatics bibliography style
\bibliography{linguistics}
%====================%
% Backup slides %
%====================%
\appendix
\begin{frame}
\frametitle{Backup slide}
\end{frame}
\end{document}
\usetheme[secheader]{Boadilla}
\setbeamercovered{transparent}
% \resetcounteronoverlays{exx}
\beamertemplatenavigationsymbolsempty
<<font-settings>>
\usepackage[sfdefault]{cabin}
<<layout-settings>>
%============================%
% Graphics and diagrams %
%============================%
\usepackage{graphicx}
<<tikz-settings>>
<<symbol-settings>>
<<bib-settings>>
%==============%
% Hyperlinks %
%==============%
\urlstyle{same} % tt,rm,sf,same
<<linguistics-settings>>
\PassOptionsToPackage{dvipsnames}{xcolor}
\documentclass[
11pt,
%handout,
]{beamer}
%===============================================================================
% Preamble %
%===============================================================================
<<lecture-settings>>
%==========%
% Macros %
%==========%
\input{jyf-macros}
\newcommand{\myblue}{blue!70!black}
\newcommand{\keyterm}[1]{%
\tikz[baseline=(word.base),anchor=text]{%
% \tikz{%
\node[fill=gray!10, thick, rounded corners, draw=\myblue] (word) {\textsc{\textcolor{\myblue}{#1}}};
}%
}
%===========%
% Title %
%===========%
\title{Title}
\author{Jamie Y. Findlay}
\institute[]{Department of Linguistics and Scandinavian Studies, University of Oslo}
\date{01 Jan 2000}
\titlegraphic{\includegraphics[width=2cm]{logos/uio-crest}}
%===============================================================================
% Document start %
%===============================================================================
\begin{document}
\begin{frame}[plain,noframenumbering]
\titlepage
% \begin{tikzpicture}[overlay, remember picture]
% \node[above right=0.8cm and .8cm of current page.south west] {\includegraphics[width=2cm]{logos/uio-crest}};
% \end{tikzpicture}
\end{frame}
\section{Fonts and layout}
\begin{frame}{Fonts and layout}
Here is some text: \textbf{bold}, \emph{italic}, \textsc{small caps}, \alert{alert}, and here is a \keyterm{key term}
\begin{block}{Basic block}
With some text
\end{block}
\begin{alertblock}{Alert block}
With some text
\end{alertblock}
\begin{exampleblock}{Example block}
With some text
\end{exampleblock}
\end{frame}
\section{Syntax}
\begin{frame}
\frametitle{Syntax}
Here is a tree:
\ex.
\begin{forest}
[S [NP [Adam]] [VP [V [loves] ] [NP [Steve]]]]
\end{forest}
\end{frame}
\section{Semantics}
\begin{frame}
\frametitle{Semantics}
Here's a semantic expression:
\ex.
$\denotes{loves} = \lambda x \lambda y. \exists e[\prd{love}(e) \land \prd{experiencer}(e,x) \land \prd{source}(e,y)] : e_{\up{subj}} \li e_{\up{obj}} \li t$
\end{frame}
%===================%
% Bibliography %
%===================%
\bibliographystyle{jyf-sp} % My modified version of the Semantics & Pragmatics bibliography style
\bibliography{linguistics}
\end{document}