减小标题框的尺寸

减小标题框的尺寸

我正在尝试添加一个宽度小于图形大小的标题。我希望标题右对齐,并且可能只有现在大小的一半。

这是我的代码:

\begin{wrapfigure}{r}{0\textwidth}
\includegraphics[width=11cm, height=8cm]{1}
\caption{some text}
\label{schildklier}
\end{wrapfigure}
Some more text which will be wrapped around the image.

这里 1 是图像的名称。可以方便地修复这个问题吗?目前换行没问题,但标题和图片一样宽,我想减小它的宽度。任何帮助都非常感谢。

完整工作示例:

\documentclass[11pt]{article}
\usepackage[left=1.5cm, right=1.5cm, top=3cm, bottom=3cm]{geometry}
\usepackage[font=scriptsize]{caption}
\usepackage{graphicx}
\usepackage{wrapfig}

\begin{document}

\subsection{subsection}
\begin{wrapfigure}{r}{0\textwidth}
\includegraphics[width=11cm, height=8cm]{example-image.pdf}
\caption{This wide caption is much too wide and will not shrink when I tell him to shrink}
\label{Im a label}
\end{wrapfigure}
Much text you are not interested in.

\end{document}

答案1

这就是你想要的吗?我冒昧地稍微简化了你的序言:

\documentclass[11pt]{article}
\usepackage[hmargin=1.5cm, vmargin=3cm]{geometry}
\usepackage[font=scriptsize, labelfont=sc]{caption}
\usepackage[demo]{graphicx}
\usepackage{wrapfig}

\begin{document}

\subsection{subsection}
\begin{wrapfigure}{r}{11cm}
  \captionsetup{singlelinecheck=off, margin={3.67cm, 0cm}, justification=raggedleft, format=hang}
  \includegraphics[width=11cm, height=8cm]{1}
  \caption{This wide caption is much too wide and will not shrink when I tell him to shrink}
  \label{Im a label}
\end{wrapfigure}
Much text you are not interested in.

\end{document}

在此处输入图片描述

答案2

\usepackage{wrapfig}
\usepackage{caption}
\captionsetup[wrapfigure]{margin=1cm}

请参阅包标题的文档以获取更多示例。

相关内容