Captions and labels for my tables, listings, images
I'm writing my master thesis and I have a lot of short tables, listings,
etc. in the text.
I would use figures for them like this:
\begin{figure}[h!]
\begin{lstlisting}[mathescape]
... my listing here ...
\end{lstlisting}
\caption{... caption ...}
\label{... label ...}
\end{figure}
\begin{figure}[h!]
\begin{tabular}{|l|l|}
... my table here ...
\end{tabular}
\caption{... caption ...}
\label{... label ...}
\end{figure}
etc, but the fact that LaTeX moves them to another page (even though they
are sometimes very short) makes the text hardly readable.
I would need LaTeX to keep them at exactly the same spot (if they fit
there) or at the top of the next page (otherwise). It is my understanding
that I should not use figures in this case. But, on the other hand, I
would like to keep the captions, labels and numberings for them to still
be able to address them.
How do I do that?
No comments:
Post a Comment