Difference between revisions of "Command/convertnumber"

From ConTeXt wiki
Jump to navigationJump to search
m (Text replace - "\[\[cmd:(.*)\|(.*)\]\]" to "{{cmd|$1}}")
m
Line 84: Line 84:
  
  
== Example ==
+
== Examples ==
<!-- Please fill in an example if you can -->
+
=== Built-in conversion set demo ===
 +
 
 +
<context mode=mkiv source=yes>
 +
\dorecurse {8}{\convertnumber{set 0}{#1}\quad}\par
 +
\dorecurse {9}{\convertnumber{set 1}{#1}\quad}\par
 +
\dorecurse{12}{\convertnumber{set 2}{#1}\quad}\par
 +
\dorecurse{15}{\convertnumber{set 3}{#1}\quad}\par
 +
</context>
  
 
== See also ==
 
== See also ==
 
<!-- something like {{cmd|goto}} -->
 
<!-- something like {{cmd|goto}} -->
 +
* {{cmd|defineconversion}}
  
 
== Help from ConTeXt-Mailinglist/Forum ==
 
== Help from ConTeXt-Mailinglist/Forum ==

Revision as of 07:30, 1 November 2012

\convertnumber

Syntax

\convertnumber{...}{...}
{...} text
{...} text


Description

Convert a number into a different form, e.g. to Roman numerals, bullets, etc.

{..Text1..} - defines the new form {..Text2..} - is the number to convert

The command is defined in core-con.tex package file.

The main conversions (there are others, see the source code) include:

{a} = characters

{A} = Characters

{AK} = smallcapped characters

{KA} = smallcapped characters

{n} = numbers

{N} = Numbers

{m} = mediaeval

{i} = roman numerals

{I} = Roman numerals

{r} = roman numerals

{R} = Roman numerals

{KR} = smallcapped roman numerals

{RK} = smallcapped roman numerals

{g} = greek numerals

{G} = Greek numerals

{o} = oldstyle numerals

{O} = Oldstyle numerals]

{or} = oldstyle roman numerals

{arabicnumberals}

{persiannumerals}

{month} = long month name

{month:mnem} = short month name

{set 0} = symbols [bullet, dash, star, triangle ...]

{set 1} = symbols [*, **, ***, dag, ...]

{set 2} = symbols [*, dag, ddag, **, dagdag ...]

{set 3} = symbols [*, **, ***, ...]


Examples

Built-in conversion set demo

\dorecurse {8}{\convertnumber{set 0}{#1}\quad}\par
\dorecurse {9}{\convertnumber{set 1}{#1}\quad}\par
\dorecurse{12}{\convertnumber{set 2}{#1}\quad}\par
\dorecurse{15}{\convertnumber{set 3}{#1}\quad}\par

See also

Help from ConTeXt-Mailinglist/Forum

All issues with: