Changes

Jump to navigation Jump to search
956 bytes added ,  15:32, 3 August 2021
something about combinations
< [[Visuals]] | [[Graphics]] | [[Using Graphics]] >= Introduction =
Floats are elements like tables or figures that Floating Objects (floats) are placed (and numbered) automatically by TeX, with a configurable (and optional) caption. They are so called as they can ''placed at an appropriate position determined by the TeX float'' around the output pages to placement algorithm. The algorithm has a place where TeX thinks they are appropriate (You number of options that can influence what TeX thinks as appropriate)float placement.
Floats Most options in the manual (such as {{cmd|placeexternalfigure}}) are ConTeXt's "base class" for everything that uses a <tt>\placedescribed using the generic {{cmd|placefloat}}...</tt> command (tableAdditionally, figure, own floats){{cmd|placelistoffigures}} creates a list of the figures used in the document.
If you search options of e.g. {{cmd|placeexternalfigure}} you must look after {{cmd|placefloat}} in the manual! (same for <tt>\setup...</tt> etc.) The float types Floats include "graphic", "figure", "table" , and "intermezzo" are readily defined. If you need more (i.e. if you need another numbering or table of something), you Additional floats can easily define your own floats with <be defined using {{cmd>|definefloat</cmd>}}.
<texcode>
(table copied from the manual)
<{{cmd>|placefigure</cmd> }} and <{{cmd>|placetable</cmd> }} also accept the same set of options, and allow to create floating figures and captions respectively.
'''reference'''
If you don't need to refer to your float, you can leave this parameter out.
== Examples ==I will explain the examples in terms of <{{cmd>|placefigure</cmd> }} but the same set of options are also valid for other floats.
* If you do not want a caption
This does not work correctly at a page boundary. The <tt>line</tt> option leaves the space above the figures empty, while the <tt>hang</tt> option also wraps texts above the figure.
==Floats and columns==
This special case is discussed [[Columns#Floats_and_other_limitations_of_columns|here]].
=Floats on empty pages= There’s a way to switch off page headings at full page floats: <texcode>\startplacefigure[title=Cow,location={page,high,header}] \externalfigure[cow.pdf]\stopplacefigure</texcode> =Protruding Floats in Double-Sided Documents==
If you have a double-sided document with wide outer margins then you might want your figures to protrude into the margin. In a double-sided document you need to tell ConTeXt to decide whether to make the figure protrude to the left or the right. This can be done as follows:
</texcode>
==Landscape Floats in a Portrait Document== 
Wide tables, for example, can be turned and most likely will need to be put on a separate page.
<texcode>
\stopplacetable
</texcode>
Both the table caption and the contents will be rotated, but not the page header and footer which remain "upright". Notice that one must set the TABLE textwidth to <{{cmd>|textheight</cmd> }} in order for the table macros to fit properly.
== Floats and section headings ==By default, section headings don't wrap "around" floating objects. Instead, they will be moved down as far as needed to appear below the float. This behaviour can be controlled using the <tt>aligntitle</tt> option of the <cmd>setupheads</cmd> or <cmd>setuphead</cmd> commands.
=By default, section headings don't wrap “around” floating objects. Instead, they will be moved down as far as needed to appear below the float. This behaviour can be controlled using the <tt>aligntitle</tt> option of the {{cmd|setupheads}} or {{cmd|setuphead}} commands. = Captions == To change the style of figure(table) captions, use <{{cmd>|setupcaptions</cmd>}}.
To use a different (e.g. abbreviated) caption in the list of floats, you can do:
 
<texcode>
\startplacefigure[title={A rather long caption},list={A short caption}]
This is the content of the actual figure
\stopplacefigure
</texcode>
 
In MkII this was possible by:
<texcode>
</texcode>
Or = Float Combinations = If you want to place floats besides each other or in more recent (circa November 2011 a regular matrix,each with its own number and later) versions caption, you need a float combination: <texcode>\startplacefigure[location=none] % disable numbering of ConTeXtouter float\startfloatcombination[2*1] % two columns, one row\startplacefigure[location=here,title={Left Image}] % figure with caption \externalfigure[dummy]\stopplacefigure\startplacefigure[location=here,title={Right Image}] \externalfigure[dummy]\stopplacefigure\stopfloatcombination\stopplacefigure</texcode> If you want only one number for the whole thing, you need a regular combination within a float:
<texcode>
\startplacefigure[location=here,title={A rather long captionMy combination}]\startcombination[2*1] % two columns,list=one row {\externalfigure[dummy]}{A short Left Image} % captionmay be empty {\externalfigure[dummy]}{Right Image}]This is the content of the actual figure\stopcombination
\stopplacefigure
</texcode>
=See also {{cmd|startcombination}}. = Flushing floats ==
The command {{cmd|placefloats}} outputs all pending floats.
 
[[Category:Basics]]
[[Category:Layout]]

Navigation menu