Re: [Haskell-cafe] Re: Pandoc questions
2008/10/17 Andrew Coppin [EMAIL PROTECTED]: It strikes me that perhaps using LaTeX to enter mathematical markup is rather against the spirit of Markdown. Surely there should be an option to include raw LaTeX, but a more natural encoding that covers most mathematics would be nice also. Of course, that means somebody has to design it first... Here's something along those lines, which I found recently on the W3C MathML software page: http://www1.chapman.edu/~jipsen/asciimath.html It's a converter from an ASCII syntax to Presentation MathML, written in JavaScript to allow mathematical notation on web pages to be converted to MathML in browsers that support it, or kept as ASCII in browsers that don't. There's a specification of the ASCII syntax which would be a good starting point if you want to write another implementation: http://www1.chapman.edu/~jipsen/mathml/asciimathsyntax.html Presumably this can't express everything that MathML can (and it doesn't deal with Content MathML), so it would be useful to support MathML in the source, like Markdown allows inline HTML, or LaTeX. Andy ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
[Haskell-cafe] Re: Pandoc questions
John MacFarlane wrote: 1. Nobody has written the LaTeX - MathML code yet, and I've been too lazy. Anyone who is interested in doing this should get in touch. Well, I'd certainly be interested. I use mathematics *a lot* in my writing. Presumably modifying a large program like Pandoc is intractably difficult though? Just write a separate library that parses LaTeX input and returns MathML output. Pandoc could then use this library. So you wouldn't need to know anything about pandoc's internals. Just write a function teXMathToMathML :: String - String. This would be a great contribution! You could get a head start by looking at the LaTeXMathML.js code. OK. I'll give that a go at some point... I think it makes good sense to use LaTeX, which is already designed to be natural but flexible, and is already known by most mathematicians. Seems like a valid argument. My guess is that in designing a more natural format, one would eventually reinvent something like LaTeX... I would dispute that. I don't think anybody will claim that \DeclareMathOperator{\erf}{erf} is natural or intuitive, nor the low-level trickery required to correctly typeset arrays and so forth. (Look at how LaTeX typesets tables. Now look at how Markdown does it. Yeah.) Even so, designing something better is probably a research project [since typeset mathematics uses *so* many obscure symbols and advanced typesetting conventions, and ASCII is woefully unable to cope]. Using LaTeX is probably a very useful step in the right direction. ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
[Haskell-cafe] Re: Pandoc questions
John MacFarlane wrote: +++ Andrew Coppin [Oct 12 08 11:21 ]: There doesn't seem to be any option to make Pandoc produce actual MathML output. Is there a reason for this? 1. Nobody has written the LaTeX - MathML code yet, and I've been too lazy. Anyone who is interested in doing this should get in touch. Well, I'd certainly be interested. I use mathematics *a lot* in my writing. Presumably modifying a large program like Pandoc is intractably difficult though? It strikes me that perhaps using LaTeX to enter mathematical markup is rather against the spirit of Markdown. Surely there should be an option to include raw LaTeX, but a more natural encoding that covers most mathematics would be nice also. Of course, that means somebody has to design it first... 2. Not all browsers can process MathML. The current system (using the LaTeXMathML.js javascript) has the advantage of falling back to raw LaTeX in browsers that don't support MathML. It's been a while since I looked, but I believe the spec provides a way to provide an alternative block of XML, similar to the 'alt' tag in the img element, for precisely this reason. (And if there was a math converter, rather than raw LaTeX you could provide something a little easier on the eyes given what raw Unicode + plain HTML can do...) MathML has the advantage that it's machine-readable as well as human-readable. That probably doesn't matter right now, but maybe it will someday. ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
[Haskell-cafe] Re: Pandoc questions
1. Nobody has written the LaTeX - MathML code yet, and I've been too lazy. Anyone who is interested in doing this should get in touch. Well, I'd certainly be interested. I use mathematics *a lot* in my writing. Presumably modifying a large program like Pandoc is intractably difficult though? Just write a separate library that parses LaTeX input and returns MathML output. Pandoc could then use this library. So you wouldn't need to know anything about pandoc's internals. Just write a function teXMathToMathML :: String - String. This would be a great contribution! You could get a head start by looking at the LaTeXMathML.js code. It strikes me that perhaps using LaTeX to enter mathematical markup is rather against the spirit of Markdown. Surely there should be an option to include raw LaTeX, but a more natural encoding that covers most mathematics would be nice also. Of course, that means somebody has to design it first... I think it makes good sense to use LaTeX, which is already designed to be natural but flexible, and is already known by most mathematicians. My guess is that in designing a more natural format, one would eventually reinvent something like LaTeX... John ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
[Haskell-cafe] Re: Pandoc questions
+++ Andrew Coppin [Oct 12 08 11:21 ]: There doesn't seem to be any option to make Pandoc produce actual MathML output. Is there a reason for this? 1. Nobody has written the LaTeX - MathML code yet, and I've been too lazy. Anyone who is interested in doing this should get in touch. 2. Not all browsers can process MathML. The current system (using the LaTeXMathML.js javascript) has the advantage of falling back to raw LaTeX in browsers that don't support MathML. John ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe