From: Hans Hagen <j.hagen@xs4all.nl>
To: mailing list for ConTeXt users <ntg-context@ntg.nl>,
Alan Braslau <braslau.list@comcast.net>,
Marco Patzer <lists@homerow.info>
Subject: Re: Ending strings with non-break space in lang-txt.lua
Date: Thu, 6 Dec 2018 09:34:57 +0100 [thread overview]
Message-ID: <04625363-e73f-e4ad-c5a3-215ab918b14e@xs4all.nl> (raw)
In-Reply-To: <20181205142945.748c200e@zoo>
On 12/5/2018 10:29 PM, Alan Braslau wrote:
> On Wed, 5 Dec 2018 19:47:31 +0100
> Marco Patzer <lists@homerow.info> wrote:
>
>> Hi!
>>
>> I've got a few unfortunate line breaks in my documents. In
>> particular, breaks are introduced in between the string “page” and
>> the number:
>>
>> See figure 1 at page
>> 2.
>>
>> The reason is that many strings in lang-txt.lua end in a space,
>> rather than a non-break space:
>>
>> ["atpage"]={
>> ["labels"]={
>> …
>> ["en"]="at page ",
>> …
>>
>> I fixed this by defining
>>
>> \setuplabeltext
>> [en]
>> [atpage=at page\nbsp]
>>
>> So I wonder: Does it ever make sense to have a regular space at the
>> end of those commands? I just skimmed through the file and most, if
>> not all, strings ending in a space would actually benefit from having
>> it replaced by a non-break space IMO.
>>
>> Example:
>>
>> \def\pageref#1%%
>> {\in{figure}[#1] \labeltext{atpage}\at[#1]}
>>
>> \starttext
>> \hsize 3cm
>> See \pageref{foo}.
>>
>> \page \startplacefigure [reference=foo] \stopplacefigure
>> \stoptext
>
> I agree, it drives me
> nuts to see p.
> 5 or in Figure
> 8 etc.
>
>
> Also, how about:
>
> \at{\labeltext{atpage}}[#1]
indeed, that is the command to use
> (and does this make the space in the label redundant?)
> In any case it is a bit sloppy...
can you experiment with this
\unexpanded\def\leftofreferencecontent
{\removeunwantedspaces
\nobreakspace
\ignorespaces}
-----------------------------------------------------------------
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
___________________________________________________________________________________
next prev parent reply other threads:[~2018-12-06 8:34 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-12-05 18:47 Marco Patzer
2018-12-05 21:29 ` Alan Braslau
2018-12-06 8:34 ` Hans Hagen [this message]
2018-12-06 9:26 ` Marco Patzer
2018-12-06 9:44 ` Hans Hagen
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=04625363-e73f-e4ad-c5a3-215ab918b14e@xs4all.nl \
--to=j.hagen@xs4all.nl \
--cc=braslau.list@comcast.net \
--cc=lists@homerow.info \
--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).