plotly / plotly/plotly_matlab

Latex math in html file not rendering in browser

未关闭
#481 1 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

还没有人认领这个 Issue。

主要语言
MATLAB
星标
413
派生
166
PR 合并指标
30 天内没有已合并 PR

描述

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

贡献指南

这个仓库没有索引到贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

调研方向

首先复现提供的 MATLAB 脚本及其通过 fig2plotly(gcf) 进行的导出,然后将生成的 HTML 与 MATLAB 图形并排在 Edge 中检查。导出的 HTML 能够在 Edge 中正确渲染 LaTeX 注释即表示完成;该 issue 未指定任何 repository 文件或要运行的测试。

由索引模型根据 Issue 内容生成。

评估

技术栈
matlab
领域
data-visualization
Issue 类型
缺陷
难度
4/5
预计耗时
3-5 天
活跃度
停滞
描述清晰度
基本清楚
新手友好度
35/100

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。