Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement mathJax #25

Open
AgeManning opened this issue Jul 10, 2016 · 6 comments
Open

Implement mathJax #25

AgeManning opened this issue Jul 10, 2016 · 6 comments
Assignees

Comments

@AgeManning
Copy link
Owner

Implement mathJax for my math typesetting.

@AgeManning AgeManning self-assigned this Jul 10, 2016
@AgeManning AgeManning modified the milestone: initial-release Jul 10, 2016
@AgeManning
Copy link
Owner Author

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.

@paulhauner
Copy link
Collaborator

paulhauner commented Jul 20, 2016

I fixed this in b24c28e. (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
Copy link
Collaborator

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

@paulhauner paulhauner reopened this Jul 20, 2016
@paulhauner
Copy link
Collaborator

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

@AgeManning
Copy link
Owner Author

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

@AgeManning
Copy link
Owner Author

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 e6e9448

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants