[NTG-context] How to implement word corrections

2023-12-27 Thread Jairo A. del Rio
Hi, list! I'm writing a small module to print word corrections, e.g.,
things like "irregardless" > "regardless"or "alverja" > "arveja" ('pea' in
Spanish) with overstrikes and underlines, but I want feedback to make a
module in the ConTeXt fashion. I hope the PDF attached explains better what
I mean. Just in case, I want to know if anyone else in the mailing list is
acquainted with grammar and orthography quizzes/exercises/exams in ConTeXt.
Merry Christmas and Happy New Year!

Best regards,

Jairo


correction_draft.tex
Description: Binary data


correction_draft.pdf
Description: Adobe PDF document
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / 
https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl
webpage  : https://www.pragma-ade.nl / https://context.aanhet.net (mirror)
archive  : https://github.com/contextgarden/context
wiki : https://wiki.contextgarden.net
___


[NTG-context] Re: checkbox in fields show the word yes

2023-10-05 Thread juh via ntg-context
Hi,

three years later I would like to hint to this thread again and ask if
there is hope that checkboxes will work better in Acrobat any time soon. 

Am Fri, Dec 11, 2020 at 06:28:36PM +0100 schrieb Hans Hagen:
> On 12/11/2020 6:13 PM, Andres Conrado Montoya wrote:
> > Firefox doesn't show the "yes", nor Acrobat X, but SumatraPDF does. I
> > modified your definition as:
> > 
> > \definefield[test][check][cbox][][]
> > 
> > And now the "yes" doesn't appear. However, I don't know how this affects
> > the functionality of the form.
> these symbols (esp how deafults are handles) has alwaye been a bit of a mess
> in acrobat (read: different per version) and relates to appearance streams
> and such (when a form is made in acrobat these streams get added, it could
> even be some dingbat kicking in or being vectorized or ... seen all kind of
> variants) ... officially a rendering should listen to some keys that relate
> to it but this is not always the case
> 
> (part of the problem is, i think, that esp for check fields a bugs or
> behaviour  has become a feature which makes it kin dof inconsisten twith the
> rest of the widgets .. it's even worse when one uses parent / child across
> pages ... it hasn;t helped that hardly any viewer supported it which in turn
> means no feedback)
> 
> (in lmtx iu could probably generate appearance streams but i'll only do that
> when i have an application for these widgets so that i can test it)
> 
> Hans
> 
> -
>   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
> ___

-- 
Autoren-Homepage: . http://literatur.hasecke.com
Satiren & Essays: . http://www.sudelbuch.de
Privater Blog:  http://www.hasecke.eu
Netzliteratur-Projekt:  http://www.generationenprojekt.de




signature.asc
Description: PGP signature
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : {listname} / https://mailman.ntg.nl/mailman3/lists/{list_id}
webpage  : https://www.pragma-ade.nl / https://context.aanhet.net (mirror)
archive  : https://github.com/contextgarden/context 
wiki : https://wiki.contextgarden.net
___


Re: [NTG-context] Contractions in ligature suppression word list

2022-06-07 Thread Denis Maier via ntg-context
A somewhat more complete testfile with a couple of options is below. My context 
installation is not current so please double check, but I think it boils down 
to this:  apostrophes seem not to be considered to be part of a word. Once I 
enable wolfin under \startlanguageoptions[en] it will disable the fi-ligature 
everywhere below, but adding the word variants with an apostroph doesn’t do 
anything, neither to the explicit wordlist under startlanguageoptions, nor in 
one of the additional goodies files.

Denis

Von: Thangalin 
Gesendet: Dienstag, 7. Juni 2022 02:14
An: Maier, Denis Christian (UB) 
Cc: mailing list for ConTeXt users ; Bruce Horrocks 

Betreff: Re: [NTG-context] Contractions in ligature suppression word list

Here's a short example (version 2022.05.11 11:36):

\setuplanguage[en][goodies={lang-en.llg}]

\starttext
  % Expected: no ligature; actual: as expected
  wolfish

  % Expected: no ligatures; actual: ligature
  wolfing
  wolfin'
  wolfin’
\stoptext


%%
%%

\startluacode
-- Testfile for fi ligature over suffix boundary

local testoversuffixboundary = {
  name= "test-over-suffix-boundary",
  options = {
{
patterns = {fi  = "f|i",},
words = [[ wolf ]],
suffixes = [[
in'
in’
]],
},
  },
}

-- Testfile for fi ligature in word with apostroph
local testwithsuffix = {
  name= "test-with-suffix",
  options = {
{
patterns = {fi  = "f|i",},
words = [[ wolfin' wolfin’ ]],
},
  },
}

-- which table do we want to test?
-- table.save("test.llg",testoversuffixboundary)
table.save("test",testwithsuffix)
\stopluacode

\setuplanguage[en][goodies={lang-en.llg,test.llg}]

% explicit suppression
\startlanguageoptions[en]
wolf|in' % this here doesn't do anything
wolf|in’ % this here doesn't do anything either
%wolf|in % this here disables the fi ligature across the board for all the 
words below
\stoplanguageoptions


\mainlanguage[en]

\starttext

% defined in lang-en.llg => works
   wolfish
   wolfing

  % Expected: no ligatures; actual: ligature
  wolfin'
  wolfin’

  % shibboleth
  wolfin

\stoptext
___
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
___


Re: [NTG-context] Contractions in ligature suppression word list

2022-06-06 Thread Thangalin via ntg-context
Here's a short example (version 2022.05.11 11:36):

\setuplanguage[en][goodies={lang-en.llg}]

\starttext
  % Expected: no ligature; actual: as expected
  wolfish

  % Expected: no ligatures; actual: ligature
  wolfing
  wolfin'
  wolfin’
\stoptext
___
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
___


Re: [NTG-context] Contractions in ligature suppression word list

2022-06-06 Thread Denis Maier via ntg-context
Could you please share a complete MWE. Makes it easier to test if the problem 
occurs here as well.
Best,
Denis

Von: ntg-context  Im Auftrag von Thangalin via 
ntg-context
Gesendet: Montag, 6. Juni 2022 23:56
An: Bruce Horrocks 
Cc: Thangalin ; mailing list for ConTeXt users 

Betreff: Re: [NTG-context] Contractions in ligature suppression word list

Thanks for the response, Bruce.


1) The file you attached doesn't include the word "wolfing", nor "wolfin". I 
assume they need to be

The suffixes section accounts for this. Wolfing and wolfish both suppress the 
ligature correctly.

I removed the comma separators, good catch. No difference, though.

Looks like I edited 
/opt/context/tex/texmf-context/tex/context/patterns/mkxl/lang-en.llg instead of 
the LMTX file. SMH.

I've now tried both files, lmtx and mkxl:

suffixes = [[
in
in'
in’
ing
]],

Wolfish works fine, the ligature is suppressed as expected. Wolfing, wolfin, 
and wolfin' aren't suppressed. I'd have thought that defining the word "wolf" 
with a suffix of "ing" (and variations thereof) would suppress ligatures at the 
suffix boundary?

Maybe that's not the case. If so, then it means having to define all the *f-ing 
words (heh) a few times for the different suffixes (in', in’, and ing), which 
seems to defeat the purpose of separating suffixes?

Help is appreciated.
___
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
___


Re: [NTG-context] Contractions in ligature suppression word list

2022-06-06 Thread Thangalin via ntg-context
Thanks for the response, Bruce.


1) The file you attached doesn't include the word "wolfing", nor "wolfin".
> I assume they need to be


The suffixes section accounts for this. Wolfing and wolfish both suppress
the ligature correctly.

I removed the comma separators, good catch. No difference, though.

Looks like I edited
/opt/context/tex/texmf-context/tex/context/patterns/mkxl/lang-en.llg
instead of the LMTX file. SMH.

I've now tried both files, lmtx and mkxl:

suffixes = [[
in
in'
in’
ing
]],

Wolfish works fine, the ligature is suppressed as expected. Wolfing,
wolfin, and wolfin' aren't suppressed. I'd have thought that defining the
word "wolf" with a suffix of "ing" (and variations thereof) would suppress
ligatures at the suffix boundary?

Maybe that's not the case. If so, then it means having to define all the
*f-ing words (heh) a few times for the different suffixes (in', in’, and
ing), which seems to defeat the purpose of separating suffixes?

Help is appreciated.
___
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
___


Re: [NTG-context] Contractions in ligature suppression word list

2022-06-06 Thread Bruce Horrocks via ntg-context


> On 6 Jun 2022, at 06:37, Thangalin via ntg-context  wrote:
> 
> Attached are tweaked endings for words like "wolf" to include contracted 
> endings, but they are being ignored. This makes for a minor inconsistency:
> 
>   wolfing -- no ligature
>   wolfish -- no ligature
>   wolfin -- no ligature (incorrect spelling, though)
>   wolfin' -- ligature
> 
> Any ideas? I tried adding various -in suffixes without luck:
> 
> suffixes = [[
> in,
> in',
> in’,
> ing
> ]],
> 
> See https://wiki.contextgarden.net/Ligatures#Word_suppression for an example 
> usage.
> 
> Thank you!
> 

I'm probably missing something here but...

1) The file you attached doesn't include the word "wolfing", nor "wolfin". I 
assume they need to be added into the f|i section? Wolfish *is* present so I'm 
not sure why it's being ignored unless there is an error being generated as a 
result of point (2) below, causing the whole file to be ignored.

2) Your suffixes list has comma separators - all the other word lists use 
whitespace as a separator.

3) Lastly, dumb question but... have you checked that you edited the right 
file? In my ConTeXt install there are two "lang-en.llg" files - one under 
/context-osx-64/tex/texmf-context/tex/context/patterns/lmtx and the other 
under .../patterns/mkxl

—
Bruce Horrocks
Hampshire, UK

___
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
___


[NTG-context] Contractions in ligature suppression word list

2022-06-05 Thread Thangalin via ntg-context
Attached are tweaked endings for words like "wolf" to include contracted
endings, but they are being ignored. This makes for a minor inconsistency:

  wolfing -- no ligature
  wolfish -- no ligature
  wolfin -- no ligature (incorrect spelling, though)
  wolfin' -- ligature

Any ideas? I tried adding various -in suffixes without luck:

suffixes = [[
in,
in',
in’,
ing
]],

See https://wiki.contextgarden.net/Ligatures#Word_suppression for an
example usage.

Thank you!


lang-en.llg
Description: Binary data
___
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
___


Re: [NTG-context] Word wrap of 'part' titles

2022-04-18 Thread Bruce Horrocks via ntg-context


> On 18 Apr 2022, at 22:10, Wolfgang Schuster via ntg-context 
>  wrote:
> 
> Bruce Horrocks via ntg-context schrieb am 18.04.2022 um 22:46:
>> In the MWE below the 'part' title is centred but on one line only and, 
>> because it is a long title, the beginning and end are lost off the sides of 
>> the page.
>> 
>> If it were a 'chapter' title then I could insert '\\' to cause a line break 
>> at that point. However this does not seem to work for 'part'.
>> 
>> Is there a way of making 'part' titles wrap the same way that 'chapter' 
>> titles do?
>> 
>> % ---begin---
>> \define[2]\placePartTitle{\midaligned{#2}}
>> 
>> \definehead [Part] [part]
>> \setuphead[Part]
>> [ placehead=yes,
>> style={\tfd},
>> command=\placePartTitle,
>> ]
> 
> \setuphead
> [Part]
> [placehead=yes,
> style=\tfd,
> align=middle,
> number=no]

Thanks very much for the quick and helpful reply.

—
Bruce Horrocks
Hampshire, UK

___
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
___


Re: [NTG-context] Word wrap of 'part' titles

2022-04-18 Thread Aditya Mahajan via ntg-context
On Mon, 18 Apr 2022, Wolfgang Schuster via ntg-context wrote:

> Bruce Horrocks via ntg-context schrieb am 18.04.2022 um 22:46:
> > In the MWE below the 'part' title is centred but on one line only and,
> because it is a long title, the beginning and end are lost off the sides of
> the page.
> >
> > If it were a 'chapter' title then I could insert '\\' to cause a line break
> at that point. However this does not seem to work for 'part'.
> >
> > Is there a way of making 'part' titles wrap the same way that 'chapter'
> titles do?
> >
> > % ---begin---
> > \define[2]\placePartTitle{\midaligned{#2}}
> >
> > \definehead [Part] [part]
> > \setuphead[Part]
> >[ placehead=yes,
> >  style={\tfd},
> >  command=\placePartTitle,
> >]
> 
> \setuphead
>    [Part]
>    [placehead=yes,
>     style=\tfd,
>     align=middle,
>     number=no]

Or use:

align={middle,broad},

which has slightly better alignment for titles, IMHO. There is also 
`alternative=middle`. 

Aditya___
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
___


Re: [NTG-context] Word wrap of 'part' titles

2022-04-18 Thread Wolfgang Schuster via ntg-context

Bruce Horrocks via ntg-context schrieb am 18.04.2022 um 22:46:

In the MWE below the 'part' title is centred but on one line only and, because 
it is a long title, the beginning and end are lost off the sides of the page.

If it were a 'chapter' title then I could insert '\\' to cause a line break at 
that point. However this does not seem to work for 'part'.

Is there a way of making 'part' titles wrap the same way that 'chapter' titles 
do?

% ---begin---
\define[2]\placePartTitle{\midaligned{#2}}

\definehead [Part] [part]
\setuphead[Part]
   [ placehead=yes,
 style={\tfd},
 command=\placePartTitle,
   ]


\setuphead
  [Part]
  [placehead=yes,
   style=\tfd,
   align=middle,
   number=no]

Wolfgang

___
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
___


[NTG-context] Word wrap of 'part' titles

2022-04-18 Thread Bruce Horrocks via ntg-context
In the MWE below the 'part' title is centred but on one line only and, because 
it is a long title, the beginning and end are lost off the sides of the page.

If it were a 'chapter' title then I could insert '\\' to cause a line break at 
that point. However this does not seem to work for 'part'.

Is there a way of making 'part' titles wrap the same way that 'chapter' titles 
do?

% ---begin---
\define[2]\placePartTitle{\midaligned{#2}}

\definehead [Part] [part]
\setuphead[Part]
  [ placehead=yes,
style={\tfd},
command=\placePartTitle,
  ]
  
\starttext
\startPart[title={A very long part title that needs to be wrapped manually}]
Some body text
\stopPart
\stoptext
%---end---

—
Bruce Horrocks
Hampshire, UK

___
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
___


Re: [NTG-context] \WORD regression

2021-12-10 Thread Henning Hraban Ramm via ntg-context

Am 10.12.21 um 12:53 schrieb Wolfgang Schuster:

Henning Hraban Ramm via ntg-context schrieb am 10.12.2021 um 08:20:

Am 09.12.21 um 19:00 schrieb Henning Hraban Ramm via ntg-context:


\starttext
\WORD{größer}
\stoptext

\WORD used to handle "ß" correctly, i.e. convert it to "SS"; now it 
makes "sS".


(If the current font contains an uppercase ß that would be even 
better, but those are rare).


I can’t tell when it changed (some LMTX versions ago) and can’t check 
MkIV, since "mtxrun --generate --luatex" doesn’t work.


Hans sent me a fix, I guess it will be included in the next upload.

And yes, uppercase ß (ẞ, U1E9E) would be even better, even according 
to the official German orthography rules since 2017, but there are 
still not many fonts that have it.


\usemodule[lingual-de]

\enabledirectives[fonts.uppercasesharps]

\setupbodyfont[libertinus]

\starttext
\WORD{größer}
\stoptext


Cool, thank you!

It would have been kind of a wonder if ConTeXt wouldn’t already contain 
something like that... ;)


Hraban
___
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
___


Re: [NTG-context] \WORD regression

2021-12-10 Thread Wolfgang Schuster via ntg-context

Henning Hraban Ramm via ntg-context schrieb am 10.12.2021 um 08:20:

Am 09.12.21 um 19:00 schrieb Henning Hraban Ramm via ntg-context:


\starttext
\WORD{größer}
\stoptext

\WORD used to handle "ß" correctly, i.e. convert it to "SS"; now it 
makes "sS".


(If the current font contains an uppercase ß that would be even 
better, but those are rare).


I can’t tell when it changed (some LMTX versions ago) and can’t check 
MkIV, since "mtxrun --generate --luatex" doesn’t work.


Hans sent me a fix, I guess it will be included in the next upload.

And yes, uppercase ß (ẞ, U1E9E) would be even better, even according 
to the official German orthography rules since 2017, but there are 
still not many fonts that have it.


\usemodule[lingual-de]

\enabledirectives[fonts.uppercasesharps]

\setupbodyfont[libertinus]

\starttext
\WORD{größer}
\stoptext

Wolfgang

___
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
___


Re: [NTG-context] \WORD regression

2021-12-09 Thread Hans Hagen via ntg-context

On 12/10/2021 8:20 AM, Henning Hraban Ramm via ntg-context wrote:

Am 09.12.21 um 19:00 schrieb Henning Hraban Ramm via ntg-context:


\starttext
\WORD{größer}
\stoptext

\WORD used to handle "ß" correctly, i.e. convert it to "SS"; now it 
makes "sS".


(If the current font contains an uppercase ß that would be even 
better, but those are rare).


I can’t tell when it changed (some LMTX versions ago) and can’t check 
MkIV, since "mtxrun --generate --luatex" doesn’t work.


Hans sent me a fix, I guess it will be included in the next upload.

And yes, uppercase ß (ẞ, U1E9E) would be even better, even according to 
the official German orthography rules since 2017, but there are still 
not many fonts that have it.
if needed we could catch that with a fallback feature (could cover more 
such cases)


Hans


-
  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
___


Re: [NTG-context] \WORD regression

2021-12-09 Thread Henning Hraban Ramm via ntg-context

Am 09.12.21 um 19:00 schrieb Henning Hraban Ramm via ntg-context:


\starttext
\WORD{größer}
\stoptext

\WORD used to handle "ß" correctly, i.e. convert it to "SS"; now it 
makes "sS".


(If the current font contains an uppercase ß that would be even better, 
but those are rare).


I can’t tell when it changed (some LMTX versions ago) and can’t check 
MkIV, since "mtxrun --generate --luatex" doesn’t work.


Hans sent me a fix, I guess it will be included in the next upload.

And yes, uppercase ß (ẞ, U1E9E) would be even better, even according to 
the official German orthography rules since 2017, but there are still 
not many fonts that have it.


Hraban
___
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
___


[NTG-context] \WORD regression

2021-12-09 Thread Henning Hraban Ramm via ntg-context


\starttext
\WORD{größer}
\stoptext

\WORD used to handle "ß" correctly, i.e. convert it to "SS"; now it 
makes "sS".


(If the current font contains an uppercase ß that would be even better, 
but those are rare).


I can’t tell when it changed (some LMTX versions ago) and can’t check 
MkIV, since "mtxrun --generate --luatex" doesn’t work.


Hraban
___
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
___


Re: [NTG-context] weird word breaking in Win64

2021-05-08 Thread Hans Hagen

On 5/8/2021 1:33 PM, Pablo Rodriguez wrote:


This seems to be added by fonts.injections.method=advance.


Hm, i need to use an different trick then for a border case (currently a 
zwj injected).  Will do.


Hans


-
  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
___


Re: [NTG-context] weird word breaking in Win64

2021-05-08 Thread Pablo Rodriguez
On 5/8/21 3:58 PM, denis.ma...@ub.unibe.ch wrote:
> Looks like I can confirm this... see below. But it seems to depend on your 
> PDF viewer. Results in Sumatra and Acrobat differ.

Many thanks for your confirmation, Denis.

With SumatraPDF 3.1.2, I get lines without spaces between words, too.

But the wrong extra extra spaces inside some words are wrong even in
Acrobat.

Of course, I would like not have all correct spaces in SumatraPDF.

But the issue in Acrobat may be a bug.

Many tha thanks for your help,

Pablo


>
> current version: 2021.05.06 23:35
>
> Sumatra
> Coming back to the use of typefaces in
> electronic publishing: many of the new
> typog‍ raphersreceivetheirknowledgeand
> infor‍ mation about the rules of typog‍ ra-
> phy from books, from com‍ puter mag‍ a-
> zines or the instruction manuals which
> theygetwiththepurchaseofaPCorsoft-
> ware. There is not so much basic instruc-
> tion, as of now, as there was in the old
> days,showingthedifferencesbetweengood
> and bad typographic design. Many peo-
> plearejustfascinatedbytheirPC'stricks,
> andthinkthatawidely--praisedprogram,
> called up on the screen, will make every-
> thing automatic from now on.
>
> Acrobat
>
> Coming back to the use of typefaces in
> electronic publishing: many of the new
> typog raphers receive their knowledge and
> infor mation about the rules of typog raphy
> from books, from com puter mag azines
> or the instruction manuals which
> they get with the purchase of a PC or software.
> There is not so much basic instruction,
> as of now, as there was in the old
> days, showing the differences between good
> and bad typographic design. Many people
> are just fascinated by their PC's tricks,
> and think that a widely--praised program,
> called up on the screen, will make everything
> automatic from now on.
>

--
http://www.ousia.tk
___
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
___


Re: [NTG-context] weird word breaking in Win64

2021-05-08 Thread denis.maier
Looks like I can confirm this... see below. But it seems to depend on your PDF 
viewer. Results in Sumatra and Acrobat differ.

Denis


current version: 2021.05.06 23:35

Sumatra
Coming back to the use of typefaces in
electronic publishing: many of the new
typog‍ raphersreceivetheirknowledgeand
infor‍ mation about the rules of typog‍ ra-
phy from books, from com‍ puter mag‍ a-
zines or the instruction manuals which
theygetwiththepurchaseofaPCorsoft-
ware. There is not so much basic instruc-
tion, as of now, as there was in the old
days,showingthedifferencesbetweengood
and bad typographic design. Many peo-
plearejustfascinatedbytheirPC'stricks,
andthinkthatawidely--praisedprogram,
called up on the screen, will make every-
thing automatic from now on.

Acrobat

Coming back to the use of typefaces in
electronic publishing: many of the new
typog raphers receive their knowledge and
infor mation about the rules of typog raphy
from books, from com puter mag azines
or the instruction manuals which
they get with the purchase of a PC or software.
There is not so much basic instruction,
as of now, as there was in the old
days, showing the differences between good
and bad typographic design. Many people
are just fascinated by their PC's tricks,
and think that a widely--praised program,
called up on the screen, will make everything
automatic from now on.

> -Ursprüngliche Nachricht-
> Von: ntg-context  Im Auftrag von Pablo
> Rodriguez
> Gesendet: Samstag, 8. Mai 2021 13:33
> An: mailing list for ConTeXt users 
> Betreff: [NTG-context] weird word breaking in Win64
> 
> Dear list,
> 
> the following sample breaks some words not right in Win64 (I cannot
> reproduce it in Linux):
> 
>   \enabledirectives[fonts.injections.method=advance]
>   \setuppapersize[A6]
>   \definefontfamily[mainface][rm]
>   [TeX Gyre Pagella]
>   \setupbodyfont[mainface]
>   \starttext
> \input zapf
>   \stoptext
> 
> Copying text from latest Acrobat Reader DC, I get:
> 
>  Coming back to the use of typefaces in
>  electronic publishing: many of the new
>  typog raphers receive their knowledge and  infor mation about the rules of
> typog raphy  from books, from com puter mag azines  or the instruction
> manuals which  they get with the purchase of a PC or software.
>  There is not so much basic instruction,  as of now, as there was in the old
> days, showing the differences between good  and bad typographic design.
> Many people  are just fascinated by their PC's tricks,  and think that a 
> widely--
> praised program,  called up on the screen, will make everything  automatic
> from now on.
> 
> Lines 3-5 contain word breaks that make searching impossible.
> 
> This seems to be added by fonts.injections.method=advance.
> 
> Could anyone on Windows confirm this issue?
> 
> Many thanks for your help,
> 
> Pablo
> --
> http://www.ousia.tk
> __
> _
> 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
> __
> _
___
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
___


[NTG-context] weird word breaking in Win64

2021-05-08 Thread Pablo Rodriguez
Dear list,

the following sample breaks some words not right in Win64 (I cannot
reproduce it in Linux):

  \enabledirectives[fonts.injections.method=advance]
  \setuppapersize[A6]
  \definefontfamily[mainface][rm]
  [TeX Gyre Pagella]
  \setupbodyfont[mainface]
  \starttext
\input zapf
  \stoptext

Copying text from latest Acrobat Reader DC, I get:

 Coming back to the use of typefaces in
 electronic publishing: many of the new
 typog raphers receive their knowledge and
 infor mation about the rules of typog raphy
 from books, from com puter mag azines
 or the instruction manuals which
 they get with the purchase of a PC or software.
 There is not so much basic instruction,
 as of now, as there was in the old
 days, showing the differences between good
 and bad typographic design. Many people
 are just fascinated by their PC's tricks,
 and think that a widely--praised program,
 called up on the screen, will make everything
 automatic from now on.

Lines 3-5 contain word breaks that make searching impossible.

This seems to be added by fonts.injections.method=advance.

Could anyone on Windows confirm this issue?

Many thanks for your help,

Pablo
--
http://www.ousia.tk
___
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
___


Re: [NTG-context] No space between \cite and next word.

2021-04-18 Thread Mikael Sundqvist
Hi,

thanks! That seems like a fair list of commands.

To the mailing list: The commands listed in the previous mail all have
more than one argument (in square brackets [ ]). We had a discussion
off list, and commands such as \in will as I understood it also keep
spaces, but it has only one argument (in square brackets [ ], there
are two optional arguments in addition, but they come in braces { }).

I assume that I should wikify this, but I do not currently see where
it would be good to put it.

/Mikael

On Sun, Apr 18, 2021 at 1:40 PM Hans Hagen  wrote:
>
> On 4/16/2021 12:00 PM, Mikael Sundqvist wrote:
> > Hi,
> >
> > I think there has been some change recently. Is it on purpose that
> > there is no space after the \cite. Look how the parenthesis that ends
> > the citation and the word "text" are set without space inbetween.
> >
> > /Mikael
> >
> > \startbuffer[mybib]
> > @article{a,
> >author = {An Author},
> >title = {A title},
> >year = {2021},
> > }
> > \stopbuffer
> >
> > \usebtxdefinitions[apa]
> >   \usebtxdataset[mybib.buffer]
> >
> > \starttext
> >
> > Text \cite[a] text.
> >
> > \placelistofpublications
> >
> > \stoptext
> Wolfgang and I agreed upon the following commands keeping spaces
>
> \cite (and variants)
> \citation (and variants)
> \date
> \figuresymbol
> \note
> \notesymbol
> \symbol
> \typeinlinebuffer
> \externalfigure
>
> Hans
>
>
> -
>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
___


Re: [NTG-context] No space between \cite and next word.

2021-04-18 Thread Hans Hagen

On 4/16/2021 12:00 PM, Mikael Sundqvist wrote:

Hi,

I think there has been some change recently. Is it on purpose that
there is no space after the \cite. Look how the parenthesis that ends
the citation and the word "text" are set without space inbetween.

/Mikael

\startbuffer[mybib]
@article{a,
   author = {An Author},
   title = {A title},
   year = {2021},
}
\stopbuffer

\usebtxdefinitions[apa]
  \usebtxdataset[mybib.buffer]

\starttext

Text \cite[a] text.

\placelistofpublications

\stoptext

Wolfgang and I agreed upon the following commands keeping spaces

\cite (and variants)
\citation (and variants)
\date
\figuresymbol
\note
\notesymbol
\symbol
\typeinlinebuffer
\externalfigure

Hans


-
  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
___


[NTG-context] No space between \cite and next word.

2021-04-16 Thread Mikael Sundqvist
Hi,

I think there has been some change recently. Is it on purpose that
there is no space after the \cite. Look how the parenthesis that ends
the citation and the word "text" are set without space inbetween.

/Mikael

\startbuffer[mybib]
@article{a,
  author = {An Author},
  title = {A title},
  year = {2021},
}
\stopbuffer

\usebtxdefinitions[apa]
 \usebtxdataset[mybib.buffer]

\starttext

Text \cite[a] text.

\placelistofpublications

\stoptext
___
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
___


Re: [NTG-context] Ligature suppression word list

2021-04-12 Thread denis.maier
Hi,

a small update on this one :
I’ve built a small python script that uses the patterns from the selnolig 
package to extract words with suspicious ligatures from the word list provided 
by the Uni Leipzig corpus project. Running the script over a corpus of over 1 
million words produces the attached word list. The resulting list of words is 
not huge. That corpus gives us a list of about 790 words. I’ll need to check 
whether they already are in the goodies file or if I need to add them.

Anyway, I was thinking about making such a script more generic. Think of 
something along the lines of:
pdftotext book.pdf | showIncorrectLigatures.py > incorrect-ligatures.txt

Denis


Von: ntg-context  Im Auftrag von rh...@t-online.de
Gesendet: Mittwoch, 7. April 2021 20:20
An: ntg-context@ntg.nl
Betreff: Re: [NTG-context] Ligature suppression word list



Message: 2
Date: Tue, 6 Apr 2021 15:03:54 +
From: mailto:denis.ma...@ub.unibe.ch>>
To: mailto:j.ha...@xs4all.nl>>, 
mailto:ntg-context@ntg.nl>>
Subject: Re: [NTG-context] Ligature suppression word list
Message-ID: 
<41e6530172b54bffb7a82febff0a6...@ub.unibe.ch<mailto:41e6530172b54bffb7a82febff0a6...@ub.unibe.ch>>
Content-Type: text/plain; charset="iso-8859-1"


-Ursprüngliche Nachricht-
Von: Hans Hagen mailto:j.ha...@xs4all.nl>>
Gesendet: Samstag, 3. April 2021 17:58
An: mailing list for ConTeXt users 
mailto:ntg-context@ntg.nl>>; Maier, Denis
Christian (UB) mailto:denis.ma...@ub.unibe.ch>>
Betreff: Re: [NTG-context] Ligature suppression word list

[…]




2. A bigger solution might be to use selnoligs patterns in a script
   that can be run over a large corpus, such as the DWDS (Digitales
   Wörterbuch der deutschen Sprache). That should produce us a more
   complete list of words where ligatures must be suppressed.

where is that DWDS ... i can write some code to deal with it (i'd rather start
from the source than from some interpretation; who know what more there
is to uncover)

As it turn out, the linguists that helped with the selnolig package did use 
another corpus: Stuttgart "Deutsch" Web as Corpus
They describe their approach in that paper: 
https://raw.githubusercontent.com/SHildebrandt/selnolig-check/master/selnolig-check-documentation.pdf

A lot of  corpora can be found here: https://wortschatz.uni-leipzig.de/de
especially here: https://wortschatz.uni-leipzig.de/de/download/German

There are corpora of many other languages, too, such as English, French, Dutch, 
Spanish, Russian, Japanese, Latin, …

HTH

Ralf

Auftrag
Auftritt
Auftakt
Auflage
Auflösung
Aufträge
fünften
Auftraggeber
Auflagen
Auffassung
fünfte
Aufführung
Auftragseingang
auftreten
Auftritte
Fünftel
Straftaten
Auftragsbestand
Aufforderung
Auftreten
Auflistung
Auftrieb
Aufführungen
Straftat
auffällig
Auftragsvolumen
Auftragsbücher
Auffällig
Auftragseingänge
Schieflage
Auftragslage
auflösen
Auftragsbestätigung
Aufträgen
Cheftrainer
Fünfte
Auffinden
Kopftuch
auffallend
auffällige
elften
Auffassungen
Auflaufform
Auftraggebers
Auftritten
auffangen
offline
Auffahrt
Auftragswert
Fünfter
Auftaktveranstaltung
Auftragserteilung
Straftatbestand
auffüllen
Auflauf
Auftragnehmer
Dorffest
Kaufinteresse
Straftäter
auftauchen
elfte
Auffallend
fünften Mal
fünfter
Auffälligkeiten
Auftragsvergabe
Kaufinteressenten
auffindbar
auftretenden
Auffahrunfall
Prüfling
aufladen
auflaufen
Auftrages
Auftrags
Dampflokomotiven
auffälliges
fünftägigen
Auflösungen
Auftragen
Hofladen
Schlaflosigkeit
auftretende
Aufladen
Aufladung
Auflockerung
Auftaktspiel
Auftragsbüchern
Auftritts
Briefträger
Prüflinge
Schlaflabor
Schlaftabletten
kampflos
Auftaktquartal
Auftauchen
Auftragsabwicklung
Auftragseingängen
Dampflok
Hoffest
Tiefflug
auffallen
auffrischen
auffälliger
auffälligsten
schlaflose
Auffrischung
Auffällige
Auflehnung
Auflieger
Auftraggebern
Auftragssumme
Brieftasche
Elfter
Straftätern
auffälligste
fünftes
schlaflose Nächte
tarifliche
Auffahrunfälle
Auflagenhöhe
Auflassung
Auftaktsieg
Auftragsbearbeitung
Auftragseingangs
Auftragsmord
Auftragsrückgang
Auftretens
Kopfteil
Kopftuchverbot
Scheffler
Tariflohn
Tieflader
auffälligen
auftragsbezogen
Auffanglager
Aufführungspraxis
Auflockerungen
Auflösungsvertrag
Auftanken
Auftragnehmers
Auftragsbestände
Auftragsbuch
Auftragseinbruch
Auftragsplus
Auftrittsmöglichkeiten
Brieffreund
Golffahrer
Kopftücher
Offline
Tiefladern
auffallende
auffordern
aufführen
auflegen
auftauen
auftragen
auftreiben
fünftägige
schlaflosen
Auffahrten
Auffahrunfällen
Auffanggesellschaft
Aufforderungscharakter
Aufforstung
Auffälligstes
Auffüllen
Auflagefläche
Auflaufen
Auflösungserscheinungen
Auftauen
Auftragsannahme
Auftragsarbeiten
Auftragskomposition
Auftragsminus
Auftragsmorde
Auftrittsort
Brieffreundin
Brieffreundschaft
Brieftaschen
Brieftauben
Cheftrainer Andreas Hirsch
Fünften
Fünftes
Kampffeld
Kaufinteressent
Kopfleiste
Surftipps
Surftips
Tiefland
aufleben
auflockern
auftanken
auftrumpfen
stoffliche
tiefliegenden
A

Re: [NTG-context] Ligature suppression word list

2021-04-08 Thread Hans Hagen

On 4/8/2021 9:37 PM, Arthur Rosendahl wrote:


   Dutch, by contrast, does not seem so well served: the OpenTaal group
is dormant and no longer offers the hyphenated word list that was once
available (that was already the case five years ago).  The most relevant
page I find: https://www.opentaal.org/projecten/woordafbreking is from
2009.  There have apparently been recent updates by a single person (who
incidentally sometimes contributes to the German hyphenation working
group), but they’re rather generic.
fwiw: They are active in collecting words (they also do stuff for open 
office). Dutch patterns don't chaneg much because the hyphenation is 
syllable based and predictable enough I think. There haven't been that 
many released of dutch patterns.


Hans

-
  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
___


Re: [NTG-context] Ligature suppression word list

2021-04-08 Thread Arthur Rosendahl
On Sat, Apr 03, 2021 at 06:02:10PM +0200, Hans Hagen wrote:
> german is just an example, dutch has some specific things, and i bet other
> languages have their demands so my aim is some general mechanism

  I appreciate that, but if you want to have data of sufficiently good
quality to use this mechanism for individual languages, you need to
invest a *lot* of time for each one of them.  German is one of the very
few languages I know of that has an active group of people working to
produce that data, the “Trennmuster people”, as Mojca calls them ;-)
Their word list supports many fine points of typography, even those that
few programs can use, for example weighted hyphenation.  Ligature
prevention came in as a side project.

  Dutch, by contrast, does not seem so well served: the OpenTaal group
is dormant and no longer offers the hyphenated word list that was once
available (that was already the case five years ago).  The most relevant
page I find: https://www.opentaal.org/projecten/woordafbreking is from
2009.  There have apparently been recent updates by a single person (who
incidentally sometimes contributes to the German hyphenation working
group), but they’re rather generic.

Best,

Arthur
___
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
___


Re: [NTG-context] Ligature suppression word list

2021-04-08 Thread denis.maier

Von: ntg-context  Im Auftrag von rh...@t-online.de
Gesendet: Mittwoch, 7. April 2021 20:20
An: ntg-context@ntg.nl
Betreff: Re: [NTG-context] Ligature suppression word list

A lot of  corpora can be found here: https://wortschatz.uni-leipzig.de/de
especially here: https://wortschatz.uni-leipzig.de/de/download/German

There are corpora of many other languages, too, such as English, French, Dutch, 
Spanish, Russian, Japanese, Latin, …

HTH

Ralf


Wow, exactly what I was looking for. Thanks!

Denis
___
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
___


Re: [NTG-context] Ligature suppression word list

2021-04-07 Thread rha17

> Message: 2
> Date: Tue, 6 Apr 2021 15:03:54 +
> From: mailto:denis.ma...@ub.unibe.ch>>
> To: mailto:j.ha...@xs4all.nl>>,  <mailto:ntg-context@ntg.nl>>
> Subject: Re: [NTG-context] Ligature suppression word list
> Message-ID: <41e6530172b54bffb7a82febff0a6...@ub.unibe.ch 
> <mailto:41e6530172b54bffb7a82febff0a6...@ub.unibe.ch>>
> Content-Type: text/plain; charset="iso-8859-1"
> 
>> -Ursprüngliche Nachricht-
>> Von: Hans Hagen mailto:j.ha...@xs4all.nl>>
>> Gesendet: Samstag, 3. April 2021 17:58
>> An: mailing list for ConTeXt users > <mailto:ntg-context@ntg.nl>>; Maier, Denis
>> Christian (UB) mailto:denis.ma...@ub.unibe.ch>>
>> Betreff: Re: [NTG-context] Ligature suppression word list

[…]

>> 
>>> 2. A bigger solution might be to use selnoligs patterns in a script
>>>that can be run over a large corpus, such as the DWDS (Digitales
>>>Wörterbuch der deutschen Sprache). That should produce us a more
>>>complete list of words where ligatures must be suppressed.
>> 
>> where is that DWDS ... i can write some code to deal with it (i'd rather 
>> start
>> from the source than from some interpretation; who know what more there
>> is to uncover)
> 
> As it turn out, the linguists that helped with the selnolig package did use 
> another corpus: Stuttgart "Deutsch" Web as Corpus
> They describe their approach in that paper: 
> https://raw.githubusercontent.com/SHildebrandt/selnolig-check/master/selnolig-check-documentation.pdf
>  
> <https://raw.githubusercontent.com/SHildebrandt/selnolig-check/master/selnolig-check-documentation.pdf>

A lot of  corpora can be found here: https://wortschatz.uni-leipzig.de/de 
<https://wortschatz.uni-leipzig.de/de>
especially here: https://wortschatz.uni-leipzig.de/de/download/German 
<https://wortschatz.uni-leipzig.de/de/download/German>

There are corpora of many other languages, too, such as English, French, Dutch, 
Spanish, Russian, Japanese, Latin, …

HTH

Ralf

___
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
___


Re: [NTG-context] Ligature suppression word list

2021-04-06 Thread denis.maier
> -Ursprüngliche Nachricht-
> Von: Hans Hagen 
> Gesendet: Samstag, 3. April 2021 17:58
> An: mailing list for ConTeXt users ; Maier, Denis
> Christian (UB) 
> Betreff: Re: [NTG-context] Ligature suppression word list
> 
> On 4/3/2021 5:06 PM, denis.ma...@ub.unibe.ch wrote:
> > Hi everyone
> >
> > Now that Hans has implemented the new ligature suppression mechanism
> > via language goodies - thanks again Hans! - we now need to come up
> > with wordlists.
> >
> > I've started working on a list of German words with ligatures that
> > should be suppressed. The list is derived from the word list that
> > comes with the lualatex selnolig package:
> > https://github.com/micoloretan/selnolig/blob/master/selnolig-german-wo
> > rdlist.tex
> > <https://github.com/micoloretan/selnolig/blob/master/selnolig-german-w
> > ordlist.tex>
> >
> > You can find the current list here :
> > https://github.com/denismaier/context-nolig-wordlist
> > <https://github.com/denismaier/context-nolig-wordlist>
> >
> > The list is currently organized as follows :
> >
> >  1. L.25-l.35: This specifies words where automatic pattern matching is
> > more difficult than usually because the words contain multiple
> > ligatures, some of which must be suppressed while others must be
> > preserved. In the case of « Auflagefläche » it's even the same
> > combination of letters. So here, we use the bar | to manually
> > indicate points where no ligature must occur.
> >  2. L. 36ff.: The vast amount of words is currently in that list that
> > specifies words where a ff, fl, fi, ffi, or ffl ligature has to be
> > broken up after the first f.
> >  3. L.1804ff contain words where ffi, ffl, or fff ligatures have to be
> > prevented after the second f, so the first two fs form a ligature.
> >  4. The remaining blocks starting at L.1900, l. 2073, l. 2157, l. 2225,
> > and l. 2277 suppress ligatures for « ft » and « fft »,  « fb » and
> > « ffb », « fh » and « ffh», «fj» and «ffj», and «fk» and «ffk»
> >
> > Obviously, that list is far from being complete, and the question is
> > if it ever can be. Please have a look and feel free to propose more
> > words to be included - either via mail or directly on github.
> >
> > More generally, there's the question how such a list should be enhanced?
> > I was thinking about two options:
> >
> >  1. The new language options features include a tracker that allows for
> > tracking for which words in a given document ligature prevention
> > happened, and which words haven't been touched by the mechanism. It
> > should be possible to analyze the log file and to create lists of
> > words with ligatures. Should be a rather simple step to derive new
> > words for the ligature-suppression wordlist.
> >  2. A bigger solution might be to use selnoligs patterns in a script
> > that can be run over a large corpus, such as the DWDS (Digitales
> > Wörterbuch der deutschen Sprache). That should produce us a more
> > complete list of words where ligatures must be suppressed.
> 
> where is that DWDS ... i can write some code to deal with it (i'd rather start
> from the source than from some interpretation; who know what more there
> is to uncover)

As it turn out, the linguists that helped with the selnolig package did use 
another corpus: Stuttgart "Deutsch" Web as Corpus
They describe their approach in that paper: 
https://raw.githubusercontent.com/SHildebrandt/selnolig-check/master/selnolig-check-documentation.pdf

Denis

___
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
___


Re: [NTG-context] Ligature suppression word list

2021-04-06 Thread denis.maier


> -Ursprüngliche Nachricht-
> Von: Hans Hagen 
> Gesendet: Samstag, 3. April 2021 17:58
> An: mailing list for ConTeXt users ; Maier, Denis
> Christian (UB) 
> Betreff: Re: [NTG-context] Ligature suppression word list
> 
> On 4/3/2021 5:06 PM, denis.ma...@ub.unibe.ch wrote:
> > Hi everyone
> >
> > Now that Hans has implemented the new ligature suppression mechanism
> > via language goodies - thanks again Hans! - we now need to come up
> > with wordlists.
> >
> > I've started working on a list of German words with ligatures that
> > should be suppressed. The list is derived from the word list that
> > comes with the lualatex selnolig package:
> > https://github.com/micoloretan/selnolig/blob/master/selnolig-german-wo
> > rdlist.tex
> > <https://github.com/micoloretan/selnolig/blob/master/selnolig-german-w
> > ordlist.tex>
> >
> > You can find the current list here :
> > https://github.com/denismaier/context-nolig-wordlist
> > <https://github.com/denismaier/context-nolig-wordlist>
> >
> > The list is currently organized as follows :
> >
> >  1. L.25-l.35: This specifies words where automatic pattern matching is
> > more difficult than usually because the words contain multiple
> > ligatures, some of which must be suppressed while others must be
> > preserved. In the case of « Auflagefläche » it's even the same
> > combination of letters. So here, we use the bar | to manually
> > indicate points where no ligature must occur.
> >  2. L. 36ff.: The vast amount of words is currently in that list that
> > specifies words where a ff, fl, fi, ffi, or ffl ligature has to be
> > broken up after the first f.
> >  3. L.1804ff contain words where ffi, ffl, or fff ligatures have to be
> > prevented after the second f, so the first two fs form a ligature.
> >  4. The remaining blocks starting at L.1900, l. 2073, l. 2157, l. 2225,
> > and l. 2277 suppress ligatures for « ft » and « fft »,  « fb » and
> > « ffb », « fh » and « ffh», «fj» and «ffj», and «fk» and «ffk»
> >
> > Obviously, that list is far from being complete, and the question is
> > if it ever can be. Please have a look and feel free to propose more
> > words to be included - either via mail or directly on github.
> >
> > More generally, there's the question how such a list should be enhanced?
> > I was thinking about two options:
> >
> >  1. The new language options features include a tracker that allows for
> > tracking for which words in a given document ligature prevention
> > happened, and which words haven't been touched by the mechanism. It
> > should be possible to analyze the log file and to create lists of
> > words with ligatures. Should be a rather simple step to derive new
> > words for the ligature-suppression wordlist.
> >  2. A bigger solution might be to use selnoligs patterns in a script
> > that can be run over a large corpus, such as the DWDS (Digitales
> > Wörterbuch der deutschen Sprache). That should produce us a more
> > complete list of words where ligatures must be suppressed.
> 
> where is that DWDS ... i can write some code to deal with it (i'd rather start
> from the source than from some interpretation; who know what more there
> is to uncover)

The DWDS is here: https://www.dwds.de/
But I still need to check how we can extract the words from there...

Denis
___
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
___


Re: [NTG-context] Ligature suppression word list

2021-04-03 Thread Thangalin
Untested. Lists are not subject to copyright, so public domain should be
legal, even though SE posts are CC-BY-SA. When a word has a single suffix
or prefix (e.g., safflower/s), the two words are listed together, rather
than using an explicit suffix/prefix section.

return {
name   = "english",
version= "1.00",
comment= "English ligature suppression",
author = "Mico Loretan, Dave Jarvis, & Hans Hagen",
copyright  = "Public domain",
options= {
{
actions = {
["|"] = "noligature"
},
words = [[
]],
},
{
patterns = {
fi  = "f|i",
fl  = "f|l",
},
words = [[
-- f|i
deafish
dwarfish
elfish
oafish
selfish
serfish
unselfish
wolfish

-- f|l
beefless
briefless
hoofless
leafless
roofless
selfless
turfless
]],
suffixes = [[
ness
ly
]],
},
{
patterns = {
fi  = "f|i",
},
words = [[
proofing
]],
prefixes = [[
air-
child-
fire-
flame-
moth-
rust-
sound-
water-
weather-
]],
},
{
patterns = {
ff  = "f|f",
fi  = "f|i",
fl  = "f|l",
ffi = "f|fi",
ffl = "f|fl",
},
words = [[
-- f|f
bookshelfful
mantelshelfful
shelfful

-- f|i
elfin

chafing
leafing
loafing
sheafing
strafing
vouchsafing
beefing
reefing
briefing
debriefing
coifing
fifing
jackknifing
knifing
midwifing
waifing
wifing

goofing
hoofing
roofing
reroofing
spoofing
whoofing
woofing

gulfing
begulfing
engulfing
ingulfing
golfing
gulfing
rolfing
selfing
wolfing
barfing
bedwarfing
dwarfing
enserfing
kerfing
scarfing
snarfing
surfing
windsurfing
turfing
wharfing

beefier
comfier
goofier
gulfier
leafier
surfier
turfier
beefiest
comfiest
goofiest
gulfiest
leafiest
surfiest
turfiest

beefily
goofily
goofiness

-- f|l
aloofly
briefly
chiefly
deafly
liefly

calflike
dwarflike
elflike
gulflike
hooflike
leaflike
rooflike
serflike
sheaflike
shelflike
surflike
turflike
waiflike
wolflike

halflife
shelflife
halfline
roofline

leaflet
leaflets
leafleted
leafleting
leafletting
leafletted
leafleteer

pdflatex

-- f|fi
chaffinch
wolffish

-- f|fl
safflower
safflowers
]],
},
{
patterns = {
ffi = "ff|i",
},
words = [[
-- ff|i
cuffing
]],
prefixes = [[
hand
un
]]

Re: [NTG-context] Ligature suppression word list

2021-04-03 Thread Hans Hagen

On 4/3/2021 6:30 PM, Thangalin wrote:

A starting list of English non-ligatures:

https://english.stackexchange.com/a/50957/22099 



The entire SE thread has additional resources and is quite informative.

So can you make a file from that like we made as starting point for German?

Hans

-
  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
___


Re: [NTG-context] Ligature suppression word list

2021-04-03 Thread Hans Hagen

On 4/3/2021 5:06 PM, denis.ma...@ub.unibe.ch wrote:


<https://github.com/denismaier/context-nolig-wordlist>


For those interested, that file only has ligature prevention definitions.

{
   actions = {
   ["|"] = "noligature"
   },
   words = [[
   Auf|lagefläche
   Auf|lageflächen
   Auf|lagenziffer
   Auf|lagenziffern
   ]],
},

can be (lig prevention already in words):

{
   words = [[
   Auf|lagefläche
   Auf|lageflächen
   Auf|lagenziffer
   Auf|lagenziffern
   ]],
},

or the more efficient (first match only):

{
   actions = {
   ["|"] = "noligature"
   },
   matches = { 1 }
   words = [[
   Auflagefläche
   Auflageflächen
   Auflagenziffer
   Auflagenziffern
   ]],
},

or if you want all matches:

{
   actions = {
   ["|"] = "noligature"
   },
   words = [[
   Auflagefläche
   Auflageflächen
   Auflagenziffer
   Auflagenziffern
   ]],
},

or when you want no kerns either (of course on can also use the petterns 
key):


   actions = {
   ["|"] = "noligature nokern"
   },
   words = [[
 ef|fe
   ]],
},

btw, user will also be able to do this in a document source

\startlanguageoptions[de]
Zapf|innovation
whatever+innovation
\stoplanguageoptions

ligature prevention in the first and compound word in the next one.

so, one way to see what we need is if users try to analyze their 
'exceptions' if they have them defined at all, so that we can spot 
possible tricks needed,


(i might actually combine this with exceptions that normally come after 
this stage)


Hans


-
  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
___


Re: [NTG-context] Ligature suppression word list

2021-04-03 Thread Thangalin
A starting list of English non-ligatures:

https://english.stackexchange.com/a/50957/22099

The entire SE thread has additional resources and is quite informative.
___
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
___


Re: [NTG-context] Ligature suppression word list

2021-04-03 Thread Hans Hagen

On 4/3/2021 5:06 PM, denis.ma...@ub.unibe.ch wrote:


 1. The new language options features include a tracker that allows for
tracking for which words in a given document ligature prevention
happened, and which words haven’t been touched by the mechanism. It
should be possible to analyze the log file and to create lists of
words with ligatures. Should be a rather simple step to derive new
words for the ligature-suppression wordlist.
I already have some code for that but can't make you an update (garden 
is / will be down for some days due to maintenance).


Hans

-
  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
___


Re: [NTG-context] Ligature suppression word list

2021-04-03 Thread Hans Hagen

On 4/3/2021 5:20 PM, Arthur Rosendahl wrote:

On Sat, Apr 03, 2021 at 03:06:22PM +, denis.ma...@ub.unibe.ch wrote:

What do you think?


   I think you should collaborate with the group of volunteers working on
German hyphenation and related topics.  They have a mailing list (in
German): https://lists.dante.de/mailman/listinfo/trennmuster which is
quite active and where Mico Loretan, the author of selnolig,
occasionally posts.  I’m sure they’ll be happy to help with suggestions
and collaborative efforts, even if all of the main contributors use
LaTeX.


german is just an example, dutch has some specific things, and i bet 
other languages have their demands so my aim is some general mechanism 
(for which much is already in place btw) ... we're talking of a what i 
tag as 'languages goodies' just like we have 'font goodies' .. a plug in 
system


Hans

-
  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
___


Re: [NTG-context] Ligature suppression word list

2021-04-03 Thread Hans Hagen

On 4/3/2021 5:06 PM, denis.ma...@ub.unibe.ch wrote:

Hi everyone

Now that Hans has implemented the new ligature suppression mechanism via 
language goodies – thanks again Hans! – we now need to come up with 
wordlists.


I’ve started working on a list of German words with ligatures that 
should be suppressed. The list is derived from the word list that comes 
with the lualatex selnolig package: 
https://github.com/micoloretan/selnolig/blob/master/selnolig-german-wordlist.tex 
<https://github.com/micoloretan/selnolig/blob/master/selnolig-german-wordlist.tex>


You can find the current list here : 
https://github.com/denismaier/context-nolig-wordlist 
<https://github.com/denismaier/context-nolig-wordlist>


The list is currently organized as follows :

 1. L.25-l.35: This specifies words where automatic pattern matching is
more difficult than usually because the words contain multiple
ligatures, some of which must be suppressed while others must be
preserved. In the case of « Auflagefläche » it’s even the same
combination of letters. So here, we use the bar | to manually
indicate points where no ligature must occur.
 2. L. 36ff.: The vast amount of words is currently in that list that
specifies words where a ff, fl, fi, ffi, or ffl ligature has to be
broken up after the first f.
 3. L.1804ff contain words where ffi, ffl, or fff ligatures have to be
prevented after the second f, so the first two fs form a ligature.
 4. The remaining blocks starting at L.1900, l. 2073, l. 2157, l. 2225,
and l. 2277 suppress ligatures for « ft » and « fft »,  « fb » and
« ffb », « fh » and « ffh», «fj» and «ffj», and «fk» and «ffk»

Obviously, that list is far from being complete, and the question is if 
it ever can be. Please have a look and feel free to propose more words 
to be included – either via mail or directly on github.


More generally, there’s the question how such a list should be enhanced? 
I was thinking about two options:


 1. The new language options features include a tracker that allows for
tracking for which words in a given document ligature prevention
happened, and which words haven’t been touched by the mechanism. It
should be possible to analyze the log file and to create lists of
words with ligatures. Should be a rather simple step to derive new
words for the ligature-suppression wordlist.
 2. A bigger solution might be to use selnoligs patterns in a script
that can be run over a large corpus, such as the DWDS (Digitales
Wörterbuch der deutschen Sprache). That should produce us a more
complete list of words where ligatures must be suppressed.


where is that DWDS ... i can write some code to deal with it (i'd rather 
start from the source than from some interpretation; who know what more 
there is to uncover)


additional info: we're talking of a mechanism sort of integrated in the 
hyphenation loop, where we can also handle compound words, if needed 
with details about how influence to hyphenate these) so the above 
question involves:


- exceptions to exceptions
- replacements before hyphenation
- compound words (including lhmin/rhmin overloads)
- (left right two sided) ligature and/or kern prevention

and whatever we like/need more (within reasonable bounds),

Hans

-
  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
___


Re: [NTG-context] Ligature suppression word list

2021-04-03 Thread Arthur Rosendahl
On Sat, Apr 03, 2021 at 03:06:22PM +, denis.ma...@ub.unibe.ch wrote:
> What do you think?

  I think you should collaborate with the group of volunteers working on
German hyphenation and related topics.  They have a mailing list (in
German): https://lists.dante.de/mailman/listinfo/trennmuster which is
quite active and where Mico Loretan, the author of selnolig,
occasionally posts.  I’m sure they’ll be happy to help with suggestions
and collaborative efforts, even if all of the main contributors use
LaTeX.

Arthur
___
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
___


[NTG-context] Ligature suppression word list

2021-04-03 Thread denis.maier
Hi everyone

Now that Hans has implemented the new ligature suppression mechanism via 
language goodies - thanks again Hans! - we now need to come up with wordlists.

I've started working on a list of German words with ligatures that should be 
suppressed. The list is derived from the word list that comes with the lualatex 
selnolig package: 
https://github.com/micoloretan/selnolig/blob/master/selnolig-german-wordlist.tex

You can find the current list here : 
https://github.com/denismaier/context-nolig-wordlist

The list is currently organized as follows :


  1.  L.25-l.35: This specifies words where automatic pattern matching is more 
difficult than usually because the words contain multiple ligatures, some of 
which must be suppressed while others must be preserved. In the case of « 
Auflagefläche » it's even the same combination of letters. So here, we use the 
bar | to manually indicate points where no ligature must occur.
  2.  L. 36ff.: The vast amount of words is currently in that list that 
specifies words where a ff, fl, fi, ffi, or ffl ligature has to be broken up 
after the first f.
  3.  L.1804ff contain words where ffi, ffl, or fff ligatures have to be 
prevented after the second f, so the first two fs form a ligature.
  4.  The remaining blocks starting at L.1900, l. 2073, l. 2157, l. 2225, and 
l. 2277 suppress ligatures for « ft » and « fft »,  « fb » and « ffb », « fh » 
and « ffh», «fj» and «ffj», and «fk» and «ffk»

Obviously, that list is far from being complete, and the question is if it ever 
can be. Please have a look and feel free to propose more words to be included - 
either via mail or directly on github.

More generally, there's the question how such a list should be enhanced? I was 
thinking about two options:

  1.  The new language options features include a tracker that allows for 
tracking for which words in a given document ligature prevention happened, and 
which words haven't been touched by the mechanism. It should be possible to 
analyze the log file and to create lists of words with ligatures. Should be a 
rather simple step to derive new words for the ligature-suppression wordlist.
  2.  A bigger solution might be to use selnoligs patterns in a script that can 
be run over a large corpus, such as the DWDS (Digitales Wörterbuch der 
deutschen Sprache). That should produce us a more complete list of words where 
ligatures must be suppressed.

What do you think?

Best,
Denis
___
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
___


Re: [NTG-context] checkbox in fields show the word yes

2020-12-11 Thread Bruce Horrocks


> On 11 Dec 2020, at 08:21, Floris van Manen  wrote:
> 
> 
> 
> On 11/12/2020 08:46, Jan U. Hasecke wrote:
>> as nobody answered I would like too repeat my question.
> 
> This is what I see


On a Mac running BigSur...
1) using the TeXShop built-in PDF viewer I see the word "yes" inside the box
2) in the 'Preview' app I see "yes" in the box
3) using Adobe Acrobat Reader DC I get:
  a) Initially a blank / grey box
  b) Hovering the mouse over the grey bit displays "yes" and the cursor changes 
from I-beam to hand
  c) Single clicking displays the word "yes"
  d) Move focus to another app and the word "yes" is replaced with a tick mark 
in the box
  e) Move focus back to Acrobat, hover over the box and the tick mark changes 
to "yes"
  f) Click the tick and the box changes to "yes"
  g) Move focus to another app and the box changes to blank i.e. unticked

I've no idea whatsoever what to do about it or suggest which is why I didn't 
reply before.

--
Bruce Horrocks
Hampshire, UK

___
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
___


Re: [NTG-context] checkbox in fields show the word yes

2020-12-11 Thread Hans Hagen

On 12/11/2020 6:13 PM, Andres Conrado Montoya wrote:
Firefox doesn't show the "yes", nor Acrobat X, but SumatraPDF does. I 
modified your definition as:


\definefield[test][check][cbox][][]

And now the "yes" doesn't appear. However, I don't know how this affects 
the functionality of the form.
these symbols (esp how deafults are handles) has alwaye been a bit of a 
mess in acrobat (read: different per version) and relates to appearance 
streams and such (when a form is made in acrobat these streams get 
added, it could even be some dingbat kicking in or being vectorized or 
... seen all kind of variants) ... officially a rendering should listen 
to some keys that relate to it but this is not always the case


(part of the problem is, i think, that esp for check fields a bugs or 
behaviour  has become a feature which makes it kin dof inconsisten twith 
the rest of the widgets .. it's even worse when one uses parent / child 
across pages ... it hasn;t helped that hardly any viewer supported it 
which in turn means no feedback)


(in lmtx iu could probably generate appearance streams but i'll only do 
that when i have an application for these widgets so that i can test it)


Hans

-
  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
___


Re: [NTG-context] checkbox in fields show the word yes

2020-12-11 Thread Andres Conrado Montoya
Firefox doesn't show the "yes", nor Acrobat X, but SumatraPDF does. I
modified your definition as:

\definefield[test][check][cbox][][]

And now the "yes" doesn't appear. However, I don't know how this affects
the functionality of the form.

-- 
Andrés Conrado Montoya
Andi Kú
andresconr...@gmail.com
http://sesentaycuatro.com
http://messier87.com
http://chiquitico.org

Los fines no justifican los medios, porque la medida verdadera de nuestro
carácter está dada por los medios que estamos dispuestos a utilizar, no por
los fines que proclamamos.


“You develop an instant global consciousness, a people orientation, an
intense dissatisfaction with the state of the world, and a compulsion to do
something about it. From out there on the moon, international politics look
so petty. You want to grab a politician by the scruff of the neck and drag
him a quarter of a million miles out and say, ‘Look at that, you son of a
bitch.’” — Apollo 14 astronaut Edgar Mitchell
___
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
___


Re: [NTG-context] checkbox in fields show the word yes

2020-12-11 Thread Jan U. Hasecke
Dear all,

as nobody answered I would like too repeat my question.

If you open the MWE in Firefox, you see the word "yes" written in the
checkbox. Is there a way to avoid this?


Thanks a lot for your help.
juh

Am 17.11.20 um 13:50 schrieb Jan U. Hasecke:
> Hi all,
> 
> with this example I get a checkbox that does not work; in my real world
> document it works, I can't say why. But this minimal example shows the
> problem I have in my real document.
> 
> 
> \usemodule[fields]
> \setupinteraction [state=start]
> 
> \setupfield[cbox][width=1em,height=1em,option=printable,frame=on,offset=0.5mm,frameoffset=1mm,type=radio,color=black]
> \definefield[test][check][cbox][yes][no]
> 
> \starttext
> \field[test] \space Do you see the word »yes«?
> \stoptext
> 
> Unfortunately in Firefox and some other PDF Viewer there is the word
> "yes" written in the checkbox.
> 
> This makes the form useless as people think the given option is set to
> yes by default.
> 
> Can I avoid this somehow?
> 

___
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
___


Re: [NTG-context] checkbox in fields show the word yes

2020-12-11 Thread Floris van Manen



On 11/12/2020 08:46, Jan U. Hasecke wrote:

as nobody answered I would like too repeat my question.


This is what I see

___
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
___


Re: [NTG-context] Problem with word not hyphenating

2020-11-30 Thread Wolfgang Schuster

Pablo Rodriguez schrieb am 30.11.2020 um 17:16:

On 11/30/20 4:48 PM, Bruce Horrocks wrote:

The word "re-implementation" refuses to hyphenate and consequently
stick outs into the right margin.

I've tried using \hyphenation but it makes no difference.
[...]
Any suggestions, please?

Hi Bruce,

here you have a sample:

   \setuphyphenation[method=traditional]
   \registerhyphenationexception[en][re-im-ple-men-ta-tion]
   \starttext
   \startTEXpage[offset=1em]
   \hyphenatedword{re-implementation}\\
   \hyphenatedword{re||implementation}\\
   \hyphenatedword{re--implementation}\\
   \hyphenatedword{reimplementation}
   \stopTEXpage
   \stoptext

If you comment the first line, only "||" allows hyphenation.


Another option is to add \setbreakpoints[compound] to the document.

Wolfgang

___
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
___


Re: [NTG-context] Problem with word not hyphenating

2020-11-30 Thread Pablo Rodriguez
On 11/30/20 4:48 PM, Bruce Horrocks wrote:
> The word "re-implementation" refuses to hyphenate and consequently
> stick outs into the right margin.
>
> I've tried using \hyphenation but it makes no difference.
> [...]
> Any suggestions, please?

Hi Bruce,

here you have a sample:

  \setuphyphenation[method=traditional]
  \registerhyphenationexception[en][re-im-ple-men-ta-tion]
  \starttext
  \startTEXpage[offset=1em]
  \hyphenatedword{re-implementation}\\
  \hyphenatedword{re||implementation}\\
  \hyphenatedword{re--implementation}\\
  \hyphenatedword{reimplementation}
  \stopTEXpage
  \stoptext

If you comment the first line, only "||" allows hyphenation.

I hope it helps,

Pablo
--
http://www.ousia.tk
___
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
___


[NTG-context] Problem with word not hyphenating

2020-11-30 Thread Bruce Horrocks
The word "re-implementation" refuses to hyphenate and consequently stick outs 
into the right margin.

I've tried using \hyphenation but it makes no difference.

\showframe
\starttext
\hyphenation{re-im-ple-men-ta-tion}
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod
re-implementation
tempor incididunt ut labore et doloremagna aliqua. Ut enim ad minim veniam,
quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo 
consequat.
\stoptext

Any suggestions, please?

(LMTX current version: 2020.11.30 10:24)
--
Bruce Horrocks
Hampshire, UK

___
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
___


[NTG-context] checkbox in fields show the word yes

2020-11-17 Thread Jan U. Hasecke
Hi all,

with this example I get a checkbox that does not work; in my real world
document it works, I can't say why. But this minimal example shows the
problem I have in my real document.


\usemodule[fields]
\setupinteraction [state=start]

\setupfield[cbox][width=1em,height=1em,option=printable,frame=on,offset=0.5mm,frameoffset=1mm,type=radio,color=black]
\definefield[test][check][cbox][yes][no]

\starttext
\field[test] \space Do you see the word »yes«?
\stoptext

Unfortunately in Firefox and some other PDF Viewer there is the word
"yes" written in the checkbox.

This makes the form useless as people think the given option is set to
yes by default.

Can I avoid this somehow?

TIA juh
___
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
___


Re: [NTG-context] inter-word spacing

2020-10-22 Thread Jano Kula
Hello Julian!

Thank you for your hints.

On Thu, 22 Oct 2020 at 11:48, jbf  wrote:

> 1. One factor will be whether you are using \definefontfeature
> [default][default]  [expansion=quality,protrusion=quality], which you
> obviously then need to call in with \setupalign.
> https://wiki.contextgarden.net/Command/setupalign
>
This doesn't influence the dimension of space. Well, it does, but it is a
side effect of alignment and line breaking algorithm. One cannot change the
space to a particular value/factor.

2. Another factor will be \setupspacing
> https://wiki.contextgarden.net/Command/setupspacing
>
This would work if the parameter could be *dimension* (\setupspacing[5pt]),
but it cannot.


> 3. A third factor might be the need to tweak things a bit once you take a
> look at what is produced, and where you might need to use a couple of other
> options, be it \, \nospace, \thinspace
>
If one will finetune every space in the paragraph, this could be a way, but
it's far from a nice solution.

\setuplanguage[en][spacing=packed].
>
> This latter especially because I want to avoid some rather ugly spaces
> after a period.
>
Which is an equivalent of \frenchspacing primitive (only regular space
after period). In most languages spacing=packed is likely the default
setting.

Not at all sure if all the above is what the purists would do, but from a
> practical point of view it works for me.
>
Purists wouldn't change kerning at all, because the font designer knows
best, what kerning should be used. Anyway, once the graphic designer starts
changing leterspacing (kerning), the space correction is sometimes needed,
too. ConTeXt changes the space proportionally to \setupcharacterkerning,
which is fine in most cases.

For this use case (short text in one font) primitive \spaceskip3.2pt will
do the job (ragged text thus no glue). I was searching for the more
abstract solution like \setupspacing[factor=1.05], because once in a while
the correction is needed. Or font goodies could be the way to change
spacing.

Regards,
Jano
___
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
___


Re: [NTG-context] inter-word spacing

2020-10-22 Thread jbf

Hi Jano,

Seems to me that there are a few options and you might need more than 
one of them, depending on the font/typefaces you are using (which 
obviously influences things):


1. One factor will be whether you are using \definefontfeature 
[default][default]  [expansion=quality,protrusion=quality], which you 
obviously then need to call in with \setupalign. 
https://wiki.contextgarden.net/Command/setupalign


2. Another factor will be \setupspacing 
https://wiki.contextgarden.net/Command/setupspacing


3. A third factor might be the need to tweak things a bit once you take 
a look at what is produced, and where you might need to use a couple of 
other options, be it \, \nospace, \thinspace


For example, I have found that for a particular project I am working on 
at the moment, my best setup does not include protrusion, but I use


\setupalign
[hz,nothyphenated,verytolerant,stretched], and

\setuplanguage[en][spacing=packed].

This latter especially because I want to avoid some rather ugly spaces 
after a period. Then once I see how things look, I apply 
{\kerncharacters[-0.025] my text} in particular instances where things 
need to be tidied up. I have found that -0.025 works well in my situation.


Not at all sure if all the above is what the purists would do, but from 
a practical point of view it works for me. Hope it helps.


Julian

On 21/10/20 1:12 am, Jano Kula wrote:


Hello,

trying to reproduce the hand-printed original as close as possible I'm 
using \setupcharacterkerning. I can match character kerning, but 
inter-word spaces are different. What is the right option, command or 
feature to change it for current font and/or in the font definition? I 
haven't found any.


MWE
% macros=mkiv
\setupcharacterkerning[large][factor=0.1]
\setcharacterkerning[large]
\starttext
\input knuth
\stoptext

Thank you,
Jano

___
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
___
___
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
___


[NTG-context] inter-word spacing

2020-10-20 Thread Jano Kula
Hello,

trying to reproduce the hand-printed original as close as possible I'm
using \setupcharacterkerning. I can match character kerning, but inter-word
spaces are different. What is the right option, command or feature to
change it for current font and/or in the font definition? I haven't found
any.

MWE
% macros=mkiv
\setupcharacterkerning[large][factor=0.1]
\setcharacterkerning[large]
\starttext
\input knuth
\stoptext

Thank you,
Jano
___
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
___


Re: [NTG-context] removing word in filtered XML

2020-08-21 Thread Pablo Rodriguez
On 8/21/20 2:59 PM, Hans Hagen wrote:
> On 8/20/2020 4:20 PM, Pablo Rodriguez wrote:
>
>>\replaceword[whatever][this or][no]
>>\replaceword[whatever][that][]
> this feature creep is in the next upload

Hans,

many thanks for the new feature.

Pablo
--
http://www.ousia.tk
___
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
___


Re: [NTG-context] removing word in filtered XML

2020-08-21 Thread Hans Hagen

On 8/20/2020 4:20 PM, Pablo Rodriguez wrote:


   \replaceword[whatever][this or][no]
   \replaceword[whatever][that][]

this feature creep is in the next upload

Hans

-
  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
___


Re: [NTG-context] removing word in filtered XML

2020-08-20 Thread Pablo Rodriguez
On 8/20/20 1:10 PM, Hans Hagen wrote:
> On 8/20/2020 12:38 PM, Pablo Rodriguez wrote:
>> [...]
>> This time, I have to remove two words, such as in:
>>
>>string.gsub([[\xmlraw{#1}{.}]]," del ", " "):gsub(" de la ", " ")}
>>
>> But they could be more (and replacements might be added to that list).
>>
>> Is there a more elegant way than appending :gsub()?
>>
>> Is there also a proper way for word scanning?
>>
>> A "word" can be "Word ", " word " " word." " word?" (and so on). I would
>> like to avoid having to code all combinations (of course, if this were
>> already available).
>
> old stuff present for a long time ... probaly documented somewhere ...
> if not than you have to wikify it ...

Many thanks for your reply, Hans.

It is already wikified
(https://wiki.contextgarden.net/Ligatures#Replacements).

I wonder whether \replaceword could be extended to replace multiple
words and also to remove them.

  \starttext

  \replaceword[whatever][this or][no]
  \replaceword[whatever][that][]

  \startlines
  it is this or that
  {\setreplacements[whatever]it is this or that}
  {\setreplacements[whatever]it is this or that}
  it is this or that
  \stoplines

  \stoptext

Many thanks for your help,

Pablo
--
http://www.ousia.tk
___
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
___


Re: [NTG-context] removing word in filtered XML

2020-08-20 Thread Hans Hagen

On 8/20/2020 12:38 PM, Pablo Rodriguez wrote:

On 8/20/20 11:27 AM, Hans Hagen wrote:

On 8/19/2020 6:10 PM, Pablo Rodriguez wrote:

[...]
Is there any way to remove " of " and " of the " in the filtered content
(xml:special)?

Sorry, Lua code is crap for sure.

[...]
\startxmlsetups xml:initialize
  \xmlsetsetup{#1}{html}{xml:gen}
  \xmlsetsetup{#1}{span[@class='special']}{xml:span:special}
\stopxmlsetups
[...]
\startxmlsetups xml:span:special
  (\cldcontext{(string.gsub([[\xmlraw{#1}{.}]]," of the ", ""))})
\stopxmlsetups


Many thanks for your reply, Hans.

I now see that \xmlraw is the way to go.

I have two questions in word replacement and Lua (maybe there is some
lpeg magic that could be used).

This time, I have to remove two words, such as in:

   string.gsub([[\xmlraw{#1}{.}]]," del ", " "):gsub(" de la ", " ")}

But they could be more (and replacements might be added to that list).

Is there a more elegant way than appending :gsub()?

Is there also a proper way for word scanning?

A "word" can be "Word ", " word " " word." " word?" (and so on). I would
like to avoid having to code all combinations (of course, if this were
already available).
old stuff present for a long time ... probaly documented somewhere ... 
if not than you have to wikify it ...


\starttext

\replaceword[whatever][this][that]
\replaceword[whatever][that][this]

\startlines
it is this or that
{\setreplacements[whatever]it is this or that}
it is this or that
\stoplines

\stoptext



-
  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
___


Re: [NTG-context] removing word in filtered XML

2020-08-20 Thread Pablo Rodriguez
On 8/20/20 11:27 AM, Hans Hagen wrote:
> On 8/19/2020 6:10 PM, Pablo Rodriguez wrote:
>> [...]
>> Is there any way to remove " of " and " of the " in the filtered content
>> (xml:special)?
>>
>> Sorry, Lua code is crap for sure.
> [...]
> \startxmlsetups xml:initialize
>  \xmlsetsetup{#1}{html}{xml:gen}
>  \xmlsetsetup{#1}{span[@class='special']}{xml:span:special}
> \stopxmlsetups
> [...]
> \startxmlsetups xml:span:special
>  (\cldcontext{(string.gsub([[\xmlraw{#1}{.}]]," of the ", ""))})
> \stopxmlsetups

Many thanks for your reply, Hans.

I now see that \xmlraw is the way to go.

I have two questions in word replacement and Lua (maybe there is some
lpeg magic that could be used).

This time, I have to remove two words, such as in:

  string.gsub([[\xmlraw{#1}{.}]]," del ", " "):gsub(" de la ", " ")}

But they could be more (and replacements might be added to that list).

Is there a more elegant way than appending :gsub()?

Is there also a proper way for word scanning?

A "word" can be "Word ", " word " " word." " word?" (and so on). I would
like to avoid having to code all combinations (of course, if this were
already available).

Many thanks for your help,

Pablo
--
http://www.ousia.tk
___
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
___


Re: [NTG-context] removing word in filtered XML

2020-08-20 Thread Pablo Rodriguez
On 8/20/20 11:08 AM, Taco Hoekwater wrote:
> [...]
> There is pretty much always ‘a way’, but I do not know of a ’nice’ way.
> Your problem is that lxml.flush() and friends do not return a value,
> they just do a direct context(‘’) call behind the scenes with no
> return string for you to modify.

Many thanks for your explanation, Taco.

> Also, the special (catcode, space handling) rules for setups and \cldcontext
> do not help you.
>
> That does not mean it can’t be done. As I don’t know a of a nice way,
> here is a low-level ‘ugly' way:
>
> \startluacode
> function filter(a)
> local div = lxml.getid(a)
> process(div)
> lxml.flush(div)
> end
> function process(div)
> for c=1,#div.dt do
> if type(div.dt[c]) == 'string' then
> div.dt[c] = string.gsub(div.dt[c], " of the ", "")
> else
> process(div.dt[c])
> end
> end
> end
> \stopluacode
>
>  \startxmlsetups xml:special
>\ctxlua{filter([[#1]])}
>  \stopxmlsetups
>
> process() is recursive because your xml:special gets the whole .
> Not sure if you intended it that way. And if it can be done nicer, I
> am sure someone will correct me :)

You’re right, my xml:special wasn’t intended to get the whole . I
was tinkering with a previous sample. And I removed an \xmlfilter. Since
I got no output, I didn’t see what I was missing.

Many thanks for your help,

Pablo
--
http://www.ousia.tk
___
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
___


Re: [NTG-context] removing word in filtered XML

2020-08-20 Thread Hans Hagen

On 8/19/2020 6:10 PM, Pablo Rodriguez wrote:

Dear list,

I have the following sample:

   \startbuffer[demo]
   
 
   
 This is
   One of the best a paragraph.
 This is another paragraph.
 This is another
   Two of the best paragraph.
 This is another
   Three paragraph.
 This is another
   Four of five paragraph.
   
 
   
   \stopbuffer

   \startxmlsetups xml:initialize
 \xmlsetsetup{#1}{html}{xml:gen}
   \stopxmlsetups

   \xmlregistersetup{xml:initialize}

   \startxmlsetups xml:gen
  \xmlfilter{#1}{/**/div/command(xml:special)}
   \stopxmlsetups

   \startxmlsetups xml:special
 %~ \startitem
 \cldcontext{string.gsub(lxml.flush([[#1]]),
" of the ", "")}\stopitem
   \stopxmlsetups

   \starttext
 \xmlprocessbuffer{main}{demo}{}
   \stoptext

Is there any way to remove " of " and " of the " in the filtered content
(xml:special)?

Sorry, Lua code is crap for sure.

\startbuffer[demo]
  

  
This is One of the best a 
paragraph.

This is another paragraph.
This is another Two of the best 
paragraph.
This is another Three 
paragraph.
This is another Four of five 
paragraph.

  
  
This is One of the best a 
paragraph.

This is another paragraph.
This is another Two of the best 
paragraph.
This is another Three 
paragraph.
This is another Four of five 
paragraph.

  

  
\stopbuffer

\startxmlsetups xml:initialize
\xmlsetsetup{#1}{html}{xml:gen}
\xmlsetsetup{#1}{span[@class='special']}{xml:span:special}
\stopxmlsetups

\xmlregistersetup{xml:initialize}

\startxmlsetups xml:gen
\startitemize
\xmlfilter{#1}{/**/div/command(xml:special)}
\stopitemize
\stopxmlsetups

\startxmlsetups xml:special
\startitem
<\xmlflush{#1}>
\stopitem
\stopxmlsetups

\startxmlsetups xml:span:special
(\cldcontext{(string.gsub([[\xmlraw{#1}{.}]]," of the ", ""))})
\stopxmlsetups

\starttext
\xmlprocessbuffer{main}{demo}{}
\stoptext

Or make a finalizer as Taco posted.

Hans



-
  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
___


Re: [NTG-context] removing word in filtered XML

2020-08-20 Thread Taco Hoekwater


> On 19 Aug 2020, at 18:10, Pablo Rodriguez  wrote:
> 
> Dear list,
> 
> I have the following sample:
> 
>  \startbuffer[demo]
>  
>
>  
>This is
>  One of the best a paragraph.
>This is another paragraph.
>This is another
>  Two of the best paragraph.
>This is another
>  Three paragraph.
>This is another
>  Four of five paragraph.
>  
>
>  
>  \stopbuffer
> 
>  \startxmlsetups xml:initialize
>\xmlsetsetup{#1}{html}{xml:gen}
>  \stopxmlsetups
> 
>  \xmlregistersetup{xml:initialize}
> 
>  \startxmlsetups xml:gen
> \xmlfilter{#1}{/**/div/command(xml:special)}
>  \stopxmlsetups
> 
>  \startxmlsetups xml:special
>%~ \startitem
>\cldcontext{string.gsub(lxml.flush([[#1]]),
>   " of the ", "")}\stopitem
>  \stopxmlsetups
> 
>  \starttext
>\xmlprocessbuffer{main}{demo}{}
>  \stoptext
> 
> Is there any way to remove " of " and " of the " in the filtered content
> (xml:special)?

There is pretty much always ‘a way’, but I do not know of a ’nice’ way. 
Your problem is that lxml.flush() and friends do not return a value,
they just do a direct context(‘’) call behind the scenes with no
return string for you to modify.

Also, the special (catcode, space handling) rules for setups and \cldcontext
do not help you.

That does not mean it can’t be done. As I don’t know a of a nice way,
here is a low-level ‘ugly' way:

\startluacode
function filter(a)
local div = lxml.getid(a)
process(div)
lxml.flush(div)
end
function process(div)
for c=1,#div.dt do
if type(div.dt[c]) == 'string' then
div.dt[c] = string.gsub(div.dt[c], " of the ", "")
else 
process(div.dt[c]) 
end
end
end
\stopluacode

 \startxmlsetups xml:special
   \ctxlua{filter([[#1]])}
 \stopxmlsetups


process() is recursive because your xml:special gets the whole . Not sure 
if you intended it that way.
And if it can be done nicer, I am sure someone will correct me :)

Best wishes,
Taco
___
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
___


[NTG-context] removing word in filtered XML

2020-08-19 Thread Pablo Rodriguez
Dear list,

I have the following sample:

  \startbuffer[demo]
  

  
This is
  One of the best a paragraph.
This is another paragraph.
This is another
  Two of the best paragraph.
This is another
  Three paragraph.
This is another
  Four of five paragraph.
  

  
  \stopbuffer

  \startxmlsetups xml:initialize
\xmlsetsetup{#1}{html}{xml:gen}
  \stopxmlsetups

  \xmlregistersetup{xml:initialize}

  \startxmlsetups xml:gen
 \xmlfilter{#1}{/**/div/command(xml:special)}
  \stopxmlsetups

  \startxmlsetups xml:special
%~ \startitem
\cldcontext{string.gsub(lxml.flush([[#1]]),
   " of the ", "")}\stopitem
  \stopxmlsetups

  \starttext
\xmlprocessbuffer{main}{demo}{}
  \stoptext

Is there any way to remove " of " and " of the " in the filtered content
(xml:special)?

Sorry, Lua code is crap for sure.

Many thanks for your help,

Pablo
--
http://www.ousia.tk
___
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
___


Re: [NTG-context] Hyphentation/Linebreak after x characters inside \WORD?

2020-04-23 Thread Rik Kabel


On 4/23/2020 15:01, Benjamin Buchmuller wrote:

Sorry, I have just realized that the problem might not be \WORD{} actually, so 
this one hyphenates:

\define[2]\mycommand{
\startxrow
\startxcell o#1 \stopxcell
\startxcell \tt\WORD #2 \stopxcell
\stopxrow
}

Whereas these ones don’t:


\define[2]\mycommand{
\startxrow
\startxcell o#1 \stopxcell
\startxcell \tt\WORD #2-3' \stopxcell
\stopxrow
}

\define[2]\mycommand{
\startxrow
\startxcell o#1 \stopxcell
\startxcell 5'-\tt\WORD #2 \stopxcell
\stopxrow
}

Assuming that this has to do with the presence of “-“ which will be the 
preferred breakpoint. So, I guess the questions boils down to how to define the 
second argument of

\definebreakpoint[mybreaks][][nright=12,nleft=12,type=1]

in this case or how to “deactivate” the default \setbreakpoints[compound]?



On 23 Apr 2020, at 20:46, Benjamin Buchmuller  
wrote:

Hi again,

I am reading a CSV file into ConTeXt which contains long DNA sequences (>> 40 
characters) to place in xtables. So far, this works fine. However, I need to 
uppercase the entries and need to \tt them. When I do this inside \WORD however, they 
don’t hyphenate any more.

I’m using:

\defineseparatedlist
[mylist]
[
separator={,}, quotechar={"},
command=\mycommand
]

\define[2]\mycommand{
\startxrow
\startxcell o#1 \stopxcell
\startxcell 5’-{\tt\WORD{#2}}-3' \stopxcell
\stopxrow
}

Since I don’t have access to each entry, I cant place hyphenation marks 
directly. Is there a way to tell ConTeXt to hyphenate after say, 12 characters?

Thanks for your help.


Benjamin


The following works for me:

   \define[2]\mycommanda{
    \startxrow
    \startxcell o#1 \stopxcell
    \startxcell \tt\WORD #2 \stopxcell
    \stopxrow
    }

   \define[2]\mycommandb{
    \startxrow
    \startxcell o#1 \stopxcell
    \startxcell \tt\WORD #2-3' \stopxcell
    \stopxrow
    }

   \define[2]\mycommandc{
    \startxrow
    \startxcell o#1 \stopxcell
    \startxcell 5'-\tt\WORD #2 \stopxcell
    \stopxrow
    }

   \definebreakpoint[mybreaks][][nright=12,nleft=12,type=1]
   \setbreakpoints[mybreaks]

   \starttext

   \setupxtable[width=5cm]
   \startxtablex
   \mycommanda{A}{lsfkgjfkgshgkhigewhgajkdkfkalhfdklahfkhaakfakfh}
   \mycommandb{B}{lsfkgjfkgshgkhigewhgajkdkfkalhfdklahfkhaakfakfh}
   \mycommandc{C}{lsfkgjfkgshgkhigewhgajkdkfkalhfdklahfkhaakfakfh}
   \stopxtable

   \stoptext

Producing:

Indeed, it produces the same when nleft and nright are both set to 1 or 
12 or 100, but not when setbreakpoints is removed.


If you are trying to do something else, please provide an MWE.
___
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
___


Re: [NTG-context] Hyphentation/Linebreak after x characters inside \WORD?

2020-04-23 Thread Benjamin Buchmuller
Sorry, I have just realized that the problem might not be \WORD{} actually, so 
this one hyphenates:

\define[2]\mycommand{
\startxrow
\startxcell o#1 \stopxcell
\startxcell \tt\WORD #2 \stopxcell
\stopxrow
}

Whereas these ones don’t: 


\define[2]\mycommand{
\startxrow
\startxcell o#1 \stopxcell
\startxcell \tt\WORD #2-3' \stopxcell
\stopxrow
}

\define[2]\mycommand{
\startxrow
\startxcell o#1 \stopxcell
\startxcell 5'-\tt\WORD #2 \stopxcell
\stopxrow
}

Assuming that this has to do with the presence of “-“ which will be the 
preferred breakpoint. So, I guess the questions boils down to how to define the 
second argument of

\definebreakpoint[mybreaks][][nright=12,nleft=12,type=1]

in this case or how to “deactivate” the default \setbreakpoints[compound]?


> On 23 Apr 2020, at 20:46, Benjamin Buchmuller  
> wrote:
> 
> Hi again,
> 
> I am reading a CSV file into ConTeXt which contains long DNA sequences (>> 40 
> characters) to place in xtables. So far, this works fine. However, I need to 
> uppercase the entries and need to \tt them. When I do this inside \WORD 
> however, they don’t hyphenate any more.
> 
> I’m using:
> 
> \defineseparatedlist
>   [mylist]
>   [
>   separator={,}, quotechar={"},
>   command=\mycommand
>   ]
> 
> \define[2]\mycommand{
>   \startxrow
>   \startxcell o#1 \stopxcell
>   \startxcell 5’-{\tt\WORD{#2}}-3' \stopxcell
>   \stopxrow
>   }
> 
> Since I don’t have access to each entry, I cant place hyphenation marks 
> directly. Is there a way to tell ConTeXt to hyphenate after say, 12 
> characters?
> 
> Thanks for your help.
> 
> 
> Benjamin

___
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
___


[NTG-context] Hyphentation/Linebreak after x characters inside \WORD?

2020-04-23 Thread Benjamin Buchmuller
Hi again,

I am reading a CSV file into ConTeXt which contains long DNA sequences (>> 40 
characters) to place in xtables. So far, this works fine. However, I need to 
uppercase the entries and need to \tt them. When I do this inside \WORD 
however, they don’t hyphenate any more.

I’m using:

\defineseparatedlist
[mylist]
[
separator={,}, quotechar={"},
command=\mycommand
]

\define[2]\mycommand{
\startxrow
\startxcell o#1 \stopxcell
\startxcell 5’-{\tt\WORD{#2}}-3' \stopxcell
\stopxrow
}

Since I don’t have access to each entry, I cant place hyphenation marks 
directly. Is there a way to tell ConTeXt to hyphenate after say, 12 characters?

Thanks for your help.


Benjamin
___
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
___


Re: [NTG-context] Capitalize first word of first line within \startlines

2020-03-05 Thread Hans Hagen

On 3/5/2020 2:46 AM, Thangalin wrote:

If it helps, here's why I thought it would work:

https://wiki.contextgarden.net/Command/definefirstline

The wiki page shows that the macro takes a style option. The style
option links to:

https://wiki.contextgarden.net/Style_Alternatives

This page has a list of predefined styles and describes how to set up
an alternative style:

https://wiki.contextgarden.net/Style_Alternatives#Defining_a_Style_Alternative

 From the wiki page:

\definealternativestyle [head:neat]   [\WORD]   []

While \definealternativestyle[PoemFirstWord][{\bf\uppercasing}][] will
work for my needs, I am concerned that it is inconsistent wrt wiki
documentation, and also appears to expose an inconsistent API, as it
were. Is there any way to make the two conform to the same usage? That
is, it was not obvious (from the wiki) that I could not use "WORD" as
an alternative style even though it is literally listed and used as an
alternative style.
WORD is not a style but some operation on characters so it won't work 
here (ok, i could probably make it work but it would be ugly code) .. it 
happens that some operations can be uses as styles


Hans

-
  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
___


Re: [NTG-context] Capitalize first word of first line within \startlines

2020-03-04 Thread Thangalin
If it helps, here's why I thought it would work:

https://wiki.contextgarden.net/Command/definefirstline

The wiki page shows that the macro takes a style option. The style
option links to:

https://wiki.contextgarden.net/Style_Alternatives

This page has a list of predefined styles and describes how to set up
an alternative style:

https://wiki.contextgarden.net/Style_Alternatives#Defining_a_Style_Alternative

From the wiki page:

\definealternativestyle [head:neat]   [\WORD]   []

While \definealternativestyle[PoemFirstWord][{\bf\uppercasing}][] will
work for my needs, I am concerned that it is inconsistent wrt wiki
documentation, and also appears to expose an inconsistent API, as it
were. Is there any way to make the two conform to the same usage? That
is, it was not obvious (from the wiki) that I could not use "WORD" as
an alternative style even though it is literally listed and used as an
alternative style.

Thanks again!
___
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
___


Re: [NTG-context] Capitalize first word of first line within \startlines

2020-03-04 Thread Hans Hagen

On 3/4/2020 5:09 PM, Thangalin wrote:

Looking to uppercase the first word of a poem:

\setupindenting[yes, 0.75em]

\setupinitial[
   state=start,
   n=2,
   distance=\zeropoint,
]

% This does not appear to work?
\definealternativestyle[PoemFirstWord][\WORD][]

\definefirstline[PoemFirstLine][
   alternative=word,
   style=PoemFirstWord,
   n=1,
]

\definestartstop[poem][
   before={\startlines \setfirstline[PoemFirstLine] \placeinitial},
   after={\stoplines},
]

\setuplines[indenting=odd]

\starttext
\startpoem
Some say the world will end in fire,
Some say in ice.
 From what I've tasted of desire
I hold with those who favor fire.
But if it had to perish twice,
I think I know enough of hate
To say that for destruction ice
Is also great,
And would suffice.
\stoppoem
\stoptext

Any ideas why the first word is not capitalized?
because it is not applied to that stretch ... but i will send you 
something to play with ... kind of braindead trivial piece of code but 
it needs testing a bit


Hans



-
  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
___


[NTG-context] Capitalize first word of first line within \startlines

2020-03-04 Thread Thangalin
Looking to uppercase the first word of a poem:

\setupindenting[yes, 0.75em]

\setupinitial[
  state=start,
  n=2,
  distance=\zeropoint,
]

% This does not appear to work?
\definealternativestyle[PoemFirstWord][\WORD][]

\definefirstline[PoemFirstLine][
  alternative=word,
  style=PoemFirstWord,
  n=1,
]

\definestartstop[poem][
  before={\startlines \setfirstline[PoemFirstLine] \placeinitial},
  after={\stoplines},
]

\setuplines[indenting=odd]

\starttext
\startpoem
Some say the world will end in fire,
Some say in ice.
From what I've tasted of desire
I hold with those who favor fire.
But if it had to perish twice,
I think I know enough of hate
To say that for destruction ice
Is also great,
And would suffice.
\stoppoem
\stoptext

Any ideas why the first word is not capitalized?

Thank you!
___
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
___


[NTG-context] registers: subentry indentation different from word--number gap?

2019-07-12 Thread Sanjoy Mahajan
I don't think the current behavior is a bug, so the following is a
feature request:

With the following fairly minimal example

  \setupregister[index][indicator=no, distance=0.5em]

  \starttext

  ABC\index{x}DEF\index{x+yyz}

  \blank
  \placeindex
  \stoptext

the distance parameter sets (1) the hanging indentation of the 'yyz'
subentry and also (2) the distance between an entry and its pagenumber.
(That's what a look at strc-reg.mkiv shows too.)

It's a matter of taste, but my eye thinks that 0.5em is right for no. 2,
but too small for no. 1 -- whereas the default (1em) is just right for
no. 1 but too large for no. 2.

Thus, could the two dimensions be decoupled and bcome settable
indepently?  Perhaps keep 'distance' for the entry--pagenumber distance
(no. 2), which is its meaning on the wiki, and invent 'subdistance' for
the hanging indent (no. 1)?

I've just realized a cheap hack to do the same, so maybe it's not worth
messing with backward compatability by adding a new parameter.  The hack:

  \def\blah#1{#1\hskip-0.5em}
  \setupregister[index][indicator=no, distance=1em, textcommand=\blah]

-- 
-Sanjoy


Save Long Wharf Park in Boston Harbor!


Six reasoning tools to make hard problems easy.
___
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
___


Re: [NTG-context] Word and character count excluding TeX-directives

2018-01-16 Thread Rik Kabel

On 2018-01-16 09:26, Dr. Thomas Möbius wrote:

\definestartstop
    [abstract]
    [style=bold,
    after={\blank[big]}]

\starttext
\title{My title: example of a word and character count}

{\strut\tfx Formal guidelines: word count of abstract: $x$, character
count of main text: $x$, character count of figure captions: $x$.}
\blank

\startabstract
This is the abstract. Read this and that.
\stopabstract

% start of the main text
Some random text with formulas

\startformula
y = α + βx + ε, \quad ε \sim N(0,σ^2)
\stopformula

And there are also figures with captions.

\startplacefigure[
    location=bottom,
    title={Residual plot with time $t$ on the x-axis and
    residuals $e_{jt}$ on the y-axis},
    reference={fig:subject-residual}]
\externalfigure[residuals][height=.242\textheight]
\stopplacefigure

And some more text with $x$ and $y$ and $z$, and \placeformula

\startformula \startalign
\NC a =\NC b \NR
\NC c =\NC d \NR
\stopalign \stopformula

And stop.
\stoptext 


Try something based on this:

   \startluacode
    userdata = userdata or { }

    function userdata.wordcount(listname)
    filename = file.addsuffix(tex.jobname,"words")
    if lfs.isfile(filename) then
    local w = dofile(filename)
    if w then
    if type(w.categories[listname]) == "table" then
    context(w.categories[listname].total)
    else
    context(w.total)
    end
    context.par()
    end
    end
    end
   \stopluacode
   \def\wordcount{%
    \dosingleempty\dowordcount}
   \def\dowordcount[#1]{%
    \ctxlua{userdata.wordcount("#1")}}
   \setupspellchecking[state=start,method=2]
   \ctxlua{languages.words.threshold=1}

   \definestartstop
    [abstract]
    [style=bold,
    after={\blank[big]}]

   \starttext

    \setupspellchecking[list=abstract]

    \startabstract
    This is the abstract. Read this and that.
    \stopabstract

    \setupspellchecking[list=main]

    Some random text with formulas

    \startformula
    y = α + βx + ε, \quad ε \sim N(0,σ^2)
    \stopformula

    And there are also figures with captions.

    \setupspellchecking[list=figures]

    \startplacefigure[
  location=bottom,
  title={Residual plot with time $t$ on the x-axis and
  residuals $e_{jt}$ on the y-axis},
  reference={fig:subject-residual}]
  \externalfigure[residuals][height=.242\textheight]
    \stopplacefigure

    \setupspellchecking[list=main]

    And some more text with $x$ and $y$ and $z$, and \placeformula

    \startformula \startalign
    \NC a =\NC b \NR
    \NC c =\NC d \NR
    \stopalign \stopformula

    And stop.

    \setupspellchecking[state=stop]

   \title{My title: example of a word and character count}

    Abstract: \wordcount[abstract]
    Main: \wordcount[main]
    Figures: \wordcount[figures]
    Wordcount: \wordcount

   \stoptext

--
Rik

___
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
___

[NTG-context] Word and character count excluding TeX-directives

2018-01-16 Thread Dr . Thomas Möbius
To meet some formal guidelines, I need to provide a word count of my 
abstract and a character count of the main text, and a character count 
of all the text appearing in figure captions.


Is this possible (maybe using some lua-magic)?

Thank you!
Thomas


Minimal example:

\definestartstop
[abstract]
[style=bold,
after={\blank[big]}]

\starttext
\title{My title: example of a word and character count}

{\strut\tfx Formal guidelines: word count of abstract: $x$, character
count of main text: $x$, character count of figure captions: $x$.}
\blank

\startabstract
This is the abstract. Read this and that.
\stopabstract

% start of the main text
Some random text with formulas

\startformula
y = α + βx + ε, \quad ε \sim N(0,σ^2)
\stopformula

And there are also figures with captions.

\startplacefigure[
location=bottom,
title={Residual plot with time $t$ on the x-axis and
residuals $e_{jt}$ on the y-axis},
reference={fig:subject-residual}]
\externalfigure[residuals][height=.242\textheight]
\stopplacefigure

And some more text with $x$ and $y$ and $z$, and \placeformula

\startformula \startalign
\NC a =\NC b \NR
\NC c =\NC d \NR
\stopalign \stopformula

And stop.
\stoptext
___
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
___

Re: [NTG-context] ligatures/substituation at word boundaries

2017-07-30 Thread Hans Hagen

On 7/30/2017 11:39 AM, Ulrike Fischer wrote:

Am Fri, 28 Jul 2017 23:21:18 +0200 schrieb Hans Hagen:


Is it possible to refer in fonts.handlers.otf.addfeature to the word
boundary? The luatex manual speaks of a virtual "left_boundary"
char, but I couldn't find a way to use it.



It is possible to check against spaces in contextual lookups. There
isn't something like left boundary. I added some test code to the beta
but keep in mind that this will only work with self-made features.


Thanks. It seems to work quite good and after some playing around I
also got the knack of the syntax.

A few questions:

1. "lookups = { 1 }," refers to the first lookup. Is it possible to
name the lookups and to refer to this name?.


no, because order matters


2. 0xFFFC refers more or less to the begin and end of line, right?
Why doesn't it interfere with hyphenations? I tried to get
   ab-
ab

and the second wasn't replaced (as wanted) and I wondered how it
worked.


0xFFFC is just the same as "anything other than glyph or discretionary"


3. Why is in the following example "abcd" not replaced by "12"?


i'll have a look at this (advancing in somewhat messy defined)


\startluacode
  fonts.handlers.otf.addfeature {
  name= "test-a",
  type= "chainsubstitution",
  lookups = {
  {
  type = "ligature",
  data = {
  ['1'] = { "a", "b" },
  ['2'] = { "c", "d" },
  },
  },
  },
  data = {
  rules = {
  {
  before  = { { " ", 0xFFFC } },
  current = { { "a" }, { "b" } },
  lookups = { 1 },
  },
  {
  current = { { "c" }, { "d" } },
  after   = { { 0xFFFC, " " } },
  lookups = { 1 },
  },
  },
  },
  }


\stopluacode

\definefontfeature[test-a][test-a=yes]

\startbuffer
xxx abcd abxcd xxx
\stopbuffer

\starttext

\typebuffer

\definedfont[file:dejavu-serif.ttf*default] \getbuffer \blank
\definedfont[file:dejavu-serif.ttf*default,test-a] \getbuffer \blank

\stoptext



--

-
  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
___

Re: [NTG-context] ligatures/substituation at word boundaries

2017-07-30 Thread Ulrike Fischer
Am Fri, 28 Jul 2017 23:21:18 +0200 schrieb Hans Hagen:

>> Is it possible to refer in fonts.handlers.otf.addfeature to the word
>> boundary? The luatex manual speaks of a virtual "left_boundary"
>> char, but I couldn't find a way to use it.

> It is possible to check against spaces in contextual lookups. There 
> isn't something like left boundary. I added some test code to the beta 
> but keep in mind that this will only work with self-made features. 

Thanks. It seems to work quite good and after some playing around I
also got the knack of the syntax.

A few questions: 

1. "lookups = { 1 }," refers to the first lookup. Is it possible to
name the lookups and to refer to this name?.

2. 0xFFFC refers more or less to the begin and end of line, right?
Why doesn't it interfere with hyphenations? I tried to get 
  ab-
ab 

and the second wasn't replaced (as wanted) and I wondered how it
worked. 

3. Why is in the following example "abcd" not replaced by "12"? 


\startluacode
 fonts.handlers.otf.addfeature {
 name= "test-a",
 type= "chainsubstitution",
 lookups = {
 {
 type = "ligature",
 data = {
 ['1'] = { "a", "b" },
 ['2'] = { "c", "d" },
 },
 },
 },
 data = {
 rules = {
 {
 before  = { { " ", 0xFFFC } },
 current = { { "a" }, { "b" } },
 lookups = { 1 },
 },
 {
 current = { { "c" }, { "d" } },
 after   = { { 0xFFFC, " " } },
 lookups = { 1 },
 },
 },
 },
 }


\stopluacode

\definefontfeature[test-a][test-a=yes]

\startbuffer
xxx abcd abxcd xxx
\stopbuffer

\starttext

\typebuffer

\definedfont[file:dejavu-serif.ttf*default] \getbuffer \blank
\definedfont[file:dejavu-serif.ttf*default,test-a] \getbuffer \blank

\stoptext





-- 
Ulrike Fischer 
http://www.troubleshooting-tex.de/

___
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
___

Re: [NTG-context] ligatures/substituation at word boundaries

2017-07-28 Thread Hans Hagen

On 7/27/2017 8:09 PM, Ulrike Fischer wrote:

Is it possible to refer in fonts.handlers.otf.addfeature to the word
boundary? The luatex manual speaks of a virtual "left_boundary"
char, but I couldn't find a way to use it.

\startluacode
 fonts.handlers.otf.addfeature {
 name = "ltest",
 type = "ligature",
 data = {
 ['1'] = { "a", "b" },
 ['2'] = { "d", "a" },
 }
 }
\stopluacode

%how to replace only the start a

\startluacode
 fonts.handlers.otf.addfeature {
 name = "wtest",
 type = "ligature",
 data = {
 ['1'] = { "left_boundary", "a" },
 }
 }
\stopluacode

\definefontfeature[wtest][wtest=yes]
\definefontfeature[ltest][ltest=yes]
\starttext

 \definedfont[file:dejavu-serif.ttf*default]%


 {\addff{ltest} ababa\par}

 {\addff{wtest} ababa\par}


\stoptext
It is possible to check against spaces in contextual lookups. There 
isn't something like left boundary. I added some test code to the beta 
but keep in mind that this will only work with self-made features. (I 
have to check performance impact because I don't like making contextual 
lookups measurable slower due to some hardly used feature. First test 
show that it behaves ok.) In the test code below 0xFFFC is the boundary 
(this 0xFFFC check is the new thing). I adapted a few more things in the 
loader so best check that out too.


I'll upload a beta.

Hans

\starttext

\startluacode
fonts.handlers.otf.addfeature {
name= "test-a",
type= "chainsubstitution",
lookups = {
{
type = "substitution",
data = {
["a"] = "A",
["b"] = "B",
["c"] = "C",
["d"] = "D",
},
},
{
type = "ligature",
data = {
['1'] = { "a", "b" },
['2'] = { "c", "d" },
},
},
},
data = {
rules = {
{
before  = { { " ", 0xFFFC } },
current = { { "a" }, { "b" } },
lookups = { 2 },
},
{
current = { { "c" }, { "d" } },
after   = { { 0xFFFC, " " } },
lookups = { 2 },
},
{
current = { { "a" } },
after   = { { "b" } },
lookups = { 1 },
},
{
current = { { "c" } },
after   = { { "d" } },
lookups = { 1 },
},
},
},
}

fonts.handlers.otf.addfeature {
name= "test-b",
type= "chainsubstitution",
lookups = {
{
type = "ligature",
data = {
['1'] = { "a", "b" },
['2'] = { "c", "d" },
},
},
},
data = {
rules = {
{
-- the space is redundant as 0xFFFC contains it
before  = { { " ", 0xFFFC } },
current = { { "a" }, { "b" } },
lookups = { 1 },
},
{
current = { { "c" }, { "d" } },
-- the space is redundant as 0xFFFC contains it
after   = { { 0xFFFC, " " } },
lookups = { 1 },
},
},
},
}

fonts.handlers.otf.addfeature {
name= "test-c",
type= "chainsubstitution",
lookups = {
{
type = "ligature",
data = {
['1'] = { "a", "b" },
['2'] = { "c", "d" },
},
},
},
data = {
rules = {
{
before  = { { " " } },
current = { { "a" }, { "b" } },
lookups = { 1 },
},
{
current = { { "c" }, { "d" } },
after   = { { " " } },
   

[NTG-context] ligatures/substituation at word boundaries

2017-07-27 Thread Ulrike Fischer
Is it possible to refer in fonts.handlers.otf.addfeature to the word
boundary? The luatex manual speaks of a virtual "left_boundary"
char, but I couldn't find a way to use it. 

\startluacode
fonts.handlers.otf.addfeature {
name = "ltest",
type = "ligature",
data = {
['1'] = { "a", "b" },
['2'] = { "d", "a" },
}
}
\stopluacode

%how to replace only the start a

\startluacode
fonts.handlers.otf.addfeature {
name = "wtest",
type = "ligature",
data = {
['1'] = { "left_boundary", "a" },
}
}
\stopluacode

\definefontfeature[wtest][wtest=yes]
\definefontfeature[ltest][ltest=yes]
\starttext

\definedfont[file:dejavu-serif.ttf*default]%


{\addff{ltest} ababa\par}

{\addff{wtest} ababa\par}


\stoptext





-- 
Ulrike Fischer 
http://www.troubleshooting-tex.de/

___
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
___

[NTG-context] Greek word sorting

2017-04-01 Thread Pablo Rodriguez
Hans,

I have the following source:

\mainlanguage[agr]
\setupbodyfont[dejavu]
\defineregister[indexgr][indexgrs]
\setupregister[indexgr][pagenumber=no, balance=yes]
\define[1]\grcindx{#1\index{#1}\indexgr{#1}}
\setupregisters[n=3, pagenumber=no, method=default]
\setupregister[index][language=grc]
\setupregister[indexgr][language=gr]
\starttext
\grcindx{ἀδικία} \grcindx{ῥόδον} \grcindx{ρῶ } \grcindx{Ῥαδίον}
\grcindx{αὐτοῦ} \grcindx{αὐτός} \grcindx{αὑτοῦ} \grcindx{αὐτός}
\grcindx{Ἀφροδιτή} \grcindx{Ἁμαρτία} \grcindx{Αὐτός}
\grcindx{πάντα} \grcindx{δὲ} \grcindx{δέ} \grcindx{δ’} \grcindx{σ}
\grcindx{ς} \grcindx{Παυσανίας} \grcindx{Παυσανίας}
\section{Improved}
\placeindex
\section{Default}
\placeregister[indexgr]
\stoptext

Just for the sake of testing, I added the following sorting language to
sort-lang.lua:

8<-
definitions["grc"] = {
replacements = {
{ "α", "α" }, { "ά", "α" }, { "ὰ", "α" }, { "ὰ", "α" }, { "ᾳ",
"α" },
{ "ἀ", "α" }, { "ἁ", "α" }, { "ἄ", "α" }, { "ἂ", "α" }, { "ἆ",
"α" },
{ "ἁ", "α" }, { "ἅ", "α" }, { "ἃ", "α" }, { "ἇ", "α" }, { "ᾁ",
"α" },
{ "ᾴ", "α" }, { "ᾲ", "α" }, { "ᾷ", "α" }, { "ᾄ", "α" }, { "ὰ",
"α" },
{ "ᾅ", "α" }, { "ᾃ", "α" }, { "ᾆ", "α" }, { "ᾇ", "α" },
{ "ε", "ε" }, { "έ", "ε" }, { "ὲ", "ε" }, { "ἐ", "ε" }, { "ἔ",
"ε" },
{ "ἒ", "ε" }, { "ἑ", "ε" }, { "ἕ", "ε" }, { "ἓ", "ε" },
{ "η", "η" }, { "η", "η" }, { "ή", "η" }, { "ὴ", "η" }, { "ῆ",
"η" },
{ "ῃ", "η" }, { "ἠ", "η" }, { "ἤ", "η" }, { "ἢ", "η" }, { "ἦ",
"η" },
{ "ᾐ", "η" }, { "ἡ", "η" }, { "ἥ", "η" }, { "ἣ", "η" }, { "ἧ",
"η" },
{ "ᾑ", "η" }, { "ῄ", "η" }, { "ῂ", "η" }, { "ῇ", "η" }, { "ᾔ",
"η" },
{ "ᾒ", "η" }, { "ᾕ", "η" }, { "ᾓ", "η" }, { "ᾖ", "η" }, { "ᾗ",
"η" },
{ "ι", "ι" }, { "ί", "ι" }, { "ὶ", "ι" }, { "ῖ", "ι" }, { "ἰ",
"ι" },
{ "ἴ", "ι" }, { "ἲ", "ι" }, { "ἶ", "ι" }, { "ἱ", "ι" }, { "ἵ",
"ι" },
{ "ἳ", "ι" }, { "ἷ", "ι" }, { "ϊ", "ι" }, { "ΐ", "ι" }, { "ῒ",
"ι" },
{ "ῗ", "ι" },
{ "ο", "ο" }, { "ό", "ο" }, { "ὸ", "ο" }, { "ὀ", "ο" }, { "ὄ",
"ο" },
{ "ὂ", "ο" }, { "ὁ", "ο" }, { "ὅ", "ο" }, { "ὃ", "ο" },
{ "ρ", "ρ" }, { "ῤ", "ρ" }, { "ῥ", "ρ" },
{ "υ", "υ" }, { "ύ", "υ" }, { "ὺ", "υ" }, { "ῦ", "υ" }, { "ὐ",
"υ" },
{ "ὔ", "υ" }, { "ὒ", "υ" }, { "ὖ", "υ" }, { "ὑ", "υ" }, { "ὕ",
"υ" },
{ "ὓ", "υ" }, { "ὗ", "υ" }, { "ϋ", "υ" }, { "ΰ", "υ" }, { "ῢ",
"υ" },
{ "ω", "ω" }, { "ώ", "ω" }, { "ὼ", "ω" }, { "ῶ", "ω" }, { "ῳ",
"ω" },
{ "ὠ", "ω" }, { "ὤ", "ω" }, { "ὢ", "ω" }, { "ὦ", "ω" }, { "ᾠ",
"ω" },
{ "ὡ", "ω" }, { "ὥ", "ω" }, { "ὣ", "ω" }, { "ὧ", "ω" }, { "ᾡ",
"ω" },
{ "ῴ", "ω" }, { "ῲ", "ω" }, { "ῷ", "ω" }, { "ᾤ", "ω" }, { "ᾢ",
"ω" },
{ "ᾥ", "ω" }, { "ᾣ", "ω" }, { "ᾦ", "ω" }, { "ᾧ", "ω" },
{ "Α", "α" }, { "Ά", "α" }, { "Ὰ", "α" }, { "Ὰ", "α" }, { "ΑΙ",
"α" },
{ "Ἀ", "α" }, { "Ἁ", "α" }, { "Ἄ", "α" }, { "Ἂ", "α" }, { "Ἆ",
"α" },
{ "Ἁ", "α" }, { "Ἅ", "α" }, { "Ἃ", "α" }, { "Ἇ", "α" }, { "ἉΙ",
"α" },
{ "ΆΙ", "α" }, { "ᾺΙ", "α" }, { "Α͂Ι", "α" }, { "ἌΙ", "α" }, {
"Ὰ", "α" },
{ "ἍΙ", "α" }, { "ἋΙ", "α" }, { "ἎΙ", "α" }, { "ἏΙ", "α" },
{ "Ε", "ε" }, { "Έ", "ε" }, { "Ὲ", "ε" }, { "Ἐ", "ε" }, { "Ἔ",
"ε" },
{ "Ἒ", "ε" }, { "Ἑ", "ε" }, { "Ἕ", "ε" }, { "Ἓ", "ε" },
{ "Η", "η" }, { "Η", "η" }, { "Ή", "η" }, { "Ὴ", "η" }, { "Η͂",
"η" },
{ "ΗΙ", "η" }, { "Ἠ", "η" }, { "Ἤ", "η" }, { "Ἢ", "η" }, { "Ἦ",
"η" },
{ "ἨΙ", "η" }, { "Ἡ", "η" }, { "Ἥ", "η" }, { "Ἣ", "η" }, { "Ἧ",
"η" },
{ "ἩΙ", "η" }, { "ΉΙ", "η" }, { "ῊΙ", "η" }, { "Η͂Ι", "η" }, {
"ἬΙ", "η" },
{ "ἪΙ", "η" }, { "ἭΙ", "η" }, { "ἫΙ", "η" }, { "ἮΙ", "η" }, {
"ἯΙ", "η" },
{ "Ι", "ι" }, { "Ί", "ι" }, { "Ὶ", "ι" }, { "Ι͂", "ι" }, { "Ἰ",
"ι" },
{ "Ἴ", "ι" }, { "Ἲ", "ι" }, { "Ἶ", "ι" }, { "Ἱ", "ι" }, { "Ἵ",
"ι" },
{ "Ἳ", "ι" }, { "Ἷ", "ι" }, { "Ϊ", "ι" }, { "Ϊ́", "ι" }, {
"Ϊ̀", "ι" },
{ "Ϊ͂", "ι" },
{ "Ο", "ο" }, { "Ό", "ο" }, { "Ὸ", "ο" }, { "Ὀ", "ο" }, { "Ὄ",
"ο" },
{ "Ὂ", "ο" }, { "Ὁ", "ο" }, { "Ὅ", "ο" }, { "Ὃ", "ο" },
{ "Ρ", "ρ" }, { "Ρ̓", "ρ" }, { "Ῥ", "ρ" },
{ "Υ", "υ" }, { "Ύ", "υ" }, { "Ὺ", "υ" }, { "Υ͂", "υ" }, { "Υ̓",
"υ" },
{ "Υ̓́", "υ" }, { "Υ̓̀", "υ" }, { "Υ̓͂", "υ" }, { "Ὑ", "υ" }, {
"Ὕ", "υ" },
{ "Ὓ", "υ" }, { "Ὗ", "υ" }, { "Ϋ", "υ" }, { "Ϋ́", "υ" }, {
"Ϋ̀", "υ" },
{ "Ω", "ω" }, { "Ώ", "ω" }, { "Ὼ", "ω" }, { "Ω͂", "ω" }, { "ΩΙ",
"ω" },
{ "Ὠ", "ω" }, { "Ὤ", "ω" }, { "Ὢ", "ω" }, { "Ὦ", "ω" }, { "ὨΙ",
"ω" },
{ "Ὡ", "ω" }, { "Ὥ", "ω" }, { "Ὣ", "ω" }, { "Ὧ", "ω" }, { "ὩΙ",
"ω" },
{ "ΏΙ", "ω" }, { "ῺΙ", "ω" }, { "Ω͂Ι", "ω" }, { "ὬΙ", "ω" }, {
"ὪΙ", "ω" },
{ "ὭΙ", "ω" }, { "ὫΙ", "ω" }, { "ὮΙ", "ω" }, { "ὯΙ", "ω" 

Re: [NTG-context] inter-word space in bibliographies

2015-12-23 Thread Wolfgang Schuster



Alan Bowen <mailto:bowenala...@gmail.com>
17. Dezember 2015 um 18:06
The appended code is supposed to allow reduction of the inter-word 
spacing in my bibliographies but it does not. Adjusting the \spaceskip 
in the setups for [tightspace] does not seem to make any difference.


Any suggestions will be most welcome.


It works when you use the style key to set the \spaceskip value.

Wolfgang
___
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
___

Re: [NTG-context] inter-word space in bibliographies

2015-12-23 Thread Alan Bowen
Thanks, Wolfgang. It does indeed!

Season’s Best,

Alan

On Wed, Dec 23, 2015 at 9:00 AM, Wolfgang Schuster <
schuster.wolfg...@gmail.com> wrote:

>
> Alan Bowen <bowenala...@gmail.com>
> 17. Dezember 2015 um 18:06
> The appended code is supposed to allow reduction of the inter-word spacing
> in my bibliographies but it does not. Adjusting the \spaceskip in the
> setups for [tightspace] does not seem to make any difference.
>
> Any suggestions will be most welcome.
>
> It works when you use the style key to set the \spaceskip value.
>
> Wolfgang
>
>
> ___
> 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
>
> ___
>
___
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
___

[NTG-context] inter-word space in bibliographies

2015-12-17 Thread Alan Bowen
The appended code is supposed to allow reduction of the inter-word spacing
in my bibliographies but it does not. Adjusting the \spaceskip in the
setups for [tightspace] does not seem to make any difference.

Any suggestions will be most welcome.

I am using the latest beta (ConTeXt  ver: 2015.11.19 19:13 MKIV beta with
LuaTeX 0.85)

Alan

\startsetups[tightspace]
  \spaceskip .7\interwordspace plus .5\interwordstretch minus
\interwordshrink
\stopsetups

\def\dostartbibitem[#1]{\startBibItem[title={#1},reference={#1}]}
\def\startbibitem{\dosingleempty\dostartbibitem}
\def\stopbibitem{\stopBibItem}

\definedescription[BibItem][
width=broad,
margin=1.5pc,
indenting={no},
indentnext=no,
alternative=hanging,
hang=1,
headcommand=\gobbleoneargument,
align=right,
before={\directsetup{tightspace}\bgroup\language[packed]},
after={\egroup},
]

\starttext

Martin, J. 1956.
\emph{Histoire du texte des phénomènes d’Aratos}. Paris.

\startbibitem[Martin 1956]
Martin, J. 1956.
\emph{Histoire du texte des phénomènes d’Aratos}. Paris.
\stopbibitem


\stoptext
___
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
___

[NTG-context] Word wrap around framed text.

2015-03-19 Thread John Culleton
This passage works OK except for the lack of word
wrap around for the framed text.
--
\starttext
\chapter{Introduction}
The specialty food market has exploded. A combination of factors
has led to exciting opportunities for food entrepreneurs. Retail sales
of all specialty foods are generating revenues of more than 88
billion a year and averaging annual growth of more than 8
percent. To some, this means great opportunity. To others, it
represents a formidable challenge.  Your ability to grab a slice
of this pie and make your mark, establish your independence,
achieve success, and acquire wealth will depend on how
effectively you prepare-and prepare you must!  How to prepare for
the opportunities and challenges of taking your food products to
the appropriate store shelves is the subject of this guide. You
need not know the basics of small business operations just yet.
For now, success will depend on your personal and business
vision, drive, talent, and the amount of capital you can raise.
Let's put that last item into perspective: the average cost of
getting national grocery store shelf exposure for a new product
by a branded manufacturer has been estimated at more than \$6
million.  Still reading? Take heart. There is a proven
alternative: the specialty food industry. It has become the
proven vehicle for entry-level food distribution in the United
States. Different market segments and new products can be tested
in the specialty food industry without the initial investment
required of the major food producers. The secret has to do with
superior execution of often ordinary ideas





\section{How Long Does It Take to Be Successful?}
 
\section{How Much Will It Cost You?}
  Depending on your approach, you can
expect to incur minimum start-up costs of approximately \$35,000
to \$100,000 and more each year for the first three to five years.
This includes production, packaging, labeling, advertising, and
promotion of one product. It does {\it not}

\setupframed[framecorner=round,
frameradius=1em,
background=screen,
backgroundscreen=0.70,
backgroundcorner=round,
backgroundradius=1em,
corner=round,
radius=1em]
\startframedtext[right][width=3.2in]
\centerline{\ss\tfb Life Before Specialty}
\centerline{\ss\tfb Food Marketing}
What food entrepeneurs did before starting a specialty food firm (in order of
prevalence):
\startitemize[1]
\item Other business non-food-related (52\%)
\item food-related business (14\%)
\item Medical profession (11\%)
\item Education (8\%)
\item Nonprofit Charity (8\%)
\item Entertainment (3.6\%)
\stopitemize
---{Food Entrepeneur Magazine 2014 pool responses}
\stopframedtext
 include the cost of
success. Many firms that won Outstanding Product Awards were
ill prepared for the next move. Not all of them succeeded in
profiting from their good fortune. This estimated cost also
assumes that you will be doing a lot of the leg work
(administrative, invoicing, database management, and so on).
Our purpose is to explore the inner workings of {\bf niche
marketing.}
Niche marketing entails finding the best combination of product
packaging, pricing, positioning, and promotion that will
encourage the consumer to purchase a product not otherwise
offered by the major suppliers. Imagination is a key ingredient,
but adequate funding is essential. 
\stoptext

-

-- 
John Culleton
Wexford Press
Free list of books for self-publishers:
http://wexfordpress.net/shortlist.html
Updated PDF e-book: Create Book Covers with
Scribus 1.4.5 coming soon at
http://www.booklocker.com/!
___
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
___

Re: [NTG-context] checking the first word in a command

2015-01-27 Thread Pablo Rodriguez
On 01/26/2015 10:26 PM, Hans Hagen wrote:
 On 1/26/2015 10:04 PM, Pablo Rodriguez wrote:
 [...]
 How can I specify that the replacer takes not only strings but complete
 words?
 
  local replacer = lpeg.replacer {
   { señora, la señora },
   { señor, el señor },
  }

Many thanks for the advice, Hans.


Pablo
-- 
http://www.ousia.tk
___
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
___

Re: [NTG-context] checking the first word in a command

2015-01-26 Thread Otared Kavian
Hi Hans,

Nice code Hans!… But somehow your replacer code gives always « el » even in 
front of « señora »…
It seems that your lua code for replacer sees « señor » and does not check 
whether it is « señora » or not.
If one modifies a little bit the code into the following, the issue is solved: 
(changing « señora » into « senora »)
%%%
\startluacode

local replacer = lpeg.replacer {
[senora] = la señora,
[señor]  = el señor,
}

function document.MaleOrFemale(str)
   context(lpeg.match(replacer,str))
end

\stopluacode

\unexpanded\def\MaleOrFemale#1%
 {\ctxlua{document.MaleOrFemale(#1)}}

\starttext
whatever \MaleOrFemale{señor Juan Martínez} and \MaleOrFemale{senora María 
Pérez}
\stoptext
%%%

Is it possible to have your replacer check the entire first words?

Best regards: OK



 On 26 Jan 2015, at 18:43, Hans Hagen pra...@wxs.nl wrote:
 
 On 1/26/2015 5:49 PM, Pablo Rodriguez wrote:
 Dear list,
 
 I have the following sample:
 
 \starttext
 
 \def\Persona{señor Juan Martínez}
 \def\Persona{señora María Pérez}
 
 El/La \Persona\ ha aprobado.
 \stoptext
 
 How can I replace El/La in text with a command that can assign the
 proper article?
 
 I could use the translate module, but the real case is more complex than
 the previous sample.
 
 What I need in the command is that it can check the first word in the
 command \Persona and assign el or la.
 
 Which is the right way to do this?
 
 \startluacode
 
 local replacer = lpeg.replacer {
[señor]  = el señor,
[señora] = la señora,
 }
 
 function document.MaleOrFemale(str)
context(lpeg.match(replacer,str))
 end
 
 \stopluacode
 
 \unexpanded\def\MaleOrFemale#1%
  {\ctxlua{document.MaleOrFemale(#1)}}
 
 \starttext
 
 whatever \MaleOrFemale{señor Juan Martínez} and \MaleOrFemale{señora María 
 Pérez}
 
 \stoptext
 
 -
  Hans Hagen | PRAGMA ADE
  Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
tel: 038 477 53 69 | voip: 087 875 68 74 | 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
 ___

___
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
___

[NTG-context] checking the first word in a command

2015-01-26 Thread Pablo Rodriguez
Dear list,

I have the following sample:

\starttext

\def\Persona{señor Juan Martínez}
\def\Persona{señora María Pérez}

El/La \Persona\ ha aprobado.
\stoptext

How can I replace El/La in text with a command that can assign the
proper article?

I could use the translate module, but the real case is more complex than
the previous sample.

What I need in the command is that it can check the first word in the
command \Persona and assign el or la.

Which is the right way to do this?

Many thanks for your help,


Pablo
-- 
http://www.ousia.tk
___
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
___

Re: [NTG-context] checking the first word in a command

2015-01-26 Thread Hans Hagen

On 1/26/2015 5:49 PM, Pablo Rodriguez wrote:

Dear list,

I have the following sample:

 \starttext

 \def\Persona{señor Juan Martínez}
 \def\Persona{señora María Pérez}

 El/La \Persona\ ha aprobado.
 \stoptext

How can I replace El/La in text with a command that can assign the
proper article?

I could use the translate module, but the real case is more complex than
the previous sample.

What I need in the command is that it can check the first word in the
command \Persona and assign el or la.

Which is the right way to do this?


\startluacode

local replacer = lpeg.replacer {
[señor]  = el señor,
[señora] = la señora,
}

function document.MaleOrFemale(str)
context(lpeg.match(replacer,str))
end

\stopluacode

\unexpanded\def\MaleOrFemale#1%
  {\ctxlua{document.MaleOrFemale(#1)}}

\starttext

whatever \MaleOrFemale{señor Juan Martínez} and \MaleOrFemale{señora 
María Pérez}


\stoptext

-
  Hans Hagen | PRAGMA ADE
  Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
tel: 038 477 53 69 | voip: 087 875 68 74 | 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
___

Re: [NTG-context] checking the first word in a command

2015-01-26 Thread Hans Hagen

On 1/26/2015 10:04 PM, Pablo Rodriguez wrote:

On 01/26/2015 09:24 PM, Otared Kavian wrote:

Hi Hans,

Nice code Hans!… But somehow your replacer code gives always « el » even in 
front of « señora »…
It seems that your lua code for replacer sees « señor » and does not check 
whether it is « señora » or not.
If one modifies a little bit the code into the following, the issue is solved: 
(changing « señora » into « senora »)
%%%
\startluacode

local replacer = lpeg.replacer {
[senora] = la señora,
[señor]  = el señor,
}


Many thanks for your replies, Hans and Otared.

Adding a blank space after “señor” and “señora” is also a workaround for
this particular issue:

 local replacer = lpeg.replacer {
[señora ] = la señora ,
[señor ]  = el señor ,
 }

How can I specify that the replacer takes not only strings but complete
words?


local replacer = lpeg.replacer {
{ señora, la señora },
{ señor, el señor },
}




--

-
  Hans Hagen | PRAGMA ADE
  Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
tel: 038 477 53 69 | voip: 087 875 68 74 | 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
___

Re: [NTG-context] checking the first word in a command

2015-01-26 Thread Pablo Rodriguez
On 01/26/2015 09:24 PM, Otared Kavian wrote:
 Hi Hans,
 
 Nice code Hans!… But somehow your replacer code gives always « el » even in 
 front of « señora »…
 It seems that your lua code for replacer sees « señor » and does not check 
 whether it is « señora » or not.
 If one modifies a little bit the code into the following, the issue is 
 solved: (changing « señora » into « senora »)
 %%%
 \startluacode
 
 local replacer = lpeg.replacer {
   [senora] = la señora,
   [señor]  = el señor,
 }

Many thanks for your replies, Hans and Otared.

Adding a blank space after “señor” and “señora” is also a workaround for
this particular issue:

local replacer = lpeg.replacer {
[señora ] = la señora ,
[señor ]  = el señor ,
}

How can I specify that the replacer takes not only strings but complete
words?

Many thanks for your help,


Pablo
-- 
http://www.ousia.tk
___
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
___

Re: [NTG-context] Prevent hyphenation of the last word on a page

2014-07-09 Thread john Culleton
On Sat, 05 Jul 2014 12:02:11 +0200
H. Özoguz h.oezo...@mmnetz.de wrote:

 If its not possible at all, a small hint to
 this fact would help, too. So I could stop to
 search :)
 
 Huseyin
 ___
 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
 ___
 
 
 ___
 Unlimited Disk, Data Transfer, PHP/MySQL Domain
 Hosting http://www.doteasy.com 

The brute force method is to study the output and
wherever a word is hyphenated at the end of a page
enclose it in {}. This is not global of course.

-- 
John Culleton
Wexford Press
Free list of books for self-publishers:
http://wexfordpress.net/shortlist.html
PDF e-book: Create Book Covers with Scribus
available at
http://www.booklocker.com/books/4055.html
___
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
___


Re: [NTG-context] Prevent hyphenation of the last word on a page

2014-07-05 Thread H. Özoguz
If its not possible at all, a small hint to this fact would help, too. 
So I could stop to search :)


Huseyin
___
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
___


Re: [NTG-context] Prevent hyphenation of the last word on a page

2014-07-02 Thread H. Özoguz

http://article.gmane.org/gmane.comp.tex.context/45001/

Don’t know if luatex has brought any advance here…


Thanks Thomas, but \brokenpenalty seems to be simply ignored or 
overwritten, no effect.


See here a minexample:

\brokenpenalty 1
\starttext
\dorecurse{200}{Aprikosengeschmacksrichtung }
\stoptext

How to create a global command/rule to prevent hyphenation over two 
pages like in the example above?


Huseyin
___
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
___

[NTG-context] Prevent hyphenation of the last word on a page

2014-07-01 Thread H. Özoguz

Hello,

how to forbid hyphenation of the last word of page? Such that no word is 
broken onto two consecutive pages like this:


page 1: Diese Unter-
page 2: brechung ist unschön.

I think the question is clear without minexample. Of course I can use 
\unhyphenated and things like that, but I would like to set this globally.


Thanks!
Huseyin
___
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
___


Re: [NTG-context] Prevent hyphenation of the last word on a page

2014-07-01 Thread Thomas A. Schmitz
On 01 Jul 2014, at 14:40, H. Özoguz h.oezo...@mmnetz.de wrote:

 Hello,
 
 how to forbid hyphenation of the last word of page? Such that no word is 
 broken onto two consecutive pages like this:
 
 page 1: Diese Unter-
 page 2: brechung ist unschön.
 
 I think the question is clear without minexample. Of course I can use 
 \unhyphenated and things like that, but I would like to set this globally.
 
 Thanks!
 Huseyin

http://article.gmane.org/gmane.comp.tex.context/45001/

Don’t know if luatex has brought any advance here…

Thomas
___
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
___


[NTG-context] Protrusion with compound word hyphenation (||)

2014-07-01 Thread Rik Kabel
I notice that with compound words broken across lines protrusion does 
not get applied. This looks pretty rough when there are normal 
hyphenated words in the same paragraph.


WE (exaggerated, but demonstrates the point):

   \setuppapersize[monarch]
   \definefontfeature [default] [protrusion=quality]
   \setupalign[hanging]
   \setuptolerance[horizontal,strict]
   \setuphyphenmark   [sign=small]
   \showframe [text] [text]
   \starttext
   \dorecurse{21}{Multisyllabic||words||separated||by||hyphens. }
   \stoptext

Is this expected behavior? Can it be changed?
--
Rik Kabel
___
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
___

Re: [NTG-context] Protrusion with compound word hyphenation (||)

2014-07-01 Thread Wolfgang Schuster

Am 02.07.2014 um 03:16 schrieb Rik Kabel cont...@rik.users.panix.com:

 I notice that with compound words broken across lines protrusion does not get 
 applied. This looks pretty rough when there are normal hyphenated words in 
 the same paragraph.
 
 WE (exaggerated, but demonstrates the point):
 \setuppapersize[monarch]
 \definefontfeature [default] [protrusion=quality]
 \setupalign[hanging]
 \setuptolerance[horizontal,strict]
 \setuphyphenmark   [sign=small]
 \showframe [text] [text]
 \starttext
 \dorecurse{21}{Multisyllabic||words||separated||by||hyphens. }
 \stoptext
 Is this expected behavior? Can it be changed?

Use a normal hyphen and the \setbreakpoints command.

\setuppapersize[monarch]
\definefontfeature [default] [default] [protrusion=quality]
\setupalign[hanging]
\setuptolerance[horizontal,strict]
\setbreakpoints[compound]
\showframe [text] [text]
\starttext
\dorecurse{21}{Multisyllabic-words-separated-by-hyphens. }
\stoptext

Wolfgang

___
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
___

Re: [NTG-context] Character and word spacing

2014-05-31 Thread Hans Hagen

On 5/31/2014 4:14 PM, Rik Kabel wrote:


My issue with Dowding (and with Gill) is that they suggest that the compositor
has an obligation to change the author's text, without consultation and
agreement, in order to meet his concept of better page makeup. Dowding's
sensitivity to the appearance of the page, on the other hand, is sadly missing
from much of book publishing today.


Long ago I have been thinking of improving some \oneof {bad} 
{suboptimal} paragraphs by applying 'alternative' words, i.e. one could 
\optional {for instance} write like this.



Gross manipulation of the space factors is probably too crude to accomplish much
in implementing the style Dowding promotes, although the tightness in the second
tufte from your example (modifying the punctuation) may be a starting point.

With XeTeX, one can use \interchartoks to handle general (non-font-specific)
kerning between punctuation and certain letter shapes (sloped left or right,
ascender, descender, ...) beyond what any particular font's kerning tables
provide. I see nothing in MKIV that provides this, and thought that perhaps
\definecharacterspacing might fill the role. Hence the original question in this
thread.


you can play with (subtle) expansion (hz) and specific stretch vectors 
.. imo kerning other than what the font designer has in mind is normally 
a bad idea; another option is to use a font with different glyphs for 
the same character but I don't know of such fonts


Hans


-
  Hans Hagen | PRAGMA ADE
  Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
tel: 038 477 53 69 | voip: 087 875 68 74 | 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
___


[NTG-context] Character and word spacing

2014-05-29 Thread Rik Kabel
I am setting some text from Geoffrey Dowding's /Finer Points in the 
Spacing and Arrangement of Type/. I am trying to set it using his 
recommendations. For those not familiar with his book, the key point is 
that he promotes extremely tight spacing to achieve a uniform density 
across the page in the belief that this leads to a pleasing presentation 
and improved readability.


Among his recommendations is that an opening single quote together with 
the space preceding it should take up no more space than a normal word 
space, and similarly following a closing single quote; that the space 
after some punctuation be minimized (some of his commas appear to have 
perhaps just a hairspace, following them); that the space between 
punctuation and letters be adjusted according to the shape of the 
letter; and that 'and' be replaced by '' as necessary to improve word 
spacing. While this last is probably beyond the scope of ConTeXt, I am 
hoping that the first few might be managed through 
\definecharacterspacing, \setupcharacterspacing, and \setcharacterspacing.


Alas, I have found no documentation on this set of commands, and what I 
see in the source is opaque.


If you have pointers to the details of these commands, or other 
suggestions for such typographic exercises, please let me know.


--
Rik Kabel
___
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
___

Re: [NTG-context] Character and word spacing

2014-05-29 Thread Hans Hagen

On 5/29/2014 8:15 PM, Rik Kabel wrote:

I am setting some text from Geoffrey Dowding's /Finer Points in the
Spacing and Arrangement of Type/. I am trying to set it using his
recommendations. For those not familiar with his book, the key point is
that he promotes extremely tight spacing to achieve a uniform density
across the page in the belief that this leads to a pleasing presentation
and improved readability.

Among his recommendations is that an opening single quote together with
the space preceding it should take up no more space than a normal word
space, and similarly following a closing single quote; that the space
after some punctuation be minimized (some of his commas appear to have
perhaps just a hairspace, following them); that the space between
punctuation and letters be adjusted according to the shape of the
letter; and that 'and' be replaced by '' as necessary to improve word
spacing. While this last is probably beyond the scope of ConTeXt, I am
hoping that the first few might be managed through
\definecharacterspacing, \setupcharacterspacing, and \setcharacterspacing.

Alas, I have found no documentation on this set of commands, and what I
see in the source is opaque.

If you have pointers to the details of these commands, or other
suggestions for such typographic exercises, please let me know.


you can mess with sfcodes:

\starttext

\input tufte

\sfcode`\.100 \sfcode`\,100
\sfcode`\?100 \sfcode`\!100
\sfcode`\:100 \sfcode`\;100

\input tufte

\dostepwiserecurse{`a}{`z}{1}{\sfcode#1=100\relax}

\input tufte

\dostepwiserecurse{0}{}{1}{\sfcode#1=100\relax}

\input tufte

\stoptext

I'm pretty sure I would not read books typeset that way.

replacing and by  can be done too but that would look even worse (for 
consistency one should then replace 'or' by | and even more can be saved 
by going sms: wandering becomes wndering, and according becomes 
acc|rding plus the usual messing with digits


probably, omitting all vowels would work out too for reader who like 
that compact typesetting


Hans


-
  Hans Hagen | PRAGMA ADE
  Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
tel: 038 477 53 69 | voip: 087 875 68 74 | 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
___


[NTG-context] Minimal word-distance?

2013-08-26 Thread H. Özoguz
Beyond the possibility to influence the tolerance by \setuptolerance, is 
it possible to declare explicit the minimal allowed word-distance? I 
ask, because in some cases the distance between consecutive words is too 
low (already using \setuptolerance[verstrict]).


Thanks.
Huseyin
___
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
___


Re: [NTG-context] Minimal word-distance?

2013-08-26 Thread Marco Patzer
On 2013–08–26 H. Özoguz wrote:

 is it possible to declare explicit the minimal allowed
 word-distance?

\starttext
  \spaceskip=1ex plus 1ex minus .2ex
  \input knuth
\stoptext

Marco


signature.asc
Description: Digital signature
___
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
___

[NTG-context] [***SPAM***] Re: Minimal word-distance?

2013-08-26 Thread H. Özoguz

\starttext
   \spaceskip=1ex plus 1ex minus .2ex
   \input knuth
\stoptext

Marco


That simply overrides protrusion and justification, forcing a constant 
distance.


The question is, only to add an minimal distance, wich has not to be 
undercut while protrusing and justifying.


Huseyin

___
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
___


Re: [NTG-context] [***SPAM***] Re: Minimal word-distance?

2013-08-26 Thread Marco Patzer
On 2013–08–26 H. Özoguz wrote:

 \starttext
\spaceskip=1ex plus 1ex minus .2ex
\input knuth
 \stoptext
 
 Marco
 
 That simply overrides protrusion and justification,

The following text has protrusion and is justified.

\setuplayout [width=6cm]
\definefontfeature [default] [default] [protrusion=pure]
\setupalign [hanging]
\showframe
\starttext
  \spaceskip=1ex plus 1ex minus .2ex
  \input knuth
\stoptext

 forcing a constant distance.

If you provide stretch and shrink the distance is not constant.

 The question is, only to add an minimal distance, wich has not to be
 undercut while protrusing and justifying.

Example please

Marco


signature.asc
Description: Digital signature
___
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
___

  1   2   3   >