From 3b92c1523fd76e735881397eec8d362f4ec48d2b Mon Sep 17 00:00:00 2001 From: Mirek Kratochvil Date: Tue, 25 Aug 2020 16:28:10 +0200 Subject: [PATCH] improve the figure&table captions --- macros.tex | 24 ++++++++---------------- metadata.tex | 1 + thesis.tex | 3 ++- 3 files changed, 11 insertions(+), 17 deletions(-) diff --git a/macros.tex b/macros.tex index a423aa8..59f7a6a 100644 --- a/macros.tex +++ b/macros.tex @@ -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.) diff --git a/metadata.tex b/metadata.tex index 4f299b7..53cb563 100644 --- a/metadata.tex +++ b/metadata.tex @@ -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} diff --git a/thesis.tex b/thesis.tex index 6737f13..b37001a 100644 --- a/thesis.tex +++ b/thesis.tex @@ -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}