From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.comp.tex.context/104859 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:21:30 +0800 Message-ID: <3A467EC0-3EEB-4B8E-AAD5-7D80723B4B7A@gmail.com> References: <33F569F6-26DD-479E-A63A-642E6EC9FBC2@gmail.com> <160C9373-1C56-4A1A-9017-AB02D89CB125@gmail.com> <051AF450-F973-469F-8ED6-1A8C96BCBC0D@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="===============6108281520987151258==" Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="99352"; 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:22:22 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 1i0RVG-000Pkc-7L for gctc-ntg-context-518@m.gmane.org; Wed, 21 Aug 2019 16:22:22 +0200 Original-Received: from localhost (localhost [127.0.0.1]) by zapf.ntg.nl (Postfix) with ESMTP id 23CA715380A; Wed, 21 Aug 2019 16:21:40 +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 MxiK7-auP7y4; Wed, 21 Aug 2019 16:21:38 +0200 (CEST) Original-Received: from zapf.ntg.nl (localhost [127.0.0.1]) by zapf.ntg.nl (Postfix) with ESMTP id 50EDC153835; Wed, 21 Aug 2019 16:21:38 +0200 (CEST) Original-Received: from localhost (localhost [127.0.0.1]) by zapf.ntg.nl (Postfix) with ESMTP id E8A22153831 for ; Wed, 21 Aug 2019 16:21:37 +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 ooy7h0Xzn8Zi for ; Wed, 21 Aug 2019 16:21:37 +0200 (CEST) Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=209.85.215.178; helo=mail-pg1-f178.google.com; envelope-from=jhannwong@gmail.com; receiver= Original-Received: from mail-pg1-f178.google.com (mail-pg1-f178.google.com [209.85.215.178]) (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 C622215380A for ; Wed, 21 Aug 2019 16:21:36 +0200 (CEST) Original-Received: by mail-pg1-f178.google.com with SMTP id d1so1408991pgp.4 for ; Wed, 21 Aug 2019 07:21:36 -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=uLO7W2iClm2rh4E6oCDLR8a683Jwf0+V3jDtYRjCgE0=; b=dhShxZcH633EWd2HkEHS44eRudooob8xoeCoxH23/fEqDwnmUT4uUa9RKZNRUklsun MTmFPWdWrO6k9XbIZb9pXKb/zAYQhHMY0j6EMWUJcA3zN02V3dQ+V1+5F6yOcXs4ibPd jljNLrfuCbj13A49BgqLs+Wdh8niuireALOHU0OnwJMwiAKhmM/hFOYMXWqDEtNIlJGe NyM/pNNmKNErbBFI8LcXQibcuzURxlyP7bYdYlfJkfjF+F1i8aCDGZTD2PFod7nWlfCd asSkM7baIYH9jvFkPXJ4Z3tJibxdroa2+M7waZqctWdXAifH698Zjd1wTZcRfFh5jul5 YMMg== 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=uLO7W2iClm2rh4E6oCDLR8a683Jwf0+V3jDtYRjCgE0=; b=i4TSkaVwV47gh2QRByhA2jw4GN7eCWLMkx4tDIm3urS6awx0dtgyd258Xsnu/xg8jj qM36i8WI87axiNt9pQN2UDhmTAhHDGydHgTamqn7Y1PP63KOS5FVG79nGf2+2f2blfOW Hv9yYc8+YJan6BJJOH6z4hLyH89jo3e45OeghtSbgsCLQbucOJP220ChN1uqJsSeFazi Av1KcMCJqaYu0s6TWj5rKa96HzBHLwyLqaPID+8is5w9xOQgUSnacHmus+Gzi0lJCP5Z pOIFVpGPe7BSibd7W3gkUuiNubUZJ/PyVDZ9D8YS4m++xkN/ohRdG6s+vUO3EsvqCmeE IG/Q== X-Gm-Message-State: APjAAAUeSa3W/yJo5lL8AMnCseSE2NKSjxb7lPlkJsjqzw8xMUWvgrTu bXc1/Yt8d0mZGzWXoY9S92YDFNrGGEY= X-Google-Smtp-Source: APXvYqzg2/RgeHVjmTggje4l6S/Z7GsFrP442w9n2aCCfxFVGiqoF8hnBh5GCAmEHTD+mAFK0JeNFg== X-Received: by 2002:a65:6546:: with SMTP id a6mr30339900pgw.220.1566397294793; Wed, 21 Aug 2019 07:21:34 -0700 (PDT) Original-Received: from [192.168.0.182] ([202.133.194.192]) by smtp.gmail.com with ESMTPSA id f12sm20084303pgq.52.2019.08.21.07.21.33 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 21 Aug 2019 07:21:34 -0700 (PDT) In-Reply-To: <051AF450-F973-469F-8ED6-1A8C96BCBC0D@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:104859 Archived-At: --===============6108281520987151258== Content-Type: multipart/alternative; boundary="Apple-Mail=_20471B8F-9E86-42F0-B7FF-F3873C2D3009" --Apple-Mail=_20471B8F-9E86-42F0-B7FF-F3873C2D3009 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=utf-8 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 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 --Apple-Mail=_20471B8F-9E86-42F0-B7FF-F3873C2D3009 Content-Transfer-Encoding: quoted-printable Content-Type: text/html; charset=utf-8 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=_20471B8F-9E86-42F0-B7FF-F3873C2D3009-- --===============6108281520987151258== 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== --===============6108281520987151258==--