Odoo Help

0

0
2 Answers
0
Fernando Sarabia
2018/02/13 10:58

Hilar, 

Thank you for your interest in helping me out.

The view is backend...  MathJax, after the page loads, looks for latex expressions between "$" signs (for example: $\sigma$) and converts to the graphic symbol of the greek letter in svg.  I was able to make it work with the following code (see below).  It works but only once.  As soon as I load a new view, mathjax does no longer work.  The following line is supposed to re-execute MathJax everytime the page is reloaded.  MathJax.Hub.Queue(["Typeset",MathJax.Hub]);  but it does not work for some reason.

Thanks again,

Fernando


<template id="editor_head" inherit_id="web.layout" name="My Func">

<xpath expr="//head" position="after">

<!-- jquery -->

<script type="text/x-mathjax-config">

MathJax.Hub.Queue(["Typeset",MathJax.Hub]);

MathJax.Hub.Config({

jax: ["input/TeX", "output/CommonHTML"],

tex2jax: {

inlineMath: [ ['$','$'], ["\\(","\\)"] ],

displayMath: [ ['$$','$$'], ["\\[","\\]"] ],

processEscapes: false

},

});

</script>

<script src='https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.0/MathJax.js?config=TeX-AMS-MML_SVG'></script>

<!-- plotly -->

</xpath>

</template>



1 Comment
Hilar AK
2018/02/14 0:14

I am sure this code will works when the view is editor_head template, and your problem is its not loading on other views? try to make it in a separate js file and include in web.assets_backend.

Ask a Question
Tag
Keep Informed
2 follower(s)
About This Community

This platform is for beginners and experts willing to share their Odoo knowledge. It's not a forum to discuss ideas, but a knowledge base of questions and their answers.

Register
Odoo Training Center

Access to our eLearning platform and experience all Odoo Apps through learning videos, use cases and quizzes.

Test it now