liffiton / dokuwiki-plugin-mathjax

MathJax plugin for DokuWiki
https://www.dokuwiki.org/plugin:mathjax
12 stars 11 forks source link

Different rendering with renewcommand in config file than directly used #34

Closed Joalland closed 3 years ago

Joalland commented 3 years ago

Thanks for the plugin. I like my vector to be in bold. I ussualy redefine the latex \vec{} command :

If i put

$\renewcommand\vec[1]{\mathbf{#1}}\vec{AA'}$

inside a dokuwiki page i get : image

If I put in on the mathax config file above :

MathJax.Hub.Config({
    tex2jax: {
        inlineMath: [ ["$","$"], ["\\(","\\)"] ],
        displayMath: [ ["$$","$$"], ["\\[","\\]"] ],
        processEscapes: true
    },
    TeX: {
        Macros: {
          RR: '{\\bf R}',
          bold: ['{\\bf #1}',1],
          vec: ['{\\mathbf #1}',1]
        }
    }
});

I get : image

Is this a bug or I'm missing something in the matjax configuration file ?

Thanks

liffiton commented 3 years ago

I may be way off, but does the line in the config need to be vec: ['{\\mathbf{#1}}',1]?

Joalland commented 3 years ago

Yes your are right. Thanks and sorry for the spurious issue.

liffiton commented 3 years ago

No worries. Glad it was an easy fix.