bartp5 / libtexprintf

Library providing printf-style formatted output routines with tex-like syntax support.
GNU General Public License v3.0
28 stars 2 forks source link

Unicode primes #21

Closed stevengj closed 1 year ago

stevengj commented 1 year ago

t' and t'' get rendered as-is using ASCII quotes, but they could be rendered using Unicode prime characters t′ and t″.

Here are several Unicode primes.

bartp5 commented 1 year ago

currently libtexprintf has the \prime, \second, \third, \fourth, and `\backprime¸ symbols. Obviously it is nice to automatically parse the single quites to generate the regular primes. I'll have a look. The more special primes, like the double backprime, will just be symbols.

bartp5 commented 1 year ago

new version implements single to quadruple primes, i.e. a' a'' a''' a''''. I also added some additional primes to the symbol list and made aliases for those I head but apparently also go by other names.

stevengj commented 1 year ago

Great! I would suggest a different fallback, though for more than 4 primes, though. Right now you have src/utftex "y'''''" render as

y⁗′

Maybe it should render as y′′′′′ instead? i.e. fallback to repeating ?

bartp5 commented 1 year ago

I see, the way I did it we depend on whoever designed the fonts on how consistent the primes look. I guess more than 4 primes is not much of a use case but, who knows, I made it so.