Difference between revisions of "Command/placefloat"

From ConTeXt wiki
m (Text replace - "\[\[cmd:(.*)\|(.*)\]\]" to "{{cmd|$1}}")
(Improve description and example. Create table to fill in location key descriptions)
Line 11: Line 11:
 
   <tr valign="top" class="first">
 
   <tr valign="top" class="first">
 
     <td class="cmd">[...]</td>
 
     <td class="cmd">[...]</td>
     <td>left right <strong>here</strong> top bottom inleft inright inmargin margin leftmargin rightmargin leftedge rightedge innermargin outermargin inneredge outeredge inner outer line high low fit page leftpage rightpage opposite always auto force tall reset line height depth </td>
+
     <td>left right '''here''' top bottom inleft inright inmargin margin leftmargin rightmargin leftedge rightedge innermargin outermargin inneredge outeredge inner outer line high low fit page leftpage rightpage opposite always auto force tall reset line height depth </td>
 
   </tr>
 
   </tr>
 
   <tr valign="top" class="second">
 
   <tr valign="top" class="second">
 
     <td class="cmd">[ref,ref,...]</td>
 
     <td class="cmd">[ref,ref,...]</td>
     <td></td>
+
     <td>''references''</td>
 
   </tr>
 
   </tr>
 
   <tr valign="top" class="third">
 
   <tr valign="top" class="third">
 
     <td class="cmd">{...}</td>
 
     <td class="cmd">{...}</td>
     <td><i>text</i> </td>
+
     <td>''caption''</td>
 
   </tr>
 
   </tr>
 
   <tr valign="top" class="first">
 
   <tr valign="top" class="first">
 
     <td class="cmd">{...}</td>
 
     <td class="cmd">{...}</td>
     <td><i>text</i> </td>
+
     <td>''float contents''</td>
 
   </tr>
 
   </tr>
 
</table>
 
</table>
 
  
 
== Description ==  
 
== Description ==  
first text  = caption ('none'=no caption at all)
+
With <code>\place''float''[''location''][''ref'']{''caption''}{''contents''}</code> you can declare that you want to take certain contents, and place them on the page as a (numbered) figure, table, graphic, or intermezzo, or as some other object type that you defined using {{cmd|definefloat}}. <code>''ref''</code> is an optional reference label; <code>''location''</code> is an optional positioning key. There are a great many positioning keys defined; the following table describes them.
second text = float contain
 
 
 
 
 
== Example ==
 
<texcode>
 
% places two cows next to each other but each one with
 
% its own caption
 
 
 
\starttext
 
 
 
\placefigure
 
  [none]
 
  {}
 
  {\startcombination
 
      {\externalfigure[cow][width=4cm]} {\placefloatcaption[figure]{one}}
 
      {\externalfigure[cow][width=4cm]} {\placefloatcaption[figure]{two}}
 
    \stopcombination}
 
 
 
\stoptext
 
</texcode>
 
 
 
  
 +
{|
 +
|-style="text-align:left"
 +
! Keyword
 +
! Meaning
 +
|-
 +
| left
 +
| left of text
 +
|-
 +
| right
 +
| to the right of the text
 +
|-
 +
| here
 +
| preferably here
 +
|-
 +
| force
 +
| force placement here
 +
|-
 +
| top
 +
| at the top of the page
 +
|-
 +
| bottom
 +
| at the bottom of the page
 +
|-
 +
| inleft
 +
| in the left margin
 +
|-
 +
| inright
 +
| in the right margin
 +
|-
 +
| inmargin
 +
| in the margin (left or right)
 +
|-
 +
| margin
 +
| in the margin (margin float)
 +
|-
 +
| leftmargin
 +
|
 +
|-
 +
| rightmargin
 +
|
 +
|-
 +
| leftedge
 +
|
 +
|-
 +
| rightedge
 +
|
 +
|-
 +
| innermargin
 +
|
 +
|-
 +
| outermargin
 +
|
 +
|-
 +
| inneredge
 +
|
 +
|-
 +
| outeredge
 +
|
 +
|-
 +
| inner
 +
|
 +
|-
 +
| outer
 +
|
 +
|-
 +
| line
 +
|
 +
|-
 +
| high
 +
|
 +
|-
 +
| low
 +
|
 +
|-
 +
| fit
 +
|
 +
|-
 +
| page
 +
| on a new (empty) page
 +
|-
 +
| leftpage
 +
|
 +
|-
 +
| rightpage
 +
|
 +
|-
 +
| opposite
 +
| on the left page (is this correct?)
 +
|-
 +
| always
 +
| precedence over stored floats
 +
|-
 +
| auto
 +
|
 +
|-
 +
| tall
 +
|
 +
|-
 +
| reset
 +
|
 +
|-
 +
| line
 +
|
 +
|-
 +
| height
 +
|
 +
|-
 +
| depth
 +
|
 +
|-
 +
|}
  
 
== Example ==
 
