Latex Problem

Psirus

Well-Known Member
Joined
Dec 15, 2008
Messages
592
Location
Berlin, Germany
I'm trying to typeset a small document in Latex, and so far I'm really liking it. I went ahead an made a new command:
Code:
\newcommand{\bild}[2]{
    \vspace{0,3cm}
    \includegraphics[width=\textwidth]{#1}
    \captionof{figure}{#2}
    \vspace{0,3cm}
}
And used it as follows:
Code:
?ungest?rten Str?mung untersucht. \\
\bild{pitot.png}{Winkelabh?ngigkeit des Pitot-Rohrs}
Die Messung zeigt?
In the output, the first vspace is not between the preceding line, but between the graphic and the caption?why?
 
Ah :)

Usually I include images like this:

Code:
\begin{figure}[placement specification, for example htb for here, top or bottom where ever is room in that order]
  \centering % if that image should be centered
  \includegraphics[options go here]{filename without extension}
  \caption{caption text} % if you want a caption
  \label{your internal label goes here to reference the figure with \ref{...} later}
\end{figure}

You should be able to specify \vspace{34635463465pt} in there, I never used that so far though.
 
vspace is tricky, it sometimes places the space where you don't expect it. So, here you go:

Code:
\begin{figure}
\centering
\includegraphics[width=\textwidth]{pitot}
\caption{Winkelabh?ngigkeit des Pitot-Rohrs}
\label{fig:pitot}
\end{figure}
The label can be referenced with \ref{fig:pitot}, like this:
Code:
In Abb.\,\ref{fig:pitot} ist zu sehen, wie\dots

And as a bonus, a useful (German language) link: LaTeX Befehlsreferenz, for when you not quite know the correct use of a command.

Edit: Damnit, narf! :p
 
Top