Compare commits

..

3 Commits

Author SHA1 Message Date
Mirek Kratochvil
96097b195a add explanatory comments to the table formatting style
If you guys believe the rant wasn't necessary, you need to re-read TeX Book
chapter 1.
2021-07-20 11:31:37 +02:00
Mirek Kratochvil
32af85cd72 fix table caption 2021-07-19 20:22:05 +02:00
Mirek Kratochvil
bf3080d8d7 aligned table-top captions (draft) 2021-07-19 20:04:06 +02:00
2 changed files with 28 additions and 5 deletions

12
ch2.tex
View File

@ -24,8 +24,10 @@ Use induction on sets of cars $C$. The statement holds trivially for $|C|\leq1$.
\end{proof} \end{proof}
\begin{table} \begin{table}
\centering % uncomment the following line if you use the fitted top captions for tables
{\footnotesize\sf % (see the \floatsetup[table] comments in `macros.tex`.
%\floatbox{table}[\FBwidth]{
\centering\footnotesize\sf
\begin{tabular}{llrl} \begin{tabular}{llrl}
\toprule \toprule
Column A & Column 2 & Numbers & More \\ Column A & Column 2 & Numbers & More \\
@ -40,8 +42,10 @@ Asd qsd 1sd & \textcolor{green!80!black}{GOOD} & 234234299 & -- \\
Asd & NUMBER & \textbf{123123} & -- \\ Asd & NUMBER & \textbf{123123} & -- \\
Asd qsd 1sd & DIFFERENT & 234234234 & (no data) \\ Asd qsd 1sd & DIFFERENT & 234234234 & (no data) \\
\bottomrule \bottomrule
\end{tabular}} \end{tabular}
\caption{An example table. Table caption should clearly explain how to interpret the data in the table. Use some visual guide, such as boldface or color coding, to highlight the most important results (e.g., comparison winners).} %}{ % uncomment if you use the \floatbox (as above), erase otherwise
\caption{An example table. Table caption should clearly explain how to interpret the data in the table. Use some visual guide, such as boldface or color coding, to highlight the most important results (e.g., comparison winners).}
%} % uncomment if you use the \floatbox
\label{tab:z} \label{tab:z}
\end{table} \end{table}

View File

@ -56,9 +56,28 @@
\captionsetup[algorithm]{style=thesis,singlelinecheck=off} \captionsetup[algorithm]{style=thesis,singlelinecheck=off}
\captionsetup[listing]{style=thesis,singlelinecheck=off} \captionsetup[listing]{style=thesis,singlelinecheck=off}
% Uncomment for table captions on top. This is sometimes recommended by the
% style guide, and even required for some publication types.
%\floatsetup[table]{capposition=top}
%
% (Opinionated rant:) Captions on top are not "compatible" with the general
% guideline that the tables should be formatted to be quickly visually
% comprehensible and *beautiful* in general (like figures), and that the table
% "head" row (with column names) should alone communicate most of the content
% and interpretation of the table. If you just need to show a long boring list
% of numbers (because you have to), either put some effort into showing the
% data in an attractive figure-table, or move the data to an attachment and
% refer to it, so that the boredom does not impact the main text flow.
%
% You can make the top-captions look much less ugly by aligning the widths of
% the caption and the table, with setting `framefit=yes`, as shown below. This
% additionally requires some extra markup in your {table} environments; see the
% comments in the example table in `ch2.tex` for details.
%\floatsetup[table]{capposition=top,framefit=yes}
\ifEN\floatname{listing}{Listing} \ifEN\floatname{listing}{Listing}
\else\floatname{listing}{Výpis kódu}\fi \else\floatname{listing}{Výpis kódu}\fi
\lstset{% \lstset{ % use this to define styling for any other language
language=C++, language=C++,
tabsize=2, tabsize=2,
showstringspaces=false, showstringspaces=false,