Welcome to the TeXnik website (under construction) Floats |
||||||||||||||||||||||||||
|
Slides and Floats Slides have by default no floats! If you want to use them as usual write in preamble: \usepackage{float} \newfloat{figure}{H}{lof} \newfloat{table}{H}{lot} \providecommand{\figurename}{Figure} \providecommand{\tablename}{Table} \floatname{figure}{\figurename} \floatname{table}{\tablename}
Image/Tabular beside Tabular For an image beside a tabular inside a float with own captions: For a tabular beside a tabular inside a float with own captions:
Floats in Twocolumn mode They are handled as usual. Only for wide floats ( \begin{figure*} ... \end{figure*} )
which span both column are some restrictions. They are placed by default on the top of
each page. With the package stfloats
you have addtional the b-option (bottom).
Doublepage Float If you like your "float" on the left page and the caption on the right one in a twosided document, then load
Image over the full Page To get something like this:
which is a demo for two a4-pages side by side.
Captions as Margin Notes this should also work with more than one line. You need package textpos: \usepackage{textpos} \newcommand{\floatmargin}[1]{% \ifodd\value{page}% \begin{textblock}{2}(9.5,0)#1\end{textblock}% \else \begin{textblock}{2}(-2.5,0)#1\end{textblock}% \fi% }and in the float write before the image in tex (red): \floatmargin{% \caption{<... any text ...>}\label{<any label>} }
Unprocessed Floats latex lets all floats unprocessed until one page is filled with text or a new chapter/section begins. the number of these unprocessed floats is set to 18! Therefore you'll get an error, when you have more than 18 floats with less text in one chapter/section. There are two ways to prevent this error: - do a \clearpage behind the th float, where a pagebreak makes sense - write in latex preamble \usepackage{morefloats}. This package is availabe at CTAN but may also be part of your local tex installation.
Centering all floats If you want to center for example all of your uncentered figures, you can do this with \makeatletter \renewenvironment{figure}[1][]{% \@float{figure}% \centering }{% \end@float } \makeatother
If you like a special placement then write f.ex.:
Text around a figure (floatflt or wrapfig) With these packages you can let the text flow around "floating" figures and "floating" tables For package wrapfig download the demofile which needs package blindtext.sty. Floating Figure
Floating Table
The floatingtable environment is different to the floatingfigure one: also have a look at http://www.tex.ac.uk/cgi-bin/texfaq2html?label=textflow
Numbering of Floats/Equations All classes have their own style of numbering floats and equations. You can change this style as for example: in LaTeX preamble: \renewcommand{\thefigure}{\thechapter-\arabic{figure}} \renewcommand{\thetable}{\arabic{chapter}.\roman{table}.} \renewcommand{\theequation}{\thechapter-\arabic{equation}}Now the figures and equations are numbered like 2-5, means "chapter-number". This works only for book classes, because artice classes do not have chapters. The tables are numbered like 2.IV.
Figure side by side in a float With the subfigure-environment it's no problem to put two figures side by side with one main-caption and two optional sub-captions. If you want the figure side by side but aligned to the top of both you can't use the parameters for minipages/parboxes because we have only one line and these position-parameters are only valid when we have more than one. A table or a figure iss for LaTeX only a character. To get both aligned to the top write in preamble: \newcommand\myTwoFig[2]{% \raisebox{-\height}{#1}% \raisebox{-\height}{#2}% }And in text in tex(red) \myTwoFig{
the images can be insert with the menu button. If you want this as a float put the preanble stuff into the environment
\begin{figure} ... \end{figure} and add a third parameter for the caption.
For another solution have a look here. Position in page Sometimes a single float is positioned on a page without any text. The standard LaTeX definitions are: \makeatletter \setlength\@fptop{0\p@ \@plus 1fil}% float at the top \setlength\@fpsep{8\p@ \@plus 2fil}% space between two floats on one page \setlength\@fpbot{0\p@ \@plus 1fil}% float at the bottom \makeatotherIf you want this float to be positioned on the top instead of a vertical centering, write in latex preamble the first line, for positioning on the bottom the second one: \makeatletter \setlength\@fptop{0\p@}% float at the top \setlength\@fpbot{0\p@}% float at the bottom \makeatother
Space between Floats and Text in text as tex (red) or in the latex-preamble \setlength{\textfloatsep}{0.5cm} % as an example \setlength{\dbltextfloatsep}{0.5cm} % same for twocolumn-mode
Endfloats - Float Placement
Also have a look at http://www.cs.uu.nl/~piet/floats/ for more Information about placement. |