Close

Scalable SVG formulae on hackaday.io via Latex

ventosusventosus wrote 08/16/2014 at 13:43 • 1 min read • Like

Do you need to add some nice-looking rescalable formula to your project at hackaday.io?

Here is a simple way to accomplish it starting from a Latex document with custom dimensions with white formula on white background, compiling it to PDF via pdflatex and converting it to SVG via pdf2svg.

formula.tex:

\documentclass[12pt]{article}

\usepackage{blindtext}
\usepackage[paperheight=20ex,paperwidth=60ex,margin=0ex]{geometry}
\usepackage{color}

\thispagestyle{empty}
\color[rgb]{1,1,1}

\begin{document}

  \begin{eqnarray*}
    B_n &=& \frac{B - B_{min}}{B_{max} - B_{min}} \\
    y_n &=& c_0 \cdot \sqrt[3]{B_n} + c_1 \cdot \sqrt{B_n} + c_2 \cdot B_n
  \end{eqnarray*}

\end{document}

Compile with:

>> pdflatex formula.tex
>> pdf2svg formula.pdf formula.svg

Now upload it to some web space and simply link to it on your hackaday.io project log and you have a nice looking and scalable formula:

Like

Discussions