Sort titles by roman numeral?

70 views
Skip to first unread message

amreus

unread,
Jun 14, 2020, 11:37:16 AM6/14/20
to TiddlyWiki
Hey all,

I have some tiddlers which have a common title but ending in a unique roman numeral. Is it possible to create a list of titles sorted by the roman numeral?

I'm attempting use `sortby`

tiddler: RomanNumerals with:
list: I II III IV V VI VII VIII IX X XI XII XIII XIV XV XVI XVII XVIII XIX XX

tiddler: Contents
text:
    {{{ {prefix[CommonTitle] +sortby{RomanNumerals!!list}] }}}


Any hint is appreciated. Thanks.


amreus

unread,
Jun 14, 2020, 12:03:59 PM6/14/20
to TiddlyWiki
This does what I want. I suppose there would need to  be a dedicated "roman numeral sort" operator to handle any possible roman numerals.

{{{ [enlist{RomanNumerals!!list}addprefix[CommonTitle ]] }}}

TW Tones

unread,
Jun 14, 2020, 8:17:29 PM6/14/20
to TiddlyWiki
Amreus,

A Quick and simple answer is one of the many reason roman numerals are not used very often today.  is there size is not directly related to the size of the number and they cant be sorted.

I suggest a macro to convert roman numerals to decimal and store this in a field and use that field to sort.

Regards
Tony

amreus

unread,
Jun 15, 2020, 3:25:38 PM6/15/20
to TiddlyWiki
Thanks for the suggestion Tony - it's not really worth the effort at this time for the reasons you imply. 

TW Tones

unread,
Jun 15, 2020, 6:51:50 PM6/15/20
to TiddlyWiki
Amreus,

We can help you achieve this, and it will be available to the community. I am busy today but I through this together.

\define roman-20() I II III IV V VI VII VIII IX X XI XII XIII XIV XV XVI XVII XVIII XIX XX
<$list filter="[range[1,20]]" variable=decimal>
   
<$set name=roman-num filter=<<roman-20>> select={{{ [<decimal>subtract[1]] }}}>
   
<<decimal>>=<<roman-num>><br>
   
</$set>
</
$list>


Regards
Tony
Reply all
Reply to author
Forward
0 new messages