侧边图中标题的水平定位

侧边图中标题的水平定位

我需要控制图形和相关标题之间的水平间距,我将标题放在图形的右侧sidecap。我该如何实现?使用floatrow而不是 对sidecap我来说不是一个选择,因为documentclass我需要处理一些与 不兼容的专有技术。我尝试在序言中的包中floatrow进行设置,但显然不起作用。skipcaption

MWE 是:

\documentclass{article}
\usepackage[demo]{graphicx}
% Some basic caption settings 
\usepackage[style=base,skip=0pt]{caption}  %% `skip` here does not seem to have any effect 
\captionsetup{font=footnotesize,labelfont=bf,labelsep=period}
% caption on the top right
\usepackage[rightcaption]{sidecap}
\sidecaptionvpos{figure}{t}

\begin{document}
\begin{SCfigure}
\includegraphics[width=0.8\textwidth]{name}
\caption*{This is going to be a long caption, and I need to have it as much as possible within the figure space, so I want to control the horizontal space between figure and caption optimally...}
\end{SCfigure}

\end{document}

答案1

您可以用自己的标题样式单独设置样式。这只有一个主要缺点:如果您使用,\parbox我会建议您为每个图形设置固定宽度的标题(除非您将标题排版到边距中,否则这并不实用)。

\documentclass{article}
\usepackage[demo]{graphicx}
% Some basic caption settings 
\usepackage[style=base]{caption}  %% `skip` here does not seem to have any effect 
\DeclareCaptionFormat{side}{\hspace*{1cm}\parbox{4cm}{#1#2#3}}
\captionsetup{format=side,font=footnotesize,labelfont=bf,labelsep=period}
% caption on the top right
\usepackage[rightcaption]{sidecap}
\sidecaptionvpos{figure}{t}

\begin{document}
\begin{SCfigure}
\includegraphics[width=0.8\textwidth]{name}
\caption*{This is going to be a long caption, and I need to have it as much as possible within the figure space, so I want to control the horizontal space between figure and caption optimally...}
\end{SCfigure}

\end{document}

相关内容