Skip to content

Commit

Permalink
splitting out macros from thesis_config.tex
Browse files Browse the repository at this point in the history
  • Loading branch information
homberghp committed May 27, 2024
2 parents 9e8d60e + 74170c6 commit a4924c3
Show file tree
Hide file tree
Showing 7 changed files with 115 additions and 76 deletions.
53 changes: 53 additions & 0 deletions configuration/longtablemacros.tex
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
\newcommand\itemcell[1]{%
%\mbox{% uncomment for debug
\begin{minipage}[t]{\linewidth}%
\begin{itemize}[leftmargin=3.5ex]%
#1
\end{itemize}%
\end{minipage}\vspace{.4\baselineskip}%
%}% uncomment
}


\newcommand\headcell[1]{%
\begin{minipage}[c]{\linewidth}
\vspace{.2\baselineskip}%
\raggedright%
\textbf{#1}
\end{minipage}\vspace{.4\baselineskip}%
}

\newcommand\firstcell[1]{%
\cellcolor{Gray}%
\begin{minipage}[c]{\linewidth}%
\vspace{.2\baselineskip}%
\raggedright%
\textbf{#1}
\end{minipage}\vspace{.4\baselineskip}%
}

\newcommand\textcell[1]{%
\fbox{%
\begin{minipage}[t]{\linewidth}%
\raggedright%
#1
\end{minipage}}\vspace{.4\baselineskip}%
}
\newlength{\BulletSize}
\setlength{\BulletSize}{1.5ex}
\definecolor{Gray}{gray}{0.9} % color used in table borders
\newlength{\TabColumnWidth} % for tables
\newcommand\CheckMarkGreen[1]{\includegraphics[height=#1]{images/Check_Green_White.pdf}\hspace{2pt}}
\newcommand\CMark{\raisebox{-.1\BulletSize}{\CheckMarkGreen{\BulletSize}}}
\newcommand\CrossMarkRed[1]{\includegraphics[height=#1]{images/Cross_red_circle.pdf}\hspace{2pt}}
\newcommand\XMark{\raisebox{-.1\BulletSize}{\CrossMarkRed{\BulletSize}}}
\newcommand\WarningMarkYellow[1]{\includegraphics[height=#1]{images/Alert_Yellow_White.pdf}\hspace{2pt}}
\newcommand\WMark{\raisebox{-.1\BulletSize}{\WarningMarkYellow{\BulletSize}}}
\newcommand\FirstCell[1]{\cellcolor{Gray}\thead{#1}}
\newcommand\URLIcon[1]{\includegraphics[height=#1]{images/URL.pdf}\hspace{2pt}}
\newcommand\UMark{\raisebox{-.1\BulletSize}{\URLIcon{\BulletSize}}}
\newcommand\itemC{\item[\CMark]}
\newcommand\itemX{\item[\XMark]}
\newcommand\itemW{\item[\WMark]}
\newcommand\itemU{\item[\UMark]}
\newcommand\MyURL[2]{\url{#1}{\UMark #1}}
33 changes: 27 additions & 6 deletions configuration/macros.tex
Original file line number Diff line number Diff line change
@@ -1,8 +1,3 @@
%----------------------------------------------------------
% DO NOT TOUCH THIS FILE UNLESS YOU KNOW WHAT YOU ARE DOING
%----------------------------------------------------------


% environment for a two column table with proper alignment
% usage
% \begin{infoblock}
Expand All @@ -16,7 +11,7 @@
\end{table}
}

% Simple command for a fancy that attracts attention.
% Simple command for a fancy quote that attracts attention.
% usage:
% \LongQuote{the text you are quoting}{the name of the author}
% Any name can be passed (e.g. \citet{author2000text})
Expand All @@ -29,3 +24,29 @@
\textit{#2}
\end{flushright}
}

% my own Itemize, Enumerate, and Description : a bit less spacy then the default
\newenvironment{Itemize} {
\begin{itemize}{}%
\setlength\topsep{0ex}%
\setlength\parskip{0ex}%
\setlength\partopsep{0em}%
\setlength\parsep{0em}%
\setlength\itemsep{0em}%
}{\end{itemize}
}
\newenvironment{Enumerate}{
\begin{enumerate}
\setlength{\itemsep}{1pt}
\setlength{\parskip}{0pt}
\setlength{\parsep}{0pt}}
{\end{enumerate}
}

\newenvironment{Description}{
\begin{description}
\setlength{\itemsep}{1pt}
\setlength{\parskip}{0pt}
\setlength{\parsep}{0pt}}
{\end{description}
}
92 changes: 28 additions & 64 deletions configuration/thesis_config.tex
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,7 @@
%% citation and bibliography style.
%% This style depends on 'sortname' and 'shorthand' fields in the bib file.
%% This gives you control on what is shown in the labels.
%% If you ommit the shorthand, the styles fall back to a numeric label

%% biblatex options, defualt to numeric but also support
%% shorthand and sortname keys in bib file bibliography.
%% If you ommit the shorthand, the styles fall back to a numeric label.
\usepackage[
backend=biber,
hyperref=true,
Expand Down Expand Up @@ -139,44 +136,59 @@

\usepackage[final]{pdfpages}

% definitions for line numbers modulo 3, tiny gray
\usepackage[pagewise,mathlines,displaymath]{lineno}
%\setpagewiselinenumbers
\modulolinenumbers[3]
\renewcommand{\linenumberfont}{\normalfont\tiny\color{gray}}
\usepackage{hyperref}
\IfFileExists{linenumberingOn}{\linenumbers}{}
%% end line numbers def

%% hyperref usage, link colors
\usepackage[unicode]{hyperref}
\hypersetup{
colorlinks=true,
colorlinks=true,
linkcolor=BlueViolet,
filecolor=DarkOrchid,
citecolor=PineGreen,
urlcolor=RoyalPurple,
pdfinfo={
Title={\documentname},
Subject={\subject},
Author={\studentname\ \snumber},
Keywords={\keywords},
}
}
%% pick up definitions from info page

%% end hyperref
\usepackage[toc,acronym,xindy]{glossaries-extra}
\setabbreviationstyle[acronym]{short-long}

%%

\usepackage{cleveref}[2012/02/15]
\crefformat{footnote}{#2\footnotemark[#1]#3}


%% add blindtext for demo
\usepackage{lipsum}
\usepackage{metainfo}
\providecommand{\MineOnlyStart}{}
\providecommand{\MineOnlyEnd}{}

\input{configuration/macros}
\input{configuration/longtablemacros}

%\usepackage{natbib}
\usepackage[nottoc]{tocbibind}
\usepackage{titlesec}
\usepackage{fancyhdr}
\addtolength\headwidth\marginparwidth
\addtolength\headwidth\marginparsep
\setlength{\parindent}{0pt}
\setlength{\parskip}{.5\baselineskip}
\usepackage{adjustbox}
\usepackage[toc,page,title,titletoc,header]{appendix}

% chapter titles theme.
% chapter section titles theme.
\definecolor{gray75}{gray}{0.75}
\newcommand{\hsp}{\hspace{20pt}}
\titleformat{\chapter}[hang]{\Huge\bfseries}{\thechapter\hsp\textcolor{gray75}{|}\hsp}{0pt}{\Huge\bfseries}
Expand All @@ -185,6 +197,10 @@
\titlespacing*{\chapter}{0pt}{0pt}{40pt}
\titlespacing{\chapter}{0pt}{-25mm}{40pt}

%% define local fancy header styles
\usepackage{fancyhdr}
\addtolength\headwidth\marginparwidth
\addtolength\headwidth\marginparsep
\fancypagestyle{fancy}{%
\fancyhf{}
\fancyfoot[C]{\thepage}
Expand Down Expand Up @@ -223,6 +239,7 @@
}
\providecommand\DefInfo[1]{ define \textbackslash{}#1 in file ``./infopage.txt''}
\providecommand\documentname{\DefInfo{documentname}}
\providecommand\subject{\DefInfo{subject}}
\providecommand\studentname{\DefInfo{studentname}}
\providecommand\place{\DefInfo{place}}
\providecommand\snumber{\DefInfo{snummer}}
Expand All @@ -239,7 +256,7 @@
\providecommand\examiner{\DefInfo{examiner}}
\providecommand\externalexpert{\DefInfo{externalexpert}}
\providecommand\hasnda{\DefInfo{hasnda}}

\providecommand\keywords{\DefInfo{\keywords}}
% This macro '\define' puts the argument in em
% and in boldface in the margin.
\providecommand{\define}[1]{% 1 argument
Expand All @@ -253,59 +270,6 @@
p{#1}%
}

\newcommand\itemcell[1]{%
%\mbox{% uncomment for debug
\begin{minipage}[t]{\linewidth}%
\begin{itemize}[leftmargin=3.5ex]%
#1
\end{itemize}%
\end{minipage}\vspace{.4\baselineskip}%
%}% uncomment
}


\newcommand\headcell[1]{%
\begin{minipage}[c]{\linewidth}
\vspace{.2\baselineskip}%
\raggedright%
\textbf{#1}
\end{minipage}\vspace{.4\baselineskip}%
}

\newcommand\firstcell[1]{%
\cellcolor{Gray}%
\begin{minipage}[c]{\linewidth}%
\vspace{.2\baselineskip}%
\raggedright%
\textbf{#1}
\end{minipage}\vspace{.4\baselineskip}%
}

\newcommand\textcell[1]{%
\fbox{%
\begin{minipage}[t]{\linewidth}%
\raggedright%
#1
\end{minipage}}\vspace{.4\baselineskip}%
}
\newlength{\BulletSize}
\setlength{\BulletSize}{1.5ex}
\definecolor{Gray}{gray}{0.9} % color used in table borders
\newlength{\TabColumnWidth} % for tables
\newcommand\CheckMarkGreen[1]{\includegraphics[height=#1]{images/Check_Green_White.pdf}\hspace{2pt}}
\newcommand\CMark{\raisebox{-.1\BulletSize}{\CheckMarkGreen{\BulletSize}}}
\newcommand\CrossMarkRed[1]{\includegraphics[height=#1]{images/Cross_red_circle.pdf}\hspace{2pt}}
\newcommand\XMark{\raisebox{-.1\BulletSize}{\CrossMarkRed{\BulletSize}}}
\newcommand\WarningMarkYellow[1]{\includegraphics[height=#1]{images/Alert_Yellow_White.pdf}\hspace{2pt}}
\newcommand\WMark{\raisebox{-.1\BulletSize}{\WarningMarkYellow{\BulletSize}}}
\newcommand\FirstCell[1]{\cellcolor{Gray}\thead{#1}}
\newcommand\URLIcon[1]{\includegraphics[height=#1]{images/URL.pdf}\hspace{2pt}}
\newcommand\UMark{\raisebox{-.1\BulletSize}{\URLIcon{\BulletSize}}}
\newcommand\itemC{\item[\CMark]}
\newcommand\itemX{\item[\XMark]}
\newcommand\itemW{\item[\WMark]}
\newcommand\itemU{\item[\UMark]}
\newcommand\MyURL[2]{\url{#1}{\UMark #1}}
\usepackage[avantgarde]{quotchap}
\renewcommand\chapterheadstartvskip{\vspace*{-5\baselineskip}}

Expand Down
Binary file modified docs/main.pdf
Binary file not shown.
2 changes: 2 additions & 0 deletions infopage.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
%% set the proper data here.
\def\documentname{Towards a better Bachelor Thesis}
\def\subject{Examples of proper \LaTeX\ usage for a Thesis\\With general tips on file formats for diagrams and tables}
\def\studentname{Pietje Bell}
\def\snumber{1234567}
\def\place{Venlo}
Expand All @@ -16,4 +17,5 @@
\def\examiner{Dr V. Strict}
\def\externalexpert{A. Einstein}
\def\hasnda{No}
\def\keywords{Thesis Structure DRY vector format}

4 changes: 1 addition & 3 deletions main.tex
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,9 @@
%% or \def\Languages{english,british} if you prefer british as English style
\def\Languages{ngerman,dutch,english}
\input{configuration/thesis_config}
%\includeonly{chapters/chapter_1}
% provide data for title page
\IfFileExists{linenumberingOn}{\linenumbers}{}
\title{\documentname}
\author{\studentname}
\author{\studentname,\snumber}
\date{\place, \today}
\addbibresource{references.bib}
% \addbibresource{SEN2Bibliography.bib}
Expand Down
7 changes: 4 additions & 3 deletions partials/informationpage.tex
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,10 @@ \chapter*{\InformationPageTitle}

\vspace*{1cm}
\noindent
{\centering \Large\bfseries
\documentname

{\begin{center} \Large\bfseries
\documentname\\
\subject
\end{center}
}

\vspace{1cm}
Expand Down

0 comments on commit a4924c3

Please sign in to comment.