MathOverflow will be down for maintenance for approximately 3 hours, starting Monday evening (06/24/2013) at approximately 9:00 PM Eastern time (UTC-4).
1

What is the recommended way to typeset algorithms?

For example, I have a question about an algorithm related to automata theory, and I would like to render the algorithm in my question.

In Latex I would use the algorithmic package and then get on with STATE and WHILE, etc. This does not seem to work here however, so is it recommended that I format the algorithm in html, with a numbered, ordered list and the individual details in jsmath/latex or is there some other tacitly agreed upon protocol?

flag
2 
This type of question is more appropriate over at the meta site. – Andrew Stacey Jun 25 2010 at 8:48
Closed: this is for meta. – Scott Morrison Jun 25 2010 at 15:50

closed as off topic by Andrew Stacey, Scott Morrison Jun 25 2010 at 15:50

1 Answer

2

To display code, indent it four spaces -- this is the markdown syntax for code blocks. For example:

factorial :: Integer -> Integer
factorial 0 = 1 
factorial n = n * factorial (n - 1)

If you need to put some code inline, then put it in backticks -- "Integer is a type". Unfortunately the code block code seems to suppress jsMath, however.

link|flag
thanks for the tip, but definitely need a solution that supports both the algorithm notation and mathjs style markup. I guess html is the way to go? – blackkettle Jun 25 2010 at 12:43
sadly, no. The formatter allows very little by way of actual HTML. I recommend that you search on meta as there are several discussions with links there that may help you. – Andrew Stacey Jun 25 2010 at 13:50

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