![如何在 hvfloat 包中使用 caption 包的格式?](https://linux22.com/image/261107/%E5%A6%82%E4%BD%95%E5%9C%A8%20hvfloat%20%E5%8C%85%E4%B8%AD%E4%BD%BF%E7%94%A8%20caption%20%E5%8C%85%E7%9A%84%E6%A0%BC%E5%BC%8F%EF%BC%9F.png)
使用 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}