更改图形标题中的文本宽度?

更改图形标题中的文本宽度?

按照某人提供的最小代码,该代码询问为什么图形标题文本的行比主文本的行更长。

\documentclass[12pt]{article}
\usepackage{array,latexsym,amsthm,amsfonts}
\usepackage[dvips,dvipdf]{graphicx,color}
\setlength{\textwidth}{7.0in} 
\setlength{\textheight}{9.0in}
\setlength{\oddsidemargin}{-.25in} 
\setlength{\topmargin}{0in}
\setlength{\tabcolsep}{0.09in}

\title{test}
\begin{document}

\maketitle

aaa aaa aaa aaa aaa aaa aaa aaa aaa aaa aaa aaa aaa aaa aaa aaa aaa aaa aaa aaa aaa aaa aaa aaa aaa aaa aaa aaa aaa aaa aaa aaa aaa aaa aaa aaa aaa aaa aaa aaa aaa aaa aaa aaa aaa aaa aaa aaa aaa aaa aaa aaa aaa aaa aaa aaa aaa aaa aaa aaa aaa aaa aaa aaa aaa aaa aaa aaa aaa aaa aaa aaa 


\begin{figure}[h,t,b]
\includegraphics[scale=.25]{b.eps}
\caption{The triangular lattice with faces labelled as close-packed (C) and empty (O), the corresponding planar modification, and its generator.}
\end{figure}

\end{document}

我无法重现他的问题。但我认为解决方案可能是设置图形标题的文本宽度,使其与正文中的文本宽度匹配。

所以我想知道如何设置图形标题的文本宽度?

答案1

您可以使用该floatrow包并为浮动环境设置更宽的边距:

\documentclass[12pt]{article}
\usepackage[demo]{graphicx}

\usepackage{floatrow}
\setfloatmargins{\hspace{-0.5in}}{\hspace{-0.5in}}

\title{test}
\begin{document}

\maketitle

aaa aaa aaa aaa aaa aaa aaa aaa aaa aaa aaa aaa aaa aaa aaa aaa aaa aaa aaa aaa aaa aaa aaa
aaa aaa aaa aaa aaa aaa aaa aaa aaa aaa aaa aaa aaa aaa aaa aaa aaa aaa aaa aaa aaa aaa aaa
aaa aaa aaa aaa aaa aaa aaa aaa aaa aaa aaa aaa aaa aaa aaa aaa aaa aaa aaa aaa aaa aaa aaa
aaa aaa aaa


\begin{figure}[htb]
\centering
\includegraphics[scale=.25]{b.eps}

\caption{The triangular lattice with faces labelled as close-packed (C) and empty (O),
the corresponding planar modification, and its generator.}

\end{figure}

\end{document}

我使用demo选项只是为了提供一个模拟说明,请勿自行使用。但请注意,latexsym已过时,amssymb应改用 (加载)。此外,不应将和amsfonts选项传递给或。dvipsdvipdfgraphicxcolor

定位说明符可以是[htb],,不带逗号。

在此处输入图片描述

相关内容