asciidoctor / asciidoctor-latex

:triangular_ruler: Add LaTeX features to AsciiDoc & convert AsciiDoc to LaTeX
http://asciidoctor.org
Other
111 stars 26 forks source link

support embedding [env] within other [env] #65

Open prudhomm opened 6 years ago

prudhomm commented 6 years ago

@jxxcarlson it would be nice to be able to embed [env] within [env] for example you may want to have nice equations using [env.equation] within a [env.theorem]

here is an example

[env.theorem#thr:14]
--
Soit stem:[T_K] une transformation affine.

Soit stem:[\mathbb{P}_k \subset \hat{P}] et stem:[k+1 > \frac{d}{2}].

Soit stem:[h_K] le diamètre de stem:[K] et stem:[\rho_K] le diamètre de la plus grande boule inscrite dans stem:[K] et stem:[\omega_K = \frac{h_K}{\rho_K}].

Alors il existe une constante stem:[c] independente de stem:[K] telle que stem:[\forall v \in H^{k+1}(K)] et pour tout stem:[m \in \{0,...,k+1\}],

[[eq:32]]
\[
  |v - \Ilag{K}(v)|_{m,K} \leq  c h^{k+1-m} \omega_K^m |v|_{k+1,K}
\]
--

I would like for example to have [eq:32] to be a [env.equation] but that's not possible

tribut commented 6 years ago

Depends on changes to asciidoctor, cf. https://github.com/asciidoctor/asciidoctor/issues/2340 and https://github.com/asciidoctor/asciidoctor/issues/1121.

mojavelinux commented 6 years ago

In the meantime, you could bind the env style to an example container, which can already be nested.

[env]
====
[env]
======
...
======
====

You could make that case that env maps well to the example container. A block extension can be bound to more than one container (which is another way to alternate them).