Using `\captionsetup[figure]{options}` within a `figure` environment does not apply the local `\captionsetup` changes
The code:
\documentclass[oneside]{book}
\usepackage{caption}
\usepackage{subcaption}
\captionsetup[figure]{position=bottom,labelfont={bf, small}, textfont={small}}
\begin{document}
\begin{figure}[t]
\caption{Bold and small}
\end{figure}
\begin{figure}[t]
\captionsetup[figure]{position=bottom,labelfont={Large,it}, labelsep=period}
\caption{Large and italic}
\showcaptionsetup{figure}
\end{figure}
\end{document}
does not apply the \captionsetup[figure]{position=bottom,labelfont={Large,it}, labelsep=period}
to the second figure caption. The log file shows:
This is pdfTeX, Version 3.141592653-2.6-1.40.24 (TeX Live 2022) (preloaded format=pdflatex)
restricted \write18 enabled.
entering extended mode
(./test.tex
LaTeX2e <2022-11-01> patch level 1
L3 programming layer <2023-02-22>
(c:/texlive/2022/texmf-dist/tex/latex/base/book.cls
Document Class: book 2022/07/02 v1.4n Standard LaTeX document class
(c:/texlive/2022/texmf-dist/tex/latex/base/bk10.clo))
(c:/texlive/2022/texmf-dist/tex/latex/caption/caption.sty
(c:/texlive/2022/texmf-dist/tex/latex/caption/caption3.sty
(c:/texlive/2022/texmf-dist/tex/latex/graphics/keyval.sty)))
(c:/texlive/2022/texmf-dist/tex/latex/caption/subcaption.sty)
(c:/texlive/2022/texmf-dist/tex/latex/l3backend/l3backend-pdftex.def)
No file test.aux.
Caption Info: Option list on `figure'
Caption Data: {position=bottom,labelfont={Large,it}, labelsep=period} on input
line 27.
Package caption Warning: Unused \captionsetup[figure] on input line 25.
See the caption package documentation for explanation.
[1{c:/texlive/2022/texmf-var/fonts/map/pdftex/updmap/pdftex.map}] (./test.aux)
*File List*
book.cls 2022/07/02 v1.4n Standard LaTeX document class
bk10.clo 2022/07/02 v1.4n Standard LaTeX file (size option)
caption.sty 2022/03/01 v3.6b Customizing captions (AR)
caption3.sty 2022/03/17 v2.3b caption3 kernel (AR)
keyval.sty 2022/05/29 v1.15 key=value parser (DPC)
subcaption.sty 2022/01/07 v1.5 Sub-captions (AR)
l3backend-pdftex.def 2023-01-16 L3 backend support: PDF output (pdfTeX)
***********
)<c:/texlive/2022/texmf-dist/fonts/type1/public/amsfonts/cm/cmbx9.pfb><c:/texl
ive/2022/texmf-dist/fonts/type1/public/amsfonts/cm/cmr10.pfb><c:/texlive/2022/t
exmf-dist/fonts/type1/public/amsfonts/cm/cmr9.pfb>
Output written on test.pdf (1 page, 30235 bytes).
Transcript written on test.log.
I am unsure if this is intended but from the documentation I did not see a difference between \captionsetup{}
and \captionsetup[figure]{}
. This arose whilst I was using subcaption
to make local changes to both subfigure
's \caption
's and the main figure
\caption
.