extua / nth

Typst package for adding english ordinals to numbers, eg. 1st, 2nd, 3rd, 4th.
https://typst.app/universe/package/nth
MIT No Attribution
3 stars 0 forks source link

I would just like to mention that a lot of English typography style-guides advocate against superscript ordinal indicators #1

Closed emilyyyylime closed 9 months ago

emilyyyylime commented 11 months ago

[Wikipedia]() compiles a good list of sources for that claim:

In 19th-century handwriting, these terminals were often elevated, that is to say written as superscripts (e.g. 2nd, 34th). With the gradual introduction of the typewriter in the late 19th century, it became common to write them on the baseline in typewritten texts,[15] and this usage even became recommended in certain 20th-century style guides. Thus, the 17th edition of The Chicago Manual of Style states: "The letters in ordinal numbers should not appear as superscripts (e.g., 122nd not 122nd)", as do the Bluebook[16] and style guides by the Council of Science Editors,[17] Microsoft,[18] and Yahoo.[19] Two problems are that superscripts are used "most often in citations" and are "tiny and hard to read".[16] Some [word processors] (https://en.wikipedia.org/wiki/Word_processor) format ordinal indicators as superscripts by default (e.g. Microsoft Word[20]). Style guide author Jack Lynch (Rutgers) recommends turning off automatic superscripting of ordinals in Microsoft Word, because "no professionally printed books use superscripts".[21]

emilyyyylime commented 11 months ago

So the default in English should probably be no

..speaking of, is this internationalised at all? Might be worth to open another issue for that

extua commented 11 months ago

That's a good point, we could make no superscript the default, after introducing an argument to toggle superscript on or off. That's the only todo item in the readme file:

Pass argument to choose whether or not to put ordinals in superscript.

As for internationalisation, it's only english ordinals for now, but worth creating an issue for other languages, I'm not sure how to approach different rules but will think about it.

extua commented 11 months ago

Coming back to this, we could add an argument for 'sup' along these lines:

#let nth(ordinal-num, sup: bool)

and then before writing out at the bottom of the function:

if sup == true {
    ordinal-str + super(ordinal-suffix)
  }
  else {
    ordinal-str + ordinal-suffix
  }

So if you wanted to have nth in superscript, you'd write

#nth(2422, sup: true)

Otherwise, omit the argument and get no superscript by default.

The only thing which bothers me about this is that including the argument each time is pretty onerous. @emilyyyylime do you know if there's a way of using set to set a default value at the top of the document, a bit like giving a series of arguments to \usepackage in LaTeX.

Or, we could provide a second function nths, which would just be a wrapper for nth with the argument added.

#let nths(ordinal) = {
  nth(ordinal, sup: true)
}

This second way would be convenient to write, at the expense of breaking some programming conventions about pointless functions.

emilyyyylime commented 11 months ago

I mean, I think the default should just be set appropriately to style guides depending on the language, only overriding where explicitly given