1

I am currently trying to change the font size as well as the line spacing within the captions of my document and am attempting this by using the setspace and caption packages. As the line spacing as well as font size belong to the same setting (font=...) i'm unsure how to set both values. This code:

\documentclass[12pt]{article} 
\renewcommand{\baselinestretch}{1.5} 
\usepackage[labelfont=bf]{caption}
\usepackage{setspace}
\captionsetup{font=footnotesize}

\begin{document}
some text 
\end{document}

As well as this code:

\documentclass[12pt]{article} 
\renewcommand{\baselinestretch}{1.5} 
\usepackage[labelfont=bf]{caption}
\usepackage{setspace}
\captionsetup{font={stretch=1.0}}

\begin{document}
some text 
\end{document}

Both work individually but i can't manage to set my font as stretch=1.0 as well as footnotesize. For reference, my normal text size is 12 pt and the line spacing is 1.5pt and i would like my caption font to be size 10pt (footnotesize) and have a line spacing of 1.0pt.

Any help is appreciated!

4
  • 2
    You can probably use a comma separated list, like \captionsetup{font={stretch=1.0, footnotesize}} – Jasper Habicht Mar 28 at 16:55
  • Your claim that "my normal text size is 12pt and the line spacing is 1.5pt" doesn't sound correct. Given that (a) you run \renewcommand{\baselinestretch}{1.5} and (b) the normal baselineskip for a 12pt Roman (aka serif) font is 14.4pt (20% more than the nominal font size), I'd say that the distance between successive lines of text is 21.6pt, not 1.5pt. – Mico Mar 28 at 17:15
  • I thought that \renewcommand{\baselinestretch}{1.5} would set my line spacing to 1.5. Thanks for pointing this out, i will try and correct this by using the actual baselineskip command. – Charlotte Mar 28 at 17:24
  • Setting the line spacing factor to 1.5 is not the same as having a baselineskip of 1.5pt. – Mico Mar 28 at 17:27
0

As already mentioned in @Jasper Habicht comment, you can write:

\documentclass[12pt]{article}
\usepackage[font={small,stretch=1}, labelfont=bf]{caption} % <---
\usepackage[onehalfspacing]{setspace} 

\usepackage{lipsum}

\begin{document}
\lipsum[66]
    \begin{figure}[ht]
\rule{\linewidth}{4pt}
    \caption{\lipsum[1][1-2]}
    \end{figure}
\lipsum[67]
\end{document}

For details and all possibilities see caption package documentation.

enter image description here

3
  • If the main document font size is 12pt, the onehalfspacing option amounts to setting \setstretch {1.241}, not \setstretch{1.5} (which is what the OP gets by running \renewcommand{\baselinestretch}{1.5}). Also, \usepackage[font={small,...}]{caption} will result in a font size of 11pt, not 10pt -- which is what the OP said is required. – Mico Mar 28 at 17:24
  • A modified version of this fixed my issues: First i thought that using \baselinestretch would set the genereal line spacing, which it doesn't so now i use \usepackage{setspace} \setstretch{1.5} as well as \usepackage[font={footnotesize,stretch=1.0}, labelfont=bf]{caption} which gives me my 10pt font size as well as the 1.0 line spacing. – Charlotte Mar 28 at 17:37
  • @Charlotte - If you employ the setspace package and run \setstretch{1.5}, there's no need for setting stretch=1.0 as one of the font options of the caption package. – Mico Mar 28 at 17:42
2

Executing the low-level command

\renewcommand{\baselinestretch}{1.5}

in the preamble is almost always a mistake, as doing so also affects the line spacing in captions, tabular-like environments, and footnotes, which are generally supposed to be typeset single-spaced regardless of the line-spacing that's applied to the other parts of the document.

What to do? Since you load the setspace package anyway, I would like to suggest that you run

\usepackage{setspace}
\setstretch{1.5}

That way, you won't have to fiddle with the line spacing in captions.

Your main document font size is set to 12pt. To get the font size that's used in captions to equal 10pt, it suffices to run

\captionsetup{font=footnotesize}

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.