forked from gvwilson/teachtogether.tech
-
Notifications
You must be signed in to change notification settings - Fork 1
/
html-settings.tex
68 lines (54 loc) · 1.89 KB
/
html-settings.tex
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
\usepackage[english]{babel}
% Allow multi-page tables.
\usepackage{longtable}
% Asides
\newenvironment{aside}[1]{\begin{quote}\subsubsection*{#1}}{\end{quote}}
% Glossary references and items
\newcommand{\gref}[2]{\hyperlink{#1}{\textbf{#2}}\index{#2}}
\newcommand{\grefdex}[3]{\hyperlink{#1}{\textbf{#2}}\index{#3}}
\newcommand{\grefcross}[2]{\hyperlink{#1}{\textbf{#2}}}
\newcommand{\gitem}[2]{\item[\hypertarget{#1}{#2}]}
% Render hyperlinks with footnotes as well.
\newcommand{\hreffoot}[2]{\href{#1}{#2}}
% Mark recommendations.
\newcommand{\recommendation}[1]{\emph{#1}}
% Bibliography.
\usepackage[backend=biber,style=alphabetic,sorting=nyt,maxbibnames=99]{biblatex}
\addbibresource{book.bib}
% https://tex.stackexchange.com/questions/8428/use-bibtex-key-as-the-cite-key
\DeclareFieldFormat{labelalpha}{\thefield{entrykey}}
\DeclareFieldFormat{extraalpha}{}
% Chapters, sections, and appendices with labels.
\newcommand{\chaplbl}[2]{\chapter{#1}\label{#2}}
\newcommand{\seclbl}[2]{\section{#1}\label{#2}}
\newcommand{\appref}[1]{Appendix~\ref{#1}}
\newcommand{\chapref}[1]{Chapter~\ref{#1}}
\newcommand{\figref}[1]{Figure~\ref{#1}}
\newcommand{\secref}[1]{Section~\ref{#1}}
% Image figures.
\newcommand{\figimg}[3]{\begin{figure}%
\centering%
\includegraphics[width=\textwidth]{#1}%
\caption{#2}%
\label{#3}%
\end{figure}}
% PDF figures.
\newcommand{\figpdf}[3]{\begin{figure}%
\centering%
\includegraphics[scale=0.6]{#1}%
\caption{#2}%
\label{#3}%
\end{figure}}
% PDF figures forcing location.
\newcommand{\figpdfhere}[3]{\begin{figure}[H]%
\centering%
\includegraphics[scale=0.6]{#1}%
\caption{#2}%
\label{#3}%
\end{figure}}
% Exercise headings.
\newcommand{\exercise}[3]{\subsection*{#1 (#2/#3)}}
%----------------------------------------
% Always load hyperref last
% https://tex.stackexchange.com/questions/16268/warning-with-footnotes-namehfootnote-xx-has-been-referenced-but-does-not-exi
\usepackage{hyperref}