-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Description
Description
A number of characters are interpreted in numbering patterns (since that's the whole point). Because there's no escape hatch, this makes them impossible to use in the various prefix of suffix. I propose that a backslash character should stop the next character from being interpreted in this way. For example a patter of "Section 1.1 )" would be written "Sect\\ion 1.1 )"
I can see two limitations:
-
It's not obvious that you need a double backslash instead of of a single one to someone not familiar with escape sequences, and that makes an actual backslash be
"\\\\"but I suspect that's not a common character at all to put in there. -
It's added complexity for something that can currently be solved with numbering functions. I do think this makes a bunch of patterns nicer for the user on the long run tho.
I'd actually be willing to implement this if there's interested, that'd be a good way to get familiar with the codebase :p
Use Case
For more involved numbering patterns, it can get frustrating to work around interpreted characters, especially aAiI. For example, numbering("Section 1.1 )") doesn't produce the expected result because the i is a special character in a numbering pattern.
With this feature it would be numbering("Sect\\ion 1.1 )") instead.
// Before
#set heading(numbering: (..nums) => "Section " + numbering("1.1 )", ..nums.pos()))
// After
#set heading(numbering: "Sect\\ion 1.1 )")