From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.comp.tex.context/90155 Path: news.gmane.org!not-for-mail From: "Keith J. Schultz" Newsgroups: gmane.comp.tex.context Subject: Re: need defaults for \definehighlight Date: Sun, 8 Feb 2015 13:56:54 +0100 Message-ID: <74705FB5-2212-43D9-9DC4-462E9CCCC91C@web.de> References: <54D60AB4.5020904@wxs.nl> Reply-To: mailing list for ConTeXt users NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 (Mac OS X Mail 8.2 \(2070.6\)) Content-Type: multipart/mixed; boundary="===============0842806772==" X-Trace: ger.gmane.org 1423400257 8736 80.91.229.3 (8 Feb 2015 12:57:37 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sun, 8 Feb 2015 12:57:37 +0000 (UTC) To: mailing list for ConTeXt users Original-X-From: ntg-context-bounces@ntg.nl Sun Feb 08 13:57:36 2015 Return-path: Envelope-to: gctc-ntg-context-518@m.gmane.org Original-Received: from balder.ntg.nl ([5.39.185.229]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1YKRQb-0002CH-HS for gctc-ntg-context-518@m.gmane.org; Sun, 08 Feb 2015 13:57:33 +0100 Original-Received: from localhost (localhost [127.0.0.1]) by balder.ntg.nl (Postfix) with ESMTP id A15C510231 for ; Sun, 8 Feb 2015 13:57:32 +0100 (CET) X-Virus-Scanned: Debian amavisd-new at balder.ntg.nl Original-Received: from balder.ntg.nl ([127.0.0.1]) by localhost (balder.ntg.nl [127.0.0.1]) (amavisd-new, port 10024) with LMTP id CBSPYB5Fiqwv for ; Sun, 8 Feb 2015 13:57:31 +0100 (CET) Original-Received: from balder.ntg.nl (localhost [IPv6:::1]) by balder.ntg.nl (Postfix) with ESMTP id C1B9E10233 for ; Sun, 8 Feb 2015 13:57:03 +0100 (CET) Original-Received: from localhost (localhost [127.0.0.1]) by balder.ntg.nl (Postfix) with ESMTP id 071F8101FD for ; Sun, 8 Feb 2015 13:56:59 +0100 (CET) X-Virus-Scanned: Debian amavisd-new at balder.ntg.nl Original-Received: from balder.ntg.nl ([127.0.0.1]) by localhost (balder.ntg.nl [127.0.0.1]) (amavisd-new, port 10024) with LMTP id IL0aBViN1kT1 for ; Sun, 8 Feb 2015 13:56:58 +0100 (CET) Original-Received: from filter3-ams.mf.surf.net (filter3-ams.mf.surf.net [192.87.102.71]) by balder.ntg.nl (Postfix) with ESMTP id 2B51F101FB for ; Sun, 8 Feb 2015 13:56:57 +0100 (CET) Original-Received: from mout.web.de (mout.web.de [212.227.15.14]) by filter3-ams.mf.surf.net (8.14.3/8.14.3/Debian-9.4) with ESMTP id t18CuuQ0010261 for ; Sun, 8 Feb 2015 13:56:57 +0100 Original-Received: from [10.0.0.106] ([84.170.125.207]) by smtp.web.de (mrweb001) with ESMTPSA (Nemesis) id 0LaCmk-1Xukqs0a4c-00m1Dr for ; Sun, 08 Feb 2015 13:56:56 +0100 In-Reply-To: <54D60AB4.5020904@wxs.nl> X-Mailer: Apple Mail (2.2070.6) X-Provags-ID: V03:K0:XaA/lK9nDfNKiZwK7/35wYaScycd/QtIYVByYN5TU2w2vktRMAj tpTQnuWnbwfBEN3hsBwSs9DqjchF8K1EDeiMCQ6eiaBfJ+hBJVbh9S6ePjIhMGKoMLdU66N WUJrrcjysWTd25Ub74YfU5339W7EGg6HYoRnn8ZDuqdyqBBDtFGQf1YVns3wv7WKPLwK99K Ri/tMwU8xvKxG2YphWQRg== X-UI-Out-Filterresults: notjunk:1; X-Bayes-Prob: 0.0001 (Score 0, tokens from: ntg-context@ntg.nl, base:default, @@RPTN) X-CanIt-Geo: ip=212.227.15.14; country=DE; latitude=51.0000; longitude=9.0000; http://maps.google.com/maps?q=51.0000,9.0000&z=6 X-CanItPRO-Stream: uu:ntg-context@ntg.nl (inherits from uu:default, base:default) X-Canit-Stats-ID: 03NNMUVn6 - 5f4a8f616d5d - 20150208 (trained as not-spam) Received-SPF: pass (filter3-ams.mf.surf.net: domain of keithjschultz@web.de designates 212.227.15.14 as permitted sender) receiver=filter3-ams.mf.surf.net; client-ip=212.227.15.14; envelope-from=; helo=mout.web.de; identity=mailfrom X-Scanned-By: CanIt (www . roaringpenguin . com) on 192.87.102.71 X-BeenThere: ntg-context@ntg.nl X-Mailman-Version: 2.1.16 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:90155 Archived-At: --===============0842806772== Content-Type: multipart/alternative; boundary="Apple-Mail=_006EFD35-AAA8-4BDD-A9E9-EF98DE867D0C" --Apple-Mail=_006EFD35-AAA8-4BDD-A9E9-EF98DE867D0C Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=us-ascii Hi Hans, Irdis, All, It might sound like splitting hairs, but I find we should be careful how = we call this beast! Basically, a highlight allows one so setup a font style and color to be = applied to it contents. The problem is that is this REALLY a Highlight!=20 A style and color is applied so, what we have is a use color and style! would it not be better to call it definecharstyle or definetextstyle For compatibility we could use keep the definehighlight as a synonym. As to setting up defaults, the question is their a generic usage of such = ways of for so called highlights. These are, basically, by those that: 1) like this much fluff 2) idiosyncratic terminology 1) is supposed to avoided! And basically makes ConTeXt look like Word! The use of another way of defining a command for the standard font = styles is proof enough for 2. Also, not everybody would want the predefined = styles and colors so they will have to be changed in the setuphighlight anyway! The use of such a command is convient, but we should think about the = nomenclature! The nomenclature should reflect what it does. We can have synonyms to = satisfy the semantic usage of it! regards Keith > Am 07.02.2015 um 13:53 schrieb Hans Hagen : >=20 [snip, snip] > Anyway, the problem with predefined highlights is that we won't = overload existing commands by default, so redefining is not an option in = the core. >=20 > An option is to provide a set like: >=20 > \unprotect >=20 > \definehighlight[\v!italic ][\c!command=3D\v!no,\c!style=3D\v!italic]= > \definehighlight[\v!bold ][\c!command=3D\v!no,\c!style=3D\v!bold] > = \definehighlight[\v!bolditalic][\c!command=3D\v!no,\c!style=3D\v!bolditali= c] > \definehighlight[\v!mono] [\c!command=3D\v!no,\c!style=3D\v!mono] > \definehighlight[\v!monobold] [\c!command=3D\v!no,\c!style=3D\v!monobol= d] >=20 > \definehighlight[important] [\c!command=3D\v!no,\c!style=3D\v!bold] > \definehighlight[unimportant] [\c!command=3D\v!no,\c!color=3Ddarkgray] > \definehighlight[warning] = [\c!command=3D\v!no,\c!style=3D\v!bold,\c!color=3Ddarkblue] > \definehighlight[error] = [\c!command=3D\v!no,\c!style=3D\v!bold,\c!color=3Ddarkred] >=20 > \protect >=20 > \starttext >=20 > \highlight[italic] {italic} > \highlight[bolditalic] {bolditalic} > \highlight[bold] {bold} > \highlight[mono] {mono} > \highlight[monobold] {monobold} > \highlight[important] {important} > \highlight[unimportant]{unimportant} > \highlight[warning] {warning} > \highlight[error] {error} >=20 > \stoptext >=20 > Keep in mind that coding in terms of 'emph' is rather useless with = respect to highlights. Highlights relate to structure (while \it = doesn't) so you need tags like 'important' and so. --Apple-Mail=_006EFD35-AAA8-4BDD-A9E9-EF98DE867D0C Content-Transfer-Encoding: quoted-printable Content-Type: text/html; charset=us-ascii Hi Hans, Irdis, All,

It might sound like splitting hairs, but I find we should be = careful how we call this beast!

Basically, a highlight allows one so = setup a font style and color to be applied
to it = contents.

The = problem is that is this REALLY a Highlight! 
A style and color is applied so, what = we have is a use color and style!

would it not be better to call = it
definecharstyle
or
definetextstyle

For compatibility we could use keep the definehighlight as a = synonym.

As to = setting up defaults, the question is their a generic usage of such ways = of
for so called highlights. These are, basically, = by those that:
1) like this much fluff
2) idiosyncratic terminology

