From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.comp.tex.context/104860 Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail From: Jon Wong Newsgroups: gmane.comp.tex.context Subject: Re: startnarrower and framed? Date: Wed, 21 Aug 2019 22:35:15 +0800 Message-ID: <4C798D15-72B8-49D0-B58C-A4E44839939D@gmail.com> References: <33F569F6-26DD-479E-A63A-642E6EC9FBC2@gmail.com> <160C9373-1C56-4A1A-9017-AB02D89CB125@gmail.com> <051AF450-F973-469F-8ED6-1A8C96BCBC0D@gmail.com> <3A467EC0-3EEB-4B8E-AAD5-7D80723B4B7A@gmail.com> Reply-To: mailing list for ConTeXt users Mime-Version: 1.0 (Mac OS X Mail 12.4 \(3445.104.11\)) Content-Type: multipart/mixed; boundary="===============2453504338120758254==" Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="161341"; mail-complaints-to="usenet@blaine.gmane.org" To: mailing list for ConTeXt users Original-X-From: ntg-context-bounces@ntg.nl Wed Aug 21 16:35:49 2019 Return-path: Envelope-to: gctc-ntg-context-518@m.gmane.org Original-Received: from zapf.boekplan.nl ([5.39.185.232] helo=zapf.ntg.nl) by blaine.gmane.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.89) (envelope-from ) id 1i0RiF-000fhS-Su for gctc-ntg-context-518@m.gmane.org; Wed, 21 Aug 2019 16:35:47 +0200 Original-Received: from localhost (localhost [127.0.0.1]) by zapf.ntg.nl (Postfix) with ESMTP id 874541535EA; Wed, 21 Aug 2019 16:35:25 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at zapf.boekplan.nl Original-Received: from zapf.ntg.nl ([127.0.0.1]) by localhost (zapf.ntg.nl [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id K0JU-DA8pd55; Wed, 21 Aug 2019 16:35:24 +0200 (CEST) Original-Received: from zapf.ntg.nl (localhost [127.0.0.1]) by zapf.ntg.nl (Postfix) with ESMTP id 93DB415381F; Wed, 21 Aug 2019 16:35:24 +0200 (CEST) Original-Received: from localhost (localhost [127.0.0.1]) by zapf.ntg.nl (Postfix) with ESMTP id CA7021537FC for ; Wed, 21 Aug 2019 16:35:23 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at zapf.boekplan.nl Original-Received: from zapf.ntg.nl ([127.0.0.1]) by localhost (zapf.ntg.nl [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id UjtoOxfxnv2I for ; Wed, 21 Aug 2019 16:35:22 +0200 (CEST) Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=209.85.214.181; helo=mail-pl1-f181.google.com; envelope-from=jhannwong@gmail.com; receiver= Original-Received: from mail-pl1-f181.google.com (mail-pl1-f181.google.com [209.85.214.181]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) by zapf.ntg.nl (Postfix) with ESMTPS id 960DE1535EA for ; Wed, 21 Aug 2019 16:35:22 +0200 (CEST) Original-Received: by mail-pl1-f181.google.com with SMTP id f19so1443687plr.3 for ; Wed, 21 Aug 2019 07:35:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:mime-version:subject:date:references:to:in-reply-to:message-id; bh=bsUw0pPwKCYIExPyNnqICvrVn0/jbi0FxWDe890k+uM=; b=LbRO26kSbAU1/A8jqhJBcOTUg/jM546XWt4GCiiyI3ZapKgt7gJ8kjM0JAPjQTOSYd Ffhc0abXhQK/JB7c7t9RY7wToINHJcHv+5RgfpVadwKN8S60ziDgwsXBBPtPy3eMar0w tUsVfDPf2+aM1sdjyMQtKb3RkIUXcBIVXLiVR8MN0IWyG10JHfYrm9SZbckcSsnFk0EM eu8j5pbza8Pk6FqfJrznf6hM5Zrg6f07on2je4NAl7fYtDzvOf26JxJVBg/KTtOjSjqy kiHj4iSkCnzyVi3NsrZYciJndX8vZrTbAnyCbyu4n1DY6KLhtH+t207uy7AB6g+wfrXy wNow== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:mime-version:subject:date:references:to :in-reply-to:message-id; bh=bsUw0pPwKCYIExPyNnqICvrVn0/jbi0FxWDe890k+uM=; b=kINBVxtKkNXSXJZPIdpM7/x+zBiRvElGMQBLTvaryg8O6QtRfhI9S8Pc5CDQ05Zq13 HpzHu1CyfFYHnYrNaQ886KJBFnfmngtx4KCusjYCa20R9GjayDjKB2/rhRH0rOEAN438 8bUp3UfmsML/PDGvVkSc9/RY5QfESKims1jlRbfZ0ZzqQWDejE+vTLxAYIhc+itIGjil G8MpQ+LmDA0mWu7JHju34oU7Kx5RZTfT44Q/cA7lM6fYw+A09PeHSxAGD9tuK8TttxDY pT4W/yat3mydRPcXyDSWb0fH+NnkDqK/D6VU0O3oeL82p3cY0sS+veTFeBLSj2vY8WLz lrzg== X-Gm-Message-State: APjAAAVL1ENQHyeQUfui9XZ3YySEHFE1Lh+prVw8BHWAOkRrnNoCgR9u GaVtKZLpSQJHW4tuxtS+Y9N/69atd5I= X-Google-Smtp-Source: APXvYqxB26HwCz0dhXAgIG6ZGpYhKzzorVU7cqZW6o4qLHPOQGrqnpKNbjjD6vK8Zd3hiu4Aw1UDCA== X-Received: by 2002:a17:902:724a:: with SMTP id c10mr4056988pll.163.1566398120393; Wed, 21 Aug 2019 07:35:20 -0700 (PDT) Original-Received: from [192.168.0.182] ([202.133.194.192]) by smtp.gmail.com with ESMTPSA id b14sm22538339pga.20.2019.08.21.07.35.19 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 21 Aug 2019 07:35:19 -0700 (PDT) In-Reply-To: <3A467EC0-3EEB-4B8E-AAD5-7D80723B4B7A@gmail.com> X-Mailer: Apple Mail (2.3445.104.11) X-BeenThere: ntg-context@ntg.nl X-Mailman-Version: 2.1.26 Precedence: list List-Id: mailing list for ConTeXt users List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: ntg-context-bounces@ntg.nl Original-Sender: "ntg-context" Xref: news.gmane.org gmane.comp.tex.context:104860 Archived-At: --===============2453504338120758254== Content-Type: multipart/alternative; boundary="Apple-Mail=_F7D6A5B0-B6B9-4D8E-8B3C-977565FE8EF8" --Apple-Mail=_F7D6A5B0-B6B9-4D8E-8B3C-977565FE8EF8 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=utf-8 Hi all, I=E2=80=99m so so sorry for yet another message in this thread. I=E2=80=99= ve solved it, but still don=E2=80=99t 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=3Dalways, background=3Dcolor, backgroundcolor=3Dlightgray, leftoffset=3D.5\bodyfontsize, rightoffset=3D.5\bodyfontsize, topoffset=3D.5\bodyfontsize, bottomoffset=3D.5\bodyfontsize, frame=3Doff,] \input knuth { \blank[line] \setupwhitespace[none] \startnarrower \dontleavehmode\framed[ width=3Dlocal, corner=3D03, background=3Dcolor, = backgroundcolor=3Dcyan, frame=3Doff ]{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 wrote: >=20 > Hi all, >=20 > Ok, last message in this topic, I promise. I=E2=80=99ve crafted a MWE. >=20 > If I \setupwhitespace[line], the \blank[-0.5em] stops working. I=E2=80=99= m sure I need to revise my TeX notes. For now, can somebody give me a = little encouragement and tell me the answer? :-P >=20 > \usecolors[xwi] > % \setupwhitespace[line] >=20 > \starttext > \definetextbackground[secondary][ > location=3Dalways, > background=3Dcolor, > backgroundcolor=3Dlightgray, > leftoffset=3D.5\bodyfontsize, > rightoffset=3D.5\bodyfontsize, > topoffset=3D.5\bodyfontsize, > bottomoffset=3D.5\bodyfontsize, > frame=3Doff,] >=20 > \input knuth >=20 > \startnarrower > \dontleavehmode\framed[ > width=3Dlocal, corner=3D03, background=3Dcolor, = backgroundcolor=3Dcyan, > frame=3Doff > ]{My header!} >=20 > \blank[-0.5em] >=20 > \startsecondary > \input knuth > \stopsecondary > \stopnarrower >=20 > \input knuth > \stoptext >=20 > Regards > Jon >=20 >=20 >> On Aug 21, 2019, at 9:37 PM, Jon Wong > wrote: >>=20 >> Hi all, >>=20 >> Ah, found the solution in TextBackground. At here: = https://www.contextgarden.net/TextBackground = >>=20 >> Can I have a 2-segment (2 vboxes) TextBackground (presumably with 2 = TextBackgrounds, zero vspace between them)? >>=20 >> For the top segment, I want rounded corners only for top corners = (corner=3D03 with \framed). >>=20 >> Seems I really should dig into MetaFun and TextBackground. Looks = really fun and useful. >>=20 >> Sorry for the noise. Am a little carried away exploring the Garden. = :-P >>=20 >> Regards >> Jon >>=20 >>=20 >>> On Aug 21, 2019, at 9:25 PM, Jon Wong > wrote: >>>=20 >>> Hi all, >>>=20 >>> Sorry, my solution didn=E2=80=99t work. >>>=20 >>> My purpose of using \startnarrower is to have some paragraphs of = text inside the \framed. Unfortunately, it seems \framed doesn=E2=80=99t = take paragraphs. >>>=20 >>> \startframedtext doesn=E2=80=99t have as many border options as = \framed. >>>=20 >>> Should I use overlays? Or layers? It seems layers require absolutely = positioning, and can=E2=80=99t be logically contained inside a = \startnarrower? >>>=20 >>> Regards >>> Jon >>>=20 >>>=20 >>>> On Aug 21, 2019, at 8:53 PM, Jon Wong > wrote: >>>>=20 >>>> Hi all, >>>>=20 >>>> I got some progress! >>>>=20 >>>> \setupnarrower[left=3D2cm, right=3D2cm] % what does middle do, = actually? >>>> \startnarrower >>>> \dontleavehmode\framed[width=3Dlocal]{testing} >>>>=20 >>>> Since this works for left offset: \framed[width=3Dlocal]{testing} >>>> \endnarrower >>>>=20 >>>> 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? >>>>=20 >>>> Regards >>>> Jon >>>>=20 >>>>> On Aug 21, 2019, at 8:14 PM, Jon Wong > wrote: >>>>>=20 >>>>> Hi all, >>>>>=20 >>>>> I want to have a \startnarrower effect. But I also want that = segment to have a border (hopefully a gradient background color too!). >>>>>=20 >>>>> I tried: >>>>>=20 >>>>> \startnarrower >>>>> \framed{testing} >>>>>=20 >>>>> Seems framed doesn=E2=80=99t observe startnarrower commands. >>>>> \endnarrower >>>>>=20 >>>>> How do I achieve that? >>>>>=20 >>>>> Regards >>>>> Jon >>>>=20 >>>=20 >>=20 >=20 --Apple-Mail=_F7D6A5B0-B6B9-4D8E-8B3C-977565FE8EF8 Content-Transfer-Encoding: quoted-printable Content-Type: text/html; charset=utf-8 Hi = all,

I=E2=80=99m so = so sorry for yet another message in this thread. I=E2=80=99ve solved it, = but still don=E2=80=99t 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=3Dalways,
  = background=3Dcolor,
  = backgroundcolor=3Dlightgray,
  = leftoffset=3D.5\bodyfontsize,
  = rightoffset=3D.5\bodyfontsize,
  = topoffset=3D.5\bodyfontsize,
  = bottomoffset=3D.5\bodyfontsize,
  = frame=3Doff,]

\input knuth

{

\blank[line]

\setupwhitespace[none]

\startnarrower
  \dontleavehmode\framed[
  =   width=3Dlocal, corner=3D03, background=3Dcolor, = backgroundcolor=3Dcyan,
    = frame=3Doff
  ]{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=E2=80=99ve crafted a MWE.

If I \setupwhitespace[line], the = \blank[-0.5em] stops working. I=E2=80=99m 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=3Dalways,
  = background=3Dcolor,
  = backgroundcolor=3Dlightgray,
  = leftoffset=3D.5\bodyfontsize,
  = rightoffset=3D.5\bodyfontsize,
  = topoffset=3D.5\bodyfontsize,
  = bottomoffset=3D.5\bodyfontsize,
  = frame=3Doff,]

\input knuth

\startnarrower
  = \dontleavehmode\framed[
    width=3Dlocal, = corner=3D03, background=3Dcolor, backgroundcolor=3Dcyan,
    frame=3Doff
  ]{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

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=3D03 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=E2=80=99t = work.

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

\startframedtext doesn=E2=80=99t have as many border options = as \framed.

Should I use overlays? Or = layers? It seems layers require absolutely positioning, and can=E2=80=99t = 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=3D2cm, right=3D2cm] % what = does middle do, actually?
\startnarrower
= \dontleavehmode\framed[width=3Dlocal]{testing}

Since this works for left offset: = \framed[width=3Dlocal]{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=E2=80=99t observe startnarrower commands.
\endnarrower

How do I achieve = that?

Regards
Jon





= --Apple-Mail=_F7D6A5B0-B6B9-4D8E-8B3C-977565FE8EF8-- --===============2453504338120758254== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: base64 Content-Disposition: inline X19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19f X19fX19fX19fX19fX19fX19fX19fX19fX18KSWYgeW91ciBxdWVzdGlvbiBpcyBvZiBpbnRlcmVz dCB0byBvdGhlcnMgYXMgd2VsbCwgcGxlYXNlIGFkZCBhbiBlbnRyeSB0byB0aGUgV2lraSEKCm1h aWxsaXN0IDogbnRnLWNvbnRleHRAbnRnLm5sIC8gaHR0cDovL3d3dy5udGcubmwvbWFpbG1hbi9s aXN0aW5mby9udGctY29udGV4dAp3ZWJwYWdlICA6IGh0dHA6Ly93d3cucHJhZ21hLWFkZS5ubCAv IGh0dHA6Ly9jb250ZXh0LmFhbmhldC5uZXQKYXJjaGl2ZSAgOiBodHRwczovL2JpdGJ1Y2tldC5v cmcvcGhnL2NvbnRleHQtbWlycm9yL2NvbW1pdHMvCndpa2kgICAgIDogaHR0cDovL2NvbnRleHRn YXJkZW4ubmV0Cl9fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19f X19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fCg== --===============2453504338120758254==--