Difference between revisions of "Dotted number in caption"

From ConTeXt wiki
Jump to navigationJump to search
(answered question on how to append a dot to section numbers)
m (Reverted edits by Kurds (Talk); changed back to last version by Mojca Miklavec)
 
(2 intermediate revisions by 2 users not shown)
Line 73: Line 73:
  
 
Somewhat surprisingly, <cmd>setuphead</cmd> does have some inheritance built in, but for the table of contents, all section levels must be treated individually.
 
Somewhat surprisingly, <cmd>setuphead</cmd> does have some inheritance built in, but for the table of contents, all section levels must be treated individually.
 +
 +
Another trick to achieve the same:
 +
<texcode>
 +
\setuplabeltext
 +
[sl]
 +
[chapter={{},{.}}]
 +
 +
\starttext
 +
\chapter{English}
 +
without a dot
 +
 +
\mainlanguage[sl]
 +
\chapter{Slovenian}
 +
having one
 +
 +
\stoptext
 +
</texcode>
 +
 +
<context>
 +
\setuplabeltext
 +
[sl]
 +
[chapter={{},{.}}]
 +
\setuphead
 +
[chapter]
 +
[style=bold,before=\smallskip,after=,page=no]
 +
 +
\starttext
 +
\chapter{English}
 +
without a dot
 +
\mainlanguage[sl]
 +
\chapter{Slovenian}
 +
having one
 +
\stoptext
 +
</context>

Latest revision as of 07:23, 3 March 2007

How to put something (a colon or dot for example) after the float number in a caption?

\let\floatcaptionsuffix=:
\placefigure[fig:cow]{cow}{\externalfigure[cow]}
\let\floatcaptionsuffix=:
\placefigure[fig:cow]{cow}{\externalfigure[cow]}


TODO: This page could use some more description, and maybe elaboration with other float caption options. (See: To-Do List)



For sections:

\def\Dot#1{#1.}
\setuphead[section][numbercommand=\Dot]
\setuplist[section][numbercommand=\Dot]
\setuplist[subsection][numbercommand=\Dot]
\setuplist[subsubsection][numbercommand=\Dot]

\starttext

\completecontent

\section{abc}
\subsection{def}

\stoptext

Somewhat surprisingly, \setuphead does have some inheritance built in, but for the table of contents, all section levels must be treated individually.

Another trick to achieve the same:

\setuplabeltext
 [sl]
 [chapter={{},{.}}]

\starttext
\chapter{English}
without a dot

\mainlanguage[sl]
\chapter{Slovenian}
having one

\stoptext