You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

40 lines
914 B

  1. 'use strict'
  2. import MathJax from 'mathjax'
  3. import $ from 'jquery'
  4. export default {
  5. name: 'content-view',
  6. data() {
  7. return {}
  8. },
  9. mounted() {
  10. let self = this
  11. $('a.toc-anchor').each((i, elm) => {
  12. let hashText = $(elm).attr('href').slice(1)
  13. $(elm).on('click', (ev) => {
  14. ev.stopImmediatePropagation()
  15. self.$store.dispatch('anchor/open', hashText)
  16. return false
  17. })
  18. })
  19. MathJax.Hub.Config({
  20. jax: ['input/TeX', 'input/MathML', 'output/SVG'],
  21. extensions: ['tex2jax.js', 'mml2jax.js'],
  22. TeX: {
  23. extensions: ['AMSmath.js', 'AMSsymbols.js', 'noErrors.js', 'noUndefined.js']
  24. },
  25. SVG: {
  26. scale: 120,
  27. font: 'STIX-Web'
  28. },
  29. tex2jax: {
  30. preview: 'none'
  31. },
  32. showMathMenu: false,
  33. showProcessingMessages: false,
  34. messageStyle: 'none'
  35. })
  36. MathJax.Hub.Configured()
  37. }
  38. }