Skip to content

Commit 8bbf4b2

Browse files
author
Clément
committed
Trying to improve the bookmarks.
1 parent 50830d3 commit 8bbf4b2

File tree

4 files changed

+81
-84
lines changed

4 files changed

+81
-84
lines changed

md_version/main.md

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,8 @@ and must be written in LaTeX, so you can create new lines
2626
using "\\" and "\\[2em]" if you want more space.
2727
-->
2828

29+
\frontmatter
30+
2931
\dedication{
3032
This part serves two purposes.\\[1em]
3133
To write the acknowledgments (as a \enquote{\emph{Thank you note}}).
@@ -50,8 +52,7 @@ It consists of a succinct summary of the thesis/dissertation and the conclusions
5052
Opinions should be omitted.
5153
\end{abstract}
5254

53-
\cleardoublepage
54-
\pagenumbering{arabic}
55+
\mainmatter
5556

5657
<!--
5758
All the rest of the document can be written either in Latex,
@@ -365,7 +366,7 @@ To declare other unicode symbols as having to be displayed using the Symbola fon
365366
⚠ Do not edit ⚠
366367
the three lines below.
367368
-->
368-
\clearpage
369+
\backmatter
369370
\printbibliography[label=chap:references, title=References]
370371
\let\printbibliography\relax
371372
<!--

md_version/main.pdf

2.35 KB
Binary file not shown.

md_version/makefile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ watch :
3333
clean:
3434
rm -f main.pdf
3535
rm -rf aux
36+
rm -rf ../tex_version/
3637

3738
tex: main.md
3839
@pandoc $(PANDOC_OPTIONS) -s $< -o main.tex

md_version/templates/head_b.tex

Lines changed: 76 additions & 81 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
\makeatletter
2828
\xapptocmd{\@subtitle}{\par}{}{}
2929
\makeatother
30-
\else
30+
\else
3131
\let\yoursubtitle\par\vspace{1em}
3232
\fi
3333

@@ -42,38 +42,38 @@
4242
% from the date, and display them in the title.
4343
\DTMsavedate{mydate}{\yourdate}
4444
\makeatletter
45-
\renewcommand{\yourdate}{%
46-
\DTMenglishmonthname{\@dtm@month}\\
47-
\@dtm@year
48-
}
45+
\renewcommand{\yourdate}{%
46+
\DTMenglishmonthname{\@dtm@month}\\
47+
\@dtm@year
48+
}
4949
\makeatother
5050

5151
% This add some information between
5252
% your name and the date.
5353
\makeatletter
54-
\pretocmd{\yourdate}{%
55-
\vspace{1em}
56-
Submitted to the Faculty of The Graduate School\\
57-
of Augusta University in partial fulfillment\\
58-
of the Requirements of the Degree of\\
59-
\iftoggle{ms}{Master of Science}{Doctor of Philosophy} % This toggle will display either
60-
% "Master of Science" or "Doctor of Philosophy"
61-
% based on the choice made in info.tex.
62-
\vspace{1em}\par
63-
}{}{}
54+
\pretocmd{\yourdate}{%
55+
\vspace{1em}
56+
Submitted to the Faculty of The Graduate School\\
57+
of Augusta University in partial fulfillment\\
58+
of the Requirements of the Degree of\\
59+
\iftoggle{ms}{Master of Science}{Doctor of Philosophy} % This toggle will display either
60+
% "Master of Science" or "Doctor of Philosophy"
61+
% based on the choice made in info.tex.
62+
\vspace{1em}\par
63+
}{}{}
6464
\makeatother
6565

6666
% This add copyright information,
6767
% abusing the "publisher" field.
6868
\makeatletter
69-
\publishers{%
70-
\textcopyright~\@dtm@year{} by \yourname%
71-
\ifdefined\yourlicence{\\[.1em] \yourlicence}
72-
\else
73-
\relax
74-
\fi
75-
\pagenumbering{gobble} % No page number on next page.
76-
}
69+
\publishers{%
70+
\textcopyright~\@dtm@year{} by \yourname%
71+
\ifdefined\yourlicence{\\[.1em] \yourlicence}
72+
\else
73+
\relax
74+
\fi
75+
\pagenumbering{gobble} % No page number on next page.
76+
}
7777
\makeatother
7878

7979
%%%%%%%%%%%
@@ -102,19 +102,9 @@
102102
% No space above chapters.
103103
% https://tex.stackexchange.com/a/231940
104104
\RedeclareSectionCommand[
105-
beforeskip=0pt
105+
beforeskip=0pt
106106
]{chapter}
107107

108-
%%%%%%%%%%%%%%%%%%%%%%%
109-
% Headers and footers %
110-
%%%%%%%%%%%%%%%%%%%%%%%
111-
112-
% We only want page numbers, no headers.
113-
\pagestyle{plain}
114-
% No page number for the first part of the document.
115-
\thispagestyle{empty}
116-
117-
118108
%%%%%%%%%%
119109
% Titles %
120110
%%%%%%%%%%
@@ -132,7 +122,8 @@
132122
pdfauthor={\yourname},
133123
pdflang={en},
134124
pdfkeywords={\yourkeywords},
135-
pdfauthor={\yourname}
125+
pdfauthor={\yourname},
126+
plainpages=false % Not sure this is helpful -- I thought it would help with https://github.com/the-au-forml-lab/au_ccs_dissertation_template/issues/13
136127
}
137128
}
138129

@@ -159,7 +150,6 @@
159150
% Spacing %
160151
%%%%%%%%%%%
161152

162-
163153
% Everything must be double spaced
164154
% "Double space" has multiple definitions,
165155
% we implement two options below, and use the
@@ -172,7 +162,7 @@
172162
\doublespacing
173163