1) is supposed to avoided! And = basically makes ConTeXt look like Word!

The use of another way of defining a = command for the standard font styles
is proof = enough for 2. Also, not everybody would want the predefined styles and = colors
so they will have to be changed in the = setuphighlight anyway!

The use of such a command is convient, but we should think = about the nomenclature!
The nomenclature should = reflect what it does. We can have synonyms to satisfy the
semantic usage of it!

regards
= Keith

Am = 07.02.2015 um 13:53 schrieb Hans Hagen <pragma@wxs.nl>:

[snip, snip]

Anyway, the problem with predefined highlights = is that we won't overload existing commands by default, so redefining is = not an option in the core.

An option is to provide a = set like:

\unprotect

\definehighlight[\v!italic =    ][\c!command=3D\v!no,\c!style=3D\v!italic]
\definehighlight[\v!bold =      ][\c!command=3D\v!no,\c!style=3D\v!bold]
\definehighlight[\v!bolditalic][\c!command=3D\v!no,\c!style=3D\= v!bolditalic]

\definehighlight[\v!mono] =      [\c!command=3D\v!no,\c!style=3D\v!mono]
\definehighlight[\v!monobold] =  [\c!command=3D\v!no,\c!style=3D\v!monobold]


\definehighlight[important] =    [\c!command=3D\v!no,\c!style=3D\v!bold]
\definehighlight[unimportant] =  [\c!command=3D\v!no,\c!color=3Ddarkgray]
\definehighlight[warning] = [\c!command=3D\v!no,\c!style=3D\v!bold,\c!color=3Ddarkblue]
\definehighlight[error] = [\c!command=3D\v!no,\c!style=3D\v!bold,\c!color=3Ddarkred]

