ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* th nd and rd
@ 2005-12-29 22:56 John R. Culleton
  2005-12-30  0:52 ` Aditya Mahajan
                   ` (2 more replies)
  0 siblings, 3 replies; 9+ messages in thread
From: John R. Culleton @ 2005-12-29 22:56 UTC (permalink / raw)


It is common to express certain numerals with the suffixes 
st, nd, rd, th,  
with the suffix in a smaller type and raised about .5em
eg:
1st 2nd 3rd 4th 5th.

It is of course possible to cobble these expressions up in macros.
But it would be handy if they were built in to Context.  

Any thoughts?


-- 
John Culleton
Books with answers to marketing and publishing questions:
http://wexfordpress.com/tex/shortlist.pdf

Book coaches, consultants and packagers:
http://wexfordpress.com/tex/packagers.pdf

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: th nd and rd
  2005-12-29 22:56 th nd and rd John R. Culleton
@ 2005-12-30  0:52 ` Aditya Mahajan
  2005-12-30  3:09 ` Idris Samawi Hamid
  2005-12-30 21:35 ` Mojca Miklavec
  2 siblings, 0 replies; 9+ messages in thread
From: Aditya Mahajan @ 2005-12-30  0:52 UTC (permalink / raw)


<--- On Dec 29, John R. Culleton wrote --->

> It is common to express certain numerals with the suffixes
> st, nd, rd, th,
> with the suffix in a smaller type and raised about .5em
> eg:
> 1st 2nd 3rd 4th 5th.
>
> It is of course possible to cobble these expressions up in macros.
> But it would be handy if they were built in to Context.
>
> Any thoughts?

Perhaps it is not too difficult to modify engord.sty 
(http://www.ctan.org/info?id=engord) from latex to work with context.

Aditya

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: th nd and rd
  2005-12-29 22:56 th nd and rd John R. Culleton
  2005-12-30  0:52 ` Aditya Mahajan
@ 2005-12-30  3:09 ` Idris Samawi Hamid
  2006-01-02  8:55   ` Hans Hagen
  2005-12-30 21:35 ` Mojca Miklavec
  2 siblings, 1 reply; 9+ messages in thread
From: Idris Samawi Hamid @ 2005-12-30  3:09 UTC (permalink / raw)


Hi John,

On Thu, 29 Dec 2005 15:56:06 -0700, John R. Culleton  
<john@wexfordpress.com> wrote:

> It is common to express certain numerals with the suffixes
> st, nd, rd, th,
> with the suffix in a smaller type and raised about .5em
> eg:
> 1st 2nd 3rd 4th 5th.
>
> It is of course possible to cobble these expressions up in macros.
> But it would be handy if they were built in to Context.
>
> Any thoughts?

I just do

\def\ST\high{st} etc. Is that unacceptable?

Best
Idris



>
>



-- 
Professor Idris Samawi Hamid
Department of Philosophy
Colorado State University
Fort Collins, CO 80523

--
Using Opera's revolutionary e-mail client: http://www.opera.com/mail/

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: th nd and rd
  2005-12-29 22:56 th nd and rd John R. Culleton
  2005-12-30  0:52 ` Aditya Mahajan
  2005-12-30  3:09 ` Idris Samawi Hamid
@ 2005-12-30 21:35 ` Mojca Miklavec
  2006-01-02  9:53   ` Hans Hagen
  2006-01-03 23:34   ` John R. Culleton
  2 siblings, 2 replies; 9+ messages in thread
From: Mojca Miklavec @ 2005-12-30 21:35 UTC (permalink / raw)


[-- Attachment #1: Type: text/plain, Size: 1041 bytes --]

John R. Culleton wrote:
> It is common to express certain numerals with the suffixes
> st, nd, rd, th,
> with the suffix in a smaller type and raised about .5em
> eg:
> 1st 2nd 3rd 4th 5th.
>
> It is of course possible to cobble these expressions up in macros.
> But it would be handy if they were built in to Context.

As usually, Hans already included (almost) that in the core :)
See the very end of lang-ger.tex and the definition of
\enordinaldaynumber. I don't know why there is \ordinalstr instead of
\highordinalstr used (in contrast to the Dutch one), but you can
(re)define it like:

\def\enordinalnumber#1%
  {#1\ifnum\lasttwodigits{#1}=11
     \highordinalstr{th}%
   \else\ifcase\lastdigit{#1}%
     \highordinalstr{th}%
   \or % 1
     \highordinalstr{st}%
   \or % 2
     \highordinalstr{nd}%
   \or % 3
     \highordinalstr{rd}%
   \else
     \highordinalstr{th}%
   \fi\fi}

And use it as:

\enordinalnumber{1}
\enordinalnumber{2}
\enordinalnumber{3}
\enordinalnumber{4}
\enordinalnumber{5}
\enordinalnumber{100}
...

Mojca

[-- Attachment #2: Type: text/plain, Size: 139 bytes --]

_______________________________________________
ntg-context mailing list
ntg-context@ntg.nl
http://www.ntg.nl/mailman/listinfo/ntg-context

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: th nd and rd
  2005-12-30  3:09 ` Idris Samawi Hamid
@ 2006-01-02  8:55   ` Hans Hagen
  0 siblings, 0 replies; 9+ messages in thread
From: Hans Hagen @ 2006-01-02  8:55 UTC (permalink / raw)


Idris Samawi Hamid wrote:

> Hi John,
>
> On Thu, 29 Dec 2005 15:56:06 -0700, John R. Culleton  
> <john@wexfordpress.com> wrote:
>
>> It is common to express certain numerals with the suffixes
>> st, nd, rd, th,
>> with the suffix in a smaller type and raised about .5em
>> eg:
>> 1st 2nd 3rd 4th 5th.
>>
>> It is of course possible to cobble these expressions up in macros.
>> But it would be handy if they were built in to Context.
>>
>> Any thoughts?
>
>
> I just do
>
> \def\ST\high{st} etc. Is that unacceptable?

\defineconversion[ordinal][\enordinaldaynumber]

\startitemize[ordinal,2*broad]
\item test
\item test
\item test
\item test
\item test
\stopitemize

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: th nd and rd
  2005-12-30 21:35 ` Mojca Miklavec
@ 2006-01-02  9:53   ` Hans Hagen
  2006-01-03 23:34   ` John R. Culleton
  1 sibling, 0 replies; 9+ messages in thread
From: Hans Hagen @ 2006-01-02  9:53 UTC (permalink / raw)


Mojca Miklavec wrote:

>As usually, Hans already included (almost) that in the core :)
>  
>
but you seem to be able to find that code faster than i can -)

Hans

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: th nd and rd
  2005-12-30 21:35 ` Mojca Miklavec
  2006-01-02  9:53   ` Hans Hagen
@ 2006-01-03 23:34   ` John R. Culleton
  2006-01-04 17:31     ` Adam Lindsay
  1 sibling, 1 reply; 9+ messages in thread
From: John R. Culleton @ 2006-01-03 23:34 UTC (permalink / raw)


On Friday 30 December 2005 04:35 pm, Mojca Miklavec wrote:
> \def\enordinalnumber#1%
>   {#1\ifnum\lasttwodigits{#1}=11
>      \highordinalstr{th}%
>    \else\ifcase\lastdigit{#1}%
>      \highordinalstr{th}%
>    \or % 1
>      \highordinalstr{st}%
>    \or % 2
>      \highordinalstr{nd}%
>    \or % 3
>      \highordinalstr{rd}%
>    \else
>      \highordinalstr{th}%
>    \fi\fi}
>
> And use it as:
>
> \enordinalnumber{1}
> \enordinalnumber{2}
> \enordinalnumber{3}
> \enordinalnumber{4}
> \enordinalnumber{5}
> \enordinalnumber{100}
> ...

It is stored now as part of my "standard macro pack" for Context.
Thanks to all. 
-- 
John Culleton
Books with answers to marketing and publishing questions:
http://wexfordpress.com/tex/shortlist.pdf

Book coaches, consultants and packagers:
http://wexfordpress.com/tex/packagers.pdf

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: th nd and rd
  2006-01-03 23:34   ` John R. Culleton
@ 2006-01-04 17:31     ` Adam Lindsay
  2006-01-04 18:16       ` Hans Hagen
  0 siblings, 1 reply; 9+ messages in thread
From: Adam Lindsay @ 2006-01-04 17:31 UTC (permalink / raw)


John R. Culleton wrote:
> On Friday 30 December 2005 04:35 pm, Mojca Miklavec wrote:
> 
>>\def\enordinalnumber#1%
>>  {#1\ifnum\lasttwodigits{#1}=11
>>     \highordinalstr{th}%
>>   \else\ifcase\lastdigit{#1}%
>>     \highordinalstr{th}%
>>   \or % 1
>>     \highordinalstr{st}%
>>   \or % 2
>>     \highordinalstr{nd}%
>>   \or % 3
>>     \highordinalstr{rd}%
>>   \else
>>     \highordinalstr{th}%
>>   \fi\fi}
>>
>>And use it as:
>>
>>\enordinalnumber{1}
>>\enordinalnumber{2}
>>\enordinalnumber{3}
>>\enordinalnumber{4}
>>\enordinalnumber{5}
>>\enordinalnumber{100}
>>...
> 
> 
> It is stored now as part of my "standard macro pack" for Context.
> Thanks to all. 

As I was just reminded by a British Telecom website (which confirmed 
that I was moving on the "13rd"), I'm used to two more exceptions 
(suggested as a patch):

\def\enordinaldaynumber#1%
   {#1\ifnum\lasttwodigits{#1}=11
      \highordinalstr{th}%
    \else\ifnum\lasttwodigits{#1}=12
      \highordinalstr{th}%
    \else\ifnum\lasttwodigits{#1}=13
      \highordinalstr{th}%
    \else\ifcase\lastdigit{#1}%
      \highordinalstr{th}%
    \or % 1
      \highordinalstr{st}%
    \or % 2
      \highordinalstr{nd}%
    \or % 3
      \highordinalstr{rd}%
    \else
      \highordinalstr{th}%
    \fi\fi\fi\fi}


-- 
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  Adam T. Lindsay, Computing Dept.     atl@comp.lancs.ac.uk
  Lancaster University, InfoLab21        +44(0)1524/510.514
  Lancaster, LA1 4WA, UK             Fax:+44(0)1524/510.492
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: th nd and rd
  2006-01-04 17:31     ` Adam Lindsay
@ 2006-01-04 18:16       ` Hans Hagen
  0 siblings, 0 replies; 9+ messages in thread
From: Hans Hagen @ 2006-01-04 18:16 UTC (permalink / raw)


Adam Lindsay wrote:

> As I was just reminded by a British Telecom website (which confirmed 
> that I was moving on the "13rd"), I'm used to two more exceptions 
> (suggested as a patch):
>
> \def\enordinaldaynumber#1%
>   {#1\ifnum\lasttwodigits{#1}=11
>      \highordinalstr{th}%
>    \else\ifnum\lasttwodigits{#1}=12
>      \highordinalstr{th}%
>    \else\ifnum\lasttwodigits{#1}=13
>      \highordinalstr{th}%
>    \else\ifcase\lastdigit{#1}%
>      \highordinalstr{th}%
>    \or % 1
>      \highordinalstr{st}%
>    \or % 2
>      \highordinalstr{nd}%
>    \or % 3
>      \highordinalstr{rd}%
>    \else
>      \highordinalstr{th}%
>    \fi\fi\fi\fi}
>
ok, patched

Hans

^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2006-01-04 18:16 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-12-29 22:56 th nd and rd John R. Culleton
2005-12-30  0:52 ` Aditya Mahajan
2005-12-30  3:09 ` Idris Samawi Hamid
2006-01-02  8:55   ` Hans Hagen
2005-12-30 21:35 ` Mojca Miklavec
2006-01-02  9:53   ` Hans Hagen
2006-01-03 23:34   ` John R. Culleton
2006-01-04 17:31     ` Adam Lindsay
2006-01-04 18:16       ` Hans Hagen

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).