== Example ==
  
<texcode>
 
% two different ways to suppress numbering and caption
 
%
 
\starttext
 
\placefigure{none}{\externalfigure[cow]}
 
\placefigure[none]{}{\externalfigure[cow]}
 
\stoptext
 
  
</texcode>
+
<context source=yes>
 +
% Tell ConTeXt where the cow picture is stored
 +
\setupexternalfigures[location={local,default}]
  
 +
\startcolumns[n=3]
 +
    caption=none
 +
    \placefigure{none}{\externalfigure[cow][height=1cm]}
 +
\column
 +
    reference=none
 +
    \placefigure[none]{}{\externalfigure[cow][height=1cm]}
 +
\column
 +
    empty caption
 +
    \placefigure{}{\externalfigure[cow][height=1cm]}
 +
\stopcolumns
 +
</context>
  
 
== See also ==
 
== See also ==
<!-- something like {{cmd|goto}} -->
+
* {{cmd|definefloat}} to define a new kind of float object.
 +
* {{cmd|startcombination}} to place multiple figures.
  
 
== Help from ConTeXt-Mailinglist/Forum ==
 
== Help from ConTeXt-Mailinglist/Forum ==

Revision as of 20:03, 25 May 2012

\placefloat

Syntax

\placefloat[...][ref,ref,...]{...}{...}
[...] left right here top bottom inleft inright inmargin margin leftmargin rightmargin leftedge rightedge innermargin outermargin inneredge outeredge inner outer line high low fit page leftpage rightpage opposite always auto force tall reset line height depth
[ref,ref,...] references
{...} caption
{...} float contents

Description

With \placefloat[location][ref]{caption}{contents} you can declare that you want to take certain contents, and place them on the page as a (numbered) figure, table, graphic, or intermezzo, or as some other object type that you defined using \definefloat. ref is an optional reference label; location is an optional positioning key. There are a great many positioning keys defined; the following table describes them.

Keyword Meaning
left left of text
right to the right of the text
here preferably here
force force placement here
top at the top of the page
bottom at the bottom of the page
inleft in the left margin
inright in the right margin
inmargin in the margin (left or right)
margin in the margin (margin float)
leftmargin
rightmargin
leftedge
rightedge
innermargin
outermargin
inneredge
outeredge
inner
outer
line
high
low
fit
page on a new (empty) page
leftpage
rightpage
opposite on the left page (is this correct?)
always precedence over stored floats
auto
tall
reset
line
height
depth

Example

% Tell ConTeXt where the cow picture is stored
\setupexternalfigures[location={local,default}]

\startcolumns[n=3]
    caption=none
    \placefigure{none}{\externalfigure[cow][height=1cm]}
\column
    reference=none
    \placefigure[none]{}{\externalfigure[cow][height=1cm]}
\column
    empty caption
    \placefigure{}{\externalfigure[cow][height=1cm]}
\stopcolumns

See also

Help from ConTeXt-Mailinglist/Forum

All issues with: