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

Katex AngularJS #1

Open
lsbardel opened this issue Nov 6, 2014 · 3 comments
Open

Katex AngularJS #1

lsbardel opened this issue Nov 6, 2014 · 3 comments

Comments

@lsbardel
Copy link
Owner

lsbardel commented Nov 6, 2014

Feedbacks and Comments for http://lucasbardella.com/blog/2014/11/katex-angularjs

@user3587412
Copy link

Hi,

Thanks for your article. I also made a custom directive based on your code. However, when i used "<" or ">" signs (e.g., <katex> 0 > p > 1 </katex>), the directive broke, probably because the <> signs are used for html tags. Would there be a way to work around this?

Thanks!

@lsbardel
Copy link
Owner Author

Looks like the only option is to fallback to MathJax by using begin{equation}

<div katex>
\begin{equation}
0 > p > \frac{1}{a}
\end{equation}
</div>

You may want to ask the question to the Katex developer for a better answer.

@josuemontano
Copy link

Great article, thanks! However I've got a problem, I render equations fetched from a DB so my controller looks like this

.controller('FormulaCrtl', ['$scope', function($scope) {
   // I really got this from a service
    $scope.formula = {
        title: 'Lorem ipsum',
        content: '<katex>d y_t = \alpha_t dt + \sigma_t d W_t</katex>'
    };
}])
.filter('html', ['$sce', function ($sce) { 
    return function (text) {
        return $sce.trustAsHtml(text);
    };    
}]);

When I render as <div ng-bind-html="article.content | html"></div> the equation is not rendered by your KaTeX directive, how could I solve it? Thanks again!

@lsbardel lsbardel reopened this Jun 28, 2020
Repository owner deleted a comment from RahulBhalley Mar 21, 2024
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

4 participants
@lsbardel @josuemontano @user3587412 and others