使用 caption-package 我声明了表格和图形标题的样式:
\RequirePackage[singlelinecheck=false,
listof=true,
tableposition=top]{caption}%
\DeclareCaptionFont{dgcapfont}{\small\sffamily\raggedright}
\DeclareCaptionFont{dgclbfont}{\bfseries}
\captionsetup[table]{labelsep=colon,
labelfont=dgclbfont,
font=dgcapfont,
position=top,
skip=8\p@}%
\captionsetup[figure]{labelsep=colon,
labelfont=dgclbfont,
font=dgcapfont,
skip=4mm}%
但这些声明不会影响 hvfloat 表格或图形中的标题。有什么想法可以解决吗?
答案1
请更具体一些,因为这对我有用(您的定义和来自文档的示例):
\documentclass[12pt]{book}
\usepackage[singlelinecheck=false,
listof=true,
tableposition=top]{caption}%
\DeclareCaptionFont{dgcapfont}{\small\sffamily\raggedright}
\DeclareCaptionFont{dgclbfont}{\bfseries}
\captionsetup[figure]{labelsep=colon,
labelfont=dgclbfont,
font=dgcapfont,
skip=4mm}%
\usepackage{hvfloat}
\begin{document}
\hvFloat[%
floatPos=htb,%
capWidth=0.5,% of \columnwidth
capPos=r,%
capVPos=c,%
objectPos=c]{figure}{\includegraphics{rose}}% or any other image
[Caption beside object and vertically centered]{%
Caption vertically centered right beside the float with a caption
width of \texttt{0.5\textbackslash columnwidth} and \texttt{
floatcapsep=5pt} (the default)}{fig:1}
\end{document}