简体   繁体   English

如何在聚合物飞镖元件内使用MathJax?

[英]How to use MathJax inside polymer dart element?

I am trying to use MathJax inside a polymer.dart element: 我正在尝试在polymer.dart元素内使用MathJax:

<script type="text/javascript"
  src="http://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML">
</script>

Any help would be appreciated. 任何帮助,将不胜感激。 Update: Using this: 更新:使用此:

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

MathJax very probably tries to find the element by using querySelector('myDivWithMath') which doesn't work because this selector doesn't find the element. MathJax很可能会尝试使用querySelector('myDivWithMath')查找元素,因为该选择器找不到元素,该方法不起作用。

You can try 你可以试试

MathJax.Hub.Queue(["Typeset",MathJax.Hub,"* /deep/ myDivWithMath"]);

don't use shadowDOM by adding the attribute 'lightdom' to the element. 不要通过向元素添加属性“ lightdom”来使用shadowDOM。 This is the only reference I found how to do this How to skip the Shadow DOM (and use the Light DOM) instead for Polymer templates (never used this myself yet). 这是我发现如何执行此操作的唯一参考。 如何跳过Shadow DOM(并使用Light DOM),而不是Polymer模板 (我自己从未使用过此模板 )。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM