Hello Karl and Gavin, I’m writing a doc for developpers, with soure code snippets that are not complete, such a left braces with no corresponding right brace.
@example complains in that a case, hence the use of @verbatim, but I need to indent the snippets for the sake of clarity of the text. Building the doc fails if I define VerbatimBlock and EndVerbatimBlock the way Gavin proposes. I’ll thus have to stick to my current way of doing things. Thanks for your help! JM > Le 20 janv. 2016 à 08:09, Gavin Smith <[email protected]> a écrit : > > On 19 January 2016 at 23:50, Karl Berry <[email protected]> wrote: >> @indentedblock >> @verbatim >> … >> @end verbatim >> @end indentedblock >> >> How about either using @example (already indented), or indenting your >> verbatim text if you want indented? That is the intention behind those >> environments. > > I agree it's better to use commands for their intended purposes. > >> There's no way to define new environments specifically, but perhaps >> @macro could do an equivalent job. Not that I ever recommend using >> @macro. > > @macro VerbatimBlock > @indentedblock > @verbatim > @end macro > > and > > @macro EndVerbatimBlock > @end verbatim > @end indentedblock > @end macro > > and > > @VerbatimBlock > ... > @EndVerbatimBlock > > > may work. This used not to work at all with the implementation in TeX, > but may work now.
