bast / cicero

:microphone: Serving presentation slides written in Markdown.
https://cicero.xyz
GNU Affero General Public License v3.0
55 stars 17 forks source link

Can math equations be a default setup? #79

Open kellard opened 4 years ago

kellard commented 4 years ago

Writing math equations is such a common feature that I think it would be good to include it in the default set up of cicero. I know there is an example at readthedocs one can follow but for new users not knowing much about css and javascript I think it can be a barrier if they just want to make a simple presentation to see if it's a software that is user friendly and easy to get started with.

bast commented 4 years ago

Indeed the barrier to add support for equations is too high now.

Just want to document the reasoning why this was done this way:

  1. Have as few defaults as possible to not have later trouble with backwards compatibility
  2. This introduces new markup which may conflict with something else: https://github.com/bast/cicero/blob/333ae9c/demo/remark/equations/talk.head.html#L12

In particular with 2) I welcome suggestions or "comforting" advice.

So in short, I agree but want to solve this the right way. Backwards compatibility is important since ideally talk slides should "never" break.

ashwinvis commented 2 years ago

An updated snippet for MathJax v3. See:

<!-- for older browsers -->
<!-- <script src="https://polyfill.io/v3/polyfill.min.js?features=es6"></script> -->

<script type="text/javascript">
  window.MathJax = {
  options: {
    skipHtmlTags: ['script', 'noscript', 'style', 'textarea', 'pre'],
    ignoreHtmlClass: 'tex2jax_ignore',
    processHtmlClass: 'tex2jax_process'
  },
  tex: {
    inlineMath: [['$','$'], ['\\(','\\)']],
    processEscapes: true,
    macros: {
      AA: "{\\unicode{x212B}}"
    },
    autoload: {
      color: [],
      colorv2: ['color']
    },
    packages: {'[+]': ['noerrors']}
  },
  chtml: {
    scale: 0.9
  },
  loader: {
    load: ['[tex]/noerrors']
  }
};
</script>

<script id="MathJax-script" async src="https://cdn.jsdelivr.net/npm/mathjax@3/es5/tex-chtml.js"
        type="text/javascript" >
</script>
bast commented 2 years ago

Thanks! I will look at this again and I will try to make this default.