davemckain / snuggletex

Ancient and somewhat pathological LaTeX parser written in Java
Other
7 stars 4 forks source link

Supperscript tokenization #4

Open axkr opened 1 year ago

axkr commented 1 year ago

Hi

can you please review my solution for this bug: https://sourceforge.net/p/snuggletex/bugs/9/

It's done in this commit in LaTeXTokenizer: https://github.com/axkr/symja_android_library/commit/526e48522c6e15e9e199ed0b3a64e6e3696c5c06

davemckain commented 12 months ago

Thanks for having a look at this and contributing your patch, Axel.

I've created a new feature branch (issue-4) based on your patch. (However I made a wee change to the singleDigitMode handling to cover cases like $x^.5$.)

I'm currently in two minds about merging this in. While the existing behaviour doesn't match LaTeX, it does actually match AsciiMath and has worked the same way since I first wrote this. So I'm not sure if I really want to change this behaviour after such a long time and now that this project is effectively dormant.

axkr commented 12 months ago

I'm currently in two minds about merging this in. While the existing behaviour doesn't match LaTeX, it does actually match AsciiMath and has worked the same way since I first wrote this. So I'm not sure if I really want to change this behaviour after such a long time and now that this project is effectively dormant.

Maybe you can add a global configuration flag to distinguish between the different TeX flavors?