Graphics, Figures & TablesFigure and table caption sizes mismatch

Information and discussion about graphics, figures & tables in LaTeX documents.
Post Reply
eesb83
Posts: 3
Joined: Fri Apr 15, 2011 1:12 pm

Figure and table caption sizes mismatch

Post by eesb83 »

Hi,

I am trying to change the font size of my figure and table captions to footnotesize but so far have only managed to change the table captions, whereas the figure captions remain the same.

Code: Select all

\usepackage[english]{babel}
\usepackage{graphicx}
\usepackage[font=footnotesize, labelfont=bf, centerlast[{caption}
\usepackage{rotating}
\usepackage{subfig}
I don't have any subfig captions, just one caption below each figure.

I don't know why the tables are changing but not the figures and I was wondering if there is something I am doing wrong or not including in my code?

any help is greatly appreciated,

thankyou,
Sarah

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

Learn LaTeX easily with newest books:

The LaTeX Beginner's Guide: 2nd edition and perfect for students writing a thesis

The LaTeX Cookbook: 2nd edition full of practical examples for mathematics, physics, chemistry, and more

LaTeX Graphics with TikZ: the first book about TikZ for perfect drawings in your LaTeX thesis

User avatar
localghost
Site Moderator
Posts: 9202
Joined: Fri Feb 02, 2007 12:06 pm

Figure and table caption sizes mismatch

Post by localghost »

If I load the caption package into a minimal document like you do I have no problem with the caption format at all. Well then?


Best regards and welcome to the board
Thorsten
eesb83
Posts: 3
Joined: Fri Apr 15, 2011 1:12 pm

Figure and table caption sizes mismatch

Post by eesb83 »

Hi,

Thankyou for your reply; sorry in my delayed reponse.

This may be a daft question, but would you be able to explain what a minimal document is?

I'm using the subfig package for figures in a thesis template, and I am using a .cls file that has all the commands in it - is that the same thing?

thanks again,
Sarah

Code: Select all

\documentclass[a4paper,12pt,oneside]{Thesis}
\graphicspath{{Figures/}} %Location of graphics
\usepackage[round,colon,authoryear]{natbib}
%\bibliographystyle{apalike}
\bibpunct{(}{)}{;}{a}{,}{,}

\begin{document}


thesis.cls file:

Code: Select all

%%
%% This is file `Thesis.cls', based on 'ECSthesis.cls', by Steve R. Gunn
%% generated with the docstrip utility.
%%
%% Created by Steve R. Gunn, modified by Sunil Patel: www.sunilpatel.co.uk

\NeedsTeXFormat{LaTeX2e}[1996/12/01]
\ProvidesClass{Thesis}
              [2007/22/02 v1.0
   LaTeX document class]
\def\baseclass{book}
\DeclareOption*{\PassOptionsToClass{\CurrentOption}{\baseclass}}
\def\@checkoptions#1#2{
  \edef\@curroptions{\@ptionlist{\@currname.\@currext}}
  \@tempswafalse
  \@tfor\@this:=#2\do{
    \@expandtwoargs\in@{,\@this,}{,\@curroptions,}
    \ifin@ \@tempswatrue \@break@tfor \fi}
  \let\@this\@empty
  \if@tempswa \else \PassOptionsToClass{#1}{\baseclass}\fi
}
\@checkoptions{11pt}{{10pt}{11pt}{12pt}}
\PassOptionsToClass{a4paper}{\baseclass}
\ProcessOptions\relax
\LoadClass{\baseclass}
\newcommand\bhrule{\typeout{------------------------------------------------------------------------------}}

\newcommand\Declaration[1]{
\btypeout{Declaration of Authorship}
\addtotoc{Declaration of Authorship}
\thispagestyle{plain}
\null\vfil
%\vskip 60\p@
\begin{center}{\huge\bf Declaration of Authorship\par}\end{center}
%\vskip 60\p@
{\normalsize #1}
\vfil\vfil\null
%\cleardoublepage
}

\newcommand\btypeout[1]{\bhrule\typeout{\space #1}\bhrule}
\def\today{\ifcase\month\or
  January\or February\or March\or April\or May\or June\or
  July\or August\or September\or October\or November\or December\fi
  \space \number\year}
\usepackage{setspace}
\onehalfspacing
\setlength{\parindent}{0pt}
\setlength{\parskip}{2.0ex plus0.5ex minus0.2ex}
\usepackage{vmargin}
\setmarginsrb           { 4.0cm}  % left margin
                        { 2.0cm}  % top margin
                        { 2.0cm}  % right margin
                        { 0.8in}  % bottom margin
                        {  20pt}  % head height
                        {0.25in}  % head sep
                        {   9pt}  % foot height
                        { 0.3in}  % foot sep
\raggedbottom
\setlength{\topskip}{1\topskip \@plus 5\p@}
\doublehyphendemerits=10000       % No consecutive line hyphens.
\brokenpenalty=10000              % No broken words across columns/pages.
\widowpenalty=9999                % Almost no widows at bottom of page.
\clubpenalty=9999                 % Almost no orphans at top of page.
\interfootnotelinepenalty=9999    % Almost never break footnotes.
\usepackage{fancyhdr}
\lhead[\rm\thepage]{\fancyplain{}{\sl{\rightmark}}}
\rhead[\fancyplain{}{\sl{\leftmark}}]{\rm\thepage}
\chead{}\lfoot{}\rfoot{}\cfoot{}
\pagestyle{fancy}
\renewcommand{\chaptermark}[1]{\btypeout{\thechapter\space #1}\markboth{\@chapapp\ \thechapter\ #1}{\@chapapp\ \thechapter\ #1}}
\renewcommand{\sectionmark}[1]{}
\renewcommand{\subsectionmark}[1]{}
\def\cleardoublepage{\clearpage\if@twoside \ifodd\c@page\else
\hbox{}
\thispagestyle{empty}
\newpage
\if@twocolumn\hbox{}\newpage\fi\fi\fi}
\usepackage{amsmath,amsfonts,amssymb,amscd,amsthm,xspace}
\theoremstyle{plain}
\newtheorem{example}{Example}[chapter]
\newtheorem{theorem}{Theorem}[chapter]
\newtheorem{corollary}[theorem]{Corollary}
\newtheorem{lemma}[theorem]{Lemma}
\newtheorem{proposition}[theorem]{Proposition}
\newtheorem{axiom}[theorem]{Axiom}
\theoremstyle{definition}
\newtheorem{definition}[theorem]{Definition}
\theoremstyle{remark}
\newtheorem{remark}[theorem]{Remark}
\newcommand{\fref}[1]{Figure~\ref{#1}}
\newcommand{\tref}[1]{Table~\ref{#1}}
\newcommand{\eref}[1]{Equation~\ref{#1}}
\newcommand{\cref}[1]{Chapter~\ref{#1}}
\newcommand{\sref}[1]{Section~\ref{#1}}
\newcommand{\aref}[1]{Appendix~\ref{#1}}
\renewcommand{\topfraction}{0.85}
\renewcommand{\bottomfraction}{.85}
\renewcommand{\textfraction}{0.1}
\renewcommand{\dbltopfraction}{.85}
\renewcommand{\floatpagefraction}{0.75}
\renewcommand{\dblfloatpagefraction}{.75}
\setcounter{topnumber}{9}
\setcounter{bottomnumber}{9}
\setcounter{totalnumber}{20}
\setcounter{dbltopnumber}{9}
\usepackage[english]{babel}
\usepackage{graphicx}
\usepackage[font=footnotesize, labelfont=bf, centerlast]{caption}
\usepackage{rotating}
\usepackage{longtable}
\usepackage{lineno}
\usepackage{float}
\usepackage{lscape}
\usepackage{array}
\usepackage[caption=false]{subfig}
\usepackage{epstopdf}
\usepackage{booktabs}
\usepackage{listings}
\usepackage{lstpatch}
\lstset{captionpos=b,
        frame=tb,
        basicstyle=\scriptsize\ttfamily,
        showstringspaces=false,
        keepspaces=true}
.....
User avatar
localghost
Site Moderator
Posts: 9202
Joined: Fri Feb 02, 2007 12:06 pm

Figure and table caption sizes mismatch

Post by localghost »

eesb83 wrote:[…] This may be a daft question, but would you be able to explain what a minimal document is? […]
A minimal document (actually called a minimal example) is something like this.

Code: Select all

\documentclass[11pt,a4paper,english]{article}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage{babel}
\usepackage[font=footnotesize,labelfont=bf,tableposition=top]{caption}
\usepackage{blindtext}

\begin{document}
  \blindtext

  \begin{figure}[!ht]
    \centering
    \rule{6.4cm}{3.6cm}
    \caption{Dummy figure}\label{fig:dummy}
  \end{figure}

  \blindtext
\end{document}
eesb83 wrote:[…] I'm using the subfig package for figures in a thesis template, and I am using a .cls file that has all the commands in it - is that the same thing? […]
If you use a non-standard class file, you should attach it completely as a file to your post or at least give a link where to find it right at the beginning. The code for the class you provided is incomplete thus useless.

Note that the caption package does not support every class and you should obtain a corresponding warning in the log file if this is the case. Address the class maintainer if necessary.
eesb83
Posts: 3
Joined: Fri Apr 15, 2011 1:12 pm

Re: Figure and table caption sizes mismatch

Post by eesb83 »

Hi,

I've managed to get it working now (sorry for not attaching the code properly)

thank you so much for your help,

Sarah
User avatar
localghost
Site Moderator
Posts: 9202
Joined: Fri Feb 02, 2007 12:06 pm

Figure and table caption sizes mismatch

Post by localghost »

eesb83 wrote:[…] I've managed to get it working now […]
I'm sure that others are also interested in this solution. And on this occasion you can mark the topic accordingly.
Post Reply