Permalink
Browse files

mathjax: Improve handling of long equations

* Use automatic linebreak feature instead of CSS overflow scrolling
* Disable mathjax notifications
* Highlight any undefined macros within equations
* Load output processors with `-full` option rather than on demand
* Update MathJax version

Fix #496
Fix #586
  • Loading branch information...
gcushen committed Jul 7, 2018
1 parent 8d596ff commit a555dd792bfeeb8b20b0f204f95442ac9f1a8076
Showing with 10 additions and 9 deletions.
  1. +2 −2 data/sri.toml
  2. +0 −4 layouts/partials/css/academic.css
  3. +8 −3 layouts/partials/footer.html
View
@@ -17,8 +17,8 @@
version = "9.12.0"
sri = "sha256-/BfiIkHlHoVihZdc6TFuj7MmJ0TWcWsMXkeDFwhi0zw="
[js.mathJax]
version = "2.7.1"
sri = "sha512-tOav5w1OjvsSJzePRtt2uQPFwBoHt1VZcUq8l8nm5284LEKE9FSJBQryzMBzHxY5P0zRdNqEcpLIRVYFNgu1jw=="
version = "2.7.4"
sri = "sha256-GhM+5JHb6QUzOQPXSJLEWP7R73CbkisjzK5Eyij4U9w="
[js.isotope]
version = "3.0.4"
sri = "sha512-VDBOIlDbuC4VWxGJNmuFRQ0Li0SKkDpmGyuhAG5LTDLd/dJ/S0WMVxriR2Y+CyPL5gzjpN4f/6iqWVBJlht0tQ=="
@@ -183,10 +183,6 @@ pre code {
overflow-x: auto;
}
.mjx-chtml {
overflow-x: auto; /* Horizontally scroll long equations. */
}
hr {
border: 0;
height: 1px;
@@ -64,12 +64,17 @@
<!-- LaTeX math rendering -->
{{ if or .Params.math .Site.Params.math }}
<script type="text/x-mathjax-config">
MathJax.Hub.Config({ tex2jax: { inlineMath: [['$','$'], ['\\(','\\)']] } });
MathJax.Hub.Config({
CommonHTML: { linebreaks: { automatic: true } },
tex2jax: { inlineMath: [ ['$', '$'], ['\\(','\\)'] ], displayMath: [ ['$$','$$'], ['\\[', '\\]'] ], processEscapes: false },
TeX: { noUndefined: { attributes: { mathcolor: 'red', mathbackground: '#FFEEEE', mathsize: '90%' } } },
messageStyle: 'none'
});
</script>
{{ if not .Site.Params.disable_sri }}
{{ printf "<script src=\"https://cdnjs.cloudflare.com/ajax/libs/mathjax/%s/MathJax.js?config=TeX-AMS_CHTML\" integrity=\"%s\" crossorigin=\"anonymous\"></script>" $js.mathJax.version $js.mathJax.sri | safeHTML }}
{{ printf "<script src=\"https://cdnjs.cloudflare.com/ajax/libs/mathjax/%s/MathJax.js?config=TeX-AMS_CHTML-full\" integrity=\"%s\" crossorigin=\"anonymous\"></script>" $js.mathJax.version $js.mathJax.sri | safeHTML }}
{{ else }}
<script async src="//cdnjs.cloudflare.com/ajax/libs/mathjax/{{- $js.mathJax.version -}}/MathJax.js?config=TeX-AMS_CHTML"></script>
<script async src="//cdnjs.cloudflare.com/ajax/libs/mathjax/{{- $js.mathJax.version -}}/MathJax.js?config=TeX-AMS_CHTML-full"></script>
{{ end }}
{{ end }}

0 comments on commit a555dd7

Please sign in to comment.