[NTG-context] Styling of included buffers or files

Wolfgang Schuster wolfgang.schuster.lists at gmail.com
Mon May 18 18:32:52 CEST 2020


Marco Patzer schrieb am 17.05.2020 um 19:04:
> On Sun, 17 May 2020 18:16:13 +0200
> "Jan U. Hasecke" <juh+ntg-context at mailbox.org> wrote:
> 
>> I am currently writing a text where I want to include text snippets
>> either by including files or including buffers.
>>
>> What is the best way to style all these included buffers?
>>
>> I know that I can do something like this:
>>
>> \startcolumns
>> \getbuffer[Muenchen]
>> \stopcolumns
>>
>> Or do something with \defineparagraph
>>
>> Is it somehow possible to apply styles to all buffers that gets
>> included via \getbuffer by defining a special getbuffer-style?
> 
> \setupbuffer has before and after keys which can be used. Example:
> 
> \setupbuffer
>   [before=\blank\blackrule\startnarrower\BufferStyle,
>    after=\stopnarrower\blackrule\blank]
> 
> [...]
> 
> \definehighlight
>    [BufferStyle]
>    [style=smallitalic,
>     color=blue]

Use the highlight-environment or create a new startstop-environment to 
apply style and color settings to the buffer.

\definestartstop
   [BufferStyle]
   [style=smallitalic,
    color=blue]

\setupbuffer
  [before={... \startBufferStyle ...},
    after={... \stopBufferStyle  ...}]

Wolfgang


More information about the ntg-context mailing list