views:

163

answers:

5

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 type 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: 

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.

liori
+1  A: 

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).

Ben Voigt
Just off the top of my head, this is what those examples would look like: `1/(x + 1)`, `1/x + 1`, `(x^2)/(x + 1)`, `x^(2/(x+1))`, `x/((x+1)^2)`, `(x/(x+1))^2`
Chetan
And my simple syntax would automatically parse out parentheses into fractions and add parentheses (`\left(` and `\right)`) where they are required to make the equation more clear.
Chetan
But what if you don't want parentheses? Or what if you do? If it was easy to figure it outautomatically don't you think Knuth would have done it?
hadley
@hadley: Well, if you think about it, you only really need parentheses around stuff to logically group them for an operation performed on them, like `sin` or an exponent. So it would look for that sort of case and put parentheses there. This approach would make functional equations quickly, and if you wanted to add or remove parentheses for just aesthetic or personal reasons, you could go and do that to the LaTeX source when you get more time later. The important thing would be that the simple syntax would be functional and readable.
Chetan
+2  A: 

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.

David Johnstone
Excellent, the ASCIIMathML script looks very similar to what I was thinking. Now if this were implemented to convert to LaTeX, and other stuff like sections and formatting were added to the simple syntax, it would be just what I'm looking for.
Chetan
I reckon the best way to do it would be to extend Markdown so that, say, `~1/(a+b)~` blocks are treated as math and converted with something like ASCIIMathML.
David Johnstone
Or you could modify Markdown so that the ``` blocks are treated as math rather than as inline code.
David Johnstone
A: 

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.

Joel
Yep, AucTeX does similar things. I'm just not satisfied with that :)
Chetan
+1  A: 

Multimarkdown uses ASCIIMathML syntax in double angle brackets:

<<x/2>>  
ergosys