EthereumMiningCalculator icon indicating copy to clipboard operation
EthereumMiningCalculator copied to clipboard

Implement mathJax

Open AgeManning opened this issue 9 years ago • 6 comments

Implement mathJax for my math typesetting.

AgeManning avatar Jul 10 '16 05:07 AgeManning

This was working in the commit that closed it. But now mathjax only recognizes things in index.html. It doesn't work for inject html, but it did previously. I'm not sure what has changed? Maybe he have a discussion on this one.

AgeManning avatar Jul 14 '16 09:07 AgeManning

I fixed this in b24c28eedc0ada46b29c3f26b4f0b12a1c10ef7c. (I made a mistake in the commit message and didn't close it via that).

I have created a mathjaxBind directive which calls Mathjax.Hub.Typeset() after the directives $scope is updated.

You should add a mathjax-bind HTML attribute (eg, <span mathjax-bind>{{formula}}</span> to anything you want to trigger a mathjax Typeset() after a $scope digest cycle.

As the new directive will not detect changes in child scopes, you must add the mathjax-bind element to the element closest to the mathjax equation. For example, you can't just add mathjax-bind to <body> because it won't notice when a $scope change happens further down inside a forecaster input directive.

There is probably a more efficient way to do this (I am pretty sure mathjax scans the whole page each time), however this works and doesn't seem to cause issues.

Keep an eye out for bugs as I wouldn't be surprised if something has slipped through the net.

paulhauner avatar Jul 20 '16 00:07 paulhauner

Still an issue - can't get it to work consistently. I need to come back to this.

paulhauner avatar Jul 20 '16 01:07 paulhauner

FYI, the issue here is determining when Typeset() should run - we might have to call it manually.

paulhauner avatar Jul 20 '16 02:07 paulhauner

I've sort of fixed this. about to commit. I made a new problem in my solution however

AgeManning avatar Jul 20 '16 02:07 AgeManning

Not sure whether I've improved this or not. But it does basically what I want. However the text after the equation's don't show?. Not super important, but would be nice. See e6e944804c4da9db820e16ffadf63b2e355846fb

AgeManning avatar Jul 20 '16 02:07 AgeManning