ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* startnarrower and framed?
@ 2019-08-21 12:14 Jon Wong
  2019-08-21 12:41 ` Hans Hagen
  2019-08-21 12:53 ` Jon Wong
  0 siblings, 2 replies; 7+ messages in thread
From: Jon Wong @ 2019-08-21 12:14 UTC (permalink / raw)
  To: mailing list for ConTeXt users

Hi all,

I want to have a \startnarrower effect. But I also want that segment to have a border (hopefully a gradient background color too!).

I tried:

\startnarrower
  \framed{testing}

  Seems framed doesn’t observe startnarrower commands.
\endnarrower

How do I achieve that?

Regards
Jon
___________________________________________________________________________________
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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki     : http://contextgarden.net
___________________________________________________________________________________

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

* Re: startnarrower and framed?
  2019-08-21 12:14 startnarrower and framed? Jon Wong
@ 2019-08-21 12:41 ` Hans Hagen
  2019-08-21 12:53 ` Jon Wong
  1 sibling, 0 replies; 7+ messages in thread
From: Hans Hagen @ 2019-08-21 12:41 UTC (permalink / raw)
  To: mailing list for ConTeXt users, Jon Wong

On 8/21/2019 2:14 PM, Jon Wong wrote:
> \startnarrower
>    \framed{testing}
> 
>    Seems framed doesn’t observe startnarrower commands.
> \endnarrower
\starttext

Seems framed doesn’t observe startnarrower commands.

\startnarrower
     \dontleavehmode \framed{testing}

     Seems framed doesn’t observe startnarrower commands.

     \startlinecorrection
         \dontleavehmode \framed{testing}
     \stoplinecorrection
\stopnarrower

\stoptext

for gradients, see metafun and example sin test suite

-- 

-----------------------------------------------------------------
                                           Hans Hagen | PRAGMA ADE
               Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
        tel: 038 477 53 69 | www.pragma-ade.nl | www.pragma-pod.nl
-----------------------------------------------------------------
___________________________________________________________________________________
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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki     : http://contextgarden.net
___________________________________________________________________________________

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

* Re: startnarrower and framed?
  2019-08-21 12:14 startnarrower and framed? Jon Wong
  2019-08-21 12:41 ` Hans Hagen
@ 2019-08-21 12:53 ` Jon Wong
  2019-08-21 13:25   ` Jon Wong
  1 sibling, 1 reply; 7+ messages in thread
From: Jon Wong @ 2019-08-21 12:53 UTC (permalink / raw)
  To: mailing list for ConTeXt users

Hi all,

I got some progress!

\setupnarrower[left=2cm, right=2cm] % what does middle do, actually?
\startnarrower
  \dontleavehmode\framed[width=local]{testing}

  Since this works for left offset: \framed[width=local]{testing}
\endnarrower

So, how do I do a gradient background? Yeah, I know I have to dive into MetaPost and MetaFun some time. Is that where the solution is?

Regards
Jon

> On Aug 21, 2019, at 8:14 PM, Jon Wong <jhannwong@gmail.com> wrote:
> 
> Hi all,
> 
> I want to have a \startnarrower effect. But I also want that segment to have a border (hopefully a gradient background color too!).
> 
> I tried:
> 
> \startnarrower
>  \framed{testing}
> 
>  Seems framed doesn’t observe startnarrower commands.
> \endnarrower
> 
> How do I achieve that?
> 
> Regards
> Jon

___________________________________________________________________________________
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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki     : http://contextgarden.net
___________________________________________________________________________________

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

* Re: startnarrower and framed?
  2019-08-21 12:53 ` Jon Wong
@ 2019-08-21 13:25   ` Jon Wong
  2019-08-21 13:37     ` Jon Wong
  0 siblings, 1 reply; 7+ messages in thread
From: Jon Wong @ 2019-08-21 13:25 UTC (permalink / raw)
  To: mailing list for ConTeXt users

Hi all,

Sorry, my solution didn’t work.

My purpose of using \startnarrower is to have some paragraphs of text inside the \framed. Unfortunately, it seems \framed doesn’t take paragraphs.

\startframedtext doesn’t have as many border options as \framed.

Should I use overlays? Or layers? It seems layers require absolutely positioning, and can’t be logically contained inside a \startnarrower?

Regards
Jon


> On Aug 21, 2019, at 8:53 PM, Jon Wong <jhannwong@gmail.com> wrote:
> 
> Hi all,
> 
> I got some progress!
> 
> \setupnarrower[left=2cm, right=2cm] % what does middle do, actually?
> \startnarrower
>  \dontleavehmode\framed[width=local]{testing}
> 
>  Since this works for left offset: \framed[width=local]{testing}
> \endnarrower
> 
> So, how do I do a gradient background? Yeah, I know I have to dive into MetaPost and MetaFun some time. Is that where the solution is?
> 
> Regards
> Jon
> 
>> On Aug 21, 2019, at 8:14 PM, Jon Wong <jhannwong@gmail.com> wrote:
>> 
>> Hi all,
>> 
>> I want to have a \startnarrower effect. But I also want that segment to have a border (hopefully a gradient background color too!).
>> 
>> I tried:
>> 
>> \startnarrower
>> \framed{testing}
>> 
>> Seems framed doesn’t observe startnarrower commands.
>> \endnarrower
>> 
>> How do I achieve that?
>> 
>> Regards
>> Jon
> 

___________________________________________________________________________________
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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki     : http://contextgarden.net
___________________________________________________________________________________

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

* Re: startnarrower and framed?
  2019-08-21 13:25   ` Jon Wong
@ 2019-08-21 13:37     ` Jon Wong
  2019-08-21 14:21       ` Jon Wong
  0 siblings, 1 reply; 7+ messages in thread
From: Jon Wong @ 2019-08-21 13:37 UTC (permalink / raw)
  To: mailing list for ConTeXt users


[-- Attachment #1.1: Type: text/plain, Size: 2072 bytes --]

Hi all,

Ah, found the solution in TextBackground. At here: https://www.contextgarden.net/TextBackground <https://www.contextgarden.net/TextBackground>

Can I have a 2-segment (2 vboxes) TextBackground (presumably with 2 TextBackgrounds, zero vspace between them)?

For the top segment, I want rounded corners only for top corners (corner=03 with \framed).

Seems I really should dig into MetaFun and TextBackground. Looks really fun and useful.

Sorry for the noise. Am a little carried away exploring the Garden. :-P

Regards
Jon


> On Aug 21, 2019, at 9:25 PM, Jon Wong <jhannwong@gmail.com> wrote:
> 
> Hi all,
> 
> Sorry, my solution didn’t work.
> 
> My purpose of using \startnarrower is to have some paragraphs of text inside the \framed. Unfortunately, it seems \framed doesn’t take paragraphs.
> 
> \startframedtext doesn’t have as many border options as \framed.
> 
> Should I use overlays? Or layers? It seems layers require absolutely positioning, and can’t be logically contained inside a \startnarrower?
> 
> Regards
> Jon
> 
> 
>> On Aug 21, 2019, at 8:53 PM, Jon Wong <jhannwong@gmail.com> wrote:
>> 
>> Hi all,
>> 
>> I got some progress!
>> 
>> \setupnarrower[left=2cm, right=2cm] % what does middle do, actually?
>> \startnarrower
>> \dontleavehmode\framed[width=local]{testing}
>> 
>> Since this works for left offset: \framed[width=local]{testing}
>> \endnarrower
>> 
>> So, how do I do a gradient background? Yeah, I know I have to dive into MetaPost and MetaFun some time. Is that where the solution is?
>> 
>> Regards
>> Jon
>> 
>>> On Aug 21, 2019, at 8:14 PM, Jon Wong <jhannwong@gmail.com> wrote:
>>> 
>>> Hi all,
>>> 
>>> I want to have a \startnarrower effect. But I also want that segment to have a border (hopefully a gradient background color too!).
>>> 
>>> I tried:
>>> 
>>> \startnarrower
>>> \framed{testing}
>>> 
>>> Seems framed doesn’t observe startnarrower commands.
>>> \endnarrower
>>> 
>>> How do I achieve that?
>>> 
>>> Regards
>>> Jon
>> 
> 


[-- Attachment #1.2: Type: text/html, Size: 3486 bytes --]

[-- Attachment #2: Type: text/plain, Size: 493 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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki     : http://contextgarden.net
___________________________________________________________________________________

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

* Re: startnarrower and framed?
  2019-08-21 13:37     ` Jon Wong
