Skip to content

Commit cbf9c4b

Browse files
author
Clément
committed
Updating the tex template.
1 parent ef23908 commit cbf9c4b

File tree

1 file changed

+56
-78
lines changed

1 file changed

+56
-78
lines changed

tex_version/main.tex

Lines changed: 56 additions & 78 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,18 @@
1-
% !TeX program = xelatex
2-
% !BIB program = bibtex
31
% Options for packages loaded elsewhere
42
\PassOptionsToPackage{unicode}{hyperref}
53
\PassOptionsToPackage{hyphens}{url}
6-
%
74
\documentclass[
85
12pt,
96
letterpaper,
107
oneside,
118
BCOR = 0 pt,
129
singlespacing = true]{scrbook}
10+
\usepackage{xcolor}
11+
\usepackage[top=1in, left=1.5in, right=1in, bottom=1in, truedimen,
12+
twoside=false, bindingoffset=0pt, nohead]{geometry}
1313
\usepackage{amsmath,amssymb}
14-
\usepackage{iftex}h
14+
\setcounter{secnumdepth}{5}
15+
\usepackage{iftex}
1516
\ifPDFTeX
1617
\usepackage[T1]{fontenc}
1718
\usepackage[utf8]{inputenc}
@@ -24,7 +25,7 @@
2425
\usepackage{lmodern}
2526
\ifPDFTeX\else
2627
% xetex/luatex font selection
27-
\setmainfont[Path=fonts/,Extension=.otf,UprightFont=*-regular,BoldFont=*-bold,ItalicFont=*-italic,BoldItalicFont=*-BoldItalic]{texgyretermes}
28+
\setmainfont[Path=fonts/,Extension=.otf,UprightFont=*-regular,BoldFont=*-bold,ItalicFont=*-italic,BoldItalicFont=*-BoldItalic]{TeXGyreTermes}
2829
\fi
2930
% Use upquote if available, for straight quotes in verbatim environments
3031
\IfFileExists{upquote.sty}{\usepackage{upquote}}{}
@@ -42,9 +43,6 @@
4243
}{% if KOMA class
4344
\KOMAoptions{parskip=half}}
4445
\makeatother
45-
\usepackage{xcolor}
46-
\usepackage[top=1in, left=1.5in, right=1in, bottom=1in, truedimen,
47-
twoside=false, bindingoffset=0pt, nohead]{geometry}
4846
\usepackage{listings}
4947
\newcommand{\passthrough}[1]{#1}
5048
\lstset{defaultdialect=[5.3]Lua}
@@ -61,21 +59,19 @@
6159
\makesavenoteenv{longtable}
6260
\usepackage{graphicx}
6361
\makeatletter
64-
\def\maxwidth{\ifdim\Gin@nat@width>\linewidth\linewidth\else\Gin@nat@width\fi}
65-
\def\maxheight{\ifdim\Gin@nat@height>\textheight\textheight\else\Gin@nat@height\fi}
66-
\makeatother
67-
% Scale images if necessary, so that they will not overflow the page
68-
% margins by default, and it is still possible to overwrite the defaults
69-
% using explicit options in \includegraphics[width, height, ...]{}
70-
\setkeys{Gin}{width=\maxwidth,height=\maxheight,keepaspectratio}
62+
\newsavebox\pandoc@box
63+
\newcommand*\pandocbounded[1]{% scales image to fit in text height/width
64+
\sbox\pandoc@box{#1}%
65+
\Gscale@div\@tempa{\textheight}{\dimexpr\ht\pandoc@box+\dp\pandoc@box\relax}%
66+
\Gscale@div\@tempb{\linewidth}{\wd\pandoc@box}%
67+
\ifdim\@tempb\p@<\@tempa\p@\let\@tempa\@tempb\fi% select the smaller of both
68+
\ifdim\@tempa\p@<\p@\scalebox{\@tempa}{\usebox\pandoc@box}%
69+
\else\usebox{\pandoc@box}%
70+
\fi%
71+
}
7172
% Set default figure placement to htbp
72-
\makeatletter
7373
\def\fps@figure{htbp}
7474
\makeatother
75-
\setlength{\emergencystretch}{3em} % prevent overfull lines
76-
\providecommand{\tightlist}{%
77-
\setlength{\itemsep}{0pt}\setlength{\parskip}{0pt}}
78-
\setcounter{secnumdepth}{5}
7975
\ifLuaTeX
8076
\usepackage[bidi=basic]{babel}
8177
\else
@@ -84,11 +80,19 @@
8480
\babelprovide[main,import]{english}
8581
\ifPDFTeX
8682
\else
87-
\babelfont[english]{rm}{texgyretermes}
83+
\babelfont{rm}[Path=fonts/,Extension=.otf,UprightFont=*-regular,BoldFont=*-bold,ItalicFont=*-italic,BoldItalicFont=*-BoldItalic]{TeXGyreTermes}
8884
\fi
8985
% get rid of language-specific shorthands (see #6817):
9086
\let\LanguageShortHands\languageshorthands
9187
\def\languageshorthands#1{}
88+
\ifLuaTeX
89+
\usepackage[english]{selnolig} % disable illegal ligatures
90+
\fi
91+
\setlength{\emergencystretch}{3em} % prevent overfull lines
92+
\providecommand{\tightlist}{%
93+
\setlength{\itemsep}{0pt}\setlength{\parskip}{0pt}}
94+
\usepackage[backend=biber]{biblatex}
95+
\addbibresource{./references/references.bib}
9296
% The following package and toggle
9397
% are needed to implement the switch
9498
% between the PhD and MS templates.
@@ -703,12 +707,7 @@
703707
% We recommend using the more modern ebproof over
704708
% the more "traditional" bussproofs,
705709
\usepackage{ebproof}
706-
\ifLuaTeX
707-
\usepackage{selnolig} % disable illegal ligatures
708-
\fi
709-
\usepackage[backend=biber]{biblatex}
710-
\addbibresource{./references/references.bib}
711-
\IfFileExists{bookmark.sty}{\usepackage{bookmark}}{\usepackage{hyperref}}
710+
\usepackage{bookmark}
712711
\IfFileExists{xurl.sty}{\usepackage{xurl}}{} % add URL line breaks if available
713712
\urlstyle{same}
714713
\hypersetup{
@@ -748,8 +747,7 @@
748747
\cleardoublepage
749748
\pagenumbering{arabic}
750749

751-
\hypertarget{introduction}{%
752-
\chapter{Introduction}\label{introduction}}
750+
\chapter{Introduction}\label{introduction}
753751

754752
This document is a guide on how to use it (``how meta!''), and its
755753
structure does not reflect the structure of a Thesis: you will need to
@@ -781,8 +779,7 @@ \chapter{Introduction}\label{introduction}}
781779
are indicated in such environments.
782780
\end{description}
783781

784-
\hypertarget{title-levels}{%
785-
\section{Title Levels}\label{title-levels}}
782+
\section{Title Levels}\label{title-levels}
786783

787784
As indicated in the koma-script manual, the class
788785
\passthrough{\lstinline!scrbook!} that is used for this document has
@@ -808,28 +805,23 @@ \subsubsection{Test}
808805
the level of heading.
809806
\end{description}
810807

811-
\hypertarget{subsection}{%
812-
\subsection{Subsection}\label{subsection}}
808+
\subsection{Subsection}\label{subsection}
813809

814810
This is a subsection.
815811

816-
\hypertarget{subsubsection}{%
817-
\subsubsection{Subsubsection}\label{subsubsection}}
812+
\subsubsection{Subsubsection}\label{subsubsection}
818813

819814
This is a subsubsection.
820815

821-
\hypertarget{paragraph}{%
822-
\paragraph{Paragraph}\label{paragraph}}
816+
\paragraph{Paragraph}\label{paragraph}
823817

824818
This is a paragraph.
825819

826-
\hypertarget{sub-paragraph}{%
827-
\subparagraph{Sub-Paragraph}\label{sub-paragraph}}
820+
\subparagraph{Sub-Paragraph}\label{sub-paragraph}
828821

829822
This is a sub-paragraph.
830823

831-
\hypertarget{debugging}{%
832-
\section{Debugging}\label{debugging}}
824+
\section{Debugging}\label{debugging}
833825

834826
If this template does not ``work'' as expected, feel free to
835827
\href{https://github.com/aubertc/au_ccs_dissertation_template/issues}{open
@@ -838,9 +830,7 @@ \section{Debugging}\label{debugging}}
838830
after having looked at \passthrough{\lstinline!aux/input.log!} as
839831
(probably) indicated by latexmk.
840832

841-
\hypertarget{references-and-bibliography}{%
842-
\chapter{References and
843-
Bibliography}\label{references-and-bibliography}}
833+
\chapter{References and Bibliography}\label{references-and-bibliography}
844834

845835
Prepare your references using \LaTeX's bibliography system
846836
\href{http://www.bibtex.org/Using/}{\BibTeX}: this template uses by
@@ -861,7 +851,7 @@ \chapter{References and
861851
\href{https://flamingtempura.github.io/bibtex-tidy/}{bibtex-tidy}.
862852

863853
The list of references is automatically inserted in
864-
\protect\hyperlink{chap:references}{the list of references},
854+
\hyperref[chap:references]{the list of references},
865855
p.~\pageref{chap:references}. Use \LaTeX's
866856
\passthrough{\lstinline!\\cite!} command to insert references.
867857

@@ -884,14 +874,13 @@ \chapter{References and
884874
\href{https://pandoc.org/MANUAL.html\#links-1}{hyperlinks} in different
885875
ways, including hyperlinks to this document\footnote{You may note that
886876
the footnote number is itself a link.} using e.g.~the
887-
\protect\hyperlink{introduction}{link automatically added to all
888-
chapters}, following the convention described
877+
\hyperref[introduction]{link automatically added to all chapters},
878+
following the convention described
889879
\href{https://pandoc.org/MANUAL.html\#heading-identifiers}{in pandoc's
890880
manual}.
891881
\end{description}
892882

893-
\hypertarget{writing-mathematics}{%
894-
\chapter{Writing Mathematics}\label{writing-mathematics}}
883+
\chapter{Writing Mathematics}\label{writing-mathematics}
895884

896885
\LaTeX can be used to render
897886
\href{https://en.m.wikibooks.org/wiki/LaTeX/Mathematics}{complex
@@ -914,9 +903,8 @@ \chapter{Writing Mathematics}\label{writing-mathematics}}
914903
\passthrough{\lstinline!<unicode symbol>!} to be rendered in math mode
915904
using \passthrough{\lstinline!\\ensuremath!}.
916905

917-
\hypertarget{theorem-proof-and-others-environments}{%
918906
\section{Theorem, Proof, and Others
919-
Environments}\label{theorem-proof-and-others-environments}}
907+
Environments}\label{theorem-proof-and-others-environments}
920908

921909
\begin{description}
922910
\item[Markdown only]
@@ -963,8 +951,7 @@ \section{Theorem, Proof, and Others
963951
properly.
964952
\end{description}
965953

966-
\hypertarget{formal-proofs}{%
967-
\section{Formal Proofs}\label{formal-proofs}}
954+
\section{Formal Proofs}\label{formal-proofs}
968955

969956
You can easily represent formal proofs using \LaTeX's ebproof or
970957
bussproof packages:
@@ -980,12 +967,10 @@ \section{Formal Proofs}\label{formal-proofs}}
980967
\end{prooftree}
981968
\end{center}
982969

983-
\hypertarget{figures-tables-code-listings-and-landscape-pages}{%
984970
\chapter{Figures, Tables, (Code) Listings and Landscape
985-
Pages}\label{figures-tables-code-listings-and-landscape-pages}}
971+
Pages}\label{figures-tables-code-listings-and-landscape-pages}
986972

987-
\hypertarget{figures}{%
988-
\section{Figures}\label{figures}}
973+
\section{Figures}\label{figures}
989974

990975
\begin{description}
991976
\tightlist
@@ -999,12 +984,11 @@ \section{Figures}\label{figures}}
999984

1000985
\begin{figure}
1001986
\centering
1002-
\includegraphics[width=0.8\textwidth,height=\textheight]{pictures/D_un_autre_age.jpg}
987+
\includegraphics[width=0.8\linewidth,height=\textheight,keepaspectratio]{pictures/D_un_autre_age.jpg}
1003988
\caption{\emph{D'un autre âge}\label{fig:d_un_autre_age}}
1004989
\end{figure}
1005990

1006-
\hypertarget{tables}{%
1007-
\section{Tables}\label{tables}}
991+
\section{Tables}\label{tables}
1008992

1009993
\begin{description}
1010994
\tightlist
@@ -1017,9 +1001,9 @@ \section{Tables}\label{tables}}
10171001
\end{description}
10181002

10191003
\begin{longtable}[]{@{}
1020-
>{\raggedright\arraybackslash}p{(\columnwidth - 4\tabcolsep) * \real{0.1528}}
1021-
>{\centering\arraybackslash}p{(\columnwidth - 4\tabcolsep) * \real{0.1667}}
1022-
>{\raggedleft\arraybackslash}p{(\columnwidth - 4\tabcolsep) * \real{0.1667}}@{}}
1004+
>{\raggedright\arraybackslash}p{(\linewidth - 4\tabcolsep) * \real{0.1528}}
1005+
>{\centering\arraybackslash}p{(\linewidth - 4\tabcolsep) * \real{0.1667}}
1006+
>{\raggedleft\arraybackslash}p{(\linewidth - 4\tabcolsep) * \real{0.1667}}@{}}
10231007
\caption{The price of categories \label{tbl:demo1}}\tabularnewline
10241008
\toprule\noalign{}
10251009
\begin{minipage}[b]{\linewidth}\raggedright
@@ -1066,9 +1050,9 @@ \section{Tables}\label{tables}}
10661050
\end{longtable}
10671051

10681052
\begin{longtable}[]{@{}
1069-
>{\raggedright\arraybackslash}p{(\columnwidth - 4\tabcolsep) * \real{0.2222}}
1070-
>{\raggedright\arraybackslash}p{(\columnwidth - 4\tabcolsep) * \real{0.2222}}
1071-
>{\raggedright\arraybackslash}p{(\columnwidth - 4\tabcolsep) * \real{0.2917}}@{}}
1053+
>{\raggedright\arraybackslash}p{(\linewidth - 4\tabcolsep) * \real{0.2222}}
1054+
>{\raggedright\arraybackslash}p{(\linewidth - 4\tabcolsep) * \real{0.2222}}
1055+
>{\raggedright\arraybackslash}p{(\linewidth - 4\tabcolsep) * \real{0.2917}}@{}}
10721056
\caption{The price and advantages of fruits
10731057
\label{tbl:demo3}}\tabularnewline
10741058
\toprule\noalign{}
@@ -1113,8 +1097,7 @@ \section{Tables}\label{tables}}
11131097
\end{minipage} \\
11141098
\end{longtable}
11151099

1116-
\hypertarget{code-listings}{%
1117-
\section{Code Listings}\label{code-listings}}
1100+
\section{Code Listings}\label{code-listings}
11181101

11191102
Code is displayed using the listings package. Check the ``Table 1:
11201103
Predefined languages'' of the listings package documentation to see the
@@ -1159,8 +1142,7 @@ \section{Code Listings}\label{code-listings}}
11591142

11601143
\lstinputlisting[language=C, caption={"\emph{Hello World}" in C}, label={lst:demo3}]{code/hello_world.c}
11611144

1162-
\hypertarget{landscape-pages}{%
1163-
\section{Landscape Pages}\label{landscape-pages}}
1145+
\section{Landscape Pages}\label{landscape-pages}
11641146

11651147
You can obtain landscape pages using the landscape package in \LaTeX.
11661148

@@ -1186,11 +1168,9 @@ \section{Landscape Pages}\label{landscape-pages}}
11861168
\vspace*{\fill}
11871169
\end{landscape}
11881170

