ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
From: Hans Hagen <pragma@wxs.nl>
To: ntg-context@ntg.nl
Subject: Re: Protrusion cancellation by index term
Date: Sun, 10 Apr 2016 16:47:54 +0200	[thread overview]
Message-ID: <570A679A.5070702@wxs.nl> (raw)
In-Reply-To: <006801d19317$49110c80$db332580$@tosovsky@email.cz>

On 4/10/2016 12:53 PM, Jan Tosovsky wrote:
> On 2016-04-03 Hans Hagen wrote:
>> On 4/1/2016 9:59 PM, Jan Tosovsky wrote:
>>> On 2016-04-01 Hans Hagen wrote:
>>>> On 3/31/2016 10:47 PM, Wolfgang Schuster wrote:
>>>>>> On 2016-03-31 Jan Tosovsky wrote:
>>>>>>
>>>>>> I couldn't find any details for that \leftboundary
>>>>>
>>>>> spac-ver.mkiv:
>>>>>
>>>>> \unexpanded\def\leftboundary   {\boundary\plusone}
>>>>> \unexpanded\def\rightboundary  {\boundary\plustwo}
>>>>
>>>> it will instruct the protrusion checker to skip the next or
>>>> previous node (e.g. a char or hbox or ...) when looking for
>>>> an edge
>>>
>>> Thanks for details. So if that worked with plain \hbox should be
>> taken rather as coincidence?
>>
>> a hbox becomes one node so that one node is ignored
>>
>
> I found a nasty drawback of this method. If that hbox is used, the first paragraph is not evaluated correctly and considered as the second one. When indentation is enabled, the first paragraph after the title is not usually indented, but now it is. Additionaly, even if indenting is disabled, there is a bigger distance between title and the following para.
>
> \setupindenting[yes, 2em]
>
> \starttext
>
> \section{The first section}\index{the first section}
>
> The first para.\par
> The second para.
>
> \section{The second section}\leftboundary\hbox{\index{the second section}}
>
> The first para.\par
> The second para.
>
> \stoptext
>
>
> I could eventually avoid inserting that 'index' tweak into titles, but this is another exception which an end-user should keep in mind ..and.. I hate exceptions ;-)
>
> Any idea?

everything protrusion is an exception

\unexpanded\def\myindex#1%
   {\dontleavehmode
    \ifcase\normalprotrudechars\else\leftboundary\hbox\fi
    {\index{#1}}}

might work (untested) given that protrusion is off in the title

Hans


-----------------------------------------------------------------
                                           Hans Hagen | PRAGMA ADE
               Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
       tel: 038 477 53 69 | www.pragma-ade.com | 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://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________

  parent reply	other threads:[~2016-04-10 14:47 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <00c301cf2f67$2df79150$89e6b3f0$@tosovsky@email.cz>
2014-02-22 13:38 ` Jan Tosovsky
     [not found] ` <000f01cf2fd3$532e9380$f98bba80$@tosovsky@email.cz>
2014-02-23  9:57   ` Hans Hagen
2016-03-21 21:59     ` Jan Tosovsky
     [not found]     ` <01ac01d183bc$f2213d50$d663b7f0$@tosovsky@email.cz>
2016-03-22 16:48       ` Hans Hagen
2016-03-30 19:53         ` Jan Tosovsky
     [not found]         ` <017c01d18abd$c8d37b90$5a7a72b0$@tosovsky@email.cz>
2016-03-30 22:10           ` Hans Hagen
2016-03-31 19:28             ` Jan Tosovsky
     [not found]             ` <56fd7a8a.e559c20a.ada5.350bSMTPIN_ADDED_BROKEN@mx.google.com>
2016-03-31 20:47               ` Wolfgang Schuster
2016-04-01  7:17                 ` Hans Hagen
2016-04-01 19:59                   ` Jan Tosovsky
     [not found]                   ` <01b401d18c51$08930ef0$19b92cd0$@tosovsky@email.cz>
2016-04-03 17:38                     ` Hans Hagen
2016-04-10 10:53                       ` Jan Tosovsky
     [not found]                       ` <006801d19317$49110c80$db332580$@tosovsky@email.cz>
2016-04-10 14:47                         ` Hans Hagen [this message]
     [not found]             ` <020f01d18b83$8635bb60$92a13220$@tosovsky@email.cz>
2016-04-01  7:23               ` Hans Hagen
2014-02-22  0:44 Jan Tosovsky

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=570A679A.5070702@wxs.nl \
    --to=pragma@wxs.nl \
    --cc=ntg-context@ntg.nl \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).