我正在尝试将标题扩展到 之外\textwidth
。我尝试使用\makebox
,但是,结果导致错误:
\documentclass{article}
\usepackage[left=2.5cm,right=2.5cm,top=2.5cm,bottom=2cm]{geometry}
\usepackage[demo]{graphicx}
\usepackage[english]{babel}
\usepackage{tikz}
\usepackage[utf8]{inputenc}
\usepackage{blindtext}
\usepackage{titlesec}
\begin{document}
\begin{figure}
\centering
\renewcommand{\arraystretch}{3}
\begin{tabular*}{\textwidth}{@{}ccc@{}}
\includegraphics[width=0.31\linewidth,height=2cm]{dummy} &
\includegraphics[width=0.31\linewidth,height=2cm]{dummy}&
\includegraphics[width=0.31\linewidth,height=2cm]{dummy}\\
\includegraphics[width=0.31\linewidth,height=2cm]{dummy} &
\includegraphics[width=0.31\linewidth,height=2cm]{dummy}&
\includegraphics[width=0.31\linewidth,height=2cm]{dummy}
\end{tabular*}
\makebox[1.2\textwidth][c]{
\caption{\emph{Title.} \blindtext}
}
\label{fig:mipLevels}
\end{figure}
\blindtext
\end{document}
错误信息:
Missing \endgroup inserted.
答案1
使用caption
包裹本地更改width
:
\documentclass{article}
\usepackage{blindtext,caption,showframe}
\begin{document}
\begin{figure}
\captionsetup{width=1.2\textwidth}
\caption{\blindtext}
\end{figure}
\end{document}
水平调整使用changepage
包裹的adjustwidth
环境也是一种选择:
\documentclass{article}
\usepackage{changepage,blindtext,showframe}
\begin{document}
\begin{figure}
% Add .1\textwidth on either side of the caption
\begin{adjustwidth}{-.1\textwidth}{-.1\textwidth}
\caption{\blindtext}
\end{adjustwidth}
\end{figure}
\end{document}
答案2
正如 Werner 所说,caption 包对此有一些特定参数,或者与任何文本一样,您可以使用类似的环境,quote
但边距为负数。如果您还需要使其他文本(而不仅仅是标题)更宽,这会很有用。
\documentclass{article}
\newenvironment{outdent}
{\list{}{\leftmargin-2cm
\rightmargin\leftmargin}%
\item\relax}
{\endlist}
\begin{document}
\begin{table}[h]
X\dotfill X
\caption{%
a a a a a a a a a a a a a a a a a a a a a a
a a a a a a a a a a a a a a a a a a a a a a
a a a a a a a a a a a a a a a a a a a a a a
}
\begin{quote}
\caption{%
a a a a a a a a a a a a a a a a a a a a a a
a a a a a a a a a a a a a a a a a a a a a a
a a a a a a a a a a a a a a a a a a a a a a
}
\end{quote}
\begin{outdent}
\caption{%
a a a a a a a a a a a a a a a a a a a a a a
a a a a a a a a a a a a a a a a a a a a a a
a a a a a a a a a a a a a a a a a a a a a a
}
\end{outdent}
\end{table}
\end{document}