Skip to content

Commit

Permalink
test for latex
Browse files Browse the repository at this point in the history
  • Loading branch information
navanchauhan committed Apr 1, 2024
1 parent 1c7f4a3 commit 8802f81
Show file tree
Hide file tree
Showing 5 changed files with 24 additions and 1 deletion.
2 changes: 1 addition & 1 deletion test/test.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ def setup():
setup()
default_tags = []
warnings = []
for extra_lib in ('pygments', 'wavedrom'):
for extra_lib in ('pygments', 'wavedrom', 'latex2mathml'):
try:
mod = importlib.import_module(extra_lib)
except ImportError:
Expand Down
11 changes: 11 additions & 0 deletions test/tm-cases/latex.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<h2>Simple Test</h2>

<p>Inline Equations can be written as <math xmlns="http://www.w3.org/1998/Math/MathML" display="inline"><mrow><mi>y</mi><mo>&#x0003D;</mo><mi>m</mi><mi>x</mi><mo>&#x0002B;</mo><mi>b</mi></mrow></math>.
Block equations are wrapped using</p>

<math xmlns="http://www.w3.org/1998/Math/MathML" display="block"><mrow><mi>x</mi><mo>&#x0003D;</mo><mfrac><mrow><mo>&#x02212;</mo><mi>b</mi><mi>&#x000B1;</mi><msqrt><mrow><msup><mi>b</mi><mn>2</mn></msup><mo>&#x02212;</mo><mn>4</mn><mi>a</mi><mi>c</mi></mrow></msqrt></mrow><mrow><mn>2</mn><mi>a</mi></mrow></mfrac></mrow></math>

<p>This code will render everywhere
<code>
some random code, describing $a and $b will be rendered, $y=mx$
</code></p>
1 change: 1 addition & 0 deletions test/tm-cases/latex.opts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"extras": ["latex","latex2mathml"]}
1 change: 1 addition & 0 deletions test/tm-cases/latex.tags
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
extra latex latex2mathml
10 changes: 10 additions & 0 deletions test/tm-cases/latex.text
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
## Simple Test
Inline Equations can be written as $y=mx+b$.
Block equations are wrapped using
$$
x = \frac{-b \pm \sqrt{b^2 - 4ac}}{2a}
$$
This code will render everywhere
```
some random code, describing $a and $b will be rendered, $y=mx$
```

0 comments on commit 8802f81

Please sign in to comment.