Difference between revisions of "Command/definefloat"

From Wiki
Jump to navigation Jump to search
(Created page with "Documentation for \definefloat")
 
Line 1: Line 1:
 
<cd:commandgroup name="definefloat" xmlns:cd="http://wiki.contextgarden.net/commanddoc/20200807">
 
<cd:commandgroup name="definefloat" xmlns:cd="http://wiki.contextgarden.net/commanddoc/20200807">
 
<cd:shortdesc>The command <tt>\definefloat</tt> defines floating object classes.
 
<cd:shortdesc>The command <tt>\definefloat</tt> defines floating object classes.
</cd:shortdesc>
+
 
 +
{{bug|there are backslashes in front of the instance names below, which is misleading. Until I find a solution for the incorrect visual, just pretend the backslashes are not there. --[[User:Taco|Taco]] ([[User talk:Taco|talk]]) 20:35, 7 September 2020 (CEST)}</cd:shortdesc>
 
<cd:instances>
 
<cd:instances>
 
     <cd:constant value="chemical"></cd:constant>
 
     <cd:constant value="chemical"></cd:constant>

Revision as of 18:37, 7 September 2020


\definefloat

Summary

The command \definefloat defines floating object classes.

{{bug|there are backslashes in front of the instance names below, which is misleading. Until I find a solution for the incorrect visual, just pretend the backslashes are not there. --Taco (talk) 20:35, 7 September 2020 (CEST)}

Instances

\chemical
\figure
\table
\intermezzo
\graphic

Settings

\definefloat[...][...][...=...,...]
[...]singular
[...]singular plural
...=...,...inherits from \setupfloat

Settings name

\definefloat[...][...][...]
[...]singular
[...]plural
[...]singular

Description

Define a new float type additional to predefined types "chemical", "graphic", "figure", "table" and "intermezzo". When invoked as \definefloat[remark][remarks][intermezzo], the following commands are defined, with defaults taken from the intermezzo environment, and the "intermezzo" counter will be used for "remark" floats:
  • \setupremark to set up the new environment
  • \placeremark to place a remark block
  • \startplaceremark...\stopplaceremark is the same, as an environment
  • \placelistofremarks for a 'table of remarks'.
  • \completelistofremarks for a table of remarks with a header
  • \startremarktext...\stopremarktext

It also defines:

  • the counter 'remark' (inherits from intermezzo)
  • the label 'remark' (inherits from intermezzo)

If no parent is given, then the label is the \Word value of the name (so: Remark) in this case.


TODO: there are some more commands and internals automatically generated (See: To-Do List)


Examples

Example 1

\definefloat[rightfigure][rightfigures][figure]

\setupcaption[rightfigure][location=right]

\starttext
\placefigure{caption 1}{\framed{figure 1}} % old one
\placerightfigure{caption 2}{\framed{figure 2}} % new one
\placefigure{caption 3}{\framed{figure 3}}
\stoptext

Notes

See also

Help from ConTeXt-Mailinglist/Forum

All issues with: