asciidoctor/asciidoctor-latex — pull request #7 by jxxcarlson (2014-11-10 11:04:20+00:00)
Title: Added: EnvironmentBlock < Extensions::BlockProcessor

The EnvironmentBlock detects [env.joke], [env.theorem], etc., in the source text and creates
an "environment" block with given content, and with a title constructed from the role
and a counter. The title is not currently used -- see below -- but will be. The created
block is subsequently processed by `converter.rb`in the backend.

Example: The source text

```
[env.joke]
--
An engineer, a philosopher, and a mathematician met
at the bar for a drink. (To be continued).
--
```
produces this latex:
```
\begin{joke}
An engineer, a philosopher, and a mathematician met
at the bar for a drink. (To be continued).
\end{joke}
```
What will also be needed is an addition to the html backend, or a customized version of it for
use with mathematical text so that the source will be accepted without error and produce output
equivalent to that of the input

```
.Joke {counter:joke}
--
An engineer, a philosopher, and a mathematician met
at the bar for a drink. (To be continued).
--
```

Note that the EnvironmentBlock provides the latex backend with `title=Joke 1`. This information is not needed by the latex backend, but it would be by a modified html backend (can we use an extension to avoid modifying it)?

@jirukta, I noticed your work on slim. Perhaps you would like to work on this also?

The goal of all this is to be able to have one `.adoc` file produce both the `.tex` and the `.html`.

See comments in `environment_block.rb` and use `samples/env.adoc` for testing.

PS. I am in Beijing till Dec 2. No google search, twitter, New York Times, etc. The Great Firewall!