如何强制 LaTeX 将图形准确地放置在我想要的位置

如何强制 LaTeX 将图形准确地放置在我想要的位置

可能重复:
强制在文本中放置图形
如何影响 LaTeX 中图形和表格等浮动环境的位置?

我怎样才能强制 LaTeX 在我想要的确切位置插入图形。

这是我使用的代码:

\lstset{framexleftmargin=0mm, frame=shadowbox, rulesepcolor=\color{black},basicstyle=\ttfamily\small,breaklines,
columns=fullflexible}
\begin{figure} [htbp!]
\begin{lstlisting}
root@bt:~# nmap -O www.we****t***.com

Starting Nmap 6.01 ( http://nmap.org ) at 2012-12-21 15:38 CET
Nmap scan report for www.we****t***.com (217.6*.***.**)
Host is up (0.0087s latency).
Not shown: 990 filtered ports
PORT     STATE  SERVICE
21/tcp   open   ftp
22/tcp   open   ssh
53/tcp   open   domain
80/tcp   open   http
110/tcp  open   pop3
143/tcp  open   imap
443/tcp  open   https
587/tcp  closed submission
3306/tcp open   mysql
Device type: general purpose
Running (JUST GUESSING): Linux 2.6.x (90%)

Aggressive OS guesses: Linux 2.6.22 (90%),
OpenWrt Kamikaze 7.09 (Linux 2.6.27) (89%),
Linux 2.6.18 - 2.6.24 (89%),
Linux 2.6.23 (86%)

No exact OS matches for host (test conditions non-ideal).

OS detection performed.
Please report any incorrect results at http://nmap.org/submit/ .
Nmap done: 1 IP address (1 host up) scanned in 79.16 seconds
\end{lstlisting}
\caption{Nmap -O}
\end{figure}

LaTeX 将图形放在另一页上,这令人惊讶,因为它使整个作品变得丑陋。

以下是我使用的序言:

\documentclass[a4paper,singleside,11pt]{report}
\usepackage{ia_urb_thesis}
\usepackage[italian]{babel}
\usepackage[latin1]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{graphicx}
\usepackage{color}
%\usepackage {listingsutf8}
%\usepackage{tikz}
\usepackage[thinlines]{easytable}
\usepackage{upquote}
\setcounter{secnumdepth}{5}
\setcounter{tocdepth}{5}

\usepackage{listings}
%\lstset{language=PHP}
\usepackage{url}
%\usepackage[pdftex]{graphicx}
\usepackage{amsmath}% http://ctan.org/pkg/amsmath
%\usepackage{epsfig}
%\usepackage{textcomp}

\begin{document}

\titolo{...Injection ...
\\[5mm]}
\candidato{xxx}
\relatore{Chiar.mo xxxx}
\annoaccademico{2011-2012}

\copertinatesi

\dedica{Ai miei genitori}
\indice
\indicefigure
\indicetabelle
\iniziatesto

\include{cap_1}
\include{cap_2}
\include{cap_3}
\include{cap_4}

\appendix
\include{app_a}
\include{biblio}

\ringraziamenti
Vorrei ringraziare ...

\end{document}

相关内容