GEX thesis source code, full text, references
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
gex-thesis/document_config.tex

304 lines
6.6 KiB

7 years ago
% extra balíky a jejich nastavení
\usepackage{todonotes} % todos
\usepackage{minted} % code listings
\usepackage{blindtext} % lorem
\usepackage{csquotes} % quotes
\usepackage{wrapfig}
\usepackage{svg}
\usepackage[all]{nowidow} % fix for orphaned lines of text
\usepackage{fancyvrb}
\usepackage{siunitx}
\usepackage{sectsty}
\usepackage{titlecaps}
7 years ago
\usepackage{cprotect}
\usepackage{framed}
\usepackage{subcaption}
\usepackage{tabularx}
\usepackage{tabulary}
\usepackage{longtable}
\usepackage{tabu}
7 years ago
\usepackage{flafter} % ensures embeds won't go before their references
\usepackage{enumitem} % better list spacing
7 years ago
\usepackage{bigfoot} % verbatin in footnote
\usepackage{makecell}
\newminted{ini}{frame=leftline,autogobble=true}
% Deprecated crap
\newcommand{\tabitem}{~~\llap{\textbullet}~~}
\newcommand{\tabitemo}{~~\llap{\textopenbullet}~~}
\newcommand\fld[1]{\tabitem \texttt{#1}:}
\newcommand\fldo[1]{\tabitemo \texttt{#1}:}
\newcommand{\fldwcode}{2.2em}
\newcommand{\fldwpld}{.35\textwidth}
\newcommand{\fldreq}{\textit{Request}\newline}
\newcommand{\fldresp}{\textit{Response}\newline}
\newcommand\flname[1]{\textbf{#1}\newline}
7 years ago
\usepackage{mytabto} % customized tabto that does not break to a new line
\newcommand{\cfield}[1]{\item \texttt{#1}\tabto{.8cm}}
\newcommand{\cname}[1]{\textbf{#1}\newline}
7 years ago
\usepackage{ragged2e}
% https://tex.stackexchange.com/questions/157389/how-to-center-column-values-in-a-table
% P will be a centered column that can have width
\newcolumntype{P}[1]{>{\centering\arraybackslash}p{#1}}
7 years ago
% this is put before a response that follows a request
% this is needed because the request has a negative gap after itself
\newcommand*{\cjoin}{\null\vspace*{-2pt}}
% This is a table of commands of events
\newenvironment{cmdlist}
{
7 years ago
% \tabulinesep=3pt
\tabulinesep=7pt
\begin{longtabu} to \textwidth {P{\fldwcode} X[3] X[3,l]}
\toprule
\textbf{Code} & \textbf{Function} & \textbf{Payload} \\
\midrule
\endhead
\bottomrule
\endfoot
}
{
\end{longtabu}
}
% a list of generic payload fields
\newenvironment{cmdpldlist}
{
%topsep=0pt,partopsep=0pt,
\begin{itemize}[
7 years ago
leftmargin=.7cm,
nosep,
7 years ago
%after = \vspace{-\baselineskip}
]
}
{
\end{itemize}
}
7 years ago
% a list of request fields, with a caption
\newenvironment{cmditemlistenv}[1]
{
\begin{minipage}[t]{\linewidth}
% \begin{flushleft} % fix weird spacing in wrapped lines
\textit{#1} \begin{cmdpldlist}
}
{
\end{cmdpldlist}
% \end{flushleft}
\end{minipage}
}
% a list of request fields, with a caption
\newenvironment{cmdreq}
{
7 years ago
\begin{cmditemlistenv}{Request:}
}
{
7 years ago
\end{cmditemlistenv}
}
% a list of request fields, with a caption
\newenvironment{cmdresp}
{
7 years ago
\begin{cmditemlistenv}{Response:}
}
{
7 years ago
\end{cmditemlistenv}
}
% a list of payload fields, with a caption
\newenvironment{cmdpld}
{
7 years ago
\begin{cmditemlistenv}{Payload:}
}
{
7 years ago
\end{cmditemlistenv}
}
7 years ago
\newcommand{\uF}{\micro\farad}
\newcommand{\nF}{\nano\farad}
\newcommand{\cm}{\centi\metre}
\newcommand{\VperA}{\V/\A}
%nobreak dash
%\usepackage{lmodern}
%\usepackage{cfr-lm}
7 years ago
\usepackage[style=numeric,backend=biber,sorting=none]{biblatex}
\usepackage{xpatch,letltxmacro}
\LetLtxMacro{\cminted}{\minted}
\let\endcminted\endminted
\xpretocmd{\cminted}{\RecustomVerbatimEnvironment{Verbatim}{BVerbatim}{}}{}{}
% More space in table cells
\renewcommand{\arraystretch}{1.4}
% Fix overful hbox
\setlength{\emergencystretch}{.5em}
%\setsvg{svgpath=img/}
\svgpath{img/}
7 years ago
% Nastavení ctuthesis
\ctusetup{
xdoctype = M,
front-list-of-tables = false,
mainlanguage = english,
%
author = {Ondřej Hruška},
supervisor = {doc. Ing. Radislav Šmíd, Ph.D.},
%
title-english = {Learning and automation GPIO platform},
title-czech = {Výuková a automatizační GPIO platforma},
%
xfaculty = F3,
department-czech = {Katedra měření},
fieldofstudy-czech = {Kybernetika a~robotika},
subfieldofstudy-czech = {Senzory a~přístrojová technika},
%
department-english = {Department of Measurement},
fieldofstudy-english = {Cybernetics and Robotics},
subfieldofstudy-english = {Sensors and Instrumentation},
front-specification = true,
specification-file = {zadani-zakryto.pdf},
%specification-file = {zadani-doc.pdf},
%specification-file = {zadani-doc.pdf},
%
keywords-czech = {},
keywords-english = {},
%
day = 0, % ???
month = 0, % ???
year = 2018, % ???
}
\ctuprocess
\hypersetup{
pdftitle = {Learning and automation GPIO platform},
pdfauthor = {Ondřej Hruška}
}
% Extra info na titulní stránce
\addto\ctucaptionsczech{%
\def\supervisorname{Vedoucí}%
\def\subfieldofstudyname{Studijní program}%
}
% Abstrakt, poděkování atd
\ctutemplateset{maketitle twocolumn default}{
\begin{twocolumnfrontmatterpage}
\ctutemplate{twocolumn.thanks}
\ctutemplate{twocolumn.declaration}
\ctutemplate{twocolumn.abstract.in.titlelanguage}
\ctutemplate{twocolumn.abstract.in.secondlanguage}
\ctutemplate{twocolumn.tableofcontents}
\ctutemplate{twocolumn.listoffigures}
\end{twocolumnfrontmatterpage}
}
% Uvozovky v češtině
% \DeclareQuoteStyle{czech}
% {\quotedblbase}
% {\textquotedblleft}
% {\textquoteleft}
% {\textquoteright}
% ??? what does this do
\makeatletter
\newcommand*{\centerfloat}{%
\parindent \z@
\leftskip \z@ \@plus 1fil \@minus \textwidth
\rightskip\leftskip
\parfillskip \z@skip}
\makeatother
% makro pro uvozovky
% \renewcommand\uv[1]{\enquote{#1}}
% monospace
\newcommand\mono[1]{\texttt{#1}}
% library name
\newcommand\lib[1]{\textit{#1}}
% add blank page unless current is left
%\newcommand*\cleartoleftpage{%
% \clearpage
% \ifodd\value{page}\hbox{}\newpage\fi
%}
% \newcommand\zdroj[1]{\textit{Zdroj: #1}}
% -- odstavce --
\setlength\parskip{1.5ex plus 1pt minus 1 pt}
%\setlength{\parskip}{1.5ex plus 0.2ex minus 0.1ex} % po změně je potřeba doladit nadpisy
%\renewcommand{\baselinestretch}{1.1}
\setlength\parindent{.5cm}
% -- set link colors ---
\usepackage{xcolor}
\hypersetup{
colorlinks,
linkcolor={red!50!black},
citecolor={blue!50!black},
urlcolor={blue!80!black}
}
% název listing figure
% \renewcommand\listingscaption{Program}
% don't clear page before chapter
%\renewcommand{\cleardoublepage}{\clearpage}
% -- section on new page, except first --
%\pretocmd{\section}{%
% \ifnum\value{section}=0 \else\clearpage\fi
%}{}{}
\usepackage{wasysym} % some symbols
% Pretty mono font
%\usepackage[scaled=.9]{beramono}
%\usepackage{cm}
\newcommand\nobr[1]{\mbox{#1}}
\usepackage{pmboxdraw}
% ---- Booktabs config ----
%\setlength{\heavyrulewidth}{0.11em}
%\setlength{\lightrulewidth}{0.05em}
%\setlength{\cmidrulewidth}{0.03em}
\setlength{\heavyrulewidth}{0.5mm}
\setlength{\lightrulewidth}{0.25mm}
\setlength{\cmidrulewidth}{0.25mm}