174164
% Option B:
175-
% Uncomment lines with two %
165+
% Uncomment lines with two % to use.
176166
% and comment Option A to use.
177167
%% \linespread{2}
178168
% But the sectionning commands
@@ -195,6 +185,7 @@
195185

196186
\pretocmd{\dedication}{%
197187
\chapter*{Acknowledgements}
188+
\pdfbookmark[0]{Acknowledgements}{toc}
198189
\pagenumbering{gobble} % No page number
199190
\par % New paragraph
200191
{
@@ -212,39 +203,45 @@
212203
% https://tex.stackexchange.com/a/40547
213204
% https://tex.stackexchange.com/a/68227
214205
\makeatletter
215-
\newenvironment{abstract}{%
216-
% At the beginning of the environment:
217-
\pagenumbering{gobble} % No page number.
218-
\chapter*{Abstract}
219-
{ % This group must be single-spaced.
220-
\linespread{1}
221-
\textsc{\yourname} \\
222-
\@title \\
223-
(Under the direction of \textsc{\youradvisor})
224-
}
225-
\\[3em]
226-
}%
227-
{%
228-
% At the end of the environment:
229-
\\[3em] \textsc{Keywords}: \StrSubstitute{\yourkeywords}{,}{\textperiodcentered} % We list the keywords.
230-
\clearpage
231-
\pagestyle{empty}
232-
% The table of content
233-
% follows immediately (and automatically)
234-
% the abstract.
235-
\renewcaptionname{english}%
236-
{\contentsname}%
237-
{Table of Contents} % We rename the table of contents.
238-
\tableofcontents % Table of contents.
239-
\iftotaltables % If there are tables in the document…
240-
\listoftables % …write out the List of Tables
241-
\fi
242-
\iftotalfigures % If there are figures in the document…
243-
\listoffigures % …write out the List of Figures
244-
\fi
245-
\iftotallstlistings % If there are listings in the document…
246-
\lstlistoflistings % …write out the List of Listings.
247-
\fi
206+
\newenvironment{abstract}{%
207+
% At the beginning of the environment:
208+
\chapter*{Abstract}
209+
\pdfbookmark[0]{Abstract}{abs} % We add it to the pdf toc
210+
{ % This group must be single-spaced.
211+
\linespread{1}
212+
\textsc{\yourname} \\
213+
\@title \\
214+
(Under the direction of \textsc{\youradvisor})
215+
}
216+
\\[3em]
217+
}%
218+
{%
219+
% At the end of the environment:
220+
\\[3em] \textsc{Keywords}: \StrSubstitute{\yourkeywords}{,}{\textperiodcentered} % We list the keywords.
221+
\clearpage
222+
% The table of content
223+
% follows immediately (and automatically)
224+
% the abstract.
225+
\renewcaptionname{english}%
226+
{\contentsname}%
227+
{Table of Contents} % We rename the table of contents.
228+
\hypertarget{tableofcontents}{}\bookmark[level=chapter,dest=tableofcontents]{\contentsname}
229+
\tableofcontents % Table of contents.
230+
\iftotaltables % If there are tables in the document…
231+
\hypertarget{listoftables}{}\bookmark[level=chapter,dest=listoftables]{\listtablename} %…we add the List of Tables to the pdf toc.
232+
\listoftables % …and write it.
233+
\fi
234+
\iftotalfigures % If there are figures in the document…
235+
\hypertarget{listoffigures}{}\bookmark[level=chapter,dest=listoffigures]{\listfigurename} % …and add it to the pdf toc.
236+
\listoffigures % …write out the List of Figures
237+
\fi
238+
\iftotallstlistings % If there are listings in the document…
239+
\renewcommand{\lstlistlistingname}%
240+
{List of Listings} % …we rename the simple "Listings" to "List of Listings"
241+
% https://stackoverflow.com/a/2709986
242+
\hypertarget{listoflistings}{}\bookmark[level=chapter,dest=listoflistings]{\lstlistlistingname} %…we add the List of Tables to the pdf toc.
243+
\lstlistoflistings % …write out the List of Listings.
244+
\fi
248245
}
249246
\makeatother
250247

@@ -259,13 +256,11 @@
259256
\AtEndPreamble{
260257
\DeclarePrintbibliographyDefaults{heading=bibintoc} % We add the references in the table of contents
261258
\defbibheading{bibliography}[\bibname]{%
262-
\chapter*{#1}%
263-
\markboth{#1}{#1}}
259+
\chapter*{#1}%
260+
\markboth{#1}{#1}}
264261
}
265262
% https://tex.stackexchange.com/a/544718
266-
% We rename the simple "Listings" to "List of Listings"
267-
\renewcommand{\lstlistlistingname}{List of Listings}
268-
% https://stackoverflow.com/a/2709986
263+
269264

270265
% Counters for figures, tables and listings
271266
% are global, and not per chapter.
@@ -280,10 +275,10 @@
280275
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
281276

282277
\ifdefined\yourmention
283-
\usepackage{accsupp} % We make it impossible to select the mention
284-
% cf. https://tex.stackexchange.com/a/309878
285-
\usepackage{draftwatermark}
286-
\SetWatermarkText{\BeginAccSupp{method=escape,ActualText={}}\yourmention\EndAccSupp{}}
287-
\SetWatermarkScale{2}
288-
\SetWatermarkColor{augustagrey!20}
278+
\usepackage{accsupp} % We make it impossible to select the mention
279+
% cf. https://tex.stackexchange.com/a/309878
280+
\usepackage{draftwatermark}
281+
\SetWatermarkText{\BeginAccSupp{method=escape,ActualText={}}\yourmention\EndAccSupp{}}
282+
\SetWatermarkScale{2}
283+
\SetWatermarkColor{augustagrey!20}
289284
\fi

0 commit comments

Comments
 (0)