Is there a easier / clearer syntax like Markdown that can compile into LaTeX?
I love LaTeX. Let's get that straight right off the bat.
The only thing I'm wishing for is a clearer syntax that compiles into LaTeX, like Markdown for HTML. This is because most of the simple document creation that I do (like taking notes in class), could be faster and improved if I could just ty开发者_JAVA技巧pe 1/2
instead of \frac{1}{2}
and it compiles it into a neat fraction. I know about and use AucTeX, and it makes for faster typing, but it's still not very clear and more prone to syntax errors in general.
If such a simpler syntax exists that compiles into LaTeX, please tell me in the answers below. If there is nothing satisfactory, I would love to start an open-source project towards this goal, but I would like to know of existing alternatives first.
A Markdown to LaTeX script exists for the Markdown in Python Markdown implementation. There is another extension called mdx_math that allows inline LaTeX math. The Haskell Markdown to whatever converter, Pandoc, can have inline LaTeX math and can export to LaTeX. There are probably others in the Markdown family. However, none of these (AFAIK) give an alternate syntax for doing math.
There are a few mathematical markup languages according to Wikipedia. Although it is written in JavaScript, you might be interested in ASCIIMathML.
You will probably need to write something yourself, but a Markdown extension looked for blocks that used a clean syntax (like ASCIIMathML) would be neat.
If you think only about the simplest cases, you're going to be in for a world of hurt. \frac{1}{2}
is waaay too simple.
What would you use for your simple syntax for each of the following:
\frac{1}{x + 1}
\frac{1}{x} + 1
\frac{x^2}{x + 1}
x^\frac{2}{x + 1}
\frac{x}{{x + 1}^2}
\frac{x}{x + 1}^2
I'll be very surprised if your first attempt doesn't include several duplicates (conflicts).
Multimarkdown uses ASCIIMathML syntax in double angle brackets:
<<x/2>>
You should really check pandoc which has excellent integration between markdown and latex. What's nice is you can just drop latex inline to cope with the iffly bits for which markdown is too simple.
I know of no other easier syntax for LaTeX.
However, there is TeXML
, which is an XML-to-TeX/LaTeX converter. It might sound weird at first, but it could make making your custom syntaxes much easier by just converting them to XML, then calling TeXML. TeX syntax is tricky: meaningful empty lines, TeX special characters, usually also lack of unicode... TeXML makes dealing with all this easier.
I know you were looking for simpler code not a new editor, and you said you use AucTeX (which I don't so I don't know if this helps), but TeXlipse for Eclipse has some nice editing features which can make for faster input, including adding end braces } and end commands \end{env} and allow for tabbing out of braces. Just a thought.
reStructuredText can compile to LaTeX (the language itself is much simplier than TeX, though it still uses TeX syntax for formulas), see Generating LaTeX with Docutils article. Various extensions to reStructuredText exist, like Sphinx.
You can also take a look at MathJax which can read math in any formats (including ASCIIMath) and has a menu option to show math as TeX.
精彩评论