16

I'm used to writing algorithms in LaTeX while preparing my slides in Beamer but now I'm using an HTML presentation engine (shower) to prepare my slides. Are there any similar workflow/styles (css, javascript) to write algorithms in HTML?

4 Answers 4

10
+50

I believe that there are plenty of them, but you can check pseudocode.js.

Pseudocode.js enables JavaScript to typeset algorithms as beautifullly as LaTeX does.

4
  • That's it! Thanks a ton (Baardzo dziekuje! :) ) Jan 13, 2017 at 12:30
  • This is excellent, and should be chosen as the "official" answer. Exceeds all expectations I had.
    – James
    Mar 2, 2018 at 14:41
  • I'm trying to insert algorithms to my reveal.js slides but they're not rendered - it shows a blank slide. No error on the console, but the pseudocode test page is rendered correctly. Has anyone managed to insert algorithm to a slide? (<section> tag) Apr 27, 2019 at 13:05
  • 1
    Looks like this link is broken, so here's the new one: saswat.padhi.me/pseudocode.js
    – DataOrc
    Sep 29, 2022 at 23:36
4

You could check out MathJax, which renders LaTeX pretty nicely (at least insofar as math is concerned). I haven't done algorithms with it, though, so I can't say how well (or whether) it does them.

2
  • I write the math content using Mathjax but I seek writing algorithms actually.
    – petrichor
    Apr 14, 2013 at 8:18
  • MathJax does not have support for any algorithm environments.
    – Nathan
    Apr 2, 2019 at 19:32
0

I think a lightweight solution like handlebars.js is a good choice here. You can create dynamic layouts such as:

{{#if isActive}}
  <img src="star.gif" alt="Active">
{{else}}
  <img src="cry.gif" alt="Inactive">
{{/if}}
0

If you want algorithms in your HTML like conditions or such. You can use templating engines like Jade or Handlebars.

Jade: https://www.npmjs.com/package/jade Handlebars: http://handlebarsjs.com/

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.