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

Latex math in html file not rendering in browser #481

Open
syncrodazt opened this issue Sep 10, 2023 · 1 comment
Open

Latex math in html file not rendering in browser #481

syncrodazt opened this issue Sep 10, 2023 · 1 comment

Comments

@syncrodazt
Copy link

I have a problem with displaying LaTeX fonts in HTML files generated by MATLAB. I used the code from this link to create a simple plot with LaTeX annotations. The plot looks fine in MATLAB, but when I open the HTML file in Edge, the Latex fonts are not rendered correctly. How can I fix this issue?

The code

fib = zeros(1, 12);
for i = 1:12
    fib(i) = (((1+sqrt(5))/2)^i - ((1-sqrt(5))/2)^i)/sqrt(5);
end

figure
plot(1:12, fib, 'k^-')


title('Fibonacci Numbers from 1-12')
xlabel('n')
ylabel('F_n')

eqtext = '$$F_n={1 \over \sqrt{5}}';
eqtext = [eqtext '\left[\left({1+\sqrt{5}\over 2}\right)^n -'];
eqtext = [eqtext '\left({1-\sqrt{5}\over 2}\right)^n\right]$$'];

text(0.5, 125, eqtext, 'Interpreter', 'Latex', 'FontSize', 12, 'Color', 'k')

fig2plotly(gcf);

MATLAB Figure

image

Figure opened in Edge

image

@emilyt-nist
Copy link

emilyt-nist commented Nov 2, 2023

I have this problem too. I posted a question on matlab answers. https://www.mathworks.com/matlabcentral/answers/2042006-how-to-get-latex-to-render-when-using-fig2plotly. Crosslinking here so somebody who finds one finds the other.

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