From 581f9cb51400e9a1e96b7b0f7589450daea8e5ca Mon Sep 17 00:00:00 2001 From: Suzanne Soy Date: Tue, 23 Mar 2021 15:50:47 +0000 Subject: [PATCH] Added examples of katex output to the docs --- scribblings/scribble-math.scrbl | 40 +++++++++++++++++++++++++++++---- 1 file changed, 36 insertions(+), 4 deletions(-) diff --git a/scribblings/scribble-math.scrbl b/scribblings/scribble-math.scrbl index 4ff7cd201..c6b86505a 100644 --- a/scribblings/scribble-math.scrbl +++ b/scribblings/scribble-math.scrbl @@ -132,7 +132,9 @@ details see the documentation of @racket[with-html5]. stylesheets to the document. The resulting element also uses a specific CSS class so that when the page is loaded into a browser, KaTeX can recognise it and render it in - @tech{inline mode}.} + @tech{inline mode}. + + @racket[($-katex "x^2")] renders as @$-katex{x^2}.} @defproc[($$-katex [math (listof? string?)]) element?]{ Produces an @racket[element?] which contains the given @@ -142,7 +144,13 @@ details see the documentation of @racket[with-html5]. properties to add scripts and stylesheets to the document. The resulting element also uses a specific CSS class so that when the page is loaded into a browser, KaTeX can - recognise it and render it in @tech{display mode}.} + recognise it and render it in @tech{display mode}. + + @racketblock[($$-katex "\\sum_{i=0}^n x_i^3")] + + renders as: + + @$$-katex{\sum_{i=0}^n x_i^3}} @defproc[($-mathjax [math (listof? string?)]) element?]{ Produces an @racket[element?] which contains the given @@ -152,7 +160,9 @@ details see the documentation of @racket[with-html5]. stylesheets to the document. The resulting element also uses a specific CSS class so that when the page is loaded into a browser, MathJax can recognise it and render it in - @tech{inline mode}.} + @tech{inline mode}. + + @racket[($-mathjax "x^2")] renders as @$-mathjax{x^2}.} @defproc[($$-mathjax [math (listof? string?)]) element?]{ Produces an @racket[element?] which contains the given @@ -162,7 +172,14 @@ details see the documentation of @racket[with-html5]. properties to add scripts and stylesheets to the document. The resulting element also uses a specific CSS class so that when the page is loaded into a browser, MathJax can - recognise it and render it in @tech{display mode}.} + recognise it and render it in @tech{display mode}. + + @racketblock[($$-mathjax "\\sum_{i=0}^n x_i^3")] + + renders as: + + @$$-mathjax{\sum_{i=0}^n x_i^3}} + @defproc[($-tex2svg [math (listof? string?)]) element?]{ Produces an @racket[element?] which contains the given @@ -173,6 +190,11 @@ details see the documentation of @racket[with-html5]. This means no new scripts or stylesheets are added to the document. It also has no style, so its style cannot be customized. +@; @racket[($-tex2svg "x^2")] renders as @$-tex2svg{x^2}. + + This procedure requires that @code{tex2svg} be installed via + @code{npm install mathjax-node-cli}. + This procedure requires Racket 6.12 or later.} @defproc[($$-tex2svg [math (listof? string?)]) element?]{ @@ -184,6 +206,16 @@ details see the documentation of @racket[with-html5]. This means no new scripts or stylesheets are added to the document. It also has no style, so its style cannot be customized. + +@; @racketblock[($$-tex2svg "\\sum_{i=0}^n x_i^3")] + +@; renders as: + +@; @$$-tex2svg{\sum_{i=0}^n x_i^3} + + This procedure requires that @code{tex2svg} be installed via + @code{npm install mathjax-node-cli}. + This procedure requires Racket 6.12 or later.} @defproc[(use-katex) void?]{