ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* narrowered columns on background image?
@ 2014-02-12 15:50 Rudolf Bahr
  2014-02-13  9:52 ` Wolfgang Schuster
  0 siblings, 1 reply; 5+ messages in thread
From: Rudolf Bahr @ 2014-02-12 15:50 UTC (permalink / raw)
  To: mailing list for ConTeXt users

[-- Attachment #1: Type: text/plain, Size: 1700 bytes --]


Hi All,

in the following two code examples I tried to place text in columns on a background image.
The first example, partly achieved by plain TeX commands is ok, even narrowering works.
Have a look at the attached .pdf file.

The second example isn't ok. Neither narrowering nor putting the text into columns work.
Though the code of the first example is completely good enough for me, I'd like to learn where my 
mistakes in the 2. example are. Any ideas?

Greetings, Rudolf


%---1. example------------------------------------------------------------------->8---------------
\setupexternalfigures
    [location={local,global,default}]

\useexternalfigure[moe][cow.pdf][width=\hsize, height=.4\vsize]

\def\txt
        {
        \startnarrower
        \setupcolumns[n=3, rule=off, align=right, distance=10pt]
        \startcolumns
                \startcolor[darkred]
                It was a dark and stormy night. The rain came down in tons. The old captain
                said: \quotation{Antonio, come and tell us a story!} And Antonio began as follows:
                \quotation{It was a dark and stormy night. The rain ...}
                \stopcolor
        \stopcolumns
        \stopnarrower
        }


\starttext

\vbox to .4\textheight{\externalfigure[moe]}
\vskip-.35\textheight
\txt

%---2. example-----

\vskip.3\vsize

\useexternalfigure[muh][cow.pdf][width=\overlaywidth, height=\overlayheight]

\setupframed[height=.4\vsize, width=\hsize]
\defineoverlay
        [muh]
        [{\externalfigure[muh]}]

\framed
        [background=muh, align=right]
        {\txt}


\stoptext
%-------------------------------------------------------------------------------->8-----------------


[-- Attachment #2: test-5.pdf --]
[-- Type: application/pdf, Size: 13127 bytes --]

[-- Attachment #3: Type: text/plain, Size: 485 bytes --]

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

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: narrowered columns on background image?
  2014-02-12 15:50 narrowered columns on background image? Rudolf Bahr
@ 2014-02-13  9:52 ` Wolfgang Schuster
  2014-02-14  6:11   ` Rudolf Bahr
  0 siblings, 1 reply; 5+ messages in thread
From: Wolfgang Schuster @ 2014-02-13  9:52 UTC (permalink / raw)
  To: mailing list for ConTeXt users


Am 12.02.2014 um 16:50 schrieb Rudolf Bahr <quasi@quasi.de>:

> 
> Hi All,
> 
> in the following two code examples I tried to place text in columns on a background image.
> The first example, partly achieved by plain TeX commands is ok, even narrowering works.
> Have a look at the attached .pdf file.
> 
> The second example isn't ok. Neither narrowering nor putting the text into columns work.
> Though the code of the first example is completely good enough for me, I'd like to learn where my 
> mistakes in the 2. example are. Any ideas?

You have to use boxedcolumns environment because the normal columns environment doesn’t work in a frame.

\setupexternalfigures[location={local,global,default}]

\starttext

\defineoverlay[muh][{\externalfigure[cow][width=\overlaywidth, height=\overlayheight]}]

\startframed[width=max,height=0.4\textheight,background=muh,align=right,foregroundcolor=darkred]%
  \startboxedcolumns[n=3]
  It was a dark and stormy night. The rain came down in tons. The old captain
  said: \quotation{Antonio, come and tell us a story!} And Antonio began as follows:
  \quotation{It was a dark and stormy night. The rain ...}
  \stopboxedcolumns
\stopframed

\stoptext

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

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: narrowered columns on background image?
  2014-02-13  9:52 ` Wolfgang Schuster
@ 2014-02-14  6:11   ` Rudolf Bahr
  2014-02-14  9:20     ` Wolfgang Schuster
  0 siblings, 1 reply; 5+ messages in thread
From: Rudolf Bahr @ 2014-02-14  6:11 UTC (permalink / raw)
  To: mailing list for ConTeXt users

On Thu, Feb 13, 2014 at 10:52:44AM +0100, Wolfgang Schuster wrote:
> 
> You have to use boxedcolumns environment because the normal columns environment doesn’t work in a frame.
> 
> \setupexternalfigures[location={local,global,default}]
> 
> \starttext
> 
> \defineoverlay[muh][{\externalfigure[cow][width=\overlaywidth, height=\overlayheight]}]
> 
> \startframed[width=max,height=0.4\textheight,background=muh,align=right,foregroundcolor=darkred]%
>   \startboxedcolumns[n=3]
>   It was a dark and stormy night. The rain came down in tons. The old captain
>   said: \quotation{Antonio, come and tell us a story!} And Antonio began as follows:
>   \quotation{It was a dark and stormy night. The rain ...}
>   \stopboxedcolumns
> \stopframed
> 
> \stoptext

Yes, that's it, what I didn't know: boxedcolumns. Your example works very well, even with inserted
narrower environment:

\startframed[...]
  \startnarrower
    \startboxedcolumns[n=3]
    ...
    ...
    \stopboxedcolumns
  \stopnarrower
\stopframed

Many thanks, Wolfgang, for your patient explanation! You helped me so many times!

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

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: narrowered columns on background image?
  2014-02-14  6:11   ` Rudolf Bahr
@ 2014-02-14  9:20     ` Wolfgang Schuster
  2014-02-14 12:06       ` Rudolf Bahr
  0 siblings, 1 reply; 5+ messages in thread
From: Wolfgang Schuster @ 2014-02-14  9:20 UTC (permalink / raw)
  To: mailing list for ConTeXt users


Am 14.02.2014 um 07:11 schrieb Rudolf Bahr <quasi@quasi.de>:

> On Thu, Feb 13, 2014 at 10:52:44AM +0100, Wolfgang Schuster wrote:
>> 
>> You have to use boxedcolumns environment because the normal columns environment doesn’t work in a frame.
>> 
>> \setupexternalfigures[location={local,global,default}]
>> 
>> \starttext
>> 
>> \defineoverlay[muh][{\externalfigure[cow][width=\overlaywidth, height=\overlayheight]}]
>> 
>> \startframed[width=max,height=0.4\textheight,background=muh,align=right,foregroundcolor=darkred]%
>>  \startboxedcolumns[n=3]
>>  It was a dark and stormy night. The rain came down in tons. The old captain
>>  said: \quotation{Antonio, come and tell us a story!} And Antonio began as follows:
>>  \quotation{It was a dark and stormy night. The rain ...}
>>  \stopboxedcolumns
>> \stopframed
>> 
>> \stoptext
> 
> Yes, that's it, what I didn't know: boxedcolumns. Your example works very well, even with inserted
> narrower environment:
> 
> \startframed[...]
>  \startnarrower
>    \startboxedcolumns[n=3]
>    ...
>    ...
>    \stopboxedcolumns
>  \stopnarrower
> \stopframed
> 
> Many thanks, Wolfgang, for your patient explanation! You helped me so many times!

Why do you want to use the narrower environment in a frame, when you want to
change only the left and right margins you can use the loffset and roffset keys.

\starttext

\startframed[align=right,width=max]
  \input knuth
\stopframed

\startframed[align=right,width=max,loffset=2cm,roffset=4cm]
  \input knuth
\stopframed

\stoptext

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

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: narrowered columns on background image?
  2014-02-14  9:20     ` Wolfgang Schuster
@ 2014-02-14 12:06       ` Rudolf Bahr
  0 siblings, 0 replies; 5+ messages in thread
From: Rudolf Bahr @ 2014-02-14 12:06 UTC (permalink / raw)
  To: mailing list for ConTeXt users

On Fri, Feb 14, 2014 at 10:20:18AM +0100, Wolfgang Schuster wrote:
> 

> 
> > On Thu, Feb 13, 2014 at 10:52:44AM +0100, Wolfgang Schuster wrote:

> 
> Why do you want to use the narrower environment in a frame, when you want to
> change only the left and right margins you can use the loffset and roffset keys.
> 
> \starttext
> 
> \startframed[align=right,width=max]
>   \input knuth
> \stopframed
> 
> \startframed[align=right,width=max,loffset=2cm,roffset=4cm]
>   \input knuth
> \stopframed
> 
> \stoptext


Ofcourse, you are right, it's better, thank you!

Rudolf

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

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2014-02-14 12:06 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-02-12 15:50 narrowered columns on background image? Rudolf Bahr
2014-02-13  9:52 ` Wolfgang Schuster
2014-02-14  6:11   ` Rudolf Bahr
2014-02-14  9:20     ` Wolfgang Schuster
2014-02-14 12:06       ` Rudolf Bahr

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).