Closed emilyyyylime closed 9 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
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.
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.
I mean, I think the default should just be set appropriately to style guides depending on the language, only overriding where explicitly given
[Wikipedia]() compiles a good list of sources for that claim: