On 06/25/2010 07:31 PM, Adrien Guillon wrote:
I would really really love to have the ability to use the algorithmic
package inside MediaWiki software. I am writing up the details of a
bunch of algorithms, and so far I have found it extremely painful to
do. If there is a better way to make my algorithms look beautiful,
I'd love to hear it. For your convenience, here is a link that shows
some nice output of the algorithmic package:
http://en.wikibooks.org/wiki/LaTeX/Algorithms_and_Pseudocode
What needs to be done to add support for this? Is this something that
can be done, or does it conflict with some design principle behind the
current solution?
I'm not familiar enough with the texvc code to know what it would take
to add support for the algorithmic package (and I'm not sure if anyone
really is; that code is notoriously low on active maintainers).
However, I'd like to offer an alternative solution (or workaround): why
not just do it in plain text? After all, that's what (pseudo)code
mostly is. Bold and italic text are easily marked up in wikitext, and
Unicode has quite a comprehensive set of arrows and other such symbols.
See a quick example here:
http://en.wikipedia.org/w/index.php?oldid=370784718
I'm aware that the result isn't quite as pretty as the one produced by
TeX; on the other hand, one thing my version has going for it is that
it's actual text, not just an image of text.
The only slightly tricky part is indentation. For my example, I abused
the <poem> tag; possible alternatives might include abusing leading
colons (possibly too much indentation), manually inserting s (very
laborious and hard to edit) or wrapping each line in a span with a
margin (somewhat laborious, though easy enough to copy and paste). You
could also just indent each line by at least one space and let MediaWiki
format it as a code block if you didn't mind the side effects
(monospaced font, funny background and border).
--
Ilmari Karonen