Skip to content

Commit

Permalink
Trying to improve the bookmarks.
Browse files Browse the repository at this point in the history
  • Loading branch information
Clément committed Dec 24, 2024
1 parent 50830d3 commit 8bbf4b2
Show file tree
Hide file tree
Showing 4 changed files with 81 additions and 84 deletions.
7 changes: 4 additions & 3 deletions md_version/main.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@ and must be written in LaTeX, so you can create new lines
using "\\" and "\\[2em]" if you want more space.
-->

\frontmatter

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

\cleardoublepage
\pagenumbering{arabic}
\mainmatter

<!--
All the rest of the document can be written either in Latex,
Expand Down Expand Up @@ -365,7 +366,7 @@ To declare other unicode symbols as having to be displayed using the Symbola fon
⚠ Do not edit ⚠
the three lines below.
-->
\clearpage
\backmatter
\printbibliography[label=chap:references, title=References]
\let\printbibliography\relax
<!--
Expand Down
Binary file modified md_version/main.pdf
Binary file not shown.
1 change: 1 addition & 0 deletions md_version/makefile
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ watch :
clean:
rm -f main.pdf
rm -rf aux
rm -rf ../tex_version/

tex: main.md
@pandoc $(PANDOC_OPTIONS) -s $< -o main.tex
Expand Down
157 changes: 76 additions & 81 deletions md_version/templates/head_b.tex
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
\makeatletter
\xapptocmd{\@subtitle}{\par}{}{}
\makeatother
\else
\else
\let\yoursubtitle\par\vspace{1em}
\fi

Expand All @@ -42,38 +42,38 @@
% from the date, and display them in the title.
\DTMsavedate{mydate}{\yourdate}
\makeatletter
\renewcommand{\yourdate}{%
\DTMenglishmonthname{\@dtm@month}\\
\@dtm@year
}
\renewcommand{\yourdate}{%
\DTMenglishmonthname{\@dtm@month}\\
\@dtm@year
}
\makeatother

% This add some information between
% your name and the date.
\makeatletter
\pretocmd{\yourdate}{%
\vspace{1em}
Submitted to the Faculty of The Graduate School\\
of Augusta University in partial fulfillment\\
of the Requirements of the Degree of\\
\iftoggle{ms}{Master of Science}{Doctor of Philosophy} % This toggle will display either
% "Master of Science" or "Doctor of Philosophy"
% based on the choice made in info.tex.
\vspace{1em}\par
}{}{}
\pretocmd{\yourdate}{%
\vspace{1em}
Submitted to the Faculty of The Graduate School\\
of Augusta University in partial fulfillment\\
of the Requirements of the Degree of\\
\iftoggle{ms}{Master of Science}{Doctor of Philosophy} % This toggle will display either
% "Master of Science" or "Doctor of Philosophy"
% based on the choice made in info.tex.
\vspace{1em}\par
}{}{}
\makeatother

% This add copyright information,
% abusing the "publisher" field.
\makeatletter
\publishers{%
\textcopyright~\@dtm@year{} by \yourname%
\ifdefined\yourlicence{\\[.1em] \yourlicence}
\else
\relax
\fi
\pagenumbering{gobble} % No page number on next page.
}
\publishers{%
\textcopyright~\@dtm@year{} by \yourname%
\ifdefined\yourlicence{\\[.1em] \yourlicence}
\else
\relax
\fi
\pagenumbering{gobble} % No page number on next page.
}
\makeatother

%%%%%%%%%%%
Expand Down Expand Up @@ -102,19 +102,9 @@
% No space above chapters.
% https://tex.stackexchange.com/a/231940
\RedeclareSectionCommand[
beforeskip=0pt
beforeskip=0pt
]{chapter}

%%%%%%%%%%%%%%%%%%%%%%%
% Headers and footers %
%%%%%%%%%%%%%%%%%%%%%%%

% We only want page numbers, no headers.
\pagestyle{plain}
% No page number for the first part of the document.
\thispagestyle{empty}


%%%%%%%%%%
% Titles %
%%%%%%%%%%
Expand All @@ -132,7 +122,8 @@
pdfauthor={\yourname},
pdflang={en},
pdfkeywords={\yourkeywords},
pdfauthor={\yourname}
pdfauthor={\yourname},
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
}
}

Expand All @@ -159,7 +150,6 @@
% Spacing %
%%%%%%%%%%%


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

% Option B:
% Uncomment lines with two %
% Uncomment lines with two % to use.
% and comment Option A to use.
%% \linespread{2}
% But the sectionning commands
Expand All @@ -195,6 +185,7 @@

