scribble icon indicating copy to clipboard operation
scribble copied to clipboard

Allow `math` to interpret content within `{}` as a (sub)superscript

Open NoahStoryM opened this issue 1 year ago • 4 comments

See #411.

NoahStoryM avatar Mar 06 '24 06:03 NoahStoryM

Please also add some tests in https://github.com/racket/scribble/blob/master/scribble-test/tests/scribble/docs/manual.scrbl

sorawee avatar Mar 06 '24 07:03 sorawee

I don't know how to test in manual.scrbl that math interprets superscript and subscript correctly, maybe I should directly test that pregexp is correct?

NoahStoryM avatar Mar 06 '24 10:03 NoahStoryM

You can write some content using math in the Scribble file, and then render it to text (https://github.com/racket/scribble/blob/master/scribble-test/tests/scribble/docs/manual.txt) and see if that's the result that you expect. If so, save the change. This will become the expected result that the test runner will compare against.

sorawee avatar Mar 06 '24 13:03 sorawee

I just realized that we can achieve similar functionality by defining functions:

(define ^ (compose superscript math))
(define _ (compose subscript math))

I'm not sure if this PR is necessary, feel free to close it.

NoahStoryM avatar May 21 '24 01:05 NoahStoryM

I will close the PR then, thanks.

sorawee avatar Jul 02 '24 19:07 sorawee