瀏覽代碼

Chamberlin: change formula to latex graphic

Replace the text formula with a png graphic generated from some
LaTeX source.
Formulas in HTML apparently never made it in the mainstream,
and the recommendation is to use LaTex to generate images. See:
https://www.w3.org/MarkUp/HTMLPlus/htmlplus_45.html

To convert the .tex to a png, try:
  pdflatex formulas.tex
  convert -density 300 formulas.pdf -quality 95 formulas.png

Signed-off-by: Graham Whaley <graham.whaley@gmail.com>
dds
Graham Whaley 4 年之前
父節點
當前提交
739c6c31f7
共有 3 個檔案被更改,包括 17 行新增3 行删除
  1. +16
    -0
      gui/formulas.tex
  2. 二進制
      gui/img/filter_formula.png
  3. +1
    -3
      gui/index.html

+ 16
- 0
gui/formulas.tex 查看文件

@@ -0,0 +1,16 @@
% Generate plain formulas to be turned into png files via a pdf. Code hints taken
% from:
%
% https://tex.stackexchange.com/questions/287481/using-latex-to-generate-png-images-of-an-equation/287501
%
\documentclass[multi={mymath},border=1pt]{standalone}
% \usepackage{amsmath}
\newenvironment{mymath}{$\displaystyle}{$}

\begin{document}

\begin{mymath}
F = Fcenter * 2^{(signal * octaves)}
\end{mymath}

\end{document}

二進制
gui/img/filter_formula.png 查看文件

Before After
Width: 555  |  Height: 47  |  Size: 3.6KB

+ 1
- 3
gui/index.html 查看文件

@@ -4519,9 +4519,7 @@ double s_freq = .0625;</p>
frequency is:
</p>
<p>
F = Fcenter * 2^<sup>(signal * octaves)</sup>
<br><small>If anyone knows how to do HTML equations, please
help me improve this.....</small>
<img src="img/filter_formula.png">
</p>
<p>When operating with signal control of corner frequency, this
object uses approximately 4% of the CPU time on Teensy 3.1.

Loading…
取消
儲存