:numbered: == Using the env block The `env` block gives a very general way of creating LaTeX-style environments with Asciidoctor. They will render properly in all output formats, e.g., HTML and LaTeX. We can make definitions with `[env.definition]` like this ---- [env.definition#def-point] -- A point is that which has no breadth. -- ---- It is rendered like this: [env.definition#def-point] -- A point is that which has no breadth. -- Here is another defnition. Note that it is numbered automatically. [env.definition] -- A line is the path of shortest length between two points. -- We can create `env`-blocks at will: `[env.theorem]`, `[env.lemma]`, `[env.corollary]`, etc. Asciidoctor does not have to be informed about them in advance if we are producing HTML. If we want a joke environment, we can have it: [env.joke] -- An engineer, a mathematician, and a philosopher met at a bar for a drink. After a few beers, talk turned to the question of how best to understand the world ... (to be continued) -- [env.objection] -- Your honor, my client could not have committed the crime of which he is accused because he was confined to the state penitentary at the time that it occurred. If it please the court, ... -- == Variations A an `env`-block can optionally take a title: .Inadmissible testimony [env.objection] -- Your honor, that testimony cannot be heard in this courtroom because it was obtained under duress and without informing my client of his rights. -- Here is how it is done: ---- .Inadmissible testimony [env.objection] -- Your honor, that testimony cannot be heard in this courtroom because it was obtained under duress and without informing my client of his rights. -- ---- In addition, numbering, which is on by default, can be turned off on a per-item basis: .Improper procedure [env.objection%no-number] -- Your honor, the physical evidence was not secured and was handled sloppily. We cannot be sure tha the items which the prosecution wishes to present here have any association with my client whatsoever. -- The no-number option also applies when there is no title. [env.objection%no-number] -- Your honor, the defense is speechless. The prosecution continues to present evidence which is inadmissbile. The defense calls for a consultation _in camera_. -- == Cross-references I refer to <> == Customizing LaTeX output for env blocks If the output is LaTeX, the situation is slightly different. As Asciidoctor converts a file, say `foo.adoc`, it generates a list of the environments it encounters and records them in a file `newEnvironments.tex`. It has entries like this: ---- \newtheorem{joke}{Joke} \newtheorem{objection}{Objection} ---- It also adds the command ---- \input newEnvironments.tex ---- to the preamble of `foo.tex`. Thus, when you run `xelatex foo.tex`, those environments will be defined and their occurence in the file `foo.tex` will not generate an error. You can modify those definitions and put them in a file named `myEnvironments.tex`. It will be used instead of `newEnvironments.tex`. Nonethless, `newEnvironments.tex`. will be regnerated each time `asciidoctor` is run.