require-ing MathJax fully working in Observerable notebook, but NOT in Quarto ojs cell #1682
Replies: 1 comment 1 reply
-
I've discovered the problem. In a On the other hand, in a Should I report this as a bug? Or is this expected behavior? |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
I'm wanting to include some Observable charts in a website I'm building with Quarto. I'd like these charts to include nicely-typeset math, and for that purpose I'm wanting to use MathJax's
tex2svg
function in the source code. Relative to other math typesetting solutions one can use in Observable,tex2svg
is nice because it outputs pure SVG paths...Thus they scale as the svg containing them is resized without any additional code, so the math looks great on every screen size.I'm running into this very weird difference in the result of a call to
require
when that call is made in an Observable Notebook, as opposed to when I make it in anojs
cell in a Quarto sourcefile.First, let's look at what happens when we require
tex2svg
in an Observable Notebook. You can see the results in this notebook. Open up the object in the first cell after the title and notice the full list of methods that the object returned by the call torequire
includes. Notice the list includes the method.tex2svg
, which is the function I need. Below is a screenshot. You'll seetex2svg
as the fourth method from the bottom.OK, great, so we can use
tex2svg
in an Observable notebook!But what happens when we do the same call to
require
in anojs
cell in a.qmd
file? Here are two cells from my current.qmd
source:Here's a screenshot of the output from the second of the above two
ojs
cells when I render/preview the sourcefile:Notice that the list of methods does not include
tex2svg
!!!! As a result, when I do something likeIn the quarto sourcefile, the output on render/preview is:
I'm kind of amazed by this.
Help?
Beta Was this translation helpful? Give feedback.
All reactions