@ 2019-08-21 14:21       ` Jon Wong
  2019-08-21 14:35         ` Jon Wong
  0 siblings, 1 reply; 7+ messages in thread
From: Jon Wong @ 2019-08-21 14:21 UTC (permalink / raw)
  To: mailing list for ConTeXt users


[-- Attachment #1.1: Type: text/plain, Size: 3196 bytes --]

Hi all,

Ok, last message in this topic, I promise. I’ve crafted a MWE.

If I \setupwhitespace[line], the \blank[-0.5em] stops working. I’m sure I need to revise my TeX notes. For now, can somebody give me a little encouragement and tell me the answer? :-P

\usecolors[xwi]
% \setupwhitespace[line]

\starttext
\definetextbackground[secondary][
  location=always,
  background=color,
  backgroundcolor=lightgray,
  leftoffset=.5\bodyfontsize,
  rightoffset=.5\bodyfontsize,
  topoffset=.5\bodyfontsize,
  bottomoffset=.5\bodyfontsize,
  frame=off,]

\input knuth

\startnarrower
  \dontleavehmode\framed[
    width=local, corner=03, background=color, backgroundcolor=cyan,
    frame=off
  ]{My header!}

  \blank[-0.5em]

  \startsecondary
    \input knuth
  \stopsecondary
\stopnarrower

\input knuth
\stoptext

Regards
Jon


> On Aug 21, 2019, at 9:37 PM, Jon Wong <jhannwong@gmail.com> wrote:
> 
> Hi all,
> 
> Ah, found the solution in TextBackground. At here: https://www.contextgarden.net/TextBackground <https://www.contextgarden.net/TextBackground>
> 
> Can I have a 2-segment (2 vboxes) TextBackground (presumably with 2 TextBackgrounds, zero vspace between them)?
> 
> For the top segment, I want rounded corners only for top corners (corner=03 with \framed).
> 
> Seems I really should dig into MetaFun and TextBackground. Looks really fun and useful.
> 
> Sorry for the noise. Am a little carried away exploring the Garden. :-P
> 
> Regards
> Jon
> 
> 
>> On Aug 21, 2019, at 9:25 PM, Jon Wong <jhannwong@gmail.com <mailto:jhannwong@gmail.com>> wrote:
>> 
>> Hi all,
>> 
>> Sorry, my solution didn’t work.
>> 
>> My purpose of using \startnarrower is to have some paragraphs of text inside the \framed. Unfortunately, it seems \framed doesn’t take paragraphs.
>> 
>> \startframedtext doesn’t have as many border options as \framed.
>> 
>> Should I use overlays? Or layers? It seems layers require absolutely positioning, and can’t be logically contained inside a \startnarrower?
>> 
>> Regards
>> Jon
>> 
>> 
>>> On Aug 21, 2019, at 8:53 PM, Jon Wong <jhannwong@gmail.com <mailto:jhannwong@gmail.com>> wrote:
>>> 
>>> Hi all,
>>> 
>>> I got some progress!
>>> 
>>> \setupnarrower[left=2cm, right=2cm] % what does middle do, actually?
>>> \startnarrower
>>> \dontleavehmode\framed[width=local]{testing}
>>> 
>>> Since this works for left offset: \framed[width=local]{testing}
>>> \endnarrower
>>> 
>>> So, how do I do a gradient background? Yeah, I know I have to dive into MetaPost and MetaFun some time. Is that where the solution is?
>>> 
>>> Regards
>>> Jon
>>> 
>>>> On Aug 21, 2019, at 8:14 PM, Jon Wong <jhannwong@gmail.com <mailto:jhannwong@gmail.com>> wrote:
>>>> 
>>>> Hi all,
>>>> 
>>>> I want to have a \startnarrower effect. But I also want that segment to have a border (hopefully a gradient background color too!).
>>>> 
>>>> I tried:
>>>> 
>>>> \startnarrower
>>>> \framed{testing}
>>>> 
>>>> Seems framed doesn’t observe startnarrower commands.
>>>> \endnarrower
>>>> 
>>>> How do I achieve that?
>>>> 
>>>> Regards
>>>> Jon
>>> 
>> 
> 


[-- Attachment #1.2: Type: text/html, Size: 5809 bytes --]

[-- Attachment #2: Type: text/plain, Size: 493 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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki     : http://contextgarden.net
___________________________________________________________________________________

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

* Re: startnarrower and framed?
  2019-08-21 14:21       ` Jon Wong
@ 2019-08-21 14:35         ` Jon Wong
  0 siblings, 0 replies; 7+ messages in thread
From: Jon Wong @ 2019-08-21 14:35 UTC (permalink / raw)
  To: mailing list for ConTeXt users


[-- Attachment #1.1: Type: text/plain, Size: 4588 bytes --]

Hi all,

I’m so so sorry for yet another message in this thread. I’ve solved it, but still don’t quite understand why it works. I post the solution here so that nobody has to spend any time crafting the solution. But I still have 1 key question.

Key question: Why does \setwhitespace[line] prevent \blank[-0.5em] from working after a \framed?

(Ok. I better sleep before I pollute the mailing list further.)

Apparent Solution:

\usecolors[xwi]
\setupwhitespace[line]

\starttext
\definetextbackground[secondary][
  location=always,
  background=color,
  backgroundcolor=lightgray,
  leftoffset=.5\bodyfontsize,
  rightoffset=.5\bodyfontsize,
  topoffset=.5\bodyfontsize,
  bottomoffset=.5\bodyfontsize,
  frame=off,]

\input knuth

{

\blank[line]

\setupwhitespace[none]

\startnarrower
  \dontleavehmode\framed[
    width=local, corner=03, background=color, backgroundcolor=cyan,
    frame=off
  ]{My header!}

  \blank[-0.5em]

  \startsecondary
  {

  \setupwhitespace[line]

    \input knuth

  }
  \stopsecondary
\stopnarrower

}

\input knuth
\stoptext


> On Aug 21, 2019, at 10:21 PM, Jon Wong <jhannwong@gmail.com> wrote:
> 
> Hi all,
> 
> Ok, last message in this topic, I promise. I’ve crafted a MWE.
> 
> If I \setupwhitespace[line], the \blank[-0.5em] stops working. I’m sure I need to revise my TeX notes. For now, can somebody give me a little encouragement and tell me the answer? :-P
> 
> \usecolors[xwi]
> % \setupwhitespace[line]
> 
> \starttext
> \definetextbackground[secondary][
>   location=always,
>   background=color,
>   backgroundcolor=lightgray,
>   leftoffset=.5\bodyfontsize,
>   rightoffset=.5\bodyfontsize,
>   topoffset=.5\bodyfontsize,
>   bottomoffset=.5\bodyfontsize,
>   frame=off,]
> 
> \input knuth
> 
> \startnarrower
>   \dontleavehmode\framed[
>     width=local, corner=03, background=color, backgroundcolor=cyan,
>     frame=off
>   ]{My header!}
> 
>   \blank[-0.5em]
> 
>   \startsecondary
>     \input knuth
>   \stopsecondary
> \stopnarrower
> 
> \input knuth
> \stoptext
> 
> Regards
> Jon
> 
> 
>> On Aug 21, 2019, at 9:37 PM, Jon Wong <jhannwong@gmail.com <mailto:jhannwong@gmail.com>> wrote:
>> 
>> Hi all,
>> 
>> Ah, found the solution in TextBackground. At here: https://www.contextgarden.net/TextBackground <https://www.contextgarden.net/TextBackground>
>> 
>> Can I have a 2-segment (2 vboxes) TextBackground (presumably with 2 TextBackgrounds, zero vspace between them)?
>> 
>> For the top segment, I want rounded corners only for top corners (corner=03 with \framed).
>> 
>> Seems I really should dig into MetaFun and TextBackground. Looks really fun and useful.
>> 
>> Sorry for the noise. Am a little carried away exploring the Garden. :-P
>> 
>> Regards
>> Jon
>> 
>> 
>>> On Aug 21, 2019, at 9:25 PM, Jon Wong <jhannwong@gmail.com <mailto:jhannwong@gmail.com>> wrote:
>>> 
>>> Hi all,
>>> 
>>> Sorry, my solution didn’t work.
>>> 
>>> My purpose of using \startnarrower is to have some paragraphs of text inside the \framed. Unfortunately, it seems \framed doesn’t take paragraphs.
>>> 
>>> \startframedtext doesn’t have as many border options as \framed.
>>> 
>>> Should I use overlays? Or layers? It seems layers require absolutely positioning, and can’t be logically contained inside a \startnarrower?
>>> 
>>> Regards
>>> Jon
>>> 
>>> 
>>>> On Aug 21, 2019, at 8:53 PM, Jon Wong <jhannwong@gmail.com <mailto:jhannwong@gmail.com>> wrote:
>>>> 
>>>> Hi all,
>>>> 
>>>> I got some progress!
>>>> 
>>>> \setupnarrower[left=2cm, right=2cm] % what does middle do, actually?
>>>> \startnarrower
>>>> \dontleavehmode\framed[width=local]{testing}
>>>> 
>>>> Since this works for left offset: \framed[width=local]{testing}
>>>> \endnarrower
>>>> 
>>>> So, how do I do a gradient background? Yeah, I know I have to dive into MetaPost and MetaFun some time. Is that where the solution is?
>>>> 
>>>> Regards
>>>> Jon
>>>> 
>>>>> On Aug 21, 2019, at 8:14 PM, Jon Wong <jhannwong@gmail.com <mailto:jhannwong@gmail.com>> wrote:
>>>>> 
>>>>> Hi all,
>>>>> 
>>>>> I want to have a \startnarrower effect. But I also want that segment to have a border (hopefully a gradient background color too!).
>>>>> 
>>>>> I tried:
>>>>> 
>>>>> \startnarrower
>>>>> \framed{testing}
>>>>> 
>>>>> Seems framed doesn’t observe startnarrower commands.
>>>>> \endnarrower
>>>>> 
>>>>> How do I achieve that?
>>>>> 
>>>>> Regards
>>>>> Jon
>>>> 
>>> 
>> 
> 


[-- Attachment #1.2: Type: text/html, Size: 8776 bytes --]

[-- Attachment #2: Type: text/plain, Size: 493 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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki     : http://contextgarden.net
___________________________________________________________________________________

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

end of thread, other threads:[~2019-08-21 14:35 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-08-21 12:14 startnarrower and framed? Jon Wong
2019-08-21 12:41 ` Hans Hagen
2019-08-21 12:53 ` Jon Wong
2019-08-21 13:25   ` Jon Wong
2019-08-21 13:37     ` Jon Wong
2019-08-21 14:21       ` Jon Wong
2019-08-21 14:35         ` Jon Wong

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).