tags:

views:

40

answers:

2

As much as I like LaTeX, I find it rather annoying (and visually noisy) that itemize and enumerate environments always require (1) the begin/end environment declaration statements, and (2) "\item" commands prior to each item.

What I'd love to have (or be able to create) is some kind of "autoitemize" environment, where something like

\begin{autoitemize}
  first item
  second item
    nested item
    another nested item
  third item
\end{autoitemize}

would be automatically translated to:

\begin{itemize}
  \item first item
  \item second item
  \begin{itemize}
    \item nested item
    \item another nested item
  \end{itemize}
  \item third item
\end{itemize}

So the question: is there a way to do this using a LaTeX package, rather than with an external preprocessor?

It might also be nice to be able to have some sort of optional line prefix on the item-lines which indicates what kind of list environment the item and its successors is in -- this would allow for nesting of one type within another.

Granted, this may not be as powerful as just doing it the normal LaTeX way, but there are enough cases where it would be sufficient and quite handy.

+2  A: 

That's what Markdown and Restructured Text (RST) are for. You're not really talking about LaTeX any more, when you ask this. You're asking about a different markup language.

From RST you can easily generate LaTeX for publication purposes.

http://docutils.sourceforge.net/rst.html

S.Lott
RST is good for a variety of documents, but it lacks the power and range of packages available for LaTeX -- it's true that it can be exported to LaTeX, but I'd really prefer to keep everything *within* a LaTeX source file. Some kind of automatic ReST to LaTeX inline conversion would be ok, but I'm not aware of anything like this.
Mark
I use automatic RST to LaTeX all the time. And the inlines convert very nicely. `rst2latex.py` comes with docutils and works marvelously well. I'm not sure what you can't do, but I'm absolutely sure it generates very nice LaTeX and simplifies my life a great deal.
S.Lott
A: 

Emacs Org mode might allow you to do something like this. It has some capacity to translate into LaTeX.

Seamus