1189-
\hypertarget{margins-and-fonts}{%
1190-
\chapter{Margins and Fonts}\label{margins-and-fonts}}
1171+
\chapter{Margins and Fonts}\label{margins-and-fonts}
11911172

1192-
\hypertarget{margins}{%
1193-
\section{Margins}\label{margins}}
1173+
\section{Margins}\label{margins}
11941174

11951175
The margin have been set to fit the graduate school's requirements to:
11961176

@@ -1202,8 +1182,7 @@ \section{Margins}\label{margins}}
12021182

12031183
Please, do not change those values.
12041184

1205-
\hypertarget{fonts}{%
1206-
\section{Fonts}\label{fonts}}
1185+
\section{Fonts}\label{fonts}
12071186

12081187
The font used is the font
12091188
\href{http://www.gust.org.pl/projects/e-foundry/tex-gyre/termes}{``TeX
@@ -1225,8 +1204,7 @@ \section{Fonts}\label{fonts}}
12251204

12261205
\appendix
12271206

1228-
\hypertarget{appendix-a-optional}{%
1229-
\chapter{Appendix A (Optional)}\label{appendix-a-optional}}
1207+
\chapter{Appendix A (Optional)}\label{appendix-a-optional}
12301208

12311209
Insert here protocols, figures not included, larger listings, etc.
12321210

0 commit comments

Comments
 (0)