\protect

\starttext

   \highlight[italic] =     {italic}
   \highlight[bolditalic] = {bolditalic}
   \highlight[bold] =       {bold}
   \highlight[mono] =       {mono}
   \highlight[monobold] =   {monobold}
   \highlight[important] =  {important}
   \highlight[unimportant]{unimportant}   \highlight[warning] =    {warning}
   \highlight[error] =      {error}

\stoptext

Keep in mind that coding in terms of 'emph' is = rather useless with respect to highlights. Highlights relate to = structure (while \it doesn't) so you need tags like 'important' and = so.

= --Apple-Mail=_006EFD35-AAA8-4BDD-A9E9-EF98DE867D0C-- --===============0842806772== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: base64 Content-Disposition: inline X19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19f X19fX19fX19fX19fX19fX19fX19fX19fX18KSWYgeW91ciBxdWVzdGlvbiBpcyBvZiBpbnRlcmVz dCB0byBvdGhlcnMgYXMgd2VsbCwgcGxlYXNlIGFkZCBhbiBlbnRyeSB0byB0aGUgV2lraSEKCm1h aWxsaXN0IDogbnRnLWNvbnRleHRAbnRnLm5sIC8gaHR0cDovL3d3dy5udGcubmwvbWFpbG1hbi9s aXN0aW5mby9udGctY29udGV4dAp3ZWJwYWdlICA6IGh0dHA6Ly93d3cucHJhZ21hLWFkZS5ubCAv IGh0dHA6Ly90ZXguYWFuaGV0Lm5ldAphcmNoaXZlICA6IGh0dHA6Ly9mb3VuZHJ5LnN1cGVsZWMu ZnIvcHJvamVjdHMvY29udGV4dHJldi8Kd2lraSAgICAgOiBodHRwOi8vY29udGV4dGdhcmRlbi5u ZXQKX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19f X19fX19fX19fX19fX19fX19fX19fX19fX19fX18= --===============0842806772==--