improve the figure&table captions

This commit is contained in:
Mirek Kratochvil 2020-08-25 16:28:10 +02:00
parent af951b3597
commit 3b92c1523f
3 changed files with 11 additions and 17 deletions

View File

@ -48,8 +48,14 @@
\newcommand{\asy}[1]{\mathcal{O}(#1)}
% listings and default lstlisting config (remove if unused)
\floatstyle{ruled}
\newfloat{listing}{tbp}{lst}
\DeclareNewFloatType{listing}{}
\floatsetup[listing]{style=ruled}
\DeclareCaptionStyle{thesis}{style=base,font={small,sf},labelfont=bf,labelsep=quad}
\captionsetup{style=thesis}
\captionsetup[algorithm]{style=thesis,singlelinecheck=off}
\captionsetup[listing]{style=thesis,singlelinecheck=off}
\ifEN\floatname{listing}{Listing}
\else\floatname{listing}{Výpis kódu}\fi
\lstset{%
@ -62,20 +68,6 @@
stringstyle=\color{red!50!black},
keywordstyle=\color{blue!75!black}}
% re-styling of the captions with the float package
\makeatletter
\newcommand\floatc@plainb[2]{\setbox\@tempboxa\hbox{{\@fs@cfont #1} #2}%
\ifdim\wd\@tempboxa>\hsize {\@fs@cfont #1} #2\par
\else\hbox to\hsize{\hfil\box\@tempboxa\hfil}\fi}
\newcommand\fs@plainb{\def\@fs@cfont{\bfseries}\let\@fs@capt\floatc@plainb%
\def\@fs@pre{}\def\@fs@post{}%
\def\@fs@mid{\vspace\abovecaptionskip\relax}%
\let\@fs@iftopcapt\iffalse}
\makeatother
\floatstyle{plainb}
\restylefloat{table}
\restylefloat{figure}
% Czech versions of the used cleveref references (It's not as convenient as in
% English because of declension, cleveref is limited to sg/pl nominative. Use
% plain \ref to dodge that.)

View File

@ -11,6 +11,7 @@
\newif\ifMFF
\MFFtrue % comment this out for the version with a big UK university logo
\def\UKName{Charles University in Prague} %this is used in UK-logo-version
\def\UKFaculty{Faculty of Mathematics and Physics}
\def\ThesisTypeName{\ifEN BACHELOR THESIS \else BAKALÁŘSKÁ PRÁCE \fi}
%\def\ThesisTypeName{\ifEN MASTER THESIS \else DIPLOMOVÁ PRÁCE \fi}

View File

@ -43,7 +43,8 @@
\usepackage{graphicx}
\usepackage{xcolor}
\usepackage{booktabs}
\usepackage{float}
\usepackage{caption}
\usepackage{floatrow}
% load bibliography tools
\usepackage[backend=bibtex,natbib,style=numeric,sorting=none]{biblatex}