\pretocmd{\dedication}{%
\chapter*{Acknowledgements}
\pdfbookmark[0]{Acknowledgements}{toc}
\pagenumbering{gobble} % No page number
\par % New paragraph
{
Expand All @@ -212,39 +203,45 @@
% https://tex.stackexchange.com/a/40547
% https://tex.stackexchange.com/a/68227
\makeatletter
\newenvironment{abstract}{%
% At the beginning of the environment:
\pagenumbering{gobble} % No page number.
\chapter*{Abstract}
{ % This group must be single-spaced.
\linespread{1}
\textsc{\yourname} \\
\@title \\
(Under the direction of \textsc{\youradvisor})
}
\\[3em]
}%
{%
% At the end of the environment:
\\[3em] \textsc{Keywords}: \StrSubstitute{\yourkeywords}{,}{\textperiodcentered} % We list the keywords.
\clearpage
\pagestyle{empty}
% The table of content
% follows immediately (and automatically)
% the abstract.
\renewcaptionname{english}%
{\contentsname}%
{Table of Contents} % We rename the table of contents.
\tableofcontents % Table of contents.
\iftotaltables % If there are tables in the document…
\listoftables % …write out the List of Tables
\fi
\iftotalfigures % If there are figures in the document…
\listoffigures % …write out the List of Figures
\fi
\iftotallstlistings % If there are listings in the document…
\lstlistoflistings % …write out the List of Listings.
\fi
\newenvironment{abstract}{%
% At the beginning of the environment:
\chapter*{Abstract}
\pdfbookmark[0]{Abstract}{abs} % We add it to the pdf toc
{ % This group must be single-spaced.
\linespread{1}
\textsc{\yourname} \\
\@title \\
(Under the direction of \textsc{\youradvisor})
}
\\[3em]
}%
{%
% At the end of the environment:
\\[3em] \textsc{Keywords}: \StrSubstitute{\yourkeywords}{,}{\textperiodcentered} % We list the keywords.
\clearpage
% The table of content
% follows immediately (and automatically)
% the abstract.
\renewcaptionname{english}%
{\contentsname}%
{Table of Contents} % We rename the table of contents.
\hypertarget{tableofcontents}{}\bookmark[level=chapter,dest=tableofcontents]{\contentsname}
\tableofcontents % Table of contents.
\iftotaltables % If there are tables in the document…
\hypertarget{listoftables}{}\bookmark[level=chapter,dest=listoftables]{\listtablename} %…we add the List of Tables to the pdf toc.
\listoftables % …and write it.
\fi
\iftotalfigures % If there are figures in the document…
\hypertarget{listoffigures}{}\bookmark[level=chapter,dest=listoffigures]{\listfigurename} % …and add it to the pdf toc.
\listoffigures % …write out the List of Figures
\fi
\iftotallstlistings % If there are listings in the document…
\renewcommand{\lstlistlistingname}%
{List of Listings} % …we rename the simple "Listings" to "List of Listings"
% https://stackoverflow.com/a/2709986
\hypertarget{listoflistings}{}\bookmark[level=chapter,dest=listoflistings]{\lstlistlistingname} %…we add the List of Tables to the pdf toc.
\lstlistoflistings % …write out the List of Listings.
\fi
}
\makeatother

Expand All @@ -259,13 +256,11 @@
\AtEndPreamble{
\DeclarePrintbibliographyDefaults{heading=bibintoc} % We add the references in the table of contents
\defbibheading{bibliography}[\bibname]{%
\chapter*{#1}%
\markboth{#1}{#1}}
\chapter*{#1}%
\markboth{#1}{#1}}
}
% https://tex.stackexchange.com/a/544718
% We rename the simple "Listings" to "List of Listings"
\renewcommand{\lstlistlistingname}{List of Listings}
% https://stackoverflow.com/a/2709986


% Counters for figures, tables and listings
% are global, and not per chapter.
Expand All @@ -280,10 +275,10 @@
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\ifdefined\yourmention
\usepackage{accsupp} % We make it impossible to select the mention
% cf. https://tex.stackexchange.com/a/309878
\usepackage{draftwatermark}
\SetWatermarkText{\BeginAccSupp{method=escape,ActualText={}}\yourmention\EndAccSupp{}}
\SetWatermarkScale{2}
\SetWatermarkColor{augustagrey!20}
\usepackage{accsupp} % We make it impossible to select the mention
% cf. https://tex.stackexchange.com/a/309878
\usepackage{draftwatermark}
\SetWatermarkText{\BeginAccSupp{method=escape,ActualText={}}\yourmention\EndAccSupp{}}
\SetWatermarkScale{2}
\SetWatermarkColor{augustagrey!20}
\fi

0 comments on commit 8bbf4b2

Please sign in to comment.