[NTG-context] Frame

Ursula Hermann ursula.hermann at univie.ac.at
Fri Feb 22 09:41:59 CET 2019


High list!

Another example, instead oft he cow, I took another figure:

\setuppapersize
  [A5]

\setupexternalfigures
  [location=default]

\setupindenting
  [yes, small]

\setupwhitespace
  [small]

\defineframedtext
  [prettyblock]
  [width=10cm,
   indenting={yes, small},
   background=color, backgroundcolor=lightgreen,
   foreground=color, foregroundcolor=black,
   offset=2mm,
   align=flushleft]

\starttext

\startprettyblock
\setupindenting[next]
  The Earth, as a habitat for animal life, is in old age and has a fatal
  illness. Several, in fact.

  It would be happening whether humans had ever evolved or not.

  \placefigure
[][fig:church]
{Stephanus Church.}
{\externalfigure[ma-cb-24][width=.4\textwidth]}

\stopprettyblock
\setupindenting[next]
Below, we have two separate columns; but up here, for the nonce, we have but the one.

\startcolumns [n=2]
  Text, text, text \dots
  all in the first column
\column
  Words, words, words \dots
  all in the second column.
  And look ye here! Even more words!
\stopcolumns

\stoptext

Works great. 

Many Regards 

Uschi 

-----Ursprüngliche Nachricht-----
Von: ntg-context <ntg-context-bounces at ntg.nl> Im Auftrag von Wolfgang Schuster
Gesendet: Donnerstag, 21. Februar 2019 18:24
An: mailing list for ConTeXt users <ntg-context at ntg.nl>; Marco Patzer <lists at homerow.info>
Betreff: Re: [NTG-context] Frame

Marco Patzer schrieb am 21.02.19 um 12:19:
> On Thu, 21 Feb 2019 10:50:21 +0000
> Ursula Hermann <ursula.hermann at univie.ac.at> wrote:
>
>> Here is my example:
>>
>> \setuppapersize[A5]
>> \setupcolors[state=start]
> This is the default, no need to start the colours any longer.
>
>> {\framed
>>     [width=10cm,
>>     background=color,backgroundcolor=darkblue,
>>     foreground=color,foregroundcolor=white,
>>     align={flushleft}]
>> {The Earth, as a habitat for animal life, is in old age and has a 
>> fatal illness. Several, in fact.\par \setupindenting[yes, small] It 
>> would be happening whether humans had ever evolved or not.
>>
>> \externalfigure[cow.pdf][width=1cm]}
>>
>> \setupwhitespace[small]
>> \starttext
>> Below, we have two separate columns; but up here, for the nonce, we 
>> have but the one.
>>
>> \startcolumns[n=2]  % Two columns, please
>>      Text, text, text \dots
>>      all in the first column
>> \column
>>      Words, words, words \dots
>>     all in the second column.
>>      And look ye here! Even more words!
>> \stopcolumns
>> \stoptext
>> Why can‘t I see the cow?
> You're missing
>
>    \setupexternalfigures
>      [location=default]
>
> Without setting the location context doesn't check the system 
> directories for the sample images.
>
> Furthermore, you're typesetting before \starttext. That's why your 
> font is monospaced.
>
> And I try to separate content from style. That's why I move all style 
> information before \starttext and after \starttext comes only content 
> and markup (if possible). Nothing wrong with mixing it, but it's 
> easier to read and easier to change the layout after the fact.
> I'd write your example as follows.
>
> \setuppapersize
>    [A5]
>
> \setupexternalfigures
>    [location=default]
>
> \setupindenting
>    [yes, small]
>
> \setupwhitespace
>    [small]
>
> \defineframedtext
>    [prettyblock]
>    [width=10cm,
>     indenting={yes, small},
>     background=color, backgroundcolor=darkblue,
>     foreground=color, foregroundcolor=white,
>     offset=2mm,
>     align=flushleft]
>
> \starttext
>
> \startprettyblock
>    \noindentation

You don’t need \noindentation when you add “next” to the indenting options.

Wolfgang

___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!

maillist : ntg-context at ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://context.aanhet.net archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki     : http://contextgarden.net
___________________________________________________________________________________


More information about the ntg-context mailing list