2011-06-01 71 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