Difference between revisions of "Dotted number in caption"
Jump to navigation
Jump to search
(faq) |
m (Text replacement - "</cmd>" to "}}") |
||
(9 intermediate revisions by 7 users not shown) | |||
Line 1: | Line 1: | ||
− | How to put a dot after the float number in a caption? | + | How to put something (a colon or dot for example) after the float number in a caption? |
− | < | + | |
− | \let\floatcaptionsuffix=. | + | <texcode> |
− | </ | + | \let\floatcaptionsuffix=: |
+ | </texcode> | ||
+ | |||
+ | <table style="border:1px solid #DDDDDD"><tr style="background-color:#EEEEEE"><td> | ||
+ | |||
+ | <texcode> | ||
+ | \placefigure[fig:cow]{cow}{\externalfigure[cow]} | ||
+ | </texcode> | ||
+ | |||
+ | </td><td> | ||
+ | |||
+ | <texcode> | ||
+ | \let\floatcaptionsuffix=: | ||
+ | \placefigure[fig:cow]{cow}{\externalfigure[cow]} | ||
+ | </texcode> | ||
+ | |||
+ | </td></tr> | ||
+ | <tr><td align="center"> | ||
+ | |||
+ | <context> | ||
+ | \placefigure[fig:cow]{cow}{\externalfigure[cow][width=3cm]} | ||
+ | </context> | ||
+ | |||
+ | </td><td align="center"> | ||
+ | |||
+ | <context> | ||
+ | \let\floatcaptionsuffix=: | ||
+ | \placefigure[fig:cow]{cow}{\externalfigure[cow][width=3cm]} | ||
+ | </context> | ||
+ | |||
+ | </td></tr></table> | ||
+ | |||
+ | {{todo|This page could use some more description, and maybe elaboration with other float caption options.}} | ||
+ | |||
+ | |||
+ | For sections: | ||
+ | <texcode> | ||
+ | \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 | ||
+ | </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}} 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> | ||
+ | |||
+ | [[Category:Basics]] | ||
+ | [[Category:Graphics]] |
Latest revision as of 13:23, 9 August 2020
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