Skip to content
Snippets Groups Projects
Commit 04949bd6 authored by Karlson Pfannschmidt's avatar Karlson Pfannschmidt
Browse files

Update cleanthesis.sty to newest version and add new options

parent 620ac41d
No related branches found
No related tags found
No related merge requests found
%% cleanthesis.sty
%% Copyright 2016 R. Langner
%% Copyright 2020 R. Langner
%
% This work may be distributed and/or modified under the
% conditions of the LaTeX Project Public License, either version 1.3
......@@ -29,7 +29,7 @@
%
% **************************************************
\NeedsTeXFormat{LaTeX2e}
\ProvidesPackage{cleanthesis}[2015/08/26 v0.3.1 A clean LaTeX style for thesis documents]
\ProvidesPackage{cleanthesis}[2020/06/17 v0.4.1 A clean LaTeX style for thesis documents]
%
% **************************************************
% Package options
......@@ -42,11 +42,6 @@
% in an easy way
\RequirePackage{xkeyval}
% OPTION sansserif
% --> values = true|false
\define@boolkey[ct]{cthesis}{sansserif}[true]{}
\setkeys[ct]{cthesis}{sansserif=false}
% OPTION hangfigurecaption
% --> values = true|false
\define@boolkey[ct]{cthesis}{hangfigurecaption}[true]{}
......@@ -62,6 +57,21 @@
\define@boolkey[ct]{cthesis}{hangsubsection}[true]{}
\setkeys[ct]{cthesis}{hangsubsection=true}
% OPTION sansserif
% --> values = true|false
\define@boolkey[ct]{cthesis}{sansserif}[false]{}
\setkeys[ct]{cthesis}{sansserif=false}
% OPTION configurelistings
% --> values = true|false
\define@boolkey[ct]{cthesis}{configurelistings}[false]{}
\setkeys[ct]{cthesis}{configurelistings=false}
% OPTION configurebiblatex
% --> values = true|false
\define@boolkey[ct]{cthesis}{configurebiblatex}[false]{}
\setkeys[ct]{cthesis}{configurebiblatex=false}
% OPTION figuresep
% --> values = none|colon|period|space|quad|endash
\define@choicekey*[ct]{cthesis}{figuresep}{none,colon,period,space,quad,newline,endash}[endash]{\def\cthesis@figuresep{#1}}
......@@ -88,14 +98,19 @@
\setkeys[ct]{cthesis}{bibfile=bib-refs}
% OPTION bibstyle
% --> values = alphabetic|numeric|authoryear
\define@choicekey*[ct]{cthesis}{bibstyle}[\val\bibstylenr]{alphabetic,numeric,authoryear}[alphabetic]{\def\cthesis@bibstyle{#1}}
% --> values = biblatex style options
\define@key[ct]{cthesis}{bibstyle}[alphabetic]{\def\cthesis@bibstyle{#1}}
\setkeys[ct]{cthesis}{bibstyle=alphabetic}
% OPTION wrapfooter
% --> values = true|false
\define@boolkey[ct]{cthesis}{wrapfooter}[false]{}
\setkeys[ct]{cthesis}{wrapfooter=false}
% OPTION bibsorting
% --> values = biblatex sorting options
\define@key[ct]{cthesis}{bibsorting}[nty]{\def\cthesis@bibsorting{#1}}
\setkeys[ct]{cthesis}{bibsorting=nty}
% OPTION quotesstyle
% --> values = csquotes style options
\define@key[ct]{cthesis}{quotesstyle}[english]{\def\cthesis@quotesstyle{#1}}
\setkeys[ct]{cthesis}{quotesstyle=english}
\DeclareOptionX*{
\PackageWarning{cleanthesis}{Unknown option ‘\CurrentOption}%
......@@ -199,6 +214,7 @@
\definecolor{ctcolorblack}{gray}{0}
\definecolor{ctcolorgray}{gray}{.5}
\definecolor{ctcolorgraylight}{gray}{.8}
\definecolor{ctcolorgraylighter}{gray}{.95}
% sets the color theme regarding the given package option colortheme
\ifcase\cthesis@colortheme
......@@ -220,9 +236,8 @@
% Font Definitions (see http://www.tug.dk/FontCatalogue/)
% **************************************************
\RequirePackage[T1]{fontenc} % font types and character verification
%\ifthenelse{\boolean{@sansserif}}%
\ifct@cthesis@sansserif
% {%
% Using sans-serif fonts
%
%\RequirePackage{helvet} % Font: Helvetica
......@@ -231,14 +246,12 @@
%\RequirePackage{libertine} % Font: Biolinum, the standard sans serif typeface with the Libertine package
%\RequirePackage[scaled]{berasans} % Font: Bera Sans, a a version of Bitstream Vera Sans slightly enhanced
\renewcommand*\familydefault{\sfdefault}%
% }{%
\else
% Using serif fonts
%
\RequirePackage{lmodern} % font set: Latin Modern
\RequirePackage{charter} % font set: Charter
%\RequirePackage{fourier} % font set: (basically improved utopia)
% }
\fi
% **************************************************
......@@ -248,11 +261,13 @@
\RequirePackage{setspace} % for line spacing, e.g. \onehalfspacing
\RequirePackage[]{graphicx} % graphics import features
\RequirePackage{tabularx} % table features
\RequirePackage{fancyhdr} % for header and footer modifications
%\RequirePackage{fancyhdr} % for header and footer modifications
\RequirePackage{enumitem} % for simple list modifications
\RequirePackage{blindtext} % package for blind text
\RequirePackage{textcomp} % different symbols
\RequirePackage{hyperref} % interactive link inside the document
\RequirePackage{calc}
\RequirePackage[automark]{scrlayer-scrpage}
%
\RequirePackage[ % modify figure and table captions
......@@ -269,28 +284,28 @@
% }{}
\fi
%
\RequirePackage[ % page layout modifications
paper=a4paper, % - use A4 paper size
%scale={0.86,0.94}, % - total body size (h,v)
%scale={0.86,0.94}, % - total body size (h,v)
nohead, % - no header
includefoot, % - include footer space
includemp, % - include side note space
bindingoffset=0.5cm, % - binding correction
top=2.25cm, % - total body: top margin
left=3.75cm, % - total body: left margin (odd pages)
right=0.75cm, % - total body: right margin (odd pages)
bottom=1.5cm, % - total body: bottom margin
marginparwidth=1.75cm, % - width for side note
marginparsep=10pt, % - space between notes and body text (content)
footskip=2cm, % - footer skip size
]{geometry}
%
% **************************************************
% Page construction
% **************************************************
\KOMAoption{headinclude}{false} % include header in body?
\KOMAoption{footinclude}{false} % include footer in body?
\KOMAoption{footlines}{2.1} % number of foot lines
\KOMAoption{mpinclude}{false} % include marginpar in body?
\KOMAoption{BCOR}{25mm} % binding correction
\KOMAoption{DIV}{12} % number of page divs (divider)
%
%
\RequirePackage[ % advanced quotes
strict=true, % - warning are errors now
style=german % - german quotes
style=\cthesis@quotesstyle % - german quotes
]{csquotes}
%
% **************************************************
% Bibliography
% **************************************************
\ifct@cthesis@configurebiblatex
\RequirePackage[ % use biblatex for bibliography
backend=\cthesis@bibsys, % - use biber backend (bibtex replacement) or bibtex
style=\cthesis@bibstyle, % - use alphabetic (or numeric) bib style
......@@ -306,7 +321,8 @@
maxbibnames=5,%
minbibnames=3,%
maxcitenames=2,%
mincitenames=1%
mincitenames=1,%,
sorting=\cthesis@bibsorting%
]{biblatex}
\bibliography{\cthesis@bibfile}
\DefineBibliographyStrings{ngerman}{%
......@@ -314,16 +330,42 @@
backrefpage = {{zitiert auf Seite}},%
backrefpages = {{zitiert auf den Seiten}},%
}
\fi
% **************************************************
% Text Format
% **************************************************
\setstretch{1.2} % value for line spacing, use \setstretch{} or \singlespacing or \onehalfspacing or \doublespacing
\setlength{\parindent}{0em} % value for paragraph indentation
%\setlength{\parindent}{0em} % value for paragraph indentation
\clubpenalty = 10000 % prevent single lines at the beginning of a paragraph (Schusterjungen)
\widowpenalty = 10000 % prevent single lines at the end of a paragraph (Hurenkinder)
\displaywidowpenalty = 10000 %
% **************************************************
% Listing Format
% **************************************************
\ifct@cthesis@configurelistings
\RequirePackage{listings} % package for listings
\lstset{%
backgroundcolor=\color{ctcolorgraylighter},
linewidth=\textwidth,
xleftmargin=10pt,
captionpos=b,
showspaces=false,
showstringspaces=false,
showtabs=false,
tabsize=2,
basicstyle=\footnotesize\ttfamily,
frame=leftline,
framerule=3pt,
framexleftmargin=4pt,
rulecolor=\color{ctcolorgraylight},
numbers=left,
numberstyle=\footnotesize\sffamily\color{ctcolorgray},
numbersep=15pt
}
\fi
% **************************************************
% List Definitions
% **************************************************
......@@ -370,78 +412,93 @@
% **************************************************
% Header and Footer
% **************************************************
\pagestyle{fancy}
\automark[section]{chapter} % automatically marks sections as rightmark
% and chapters as leftmark
\setlength{\footheight}{120pt} % avoids scrlayer-scrpage warning:
% footheight to low warning
\setlength{\footskip}{185pt} % BAD HACK that moves the foot downwards
\KOMAoption{footwidth}{foot:53pt} % BAD HACK that moves the foot towards
% the outer border
\setkomafont{pagefoot}{\ctfontfootertext} % font for footer
\setkomafont{pagenumber}{\ctfontfooterpagenumber} % font for page numbers
%% Redefinition of the chaptermark (used for footer mark on even (left) pages)
\renewcommand{\chaptermark}[1]{%
\markboth{%
\footnotesize%
% use \@chapapp instead of \chaptername to avoid 'Chapter A Appendix ...', thanks to @farbverlust (issue #47)
\ctfontfootertext
% use \@chapapp instead of \chaptername to avoid
% 'Chapter A Appendix ...', thanks to @farbverlust (issue #47)
{\color{ctcolorfootermark}\textbf{\@chapapp\ \thechapter}}%
\quad%
\ifct@cthesis@wrapfooter%
{\color{ctcolorfootertitle}\protect\parbox[t]{.7\textwidth}{#1}}%
\else%
{\color{ctcolorfootertitle}#1}%
\fi%
\hspace{.25cm}%
\protect\begin{minipage}[t]{.65\textwidth}%
#1%
\protect\end{minipage}%
}{}%
}
%% Redefinition of the sectionmark (used for footer mark on odd (right) pages)
\renewcommand{\sectionmark}[1]{%
\markright{%
\footnotesize%
\ctfontfootertext
\protect\raggedleft%
{\color{ctcolorfootermark}\textbf{\thesection}}%
\quad%
\ifct@cthesis@wrapfooter%
{\color{ctcolorfootertitle}\protect\parbox[t]{.7\textwidth}{#1}}%
\else%
{\color{ctcolorfootertitle}#1}%
\fi%
\hspace{.25cm}%
\protect\begin{minipage}[t]{\minof{\widthof{#1}}{.7\textwidth}}%
#1%
\protect\end{minipage}%
}%
}
%
\fancypagestyle{plain}{%
\fancyhf{}
\fancyfootoffset[OR]{1.85cm}
\fancyfoot[OR]{%
{\ }\tgherosfont%
{\color{ctcolorfooterline}\rule[-90pt]{1.25pt}{100pt}}%
\hspace*{10pt}\begin{minipage}[b]{1.5cm}%
\color{ctcolorfooterpage}\normalsize\textbf{\thepage}%
\end{minipage}%
%% Vertical line in the footer (between page number and mark)
\newcommand{\ctfooterline}{%
\color{ctcolorfooterline}\rule[-90pt]{1.25pt}{100pt}%
}
\fancyfootoffset[EL]{1.85cm}
\fancyfoot[EL]{%
\tgherosfont%
%% Page number for odd (right) pages
\newcommand{\ctfooterrightpagenumber}{%
\ctfooterline%
\hspace*{10pt}%
\begin{minipage}[b]{1.5cm}%
\raggedleft\color{ctcolorfooterpage}\normalsize\textbf{\thepage}%
\pagemark\ %
\end{minipage}%
\hspace*{10pt}{\color{ctcolorfooterline}\rule[-90pt]{1.25pt}{100pt}}%
}
\renewcommand{\headrulewidth}{0pt}
\renewcommand{\footrulewidth}{0pt}
}
%
\fancypagestyle{maincontentstyle}{%
\pagestyle{plain}
\fancyhf{}
\fancyfootoffset[OR]{1.85cm}
\fancyfoot[OR]{%
{\ }\tgherosfont\footnotesize%
\rightmark%
\hspace*{0.75cm}{\color{ctcolorfooterline}\rule[-90pt]{1.25pt}{100pt}}%
\hspace*{10pt}\begin{minipage}[b]{1.5cm}%
\color{ctcolorfooterpage}\normalsize\textbf{\thepage}%
\end{minipage}%
}
\fancyfootoffset[EL]{1.85cm}
\fancyfoot[EL]{%
\tgherosfont\footnotesize%
%% Page number for even (left) pages
\newcommand{\ctfooterleftpagenumber}{%
\begin{minipage}[b]{1.5cm}%
\raggedleft\color{ctcolorfooterpage}\normalsize\textbf{\thepage}%
\raggedleft\pagemark%
\end{minipage}%
\footnotesize%
\hspace*{10pt}{\color{ctcolorfooterline}\rule[-90pt]{1.25pt}{100pt}}%
\hspace*{0.75cm}\leftmark%
\hspace*{10pt}%
\ctfooterline%
}
%% Defines the content for header and footer
\lehead{}
\cehead{}
\rehead{}
\lohead{}
\cohead{}
\rohead{}
\lefoot[% > plain
\ctfooterleftpagenumber%
]{% > srcheadings
\ctfooterleftpagenumber%
\hspace*{0.75cm}%
\headmark%
}
\cefoot{}
\refoot{}
\lofoot{}
\cofoot{}
\rofoot[% > plain
\ctfooterrightpagenumber%
]{% > srcheadings
\headmark%
\hspace*{0.75cm}%
\ctfooterrightpagenumber%
}
% **************************************************
% New Commands
......@@ -509,13 +566,22 @@
\newcommand{\book}{\fontfamily{pbk}\fontseries{m}\fontsize{11}{13}\selectfont}
\newcommand{\tgherosfont}{\fontfamily{qhv}\selectfont}
\newcommand{\thesispartlabelfont}{\color{ctcolorpartnum}\book\fontsize{60}{60}\selectfont}
\newcommand{\thesispartfont}{\color{ctcolorparttext}\huge \tgherosfont\selectfont}
\newcommand{\thesischapterfont}{\color{ctcolorblack}\huge \fontfamily{phv}\selectfont}
%\newcommand{\thesissectionfont}{\color{ctcolormain}\LARGE\bfseries \tgherosfont}
\newcommand{\thesissectionfont}{\color{ctcolorsection}\LARGE \tgherosfont}
\newcommand{\thesissubsectionfont}{\color{ctcolorsubsection}\Large \tgherosfont}
\newcommand{\thesisparagraphfont}{\color{ctcolorparagraph}\tgherosfont\small\bfseries}
\newcommand{\thesispartlabelfont}{\color{ctcolorpartnum}\nobreak\book\fontsize{60}{60}\selectfont}
\newcommand{\thesispartfont}{\color{ctcolorparttext}\nobreak\normalfont\huge \tgherosfont\selectfont}
\newcommand{\thesischapterfont}{\color{ctcolorblack}\nobreak\normalfont\huge \fontfamily{phv}\selectfont}
%\newcommand{\thesissectionfont}{\color{ctcolormain}\nobreak\LARGE\bfseries \tgherosfont}
\newcommand{\thesissectionfont}{\color{ctcolorsection}\nobreak\normalfont\LARGE \tgherosfont}
\newcommand{\thesissubsectionfont}{\color{ctcolorsubsection}\nobreak\normalfont\Large \tgherosfont}
\newcommand{\thesisparagraphfont}{\color{ctcolorparagraph}\nobreak\tgherosfont\small\bfseries}
\newcommand{\ctfontfooterpagenumber}{%
\color{ctcolorfooterpage}%
\normalfont\normalsize\bfseries \tgherosfont%
}
\newcommand{\ctfontfootertext}{%
\color{ctcolorfootertitle}%
\normalfont\footnotesize \tgherosfont%
}
%
% headings
\setkomafont{part}{\thesispartfont} % for chapter entries
......@@ -529,6 +595,7 @@
%\setkomafont{subsection}{\large} % for subsection entries
%
% **************************************************
% Sectioning
......@@ -617,29 +684,15 @@
%
%
% **************************************************
% ToC, LoF, LoT
% ToC, LoF, LoT, LoL
% **************************************************
%
% -- modifications regarding the table of contents,
% the list of figures and the list of tables
%
%
% The tocloft package enables us to control the typographic design of the
% table of contents, list of figures and list of tables
\RequirePackage{tocloft}
% - fixes wrong fonts in the toc, thanks to magnucki
\renewcommand{\cftchapfont}{\usefont{T1}{bch}{b}{n}\selectfont}
\renewcommand{\cfttoctitlefont}{\thesischapterfont}
\renewcommand{\cftloftitlefont}{\thesischapterfont}
\renewcommand{\cftlottitlefont}{\thesischapterfont}
%
%
% > adjusts the indention for figure and table entries (lof and lot)
% -- \cftsetindents{entry}{indent}{numwidth} sets the entry's indent to
% the length indent and its numwidth to the length numwidth
\cftsetindents{figure}{0em}{3em}
\cftsetindents{table}{0em}{3em}
% the list of figures, list of tables,
% and list of listings
%
% > removes indention for lists of floating environments (e.g., lof and lot)
\KOMAoption{listof}{flat}
%
%
% **************************************************
......
......@@ -13,6 +13,8 @@
listof=totoc, % include listof entries in toc
titlepage=on, % own page for each title page
captions=tableabove, % display table captions above the float env
chapterprefix=false, % do not display a prefix for chapters
appendixprefix=false, % but display a prefix for appendix chapter
draft=false, % value for draft version
]{scrreprt}%
......@@ -51,6 +53,7 @@
\input{content/acknowledgement} % INCLUDE: acknowledgement
\cleardoublepage
%
\currentpdfbookmark{\contentsname}{toc}
\setcounter{tocdepth}{2} % define depth of toc
\tableofcontents % display table of contents
\cleardoublepage
......@@ -60,7 +63,7 @@
% --------------------------
\pagenumbering{arabic} % arabic page numbering
\setcounter{page}{1} % set page counter
\pagestyle{maincontentstyle} % fancy header and footer
\pagestyle{scrheadings} % fancy header and footer
\input{content/chapter-introduction} % INCLUDE: introduction
\input{content/chapter-related-work} % INCLUDE: related work
......@@ -80,7 +83,8 @@
\setlength{\biblabelsep}{0pt}
\setlength{\bibitemsep}{0.5\baselineskip plus 0.5\baselineskip}
\printbibliography[nottype=online]
\printbibliography[heading=subbibliography,title={Webpages},type=online,prefixnumbers={@}]
\newrefcontext[labelprefix={@}]
\printbibliography[heading=subbibliography,title={Webpages},type=online]
}
\cleardoublepage
......
......@@ -49,16 +49,18 @@
\usepackage[english]{babel} % babel system, adjust the language of the content
\PassOptionsToPackage{% setup clean thesis style
figuresep=colon,%
sansserif=false,%
hangfigurecaption=false,%
hangsection=true,%
hangsubsection=true,%
sansserif=false,%
configurelistings=true,%
colorize=full,%
colortheme=upbisg,%
configurebiblatex=true,%
bibsys=biber,%
bibfile=bib-refs,%
bibstyle=alphabetic,%
wrapfooter=false,%
bibsorting=nty,%
}{cleanthesis}
\usepackage{cleanthesis}
......@@ -75,3 +77,8 @@
bookmarksnumbered=true, %
bookmarksopen=true %
}
% **************************************************
% Other Packages
% **************************************************
\usepackage{scrhack}
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment