TeXnik - Tips TeX and LaTeX

Welcome to the TeXnik website (under construction)

TUG logo

Main page

Search CTAN:


Google c.t.t.

Google d.c.t.t.



Absolute Position in a Page | 
Caption beside Figure/Table  |  Captions  |  Caption as Margin  |  Caption width  |  Centering all Floats  |  Compress eps-files  |  Continuing Counting  |  Counter  | 
Doublepage Floats  | 
Endfloats  |  eps-figures | 
Figure side by side |  Float as part of the Margin |  Float beside caption |  Floatflt |  Float placement |  Floats in Twocolumn mode |  Floats other than figure/table/algorithm |  "Floats" over more than one page | 
Height/Width not greater than textwidth or textheight | 
Image over the full page |  Images side by side | 
Multicols and Floats |  Multiple graphics side by side |  Marginnotes inside Floats |  Max Width/Height not greater than textwidth or textheight |  Multiple graphics side by side | 
New Floats |  Nonfloats inside Floats  |  Numbering |  Number of Unprocessed floats | 
Parameter |  Placement |  Position in a page | 
Ref on Subfigure |  Rotating Tables/Images | 
Slides and Floats |  Space between floats and text |  Subfigures inside Floats  | 
Table and figure side by side |  Tables side by side |  Text flows around figure |  Text beside figure float |  Twocolumn mode and floats | 
Unprocessed floats | 
Vertical Text beside figure float  | 
Width as textwidth and marginwidth floats  |  Width not greater than textwidth or textheight  |  Width of the caption  |  wrapfig package  | 

a figure-, table-, algorithm- or another float is only possible on one page! Therefore a pagebreak in a float is not possible! look at this page for a "nonFloat inside floats".
Read the epslatex documentation for all information around floats, figures and tables.
Information about rotating in general
hvfloat, a useful package for rotating of captions and float objects.

Slides and Floats
Slides have by default no floats! If you want to use them as usual write in preamble:

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.

Some of the stuff is only for demonstration and not needed for regular use. The image is available too: lyx1.eps

Captions as Margin Notes
this should also work with more than one line. You need package textpos:
and in the float write before the image in tex (red):
	\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

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:

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:

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:
\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
If 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:
\setlength\@fptop{0\p@}% float at the top
\setlength\@fpbot{0\p@}% float at the bottom

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

  • if you want all floats and the end of your doc use package endfloats, available at CTAN.

    Also have a look at http://www.cs.uu.nl/~piet/floats/ for more Information about placement.

  • If you like to place the float where it is, use the [H]-Option from package float, it's a absolute positining. Use [H] as described above. [21~
  • local time: Sat Jun 22 22:17:39 CEST 2024 ; file is: 1823.22153935185 days old
    contact webmaster _at_ TeXnik.de