From: Alan R. <ri...@ec...> - 2007-11-22 15:21:16
|
Karl Koch wrote: > Hi there, > > I have a question about MikTeX that bothers me for quite a while. I have the book template (but I am quite sure it is general enough so that it will also appear in other classes). When putting images or tables, LaTeX naturally floats those objects around. Sometimes an image lands on the next page, but in the original MikTeX code I obviously reserved a particular place - as shown in the following code example: The figure environment is a floating environment, and when you use it you are explicitly instructing LaTeX to place the contents of the environment wherever it sees fit. The best way to prevent it floating is not to use a floating environment -- minipage works well. > --------------------------- > A typical system does this and that and some more of that and some more of this as shown in figure \ref{fig:pic2}. > > \begin{figure}[ht!] > \begin{center} > \includegraphics[scale=0.25,angle=0]{pic2.jpg} > \label{fig:pic2} > \end{center} > \end{figure} > > It is important to consider... > --------------------------- The blank lines before \begin{figure} and after \end{figure} function like blank lines anywhere else in a LaTeX document -- the signal the end of a paragraph and the start of a new one. > When the picture floats, MikTeX now produces something like that: > > ---------------------------- > A typical system does this and that and some more of that and some more of this as shown in figure 3.2. > ___It is important to consider... > > ---------------------------- > > Where ___ presents a small gap to signal the next paragraph. My question now: How can I make it look like the following: > > --------------------------- > A typical system does this and that and some more of that and some more of this as shown in figure 3.2. > > It is important to consider... > --------------------------- > > without gap that basically hides the fact that something has not been put there but rather on the next page (which is not a problem). Eliminate the blank lines that tell LaTeX to start a new paragraph. One way would be: --- Blah blah blah. \begin{figure} ... \end{figure} Foo bar baz. --- But since LaTeX is going to float the contents of the figure environment anyway, you don't really need to place it right in the middle of the paragraph. I usually do: --- Blah blah blah. Foo bar baz. \begin{figure} ... \end{figure} --- Alan |