On 2014-07-28 15:29, Joshua Krämer wrote:
Dear list,

I want to setup all my floats' contents to be middle-aligned, not
indented and typeset in a distinct font.  How can I do this?  The
attached example does not work.

Thank you and kind regards,
Joshua Krämer


\setupindenting	[yes, \the\baselineskip]
\definefontfamily [figurefamily] [serif] [Latin Modern Sans]
\setupfloats [align=middle, style={\switchtobodyfont[figurefamily]},
indenting=no]

\starttext
\input knuth

\startplacefigure
Word
\stopplacefigure

\stoptext



\setupexternalfigures[location={local,default}]
\setupindenting    [yes, \the\baselineskip]
%\definefontfamily [figurefamily] [serif] [Latin Modern Sans]
%\setupfloats [align=middle, style={\switchtobodyfont[figurefamily]}, indenting=no]
\setupcaptions [style=ss]
\setupframed[style=it]

\starttext
\input knuth

\startplacefigure[title={Not a figure}]
Word
\stopplacefigure

\startplacetable[title={A table}]
\starttable[||]
\NC Table\NC\NR
\stoptable
\stopplacetable

\startplacefigure[title={A bovine figure}]
\externalfigure[cow][width=5cm]
\stopplacefigure

\startplaceintermezzo[title={An intermezzo}]
\startframedtext
\input ward
\stopframedtext
\stopplaceintermezzo

\stoptext


Captions are styled separately from the floats, hence \setupcaptions.

"Word" is not a figure. \startplacefigure does not make what follows a figure. When a real figure is set with \startplacefigure, it is centered by default.

You may be able to get away with style=ss instead of a new font definition if the sans is linked to the main serif font.

The contents of a float are styled according to the type of float.