2011-06-01 132 views
0

我想添加一个简单的数字到我的乳胶代码。我有这样的代码:文本在数字乳胶

\begin{figure}[H] 
\resizebox{40pt}{!}{ 
\centering \includegraphics{FigureStereo.jpg}} 
\caption{Epipolar Geometry} 
\label{fig:cclogo} 
\end{figure} 

与此然而短信来对图像的顶部,也图像不居中。我做错了什么?希望这不是一个重复的问题,因为我做了相关帖子的快速检查。 编辑 这里是序言

\documentclass[draftthesis,tocnosub,noragright,centerchapter,12pt,]{uiucecethesis09} 


\makeatletter 

\usepackage{setspace} 
\usepackage{epsfig} % for figures 
\usepackage{graphicx} % another package that works for figures 
%\usepackage{subfigure} % for subfigures 
\usepackage{amsmath} % for math spacing 
%\usepackage{amssymb} % for math spacing 
%\usepackage{url} % Hyphenation of URLs. 
\usepackage{lscape} % Useful for wide tables or figures. 
\usepackage[justification=raggedright]{caption} % makes captions ragged right - thanks to Bryce Lobdell 
\usepackage{float} 
\usepackage{wrapfig} 

% Uncomment the appropriate one of the following four lines: 
\msthesis 
%\phdthesis 
%\otherdoctorate[abbrev]{Title of Degree} 
%\othermasters[abbrev]{Title of Degree} 

\title{} 

\author{} 
\department{} 
\degreeyear{} 

% Advisor name is required for 
% - doctoral students for the ProQuest abstract 
% - master's students who do not have a master's committee 
\advisor{} 

% Uncomment the \committee command for 
% - all doctoral students 
% - master's students who have a master's committee 
%\committee{Professor Firstname Lastname, Chair\\ 
%  Professor Firstname Lastname} % etc. 

回答

1

可以使用center环境为中心,它包裹的图像框和标题都:

\begin{figure}[h!] 
\begin{center} 
\resizebox{40pt}{!}{\includegraphics{FigureStereo.jpg}} 
\caption{Epipolar Geometry} 
\label{fig:cclogo} 
\end{center} 
\end{figure} 

但是,请注意,LaTeX有时会很顽固,关于如何在浮动el有趣的是, h选项比保证更重要。在某些情况下,最好不要使用浮动的figure环境,而应直接插入图形和文本。

此外,你最好在TeX StackExchange site问这类问题。

+0

@ walkytalky - 尝试完全按照你的说法,但它仍然有文字在图像上,而不是中心。 – Manish 2011-06-01 21:16:20

+0

@Manish如果你跳过'resizebox'并且只是'\ includegraphics [width = 40pt] {FigureStereo.jpg}',会发生什么? – walkytalky 2011-06-01 22:24:21

+0

@walkytalky: - 没有.tried that ..doesnt help。文字仍然出现在图上。 – Manish 2011-06-01 22:35:34

0

你可能只是想是

 
\begin{figure}[t] 
\centerline{\includegraphics[width=\columnwidth]{figs/foo}} 
\caption{Caption Goes Here} 
\label{fig:cclogo} 
\end{figure} 
+0

感谢Niraj,这使得数字进入一个新的页面,仍然不居中。这不是我正在寻找的东西。我想要的是将数字放置在文本之间(可能是部分出现在哪里tex代码)并居中。因此,如果我要对页面进行垂直遍历,则会有一些文本,图形(周围没有文本),然后在到达页面末尾之前显示更多文本。 – Manish 2011-06-01 07:12:06

+0

只需减少宽度(或图的高度)。例如'width = \ 0.25columnwidth'。我相信你的身材可能足够大,以至于被视为浮动。你的胶乳版本应该吐出一些关于它的警告。 – 2011-06-01 16:23:11

+0

- 我将尺寸缩小到20pt,但它仍然显示图像上方的文字,并且不再居中。 – Manish 2011-06-01 21:15:37