Platform
Resources
Pricing
Sign in
Get started
tmori3y2
Workspace
Fork
Published
By
tmori3y2
Edited
Oct 5, 2019
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
mml
=
tex2MathML
(
expression
)
;
Insert cell
Insert cell
Insert cell
jsonML
=
mathML2Json
(
mml
)
;
Insert cell
Insert cell
Insert cell
tex2MathML
=
(
tex
,
inline
=
true
)
=>
{
return
katex
.
renderToString
(
tex
,
{
displayMode
:
!
inline
,
output
:
"mathml"
}
)
;
}
Insert cell
tex2Span
=
(
tex
,
inline
=
true
)
=>
{
return
katex
.
renderToString
(
tex
,
{
displayMode
:
!
inline
,
output
:
"html"
}
)
;
}
Insert cell
mathML2Json
=
(
mathML
)
=>
{
return
onml
.
parse
(
mathML
)
.
splice
(
2
,
1
)
;
}
;
Insert cell
htmlBeautify
=
(
html
)
=>
{
return
jsBeautify
.
html
(
html
,
{
indent_size
:
2
,
end_with_newline
:
true
,
preserve_newlines
:
false
,
max_preserve_newlines
:
0
,
wrap_line_length
:
0
,
wrap_attributes_indent_size
:
0
,
unformatted
:
[
'mi'
,
'mn'
,
'mo'
]
}
)
;
}
Insert cell
Insert cell
katex
=
require
(
'katex@0.11.1/dist/katex.js'
)
;
Insert cell
html
`
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/katex@0.11.1/dist/katex.min.css" integrity="sha384-zB1R0rpPzHqg7Kpt0Aljp8JPLqbXI3bhnPWROx27a9N0Ll6ZP/+DiW/UqRcLbRjq" crossorigin="anonymous">
`
Insert cell
onml
=
require
(
'onml@1.1.0/build/onml.js'
)
Insert cell
jsBeautify
=
require
(
'https://bundle.run/js-beautify@1.10.2'
)
;
Insert cell
jsonBeautify
=
require
(
'https://bundle.run/json-beautify@1.1.1'
)
;
Insert cell
Purpose-built for displays of data
Observable is your go-to platform for exploring data and creating expressive data visualizations. Use reactive JavaScript notebooks for prototyping and a collaborative canvas for visual data exploration and dashboard creation.
Try it for free
Learn more
Fork
View
Export
Edit
Add comment
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
expression
Edit
Add comment
Copy import
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
Edit
Add comment
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
Edit
Add comment
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
mml
Add comment
Copy import
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
Edit
Add comment
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
Edit
Add comment
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
jsonML
Add comment
Copy import
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
Edit
Add comment
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
Edit
Add comment
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
tex2MathML
Add comment
Copy import
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
tex2Span
Add comment
Copy import
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
mathML2Json
Add comment
Copy import
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
htmlBeautify
Add comment
Copy import
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
Edit
Add comment
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
katex
Add comment
Copy import
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
Add comment
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
onml
Add comment
Copy import
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
jsBeautify
Add comment
Copy import
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
jsonBeautify
Add comment
Copy import
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML