Difference between revisions of "Dotted number in caption"

From ConTeXt wiki
Jump to navigationJump to search
(an example added and another question: how to do the same for \sections?)
(answered question on how to append a dot to section numbers)
Line 37: Line 37:
  
  
How to do the same for sections?
+
For sections:
* 1. Section
+
<texcode>
** 1.1. Subsection
+
\def\Dot#1{#1.}
 +
\setuphead[section][numbercommand=\Dot]
 +
\setuplist[section][numbercommand=\Dot]
 +
\setuplist[subsection][numbercommand=\Dot]
 +
\setuplist[subsubsection][numbercommand=\Dot]
  
{{howto}}
+
\starttext
 +
 
 +
\completecontent
 +
 
 +
\section{abc}
 +
\subsection{def}
 +
 
 +
\stoptext
 +
</texcode>
 +
 
 +
<context>
 +
\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
 +
</context>
 +
 
 +
Somewhat surprisingly, <cmd>setuphead</cmd> does have some inheritance built in, but for the table of contents, all section levels must be treated individually.

Revision as of 17:35, 22 September 2005

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.