I am writing a short report using the 'article' documentclass. I would like all of my tables to be a smaller font size than the rest of the text and I would like to have bold captions for figures and tables.
I would like to avoid having to format each cell to a specific font size. Also I can't seem to get bolded font for the captions.
Is there a way to do this in the preamble?
Graphics, Figures & Tables ⇒ Formatting tables, captions in preamble?
Formatting tables, captions in preamble?
Last edited by fini_fly on Thu Jan 22, 2009 11:00 pm, edited 1 time in total.
- localghost
- Site Moderator
- Posts: 9201
- Joined: Fri Feb 02, 2007 12:06 pm
Formatting tables, captions in preamble?
The caption package lets you customize captions of floats. This and other requested settings are demonstrated in the following example for a table.
The used packages and their documentations can be found on CTAN or via command prompt on your local machine.
Best regards and welcome to the board
Thorsten¹
Code: Select all
\documentclass[11pt,a4paper,english]{article}
\usepackage[T1]{fontenc}
\usepackage[latin1]{inputenc}
\usepackage{babel}
\usepackage[font=small,textfont=bf]{caption}
\usepackage{booktabs}
\usepackage{lmodern}
\usepackage{blindtext}
\parindent0em
\begin{document}
\blindtext
\begin{table}[!ht]
\centering
\small
\caption{Dummy table}\label{tab:dummy}
\begin{tabular}{cc} \toprule
Measurement & Value \\ \midrule
1 & 49587 \\
2 & 39509 \\
3 & 17389 \\ \bottomrule
\end{tabular}
\end{table}
\blindtext
\end{document}
Code: Select all
texdoc babel
Best regards and welcome to the board
Thorsten¹
How to make a "Minimal Example"
Board Rules
Avoidable Mistakes[/size]
¹ System: openSUSE 42.2 (Linux 4.4.52), TeX Live 2016 (vanilla), TeXworks 0.6.1
Board Rules
Avoidable Mistakes[/size]
¹ System: openSUSE 42.2 (Linux 4.4.52), TeX Live 2016 (vanilla), TeXworks 0.6.1
Formatting tables, captions in preamble?
Hello,
a small addition:
To change the font size global you can define your own environment:
Marco
a small addition:
To change the font size global you can define your own environment:
Code: Select all
\documentclass[english]{article}
\usepackage{babel}
\usepackage[utf8]{inputenc}
\usepackage{blindtext}
\usepackage[bf]{caption}
\captionsetup[table]{position=above}
\newenvironment{mytable}[1][htb]
{\begin{table}[#1]\small\centering}%
{\end{table}
}
\begin{document}
\blindtext
\begin{mytable}[ht]
\caption{position ht}
\begin{tabular}{cc}
1 & 4 \\
\end{tabular}
\end{mytable}
\blindtext
\begin{mytable}
\caption{position p}
\begin{tabular}{cc}
1 & 4 \\
\end{tabular}
\end{mytable}
\end{document}
i am German. I can not use difficult words. 

Re: Formatting tables, captions in preamble?
Thanks for the quick response. I'll give both a shot and let you know how it all goes!
Thanks again.
Thanks again.
Formatting tables, captions in preamble?
I've tried both of your suggestions and they work to a point as I can only get the caption to be bolded. For example:
Figure 2: Figure 2 caption is bold
How about the 'Figure #' and 'Table #' parts?
Figure 2: Figure 2 caption is bold
How about the 'Figure #' and 'Table #' parts?
Formatting tables, captions in preamble?
Hello,
have you read the documentation of caption? Thorsten gave you the url. What do you mean with
Marco
have you read the documentation of caption? Thorsten gave you the url. What do you mean with
regardsFigure 2: Figure 2 caption is bold
How about the 'Figure #' and 'Table #' parts?
Marco
i am German. I can not use difficult words. 

- localghost
- Site Moderator
- Posts: 9201
- Joined: Fri Feb 02, 2007 12:06 pm
Formatting tables, captions in preamble?
A look at the manual of the package yields the solution. Simply change the options of package inclusion.fini_fly wrote:I've tried both of your suggestions and they work to a point as I can only get the caption to be bolded. For example:
Figure 2: Figure 2 caption is bold
How about the 'Figure #' and 'Table #' parts?
Code: Select all
\usepackage[font={small,bf}]{caption}
How to make a "Minimal Example"
Board Rules
Avoidable Mistakes[/size]
¹ System: openSUSE 42.2 (Linux 4.4.52), TeX Live 2016 (vanilla), TeXworks 0.6.1
Board Rules
Avoidable Mistakes[/size]
¹ System: openSUSE 42.2 (Linux 4.4.52), TeX Live 2016 (vanilla), TeXworks 0.6.1
Formatting tables, captions in preamble?
Sorry but I hadn't had a chance to check the documentation. This answered my question:
Code: Select all
\usepackage[font={footnotesize,bf}]{caption}