Permalink
Browse files

pretty printing example: expose implicit multiplication options

  • Loading branch information...
1 parent f038f86 commit c57964003d7c5ec3f86801f564fcb7e9068bab1b @FSMaxB FSMaxB committed Mar 19, 2016
Showing with 7 additions and 2 deletions.
  1. +7 −2 examples/browser/pretty_printing_with_mathjax.html
@@ -65,13 +65,18 @@
<input type="radio" name="parenthesis" value="keep" onclick="parenthesis = 'keep'; expr.oninput();" checked>keep
<input type="radio" name="parenthesis" value="auto" onclick="parenthesis = 'auto'; expr.oninput();">auto
<input type="radio" name="parenthesis" value="all" onclick="parenthesis = 'all'; expr.oninput();">all
+<br/>
+<b>Implicit multiplication:</b>
+<input type="radio" name="implicit" value="hide" onclick="implicit = 'hide'; expr.oninput();" checked>hide
+<input type="radio" name="implicit" value="show" onclick="implicit = 'show'; expr.oninput();">show
<script>
var expr = document.getElementById('expr'),
pretty = document.getElementById('pretty'),
result = document.getElementById('result'),
- parenthesis = 'keep';
+ parenthesis = 'keep',
+ implicit = 'hide';
// initialize with an example expression
expr.value = 'sqrt(75 / 3) + det([[-1, 2], [3, 1]]) - sin(pi / 4)^2';
@@ -94,7 +99,7 @@
try {
// export the expression to LaTeX
- var latex = node ? node.toTex({parenthesis: parenthesis}) : '';
+ var latex = node ? node.toTex({parenthesis: parenthesis, implicit: implicit}) : '';
console.log('LaTeX expression:', latex);
// display and re-render the expression

0 comments on commit c579640

Please sign in to comment.