[NTG-context] directlua question

2018-12-04 Thread Hans van der Meer
I am trying to extract something from a string with a \directlua call, the last 
word of a string in case:

\directlua{tex.print(string.match(“This is a string","%s%a$"))}

However, the %s%a are not working with the TeX-error “unfinished string near 
eof”. Obviously caused by the %’s.
How to get this working? \textpercent will not do, off course within Luacode.

dr. Hans van der Meer


___
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] Interlinear translations in Context

2018-12-03 Thread Huseyin Özoguz
Thank you, I will investigate it, seems to be a pretty powerful 
mechanism. First it failed to compile (with Context version from 2015, 
did not know \defineruby), but with the most recent beta it does well.


So a small btw-question, I compile out of notepad++ (windows 7, 64 bit) 
with this code:


cd $(CURRENT_DIRECTORY)
context $(CURRENT_DIRECTORY)\main.tex --synctex=1
taskkill \im SumatraPDF.exe
C:\Users\Huseyin\sumatra.bat "$(CURRENT_DIRECTORY)\main.pdf"

This always uses the default context-version, which path' is saved the 
environment-variables of windows. How can I switch (and control) between 
different context-versions or pathes for compiling without changing the 
environment variables in Win (and after that I have to restart)? I tried 
to write the path directly into the command above, but did not work.


Thanks and I may have questions to the actual question about interlinear 
typesetting later, will try to define some nice macros with 
arabic-german interlinear texts.


Huseyin

Huseyin Özoguz

E-Mail: h.oezo...@mmnetz.de

Am 03.12.2018 um 11:17 schrieb Hans Hagen:

On 12/3/2018 10:29 AM, Huseyin Özoguz wrote:

Hello,

I have now the challenge in a book to set an interlinear translation. 
That is two languages word-by-word (original above translation), so 
the sentence structure follows the originals language, like its 
common in many scientific bible translations.


My problem: The TABLES are not suitable, because

1. I have to determine in advance, how many words are in the row, 
which depens obviously on the page-width and widths of the words.


2. Its not readable and well editable, because in Context (and most 
other languages) one has to write the table in rows and not in 
columns, as I need it for interlinear translations.


Example:

\bTABLE
\bTR \bTD word 1, language 1\eTD \bTD word 2, language 1\eTD \bTD 
word 3, language 1\eTD \eTR
\bTR \bTD word 1, language 2\eTD \bTD word 2, language 2\eTD \bTD 
word 3, language 2\eTD \eTR

\eTABLE

So I can not make this into and simple macro \interlinear{#1}{#2}, 
which I could use this way:


\interlinear{word 1, language 1}{word 1, language 2}
\interlinear{word 2, language 1}{word 2, language 2}
\interlinear{word 3, language 1}{word 3, language 2}

(all three blocks in the same horizontal line, if no linebreak is 
needed)


On top of this, the language 1 (arabic) is right-to-left (so language 
2 (german) must follow), it should be compatible with right-to-left 
reading someway. I tried with \framed, but failed, because the framed 
blocks are set one under the other, not side by side. How can I 
achieve a nice way with this simple readable macros?

Processing this might give you some ideas:

\usemodule[art-01]\setupbodyfont[dejavu,12pt]

\defineruby[auto]  [align=auto,color=darkred]
\defineruby[left]  [align=flushleft,color=darkred]
\defineruby[right] [align=flushright,color=darkred]
\defineruby[spread][stretch=yes]

\showframe \showglyphs \showfontkerns \setupinterlinespace[22pt]

\starttext

\startbuffer
    \dorecurse{20}{\ruby{XYZ}{a|bc|d} }\par
    \dorecurse{20}{\ruby{PQR}{p|q|r} }\par
    \dorecurse{20}{\ruby{XYZ}{1|22|333} }\par
    \dorecurse{20}{\ruby{XYZ}{111|222|333} }\par
    \dorecurse{20}{\ruby{XYZ}{foobar} }\par
    \dorecurse{20}{\ruby{XYZ}{fooledbar} }\par
    \dorecurse{20}{\ruby[spread]{XYZ}{fooledbar} }\par
    \dorecurse{20}{\ruby{extremely}{wide} }\par
    \dorecurse{20}{\ruby{wide}{extremely} }\par
 stopbuffer

\testfeatureonce{1}{\start \setupinterlinespace[16pt] 
\setupruby[location=none]   \getbuffer \stop \page}
\testfeatureonce{1}{\start \setupinterlinespace[16pt] 
\setupruby[location=right]  \getbuffer \stop \page}
\testfeatureonce{1}{\start \setupinterlinespace[28pt] 
\setupruby[align=auto,color=darkred]    \getbuffer \stop \page}
\testfeatureonce{1}{\start \setupinterlinespace[28pt] 
\setupruby[align=flushleft,color=darkgreen] \getbuffer \stop \page}
\testfeatureonce{1}{\start \setupinterlinespace[28pt] 
\setupruby[align=flushright,color=darkblue] \getbuffer \stop \page}
\testfeatureonce{1}{\start \setupinterlinespace[28pt] 
\setupruby[align=middle,color=darkyellow]   \getbuffer \stop \page}


\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] Interlinear translations in Context

2018-12-03 Thread Hans Hagen

On 12/3/2018 10:29 AM, Huseyin Özoguz wrote:

Hello,

I have now the challenge in a book to set an interlinear translation. 
That is two languages word-by-word (original above translation), so the 
sentence structure follows the originals language, like its common in 
many scientific bible translations.


My problem: The TABLES are not suitable, because

1. I have to determine in advance, how many words are in the row, which 
depens obviously on the page-width and widths of the words.


2. Its not readable and well editable, because in Context (and most 
other languages) one has to write the table in rows and not in columns, 
as I need it for interlinear translations.


Example:

\bTABLE
\bTR \bTD word 1, language 1\eTD \bTD word 2, language 1\eTD \bTD word 
3, language 1\eTD \eTR
\bTR \bTD word 1, language 2\eTD \bTD word 2, language 2\eTD \bTD word 
3, language 2\eTD \eTR

\eTABLE

So I can not make this into and simple macro \interlinear{#1}{#2}, which 
I could use this way:


\interlinear{word 1, language 1}{word 1, language 2}
\interlinear{word 2, language 1}{word 2, language 2}
\interlinear{word 3, language 1}{word 3, language 2}

(all three blocks in the same horizontal line, if no linebreak is needed)

On top of this, the language 1 (arabic) is right-to-left (so language 2 
(german) must follow), it should be compatible with right-to-left 
reading someway. I tried with \framed, but failed, because the framed 
blocks are set one under the other, not side by side. How can I achieve 
a nice way with this simple readable macros?

Processing this might give you some ideas:

\usemodule[art-01]\setupbodyfont[dejavu,12pt]

\defineruby[auto]  [align=auto,color=darkred]
\defineruby[left]  [align=flushleft,color=darkred]
\defineruby[right] [align=flushright,color=darkred]
\defineruby[spread][stretch=yes]

\showframe \showglyphs \showfontkerns \setupinterlinespace[22pt]

\starttext

\startbuffer
\dorecurse{20}{\ruby{XYZ}{a|bc|d} }\par
\dorecurse{20}{\ruby{PQR}{p|q|r} }\par
\dorecurse{20}{\ruby{XYZ}{1|22|333} }\par
\dorecurse{20}{\ruby{XYZ}{111|222|333} }\par
\dorecurse{20}{\ruby{XYZ}{foobar} }\par
\dorecurse{20}{\ruby{XYZ}{fooledbar} }\par
\dorecurse{20}{\ruby[spread]{XYZ}{fooledbar} }\par
\dorecurse{20}{\ruby{extremely}{wide} }\par
\dorecurse{20}{\ruby{wide}{extremely} }\par
 stopbuffer

\testfeatureonce{1}{\start \setupinterlinespace[16pt] 
\setupruby[location=none]   \getbuffer \stop \page}
\testfeatureonce{1}{\start \setupinterlinespace[16pt] 
\setupruby[location=right]  \getbuffer \stop \page}
\testfeatureonce{1}{\start \setupinterlinespace[28pt] 
\setupruby[align=auto,color=darkred]\getbuffer \stop \page}
\testfeatureonce{1}{\start \setupinterlinespace[28pt] 
\setupruby[align=flushleft,color=darkgreen] \getbuffer \stop \page}
\testfeatureonce{1}{\start \setupinterlinespace[28pt] 
\setupruby[align=flushright,color=darkblue] \getbuffer \stop \page}
\testfeatureonce{1}{\start \setupinterlinespace[28pt] 
\setupruby[align=middle,color=darkyellow]   \getbuffer \stop \page}


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

[NTG-context] Interlinear translations in Context

2018-12-03 Thread Huseyin Özoguz

Hello,

I have now the challenge in a book to set an interlinear translation. 
That is two languages word-by-word (original above translation), so the 
sentence structure follows the originals language, like its common in 
many scientific bible translations.


My problem: The TABLES are not suitable, because

1. I have to determine in advance, how many words are in the row, which 
depens obviously on the page-width and widths of the words.


2. Its not readable and well editable, because in Context (and most 
other languages) one has to write the table in rows and not in columns, 
as I need it for interlinear translations.


Example:

\bTABLE
\bTR \bTD word 1, language 1\eTD \bTD word 2, language 1\eTD \bTD word 
3, language 1\eTD \eTR
\bTR \bTD word 1, language 2\eTD \bTD word 2, language 2\eTD \bTD word 
3, language 2\eTD \eTR

\eTABLE

So I can not make this into and simple macro \interlinear{#1}{#2}, which 
I could use this way:


\interlinear{word 1, language 1}{word 1, language 2}
\interlinear{word 2, language 1}{word 2, language 2}
\interlinear{word 3, language 1}{word 3, language 2}

(all three blocks in the same horizontal line, if no linebreak is needed)

On top of this, the language 1 (arabic) is right-to-left (so language 2 
(german) must follow), it should be compatible with right-to-left 
reading someway. I tried with \framed, but failed, because the framed 
blocks are set one under the other, not side by side. How can I achieve 
a nice way with this simple readable macros?


Thank you.

Huseyin

--
Huseyin Özoguz

E-Mail: h.oezo...@mmnetz.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] Grammar to parse TeX input?

2018-11-28 Thread Hans Hagen

On 11/28/2018 9:33 AM, Joseph Canedo wrote:
I’d like to change some input to modify used font but only in parts of 
it, for example to implement having first line with different font. So 
basically if I have text with macros etc…:

% firstlines-001.tex

\setupbodyfont
  [pagella]

\setupalign
  [tolerant,stretch]

\setupfirstline
  [alternative=line,
   color=darkred,
   style=\setfontfeature{smallcaps}]

\setupfirstline
  [fancy]
  [n=3]

\setupfirstline
  [fancier]
  [alternative=word,
   color=darkblue,
   style=bold,
   n=3]

\setupfirstline
  [weirder]
  [alternative=line,
   color=darkgreen,
   style=\setfontfeature{smallcaps},
   n=3]

\setupinitial
  [location=text,
   n=2,
   color=darkred,
   voffset=1.2\lineheight,
   before={\blank[2*big]}]

% \enabletrackers[typesetters.firstlines,typesetters.initials]

\starttext

\setfirstline

\input ward \par

\placeinitial

\input ward \par

\setupindenting[medium,yes]

\setinitial % \placeinitial

\input ward \par

\setinitial %  \placeinitial
\setfirstline

\input ward \par

\setfirstline[fancy]

\input ward \par

\setfirstline[fancier]

\input ward \par

\setinitial %  \placeinitial
\setfirstline[weirder]

\input ward \par

\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] Grammar to parse TeX input?

2018-11-28 Thread Joseph Canedo
I’d like to change some input to modify used font but only in parts of it, for 
example to implement having first line with different font. So basically if I 
have text with macros etc…:

\WORD{i}eu \Note[]{}{Ebrieux \LeftDot 11.a.}crea au commencement le ciel et la 
terre. Et la terre
estoit \Note[]{*}{{\Hebreu\Tav\He\Vav} c'est a dire/ vaine/ qui ne proffite et 
ne sert a rien.}indisposee et \Note[]{*}{{\Hebreu\Bet\He\Vav} non remplie & 
ornee/ de plantes et d'animaux.}vuyde/ et les tenebres estoient sus les 
abysmes/ et \Note[]{*}{Selon les Ebrieux/ ou esperit: car 
{\Hebreu\Dalet\Vav\Het} signifie vent & esperit.}le vent \Note[]{*}{ou/ 
vehement car {\Hebreu\Alef\Lamed\Resh\He\Yod\Memfinal} se prent aucunesfois 
pour hault/ excellent/ & puissant.}de Dieu se demenoit par dessus les eaues.

I’d like to typeset the beginning of that using a different font BigFont (but 
letting lua code to determine the position of closing brace). Ie :

{\BigFont \WORD{i}eu \Note[]{}{Ebrieux \LeftDot 11.a.}crea au commencement le 
ciel et la terre.} Et la terre
estoit \Note[]{*}{{\Hebreu\Tav\He\Vav} c'est a dire/ vaine/ qui ne proffite et 
ne sert a rien.}indisposee et \Note[]{*}{{\Hebreu\Bet\He\Vav} non remplie & 
ornee/ de plantes et d'animaux.}vuyde/ et les tenebres estoient sus les 
abysmes/ et \Note[]{*}{Selon les Ebrieux/ ou esperit: car 
{\Hebreu\Dalet\Vav\Het} signifie vent & esperit.}le vent \Note[]{*}{ou/ 
vehement car {\Hebreu\Alef\Lamed\Resh\He\Yod\Memfinal} se prent aucunesfois 
pour hault/ excellent/ & puissant.}de Dieu se demenoit par dessus les eaues.

To do this I’d need to extract the macros etc… « Worst » case scenario I’ll 
write a simple adhoc lpeg grammar to parse input, but was wondering if such 
grammar existed already in context lua code, or elsewhere.

Thanks

De : Hans Hagen
Envoyé le :mercredi 28 novembre 2018 09:04
À : Joseph Canedo; mailing list for ConTeXt users
Objet :Re: [NTG-context] Grammar to parse TeX input?

On 11/27/2018 11:00 PM, Joseph Canedo wrote:
> I’ve tried context.processbuffer but I am afraid it’s not what I am 
> after, most probably I have not phrased clearly my question.
> 
> What I am looking for is roughly what’s described in Taco’s presentation 
> https://meeting.contextgarden.net/2014/talks/2014-09-12-taco-luatex/luatextalk.pdf
> 
> A way to decompose some input into tokens which represent either normal 
> text, csnames etc…  I had a try to this token library in LuaTeX but I 
> could not find examples of how to use it. I suspect that buffers 
> mechanism use it somehow.
you can pick up stuff from the input so in principle you can start your 
input with a token scanner, but then you not only end up with lots of 
'tokens' but also need to interpret them ... and that is actually what 
tex is quite effecient in and good at, so the question is: what do you 
want to achieve ... there might be better ways

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] can \REGISTER[key]{term} modify typesetting (adding space)?

2018-11-27 Thread Wolfgang Schuster



Rik Kabel schrieb am 27.11.18 um 22:27:
What is unexpected is that the space does not appear in the body 
(non-footnote) text of the second paragraph. The difference between 
handling in notes and in body text seems discordant.


\startparagraph does *not* start a paragraph.


In the two paragraphs in the following example it is always the word 
“Text” which start the paragraph.


\setuppapersize[A9]

\starttext

\index{Strumpf}
Text

\startparagraph
\index{Strumpf}
Text
\stopparagraph

\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] latest beta (october 18th): likely bug in \mirror

2018-11-24 Thread Hans Hagen

On 11/23/2018 1:31 PM, mf wrote:

A much simpler example:

\starttext

\ConTeXt\ version: \contextversion.

A paragraph with a mirrored \mirror{word} inside.

Another paragraph.

\stoptext

i'll send you a fix

-
  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] latest beta (october 18th): likely bug in \mirror

2018-11-23 Thread mf

A much simpler example:

\starttext

\ConTeXt\ version: \contextversion.

A paragraph with a mirrored \mirror{word} inside.

Another paragraph.

\stoptext


mirror-not-ok.pdf
Description: Adobe PDF document


mirror-ok.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 / 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] wrong hyphenation in ancient Greek?

2018-10-30 Thread Arthur Reutenauer
On Sat, Oct 13, 2018 at 10:05:15AM +0200, Pablo Rodriguez wrote:
> πρᾶ-γμα πρά-γμα-τος
> 
> As far as I know, two consonants in ancient Greek aren’t hyphenated,
> when they may begin a word.
> 
> Γν may be the beginning of word in Greek (such as γνῶσις), but even LSJ
> has no word that begins with γμ.
> 
> Am I missing something or should this be improved in the hyphenation
> patterns?

  Since we’ve continued that discussion off list, I’d like to mention
our conclusion, which is that the patterns shouldn’t be changed, since
they follow a somewhat different rule, where a few additional consonant
clusters receive the same treatment as γν.  That rule is documented in
William Goodwin’s Greek grammar, §97:

https://archive.org/details/greekgrammar00gooduoft/page/24

  Thomas pointed out that Goodwin’s statement that his rule was “based
on ancient tradition” is not very convincing, and that different
behaviours are possible, but the one reported by Pablo above is
documented and intentional.

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] --|--- not transformed to endash|emdash

2018-10-24 Thread Hans Hagen

On 10/24/2018 7:24 PM, Tomas Hala wrote:

Hi Hans,

you are right, tlig is the missing one. Thank you for directing me.

Does it mean that all features are disabled when the new "non-TeX" font is 
joined?
(I used \starttypescript with \definefontsynonym; then \definetypeface and 
\setupbodyfont.)


features are bound to a font instance


Later I discovered [features=default] (at \definefontsynonym) which enables it, 
too.
Which features are enabled by this word default?


\usemodule[fonts-features]

\starttext

\showfeatureset[name=default]

\stoptext


Side effect of my experimets was the syntantic error  "! Missing \endcsname 
inserted"
at \definefontsynonym [Serif][name:JohnBaskerville][] with empty last brackets.
Is it ok, or not?


well, the empty argument is not ok



Best wishes,

Tomáš

Tue, Oct 23, 2018 ve 07:08:44PM +0200 Hans Hagen napsal(a):
# On 10/23/2018 6:36 PM, Tomas Hala wrote:
# >Hi all,
# >
# >usually, if one writes -- or ---, will receive real en-dash or em-dash,
# >respectively. I just tried font called JohnBaskerville
# >(commercial; from Štorm type foundry, CZ) but I got only '--' and '---',
# >ie. sequences were not transformed to the proper characters.
# >
# >Dashes are present in then font, commands \endash and \emdash produce them 
correctly.
# >
# >What could be wrong?
#
# no features enabled?
#
# -
#   Hans Hagen | PRAGMA ADE
#   Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
#tel: 038 477 53 69 | www.pragma-ade.nl | www.pragma-pod.nl
# -

  Tomáš Hála

Mendelova univerzita, Provozně ekonomická fakulta, ústav informatiky
Zemědělská 1, CZ-613 00 Brno,  tel. +420 545 13 22 28

http://akela.mendelu.cz/~thala




--

-
  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] --|--- not transformed to endash|emdash

2018-10-24 Thread Tomas Hala
Hi Hans, 

you are right, tlig is the missing one. Thank you for directing me.

Does it mean that all features are disabled when the new "non-TeX" font is 
joined? 
(I used \starttypescript with \definefontsynonym; then \definetypeface and 
\setupbodyfont.)

Later I discovered [features=default] (at \definefontsynonym) which enables it, 
too.
Which features are enabled by this word default?

Side effect of my experimets was the syntantic error  "! Missing \endcsname 
inserted"
at \definefontsynonym [Serif][name:JohnBaskerville][] with empty last brackets.
Is it ok, or not?

Best wishes,

Tomáš

Tue, Oct 23, 2018 ve 07:08:44PM +0200 Hans Hagen napsal(a):
# On 10/23/2018 6:36 PM, Tomas Hala wrote:
# >Hi all,
# >
# >usually, if one writes -- or ---, will receive real en-dash or em-dash,
# >respectively. I just tried font called JohnBaskerville
# >(commercial; from Štorm type foundry, CZ) but I got only '--' and '---',
# >ie. sequences were not transformed to the proper characters.
# >
# >Dashes are present in then font, commands \endash and \emdash produce them 
correctly.
# >
# >What could be wrong?
# 
# no features enabled?
# 
# -
#   Hans Hagen | PRAGMA ADE
#   Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
#tel: 038 477 53 69 | www.pragma-ade.nl | www.pragma-pod.nl
# -

 Tomáš Hála

Mendelova univerzita, Provozně ekonomická fakulta, ústav informatiky
Zemědělská 1, CZ-613 00 Brno,  tel. +420 545 13 22 28

http://akela.mendelu.cz/~thala
___
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] wrong hyphenation in ancient Greek?

2018-10-15 Thread Arthur Reutenauer
On Sat, Oct 13, 2018 at 11:05:01AM +0200, Thomas A. Schmitz wrote:
> You're right, this shouldn't happen. I tried in vain to find the culprit in
> lang-agr.lua and to see more with
> 
> \enabletrackers[hyphenator.visualize,hyphenator.steps,languages.patterns]
> 
> failed. Arthur is the guru here, so maybe he has a suggestion?

  Ah, I was going for a title that inspired more awe, like “Emperor of
Hyphenation”, but guru will do for the time being :-)

  The reason you can’t find any obvious culprit is because you need to
look at the patterns that are missing: taking πράγματσς as an example,
the matching patterns are

.π4 ά1 α1 ο1 4ς.

that allow a break after any vowel and prohibit breaks after the first
letter and before the last letter in the word (which is relevant because
\lefthyphenmin and \righthyphenmin are both set to 1).  Since these are
the only patterns that apply, the possible hyphenation points are thus

πρά-γμα-τος

  Digging deeper in the pattern file, you’ll see that it takes quite
many two-consonant clusters into account, starting at line 267 of the
master file in the repository, with a comment “other divisable consonant
combinations” 
(https://github.com/hyphenation/tex-hyphen/blob/82e5651/hyph-utf8/tex/generic/hyph-utf8/patterns/tex/hyph-grc.tex#L267):

  2β1γ 2β1ζ 2β1θ 2β1κ ... 2γ1θ 2γ1κ 2γ1ξ 2γ1π ...

  You can see that γμ is not there (nor, of course, γν, which was
expected).  If it was, the pattern 2γ1μ would force the break πράγ-μα,
hence its absence leads me to believe that the breaks before γμ are
intentional.  I suggest you contact Dimitrios Filippou, the main author
of the patterns, to ask if it was somehow an oversight or if he was
following a different rule (email address at the top of the file linked
to, in a slightly obfuscated form).

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] wrong hyphenation in ancient Greek?

2018-10-13 Thread Pablo Rodriguez
On 10/13/18 11:49 AM, Pablo Rodriguez wrote:
> On 10/13/18 11:05 AM, Thomas A. Schmitz wrote:
>> On 13.10.2018 10:05, Pablo Rodriguez wrote:
>>> [...]
>>> Γν may be the beginning of word in Greek (such as γνῶσις), but even LSJ
>>> has no word that begins with γμ.
>>
>> You're right, this shouldn't happen. I tried in vain to find the culprit 
>> in lang-agr.lua and to see more with
>>
>> \enabletrackers[hyphenator.visualize,hyphenator.steps,languages.patterns]
>>
>> but failed. Arthur is the guru here, so maybe he has a suggestion?
> 
> I have just discovered that LuaLaTeX (from the TeX Live version that
> comes with Fedora 32)

Of course, I meant Fedora 28. Fedora 32 should be released in 2020.

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] wrong hyphenation in ancient Greek?

2018-10-13 Thread Pablo Rodriguez
On 10/13/18 11:05 AM, Thomas A. Schmitz wrote:
> On 13.10.2018 10:05, Pablo Rodriguez wrote:
>> [...]
>> Γν may be the beginning of word in Greek (such as γνῶσις), but even LSJ
>> has no word that begins with γμ.
> 
> You're right, this shouldn't happen. I tried in vain to find the culprit 
> in lang-agr.lua and to see more with
> 
> \enabletrackers[hyphenator.visualize,hyphenator.steps,languages.patterns]
> 
> but failed. Arthur is the guru here, so maybe he has a suggestion?

I have just discovered that LuaLaTeX (from the TeX Live version that
comes with Fedora 32) does exactly the same with ancient Greek
(hyphenation is fine in modern polytonic Greek).

Just in case 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
___

Re: [NTG-context] wrong hyphenation in ancient Greek?

2018-10-13 Thread Thomas A. Schmitz

On 13.10.2018 10:05, Pablo Rodriguez wrote:

As far as I know, two consonants in ancient Greek aren’t hyphenated,
when they may begin a word.

Γν may be the beginning of word in Greek (such as γνῶσις), but even LSJ
has no word that begins with γμ.

Am I missing something or should this be improved in the hyphenation
patterns?


You're right, this shouldn't happen. I tried in vain to find the culprit 
in lang-agr.lua and to see more with


\enabletrackers[hyphenator.visualize,hyphenator.steps,languages.patterns]

but failed. Arthur is the guru here, so maybe he has a suggestion?

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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___

[NTG-context] wrong hyphenation in ancient Greek?

2018-10-13 Thread Pablo Rodriguez
Dear list,

I have the following sample:

\mainlanguage[agr]
\setupbodyfont[dejavu]
\starttext
\startTEXpage[offset=2em]
\hyphenatedword{πρᾶγμα πράγματος}
\stopTEXpage
\stoptext

that ouputs:

πρᾶ-γμα πρά-γμα-τος

As far as I know, two consonants in ancient Greek aren’t hyphenated,
when they may begin a word.

Γν may be the beginning of word in Greek (such as γνῶσις), but even LSJ
has no word that begins with γμ.

Am I missing something or should this be improved in the hyphenation
patterns?

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] Unexpected space after hyphen in xml/html export

2018-10-08 Thread Rik Kabel

On 10/6/2018 19:28, Hans Hagen wrote:

On 10/7/2018 12:19 AM, Rik Kabel wrote:

List,

Occasionally an unexpected and unwanted space is inserted following 
the hyphen of a compound word in html/xml exports. In a document with 
about 500 such compounds, this occurs 30 times.


The following input:

    \setupbackend [export=yes,xhtml=yes]
    \starttext
    Theocracy, the priest power; monarchy, the one|-|man power; and
    oligarchy, the few|-|men power|—|are three forms of vicarious
    government over the people, perhaps for them, not by them. 
Democracy is

    direct self|-|government over all the people, for all the people, by
    all the people. Our institutions are democratic: theocratic, 
monarchic,

    oligarchic vicariousness is all gone. We have no Divine vicar who is
    responsible to God for our politics and religion; only a human 
attorney,
    answerable to the people for his official work. The axis of 
rotation has
    changed: the equator of the old civilization passes through the 
poles
    of the new. This makes some change in the geography of both 
Church and

    State.
    \stopsection
    \stoptext

Produces, in relevant part, the following xml (wrapped for convenience):

    Theocracy, the priest power; monarchy, the one-man power; and 
oligarchy,

    the few- men power—are three forms of vicarious government over
    the people, perhaps for them, not by them. Democracy is direct
    self-government over all the people, for all the people, by all the
    people. Our institutions are democratic: theocratic, monarchic,
    oligarchic vicariousness is all gone. We have no Divine vicar who is
    responsible to God for our politics and religion; only a human 
attorney,
    answerable to the people for his official work. The axis of 
rotation has
    changed: the equator of the old civilization passes through the 
poles
    of the new. This makes some change in the geography of both 
Church and

    State.

Note the space after "few-" in the second line of the output text.

(The paragraph is a quotation from Theodore Parker's sermon "The 
Effect of Slavery on the American People," delivered on July 4, 1858. 
It is thought by many to be the inspiration for part of Lincoln's 
Gettysburg Address.)


But it's not what happened: quite some folks in power have middle age 
monarchic characteristics, oligarchies are around etc. Old 
institutions (that probably root deeply in mankind0 are just better in 
pretending to be different.


Anyway fixed in next beta (but you need to keep an eye on disc side 
effects.


Hans
Alas, it is fixed for that particular occurence, but it still occurs 29 
times in the document (using today's beta).


A more extended search shows that there are also spaces afters en-dashes 
(in "Press|–|Citizen" and  in "Miniatur|–|Bibliothek der Deutschen 
Classiker"), but none after em-dashes. Unfortunately, my attempts to 
reproduce this in a smaller document have so far failed.


Perhaps this quote, in which the problem also occurs, is in line with 
your other comments:


   There is only one party in the United States, the Property
   Party\nbsp \dots{} and it has two right wings: Republican
   and Democrat. Republicans are a bit stupider, more rigid,
   more doctrinaire in their laissez|-|faire capitalism than
   the Democrats, who are cuter, prettier, a bit more
   corrupt—until recently\nbsp \dots{} and more willing than the
   Republicans to make small adjustments when the poor, the black,
   the anti|-|imperialists get out of hand. But, essentially, there
   is no difference between the two parties.

(That is from Gore Vidal in 1975. Plus ça change.) In it, I get a space 
after "anti-".


But more like this and folks will complain about politics on the list. 
Or worse, encourage it.

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

Re: [NTG-context] Unexpected space after hyphen in xml/html export

2018-10-06 Thread Hans Hagen

On 10/7/2018 12:19 AM, Rik Kabel wrote:

List,

Occasionally an unexpected and unwanted space is inserted following the 
hyphen of a compound word in html/xml exports. In a document with about 
500 such compounds, this occurs 30 times.


The following input:

\setupbackend [export=yes,xhtml=yes]
\starttext
Theocracy, the priest power; monarchy, the one|-|man power; and
oligarchy, the few|-|men power|—|are three forms of vicarious
government over the people, perhaps for them, not by them. Democracy is
direct self|-|government over all the people, for all the people, by
all the people. Our institutions are democratic: theocratic, monarchic,
oligarchic vicariousness is all gone. We have no Divine vicar who is
responsible to God for our politics and religion; only a human attorney,
answerable to the people for his official work. The axis of rotation has
changed: the equator of the old civilization passes through the poles
of the new. This makes some change in the geography of both Church and
State.
\stopsection
\stoptext

Produces, in relevant part, the following xml (wrapped for convenience):

Theocracy, the priest power; monarchy, the one-man power; and oligarchy,
the few- men power—are three forms of vicarious government over
the people, perhaps for them, not by them. Democracy is direct
self-government over all the people, for all the people, by all the
people. Our institutions are democratic: theocratic, monarchic,
oligarchic vicariousness is all gone. We have no Divine vicar who is
responsible to God for our politics and religion; only a human attorney,
answerable to the people for his official work. The axis of rotation has
changed: the equator of the old civilization passes through the poles
of the new. This makes some change in the geography of both Church and
State.

Note the space after "few-" in the second line of the output text.

(The paragraph is a quotation from Theodore Parker's sermon "The Effect 
of Slavery on the American People," delivered on July 4, 1858. It is 
thought by many to be the inspiration for part of Lincoln's Gettysburg 
Address.)


But it's not what happened: quite some folks in power have middle age 
monarchic characteristics, oligarchies are around etc. Old institutions 
(that probably root deeply in mankind0 are just better in pretending to 
be different.


Anyway fixed in next beta (but you need to keep an eye on disc side 
effects.


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] Unexpected space after hyphen in xml/html export

2018-10-06 Thread Rik Kabel

List,

Occasionally an unexpected and unwanted space is inserted following the 
hyphen of a compound word in html/xml exports. In a document with about 
500 such compounds, this occurs 30 times.


The following input:

   \setupbackend [export=yes,xhtml=yes]
   \starttext
   Theocracy, the priest power; monarchy, the one|-|man power; and
   oligarchy, the few|-|men power|—|are three forms of vicarious
   government over the people, perhaps for them, not by them. Democracy is
   direct self|-|government over all the people, for all the people, by
   all the people. Our institutions are democratic: theocratic, monarchic,
   oligarchic vicariousness is all gone. We have no Divine vicar who is
   responsible to God for our politics and religion; only a human attorney,
   answerable to the people for his official work. The axis of rotation has
   changed: the equator of the old civilization passes through the poles
   of the new. This makes some change in the geography of both Church and
   State.
   \stopsection
   \stoptext

Produces, in relevant part, the following xml (wrapped for convenience):

   Theocracy, the priest power; monarchy, the one-man power; and oligarchy,
   the few- men power—are three forms of vicarious government over
   the people, perhaps for them, not by them. Democracy is direct
   self-government over all the people, for all the people, by all the
   people. Our institutions are democratic: theocratic, monarchic,
   oligarchic vicariousness is all gone. We have no Divine vicar who is
   responsible to God for our politics and religion; only a human attorney,
   answerable to the people for his official work. The axis of rotation has
   changed: the equator of the old civilization passes through the poles
   of the new. This makes some change in the geography of both Church and
   State.

Note the space after "few-" in the second line of the output text.

(The paragraph is a quotation from Theodore Parker's sermon "The Effect 
of Slavery on the American People," delivered on July 4, 1858. It is 
thought by many to be the inspiration for part of Lincoln's Gettysburg 
Address.)


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

Re: [NTG-context] Need help with project: TeX capacity exceeded

2018-10-04 Thread Axel Kielhorn

> Am 04.10.2018 um 09:27 schrieb Taco Hoekwater :
> 
>> According to my understanding I should be able to
>> context c_01 to get one chapter
>> context prd_A to get one product
>> context project_ecm to get the whole book.
> 
> Any whole book should be a product, and the Parts should just be components. 
> The project level is only there to connect meta-info across a book series. 
> You are not supposed to run ‘context’ on the project file.

I see.
I’ll probably keep it as three books.
It’s easy to change later as long as the components have different names.
Right now that’s just a limitation of the word processor.

> That said, it is definitely not your installation or understanding of the
> wiki page that creates the circular inclusion. The same happens here. I 
> discovered it works OK if I move the \product to within the \startcomponent,
> and I assume that is how it supposed to work:
> 
>  \startcomponent
>  \product prd_1
>   … 
>  \stopcomponent

Works here as well, thank you.
What about the project?
Right now it is outside the \start{product|component} and it works.

Now it is inside the \start{product|component} and it works as well.

Next question:
Should the environment be inside \startproject \stopproject?

It seems to make no difference.

Thus having the whole file inside \start{project|product|component} \stop… 
would be a good idea and consistent.

> At a guess, I think the wiki page is wrong. But before editing that,
> I would like to have confirmation of the above assumption.

Thanks for the quick response, now I can tell pandoc to convert the book to 
context:-)

Greetings Axel

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

2018-09-07 Thread Procházka Lukáš Ing .

Hello,

due to great TextAdept (TA) [1] extendibility, I'd like to try to program a TA add-on 
which would provide a ConTeXt source "browser".

The idea is to create an independent window in the TA which will show the 
current document structure, or even the project structure, and provide some 
click-in-browser-go-to-source functionality.

Suppose having a source file with the following content (line numbers in (...) 
just for referring):

 a.tex
(1) \section{Sec}
(2)
(3) Hello
(4)
(5)  \subsection{Subsec}
(6)
(7)  Word


The "browser" should display this:


Sec (section)
Subsec (subsection)


After some investigation and some questioning in TA mailing list, it seem that 
"tatoolbar" [2] might bu useful for this purpose.

Unfortunately, there is an initial problem: the tatoolbar is not pre-compiled 
for Windows [3] and compilation under Windows is not so easy (I tried with 
GnuWin32 and MinGW installed on my WinX computer); getting Win bins is done by 
cross compiling under Linux.

Is there someone here - who is familiar with Linux - who could compile 
tatoolbar first - and provide it for trying to write the source browser?

Thank you in advance.

Best regards,

Lukas

[1] https://foicica.com/textadept/
[2] https://github.com/gabdub/ta-tweaks/wiki/tatoolbar
[3] https://foicica.com/textadept/manual.html#Compiling


--
Ing. Lukáš Procházka | mailto:l...@pontex.cz
Pontex s. r. o.  | mailto:pon...@pontex.cz | http://www.pontex.cz | 
IDDS:nrpt3sn
Bezová 1658
147 14 Praha 4

Mob.: +420 702 033 396

___
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] contextbeta moved or server down?

2018-09-07 Thread Hans van der Meer
telnet is not present here on the system (for safety I presume)

> On 7 Sep 2018, at 17:45, Harald Koenig  
> wrote:
> 
> On Sep 07, Alan Braslau wrote:
> 
>> rsync uses port 873
>> 
>> This often gets blocked at many sites.
> 
> an easy and "naiive" test can be trying to connect to that port via rsync:
> 
> 
>   telnet 193.2.4.200 rsync
> or
>   telnet 193.2.4.200 873
> 
> 
> the output should look similar to this if that outgoing port is open (not 
> blocked):
> 
>   Trying 193.2.4.200...
>   Connected to 193.2.4.200.
>   Escape character is '^]'.
>   @RSYNCD: 31.0
> 
> 
> Harald
> -- 
> "I hope to die  ___   _
> before I *have* to use Microsoft Word.",   0--,|/OOO\
> Donald E. Knuth, 02-Oct-2001 in Tuebingen.<_/  /  /OOO\
>\  \/OOO\
>  \ O|//
>   \/\/\/\/\/\/\/\/\/
> Harald Koenig   //  / \\  \
> koe...@tat.physik.uni-tuebingen.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
> ___

met vriendelijke groet
dr. Hans van der Meer


___
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] contextbeta moved or server down?

2018-09-07 Thread Harald Koenig
On Sep 07, Alan Braslau wrote:

> rsync uses port 873
> 
> This often gets blocked at many sites.

an easy and "naiive" test can be trying to connect to that port via rsync:


telnet 193.2.4.200 rsync
or
telnet 193.2.4.200 873


the output should look similar to this if that outgoing port is open (not 
blocked):

Trying 193.2.4.200...
Connected to 193.2.4.200.
Escape character is '^]'.
@RSYNCD: 31.0


Harald
-- 
"I hope to die  ___   _
before I *have* to use Microsoft Word.",   0--,|/OOO\
Donald E. Knuth, 02-Oct-2001 in Tuebingen.<_/  /  /OOO\
\  \/OOO\
  \ O|//
   \/\/\/\/\/\/\/\/\/
Harald Koenig   //  / \\  \
koe...@tat.physik.uni-tuebingen.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] closesymbol on same line as displayed formula

2018-08-28 Thread Jeong Dal
Dear Aditya,

Thank you for the reply.

>> \startproof
>> \startitemize[n]
>> \item first line.
>> \item second line
> 
> Add: \placeclosesymbol here
> 
>> \stopitemize
>> \stopproof
>> 
>> \stoptext
> 

It works in many cases that item content ends with words. But it is not working 
if the item contents end with \stopformula. If I put \placeclosesymbol before 
\stopformula, then it is shown just after the last word.
Anyway, it works in most cases.

Thank you again.

Best regards,

Dalyoung

%
\defineenumeration[proof][text=Proof.]

\setupenumeration[proof]
[number=no,
closesymbol=\mathematics{\square},
closecommand=\ifmmode\eqno\else\wordright\fi]


\starttext
\startproof
This is a simple proof.
\startformula
1+1=2.
\stopformula
\placeclosesymbol
\stopproof

\startproof
This is another simple proof that ends with a formula
\startformula
1+1=2.
\placeclosesymbol
\stopformula
\stopproof

\startproof
\startitemize[n]
\item first line.
\item Here is an example.
\startformula \cosh x + \sinh x = e^x,~~\cosh x - \sinh x = e^{-x}  
\stopformula
The next formula is following: 
\startformula\startalign
\NC\sinh (x + y) \NC= \frac{e^{x+y} - e^{-(x+y)}}{2} \NR
\NC \NC = \frac{e^x e^y - e^{-x}e^{-y}}{2}  \NR%$
\NC \NC = \frac{(\cosh x + \sinh x)(\cosh y + \sinh y) - (\cosh x - \sinh 
x)(\cosh y - \sinh y)}{2} \NR
\NC \NC = \sinh x \cosh y + \cosh x \sinh y \NR
\stopalign \stopformula
\placeclosesymbol
\stopitemize
\stopproof

\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] how to put page X of N in header or top space?

2018-08-14 Thread David Walther

On Wed, Aug 15, 2018 at 05:41:33AM +0200, Wolfgang Schuster wrote:

\setuppagenumbering
 [alternative=doublesided,
  location=none,
  page=no]


Thanks Wolfgang, that works like a champ.  Now I've found the documentation for
ConTeXt in Debian, it is tucked away in
/usr/share/texmf/doc/context/documents/general/manuals directory as a pile of
PDFs.  I have some reading to do now.  Thank you everyone for your help.

David




Wolfgang


David Walther schrieb am 14.08.18 um 22:44:
Thank you Wolfgang, that worked nicely.  Two artifacts I'm not sure 
how to address:


I did page Page X of N, but in the output, it displays like
Page 2of 3, Page 1of 3, etc.  It ignores the space between the 
number and the word of.


Secondly, when I use the doublesided and the {singlesided,doublesided}
alternative page numbering, it rounds up to an even number of pages, even
though the last page is blank.  When I just use the singlesided 
option I get 3
pages as expected, but it doesn't do the nice interior margins and 
switching
sides of page numbers.  Even context doesn't view the blank page at 
the end as

a page, because it doesn't print the header or footer on it.

David


On Tue, Aug 14, 2018 at 09:32:29PM +0200, Wolfgang Schuster wrote:

\setuppagenumbering
[alternative=doublesided,   % doublesided layout
%alternative={singlesided,doublesided}, % singlesided layout with 
left/right pages

 location=none]

\setupheadertexts [My Spreadsheet]

\setupheadertexts
[] [Page \userpagenumber\ of \lastuserpagenumber]
[Page \userpagenumber\ of \lastuserpagenumber] []

\starttext
\dorecurse{10}{\page[dummy]}
\stoptext


Wolfgang


David Walther schrieb am 14.08.18 um 18:28:
Hi, I am slowly learning ConTeXt.  I am generating tables and 
spreadsheets, and

transforming them into ConTeXt, finally got it working after a lot of
mysterious errors about missing } as macro arguments.

I have read this page carefully: http://wiki.contextgarden.net/Layout

How can I alter the page number?  Is it in the header, or is it in the
topspace?

I want this to be at the top of each page of my spreadsheet:

My Spreadsheet (centered) Page 1 of 3 (right justified)

And on even pages, the other way around:

Page 2 of 3 (left justified) My Spreadsheet (centered)

What is the right way to do this?  Is there an override and a 
blob of code I need to put into one of the boxes in the Layout?


David
___


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
___



___
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] how to put page X of N in header or top space?

2018-08-14 Thread Wolfgang Schuster

\setuppagenumbering
  [alternative=doublesided,
   location=none,
   page=no]


Wolfgang


David Walther schrieb am 14.08.18 um 22:44:
Thank you Wolfgang, that worked nicely.  Two artifacts I'm not sure 
how to address:


I did page Page X of N, but in the output, it displays like
Page 2of 3, Page 1of 3, etc.  It ignores the space between the number 
and the word of.


Secondly, when I use the doublesided and the {singlesided,doublesided}
alternative page numbering, it rounds up to an even number of pages, even
though the last page is blank.  When I just use the singlesided option 
I get 3
pages as expected, but it doesn't do the nice interior margins and 
switching
sides of page numbers.  Even context doesn't view the blank page at 
the end as

a page, because it doesn't print the header or footer on it.

David


On Tue, Aug 14, 2018 at 09:32:29PM +0200, Wolfgang Schuster wrote:

\setuppagenumbering
 [alternative=doublesided,   % doublesided layout
 %alternative={singlesided,doublesided}, % singlesided layout with 
left/right pages

  location=none]

\setupheadertexts [My Spreadsheet]

\setupheadertexts
 [] [Page \userpagenumber\ of \lastuserpagenumber]
 [Page \userpagenumber\ of \lastuserpagenumber] []

\starttext
\dorecurse{10}{\page[dummy]}
\stoptext


Wolfgang


David Walther schrieb am 14.08.18 um 18:28:
Hi, I am slowly learning ConTeXt.  I am generating tables and 
spreadsheets, and

transforming them into ConTeXt, finally got it working after a lot of
mysterious errors about missing } as macro arguments.

I have read this page carefully: http://wiki.contextgarden.net/Layout

How can I alter the page number?  Is it in the header, or is it in the
topspace?

I want this to be at the top of each page of my spreadsheet:

My Spreadsheet (centered) Page 1 of 3 (right justified)

And on even pages, the other way around:

Page 2 of 3 (left justified) My Spreadsheet (centered)

What is the right way to do this?  Is there an override and a blob 
of code I need to put into one of the boxes in the Layout?


David
___ 



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
___


___
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] how to put page X of N in header or top space?

2018-08-14 Thread Alan Braslau
On Tue, 14 Aug 2018 14:19:25 -0700
David Walther  wrote:

> On Tue, Aug 14, 2018 at 02:58:58PM -0600, Alan Braslau wrote:
> >On Tue, 14 Aug 2018 13:44:43 -0700
> >David Walther  wrote:
> >  
> >> I did page Page X of N, but in the output, it displays like
> >> Page 2of 3, Page 1of 3, etc.  It ignores the space between the number and 
> >> the word of.  
> >
> >You must have forgotten the trailing "\ " of "\userpagenumber\ ".  
> 
> Thank you Alan.  That worked.  I didn't forget it; I never knew it.  I'm
> starting to run into the area where the Wiki isn't enough, but I don't know
> enough TeX to read the Context source for the macros.  What is recommended to
> get up to speed on Context?  Should I go back and re-read Knuth's book on TeX
> then try reading ConTeXt source?  Last time I read it was 20 years ago, and
> only got half way through; that was enough for my needs back then.  I guess a
> week or two reading everything on this page would help too:
> 
>   http://www.luatex.org/documentation.html
> 
> Now just need an answer for the blank page issue and I can start shipping 
> these
> spreadsheets to clients.

TeX commands such as \userpagenumber "gobble" a trailing blank space, 
delimiting the end of the token name ("userpagenumber"). It can also be 
terminated by any non-token-name character or another token. So we generally 
write \userpagenumber\ . One could also write {\userpagenumber}, i.e. enclosing 
the TeX command within delimiters, and it is a question of taste what coding is 
more readable. \userpagenumber{} is also valid, yet I find this even less 
readable.

You can learn much from emulation, paying attention to details, as Wolfgang had 
written

\setupheadertexts
   [] [Page \userpagenumber\ of \lastuserpagenumber]
   [Page \userpagenumber\ of \lastuserpagenumber] []



One tricky point that might not be obvious, \setupheadertexts can take a 
varying number of arguments enclosed in []. The form above (4 groups of []), 
sets the left/right headertexts for even/odd pages. Whereas the single group 
instance

\setupheadertexts [My Spreadsheet]

sets the center text. Having three or five group versions gets unwieldy or 
ambiguous (the two group version sets left/right for singlesided layout), so 
having to make two "calls" to \setupheadertexts as above is cleaner, although 
was confusing to me at first.

Alan
___
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] how to put page X of N in header or top space?

2018-08-14 Thread David Walther

On Tue, Aug 14, 2018 at 02:58:58PM -0600, Alan Braslau wrote:

On Tue, 14 Aug 2018 13:44:43 -0700
David Walther  wrote:


I did page Page X of N, but in the output, it displays like
Page 2of 3, Page 1of 3, etc.  It ignores the space between the number and the 
word of.


You must have forgotten the trailing "\ " of "\userpagenumber\ ".


Thank you Alan.  That worked.  I didn't forget it; I never knew it.  I'm
starting to run into the area where the Wiki isn't enough, but I don't know
enough TeX to read the Context source for the macros.  What is recommended to
get up to speed on Context?  Should I go back and re-read Knuth's book on TeX
then try reading ConTeXt source?  Last time I read it was 20 years ago, and
only got half way through; that was enough for my needs back then.  I guess a
week or two reading everything on this page would help too:

 http://www.luatex.org/documentation.html

Now just need an answer for the blank page issue and I can start shipping these
spreadsheets to clients.

David
___
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] how to put page X of N in header or top space?

2018-08-14 Thread Alan Braslau
On Tue, 14 Aug 2018 13:44:43 -0700
David Walther  wrote:

> I did page Page X of N, but in the output, it displays like
> Page 2of 3, Page 1of 3, etc.  It ignores the space between the number and the 
> word of.

You must have forgotten the trailing "\ " of "\userpagenumber\ ".

Alan
___
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] how to put page X of N in header or top space?

2018-08-14 Thread David Walther

Thank you Wolfgang, that worked nicely.  Two artifacts I'm not sure how to 
address:

I did page Page X of N, but in the output, it displays like
Page 2of 3, Page 1of 3, etc.  It ignores the space between the number and the 
word of.

Secondly, when I use the doublesided and the {singlesided,doublesided}
alternative page numbering, it rounds up to an even number of pages, even
though the last page is blank.  When I just use the singlesided option I get 3
pages as expected, but it doesn't do the nice interior margins and switching
sides of page numbers.  Even context doesn't view the blank page at the end as
a page, because it doesn't print the header or footer on it.

David


On Tue, Aug 14, 2018 at 09:32:29PM +0200, Wolfgang Schuster wrote:

\setuppagenumbering
 [alternative=doublesided,   % doublesided layout
 %alternative={singlesided,doublesided}, % singlesided layout with 
left/right pages

  location=none]

\setupheadertexts [My Spreadsheet]

\setupheadertexts
 [] [Page \userpagenumber\ of \lastuserpagenumber]
 [Page \userpagenumber\ of \lastuserpagenumber] []

\starttext
\dorecurse{10}{\page[dummy]}
\stoptext


Wolfgang


David Walther schrieb am 14.08.18 um 18:28:
Hi, I am slowly learning ConTeXt.  I am generating tables and 
spreadsheets, and

transforming them into ConTeXt, finally got it working after a lot of
mysterious errors about missing } as macro arguments.

I have read this page carefully:  http://wiki.contextgarden.net/Layout

How can I alter the page number?  Is it in the header, or is it in the
topspace?

I want this to be at the top of each page of my spreadsheet:

My Spreadsheet (centered) Page 1 of 3 (right justified)

And on even pages, the other way around:

Page 2 of 3 (left justified) My Spreadsheet (centered)

What is the right way to do this?  Is there an override and a blob 
of code I need to put into one of the boxes in the Layout?


David
___

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
___

Re: [NTG-context] referencing the equation

2018-08-09 Thread Henri Menke
I usually define my own reference formats, “ineq” for equations, “infig” 
for figures:


\definereferenceformat[ineq][left=(,right=)]
\definereferenceformat[infig][left=\labeltext{figure}]

\starttext

\starttext

\placeformula
\startformula \startalign
 \NC a_1 x + b_1 y \NC = c_1 \NR[eq:1]
 \NC a_2 x + b_2 y \NC = c_2 \NR[eq:2]
\stopalign \stopformula

As seen from \ineq[eq:1] and \ineq[eq:2], referring equations is 
straight forward.


\stoptext

\stoptext

On 10/08/18 10:00, Jeong Dal wrote:

Dear Wolfgang,

Although there is an answer in the manual, I didn’t read it carefully.

Sometimes, I used “\in{word}[reference]” like “\in{equation}[eq:1]".
But I have to change it to “equation (\in[eq:1])”.

Thank you so much.

Best regards,

Dalyoung


2018. 8. 10. 오전 12:21, Wolfgang Schuster  작성:

When you look at the first example in section 4.1 you can see that the 
parentheses are inserted by hand.

%%
\starttext

\placeformula
\startformula \startalign
  \NC a_1 x + b_1 y \NC = c_1 \NR[eq:1]
  \NC a_2 x + b_2 y \NC = c_2 \NR[eq:2]
\stopalign \stopformula

As seen from (\in[eq:1]) and (\in[eq:2]), referring equations is straight 
forward.

\stoptext
%%

Wolfgang



Jeong Dal schrieb am 09.08.18 um 17:12:

Dear,

The examples in mathalign.pdf(p4 - ) tells us the method of referencing the 
equation.
The numbers for the equation is written as (1.1), and in the text, it is 
written as (1.1).
That is the numbers are  always surrounded by ( , ).

In the output of the following code, the equations are numbered surrounded by 
().
But there is no (), when we referece it.

What is the difference between MWE and mathalign.pdf.

Thank you for reading.

Best regards,

Dalyoung

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


___
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] referencing the equation

2018-08-09 Thread Jeong Dal
Dear Wolfgang,

Although there is an answer in the manual, I didn’t read it carefully.

Sometimes, I used “\in{word}[reference]” like “\in{equation}[eq:1]". 
But I have to change it to “equation (\in[eq:1])”. 

Thank you so much.

Best regards,

Dalyoung

> 2018. 8. 10. 오전 12:21, Wolfgang Schuster  
> 작성:
> 
> When you look at the first example in section 4.1 you can see that the 
> parentheses are inserted by hand.
> 
> %%
> \starttext
> 
> \placeformula
> \startformula \startalign
>  \NC a_1 x + b_1 y \NC = c_1 \NR[eq:1]
>  \NC a_2 x + b_2 y \NC = c_2 \NR[eq:2]
> \stopalign \stopformula
> 
> As seen from (\in[eq:1]) and (\in[eq:2]), referring equations is straight 
> forward.
> 
> \stoptext
> %%
> 
> Wolfgang
> 
> 
> 
> Jeong Dal schrieb am 09.08.18 um 17:12:
>> Dear,
>> 
>> The examples in mathalign.pdf(p4 - ) tells us the method of referencing the 
>> equation.
>> The numbers for the equation is written as (1.1), and in the text, it is 
>> written as (1.1).
>> That is the numbers are  always surrounded by ( , ).
>> 
>> In the output of the following code, the equations are numbered surrounded 
>> by ().
>> But there is no (), when we referece it.
>> 
>> What is the difference between MWE and mathalign.pdf.
>> 
>> Thank you for reading.
>> 
>> Best regards,
>> 
>> Dalyoung
>> 
>> ___
>> 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
___

Re: [NTG-context] general suggestion for ConTeXt documentation

2018-08-08 Thread Pablo Rodriguez
On 08/08/2018 03:30 PM, Robert Zydenbos wrote:
> On 8. Aug 2018, at 00:54, Alan Braslau wrote:
>>
>> tex/context/interface/mkiv/i-context.pdf
> 
> Thank you! I didn’t know I already had this updated version of a
> document I’ve already been using. But however useful this document
> already is, it does illustrate some of my problems. For instance, in
> the entry ‘\setupnote’ I see:
> 
> …
> indicator: yes no
> distance: dimension
> …
> 
> Surely this is fine for those who have been working on ConTeXt for
> years at a very low coding level.

Hi Robert,

please, don’t consider me among those who have been worked on ConTeXt at
a very low level (even for milliseconds).

> But I see this and ask myself: “indicator of what? distance to what?” etc.

Indicator that the note goes to the following page. But I don’t know
what "distance" in \setupnote does.

> (Sometimes, when confronted with such information, I just play
> around a bit with changing parameters and see what happens: sometimes
> I discover the meanings, sometimes I don’t.)

Lucky you, I have to play all the time to see what happens. I only learn
by doing.

> ‘\setupnote’ inherits from ‘\setupframed’. There one finds
> 
> …
> profile = NAME
> empty = yes no
> …
> 
> and similar questions arise: “what kind of profile?”, “what is empty
> or not?” etc.

The note zone is a frame. Empty or full is the text in that frame. In
that case (if this frame is empty), it removes the footnotes themselves.

I don’t know what are profiles. But I never needed to use them.

> Unfortunately the source browser on the Wiki is out of order,
> otherwise that might have helped.

http://source.contextgarden.net/ does work for me. But it is better that
you search your distribution, since the sources from your computer may
be the latest beta. In the garden, they are outdated.

> Suggestion / request: all the ConTeXt source files are, of course,
> read and processed in a particular order. It would surely be useful if
> someone could indicate where this chain begins. Anybody who would be
> interested in sorting out the workings of ConTeXt and writing a manual
> (no, I am not making any promises yet :-) ) could then trace how one
> command leads to another, another, another… and how the entire system is
> built up.

I wonder how many participants in this list might be able to do that
(Hans, Wolfgang and Taco excluded, of course).

No doubt that you are way smarter than me, but let me say a word on your
approach to ConTeXt.

Typography is a craftmanship. I don’t think it is totally different when
it is digital. Learning by doing is a good approach.

Of course, you may afford to learn from the source. But after all,
ConTeXt knowledge is relevant to typeset texts.

I might be totally missing your point here, but it seems to me that you
try to know what can be achieved in general with ConTeXt, even before to
learn how to use ConTeXt for your typesetting needs.

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
___

Re: [NTG-context] future versions

2018-07-24 Thread Rik Kabel

On 7/24/2018 14:43, Hans Hagen wrote:

Hi,

Around the upcoming context meeting we expect to release luatex 1.09 
(or 1.10 ... yet undecided) which is the prelude to the next year tex 
live version. It's another step towards a stable version in terms of 
functionality as we don't expect much more to be added (in fact, I'm 
wondering if it makes sense to come up with a leaner and meaner 
version at some point because context can probably benefit from that). 
Of course under the hood there are improvements possible and we have 
some ideas (that might materialize at some point) but generally 
spoken, this is what one gets.


That said, a logical question is how about next versions of context. 
Are there fundamental features missing? Is more needed? Keep in mind 
that we're not talking of desk top publishing (click and point and 
place stuff) and also not of word processing (office like stuff) but 
of mostly automated structured document rendering. Also, keep in mind 
the landscape that we operate in (context development is mostly user 
driven as publishers imo long ago lost interest in any research and 
development and the potential of tex and friends is largely unknown 
elsewhere).


It's not my intention to implement each possible feature as core 
feature (no one would document it anyway). Also, as development is 
basically a spare time effort, don't expect complex commercially 
interesting niches to come for free either as in that case one can 
wait till I a find a reason for implementing it for fun or development 
is driven by a project.


When thinking of future additions, tex, lua, metapost of a mix is 
possible. They should be of interest for more than one user. Of course 
it can also be that everything needed is there. Maybe existing 
mechanisms can be improved in terms of functionality or performance 
(although i think that performance wise we're ok). But again keep in 
mind that the boundary conditions (all these interacting sub 
mechanisms) also prohibit some functionality.


Hans

I would ask for more stylistic or semantic tagging to be added to the 
XML export. A good example is that of bibliographies, where font styles 
carry significant semantic meaning (depending on the standard used: 
italic for book titles, ibold or talic for volume and issue numbers, and 
so on.) The xml output reflects none of this.


I do not know whether one would want stylistic tagging (italic, bold, 
...) or semantic (booktitle, issue number). In either case, they could 
be implemented as highlights or tagged elements, both of which are 
currently carried through, and the user could then apply the appropriate 
styling with css or other transformation mechanisms.


The ability to point register entries to something other than page 
numbers would also be useful. For export formats (XML) this requires 
that label references be part of the export.


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

Re: [NTG-context] future versions

2018-07-24 Thread Idris Samawi Hamid ادريس سماوي حامد

Hi Hans, all,

On Tue, 24 Jul 2018 12:43:51 -0600, Hans Hagen  wrote:


Hi,

Around the upcoming context meeting we expect to release luatex 1.09 (or  
1.10 ... yet undecided) which is the prelude to the next year tex live  
version. It's another step towards a stable version in terms of  
functionality as we don't expect much more to be added (in fact, I'm  
wondering if it makes sense to come up with a leaner and meaner version  
at some point because context can probably benefit from that). Of course  
under the hood there are improvements possible and we have some ideas  
(that might materialize at some point) but generally spoken, this is  
what one gets.


That said, a logical question is how about next versions of context. Are  
there fundamental features missing? Is more needed? Keep in mind that  
we're not talking of desk top publishing (click and point and place  
stuff) and also not of word processing (office like stuff) but of mostly  
automated structured document rendering. Also, keep in mind the  
landscape that we operate in (context development is mostly user driven  
as publishers imo long ago lost interest in any research and development  
and the potential of tex and friends is largely unknown elsewhere).


It's not my intention to implement each possible feature as core feature  
(no one would document it anyway). Also, as development is basically a  
spare time effort, don't expect complex commercially interesting niches  
to come for free either as in that case one can wait till I a find a  
reason for implementing it for fun or development is driven by a project.


When thinking of future additions, tex, lua, metapost of a mix is  
possible. They should be of interest for more than one user. Of course  
it can also be that everything needed is there. Maybe existing  
mechanisms can be improved in terms of functionality or performance  
(although i think that performance wise we're ok). But again keep in  
mind that the boundary conditions (all these interacting sub mechanisms)  
also prohibit some functionality.


One needed feature that would be of general use is better support for  
synctex. Thinking especially of structural elements such as headings,  
footnotes, etc. which mostly do not work with synctex - i.e., clicking on  
these elements in the pdf do not take one back to the correct location in  
the relevant TEX file.


Best wishes
Idris
--
Idris Samawi Hamid, Professor
Department of Philosophy
Colorado State University
Fort Collins, CO 80512
___
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] future versions

2018-07-24 Thread Hans van der Meer
I am using XML a lot for structured data and typesetting them with hopefully 
not too much attention to detail — although I must confess often being a 
hopeless perfectionist.
If there are general improvements that can be made in that direction, I would 
welcome them. Although I apologise not being able to propose concrete 
suggestions at the moment, I hope this post will incite those more 
knowledgeable than me, to do so. They are thanked beforehand.

Hans van der Meer

> On 24 Jul 2018, at 20:43, Hans Hagen  wrote:
> 
> Hi,
> 
> Around the upcoming context meeting we expect to release luatex 1.09 (or 1.10 
> ... yet undecided) which is the prelude to the next year tex live version. 
> It's another step towards a stable version in terms of functionality as we 
> don't expect much more to be added (in fact, I'm wondering if it makes sense 
> to come up with a leaner and meaner version at some point because context can 
> probably benefit from that). Of course under the hood there are improvements 
> possible and we have some ideas (that might materialize at some point) but 
> generally spoken, this is what one gets.
> 
> That said, a logical question is how about next versions of context. Are 
> there fundamental features missing? Is more needed? Keep in mind that we're 
> not talking of desk top publishing (click and point and place stuff) and also 
> not of word processing (office like stuff) but of mostly automated structured 
> document rendering. Also, keep in mind the landscape that we operate in 
> (context development is mostly user driven as publishers imo long ago lost 
> interest in any research and development and the potential of tex and friends 
> is largely unknown elsewhere).
> 
> It's not my intention to implement each possible feature as core feature (no 
> one would document it anyway). Also, as development is basically a spare time 
> effort, don't expect complex commercially interesting niches to come for free 
> either as in that case one can wait till I a find a reason for implementing 
> it for fun or development is driven by a project.
> 
> When thinking of future additions, tex, lua, metapost of a mix is possible. 
> They should be of interest for more than one user. Of course it can also be 
> that everything needed is there. Maybe existing mechanisms can be improved in 
> terms of functionality or performance (although i think that performance wise 
> we're ok). But again keep in mind that the boundary conditions (all these 
> interacting sub mechanisms) also prohibit some functionality.
> 
> 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
> ___


___
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] future versions

2018-07-24 Thread Hans Hagen

Hi,

Around the upcoming context meeting we expect to release luatex 1.09 (or 
1.10 ... yet undecided) which is the prelude to the next year tex live 
version. It's another step towards a stable version in terms of 
functionality as we don't expect much more to be added (in fact, I'm 
wondering if it makes sense to come up with a leaner and meaner version 
at some point because context can probably benefit from that). Of course 
under the hood there are improvements possible and we have some ideas 
(that might materialize at some point) but generally spoken, this is 
what one gets.


That said, a logical question is how about next versions of context. Are 
there fundamental features missing? Is more needed? Keep in mind that 
we're not talking of desk top publishing (click and point and place 
stuff) and also not of word processing (office like stuff) but of mostly 
automated structured document rendering. Also, keep in mind the 
landscape that we operate in (context development is mostly user driven 
as publishers imo long ago lost interest in any research and development 
and the potential of tex and friends is largely unknown elsewhere).


It's not my intention to implement each possible feature as core feature 
(no one would document it anyway). Also, as development is basically a 
spare time effort, don't expect complex commercially interesting niches 
to come for free either as in that case one can wait till I a find a 
reason for implementing it for fun or development is driven by a project.


When thinking of future additions, tex, lua, metapost of a mix is 
possible. They should be of interest for more than one user. Of course 
it can also be that everything needed is there. Maybe existing 
mechanisms can be improved in terms of functionality or performance 
(although i think that performance wise we're ok). But again keep in 
mind that the boundary conditions (all these interacting sub mechanisms) 
also prohibit some functionality.


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] Some questions about the presentation of a book

2018-07-21 Thread Pablo Rodriguez
On 07/21/2018 11:41 AM, Fabrice Couvreur wrote:
> Hello,
> To center the titles, we must add the key alternative = middle

Hi Fabrice,

no, you should add:

  \setuphead[chapter][align=center]

> However for the title of the summary, it is correct because a single
> word but for the titles of chapters, it is not correct because I get :
> 
> Chapitre I :
> First chapter
> 
> instead of :Chapitre I : First chapter

Fixed with the option above.

> 2018-07-20 23:55 GMT+02:00 Fabrice Couvreur:
> 
> Hello,
> I would like to modify the file below to :
> 
> - center the title "Sommaire"
> - delete the line of the first page
> - center the title of each chapter
> - delete the line on each page with the title of the chapter

As far as I can remember, "\setuphead[chapter][header=none]" removed the
header only in the page where the chapter heading is placed.

But I must be missing something, since it doesn’t work.

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
___

Re: [NTG-context] Some questions about the presentation of a book

2018-07-21 Thread Fabrice Couvreur
Hello,
To center the titles, we must add the key alternative = middle
However for the title of the summary, it is correct because a single word
but for the titles of chapters, it is not correct because I get :

Chapitre I :
First chapter

instead of : Chapitre I : First chapter

​Thanks
Fabrice​




2018-07-20 23:55 GMT+02:00 Fabrice Couvreur :

> Hello,
> I would like to modify the file below to :
>
> - center the title "Sommaire"
> - delete the line of the first page
> - center the title of each chapter
> - delete the line on each page with the title of the chapter
>
> Thanks for your help
> Fabrice
>
> 
> ##
> \usemodule[visual]
>
> \mainlanguage[fr]
>
> \setuphead[chapter][commandbefore={:\,},header=empty]
>
> \setuphead[subsection][style=bold]
>
> \setuphead[section]
>   [distance=\zeropoint,
>style=bold,
>commandbefore={\space\endash\space}]
>
> \setuphead[title][commandbefore={}]
>
> \setuplayout
>   [height=middle,
>width=middle,
>backspace=2cm,
>topspace=10mm,
>bottomspace=10mm,
>header=10mm,
>footer=10mm,
>footerdistance=10mm,
>headerdistance=10mm]
>
> \definelayout
>   [firstpage]
>   [header=empty]
>
>
> \setupbackgrounds[header][text][bottomframe=on]
>
> \setupheadertexts[{\getmarking[section]}]
>  [pagenumber]
>  [{\getmarking[chapter]}]
>  [pagenumber]
>
>
> \setuppagenumbering[alternative=,location=]
>
>
> \setuplabeltext[fr][chapter=Chapitre ]
>
> \definestructureconversionset
>   [structure]
>   [n, R, n, n, n]
>
> \definestructureconversionset
>   [digits]
>   [n, n, n, n, n]
>
> \setupheads[sectionconversionset=structure]
>
> \setuplist[chapter][style=bold,width=5mm]
>
> \starttext
>
> \starttitle[title={\bf Sommaire}]
> \placelist
>   [chapter,section,subsection]
>   [criterium=all,
>alternative=c]
>
> \stoptitle
>
> \startchapter[title=First chapter]
> \startsection[title=Fist section]
> \startsubsection[title=First subsection]
>  \dorecurse{10}{\fakewords{120}{120}\par}
> \stopsubsection
> \stopsection
> \stopchapter
> \startchapter[title=Second chapter]
> \startsection[title=Second section]
> \startsubsection[title=Second subsection]
> \dorecurse{10}{\fakewords{120}{120}\par}
> \stopsubsection
> \stopsection
> \stopchapter
> \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] text in mathematics

2018-07-09 Thread Hans Hagen

On 7/9/2018 11:39 AM, Wolfgang Schuster wrote:

Hi Alan,

you should at least limit the scope of the command to math mode

\appendtoks
     \let\t\mathtext
     \let\w\mathword
\to \everymathematics

something

\ifdefined\t \else \unexpanded\def\t{\mathortext\text\mathtext} \fi
\ifdefined\w \else \unexpanded\def\w{\mathortext\word\mathword} \fi

\appendtoks
\let\t\mathtext
\let\w\mathword
\to \everymathematics

because sometimes a \t or \w is part of an expansion so we need it to be 
defined then (for instance, Alan loves to put lots of complex math in 
textext)


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] issue with hyphenation patterns

2018-06-11 Thread Pablo Rodriguez
Dear list,

I have the following sample:

\setuplanguage[agr][patterns={agr, en}]
\setuplanguage[en][patterns={en, agr}]
\starttext
\hyphenatedword{judgmental}
\agr \hyphenatedword{judgmental}
\stoptext

I wonder why \en hyphenates the word and \agr doesn’t.

I mean, both languages have the same patterns loaded.

Using \de or \es, hyphenation works fine in both cases:

\setuplanguage[agr][patterns={agr, deo}]
\setuplanguage[deo][patterns={de, agr}]
\mainlanguage[de]
\starttext
\hyphenatedword{Klugheit}
\agr \hyphenatedword{Klugheit}
\stoptext

\setuplanguage[agr][patterns={agr, deo}]
\setuplanguage[es][patterns={es, agr}]
\mainlanguage[es]
\starttext
\hyphenatedword{experimentado}
\agr \hyphenatedword{experimentado}
\stoptext

If this isn’t a bug, what am I 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] Problem defining macro with Lua inside

2018-05-30 Thread Procházka Lukáš Ing .

... Great, thank you!

Lukas


On Wed, 30 May 2018 13:47:12 +0200, Henri Menke  wrote:


On 05/30/2018 08:19 PM, Procházka Lukáš Ing. wrote:

Hello,

I'm trying to define a macro (a MS Word -> clipboard -> Ctx tool), whose
simplified form is the following:



This cannot work \startluacode has to “see” \stopluacode.  Use buffers:

\unexpanded\def\startWord
  {\grabbufferdata[Word][startWord][stopWord]}

\unexpanded\def\stopWord
  {\startluacode
print(buffers.prepend("Word","context[["))
print(buffers.append("Word","]]"))
  \stopluacode
  \ctxluabuffer[Word]}

\starttext

\startWord
  abc
  def

  ghi
\stopWord

\stoptext




\def\startWord{%
  \startluacode
context[[
}

\def\stopWord{%
]]
  \stopluacode
}

\starttext
  aaa

  \startWord
abc
def

ghi
  \stopWord
\stoptext


Unfortunately, I'm not able to define \startWord and \stopWord in a way
that Ctx would accept.

How to define it?

Any help would be appreciated.

Best regards,

Lukas



--
Ing. Lukáš Procházka | mailto:l...@pontex.cz
Pontex s. r. o.  | mailto:pon...@pontex.cz | http://www.pontex.cz | 
IDDS:nrpt3sn
Bezová 1658
147 14 Praha 4

Mob.: +420 702 033 396

___
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 defining macro with Lua inside

2018-05-30 Thread Hans Hagen

On 5/30/2018 10:19 AM, Procházka Lukáš Ing. wrote:

Hello,

I'm trying to define a macro (a MS Word -> clipboard -> Ctx tool), whose 
simplified form is the following:



\def\startWord{%
   \startluacode
     context[[
}

\def\stopWord{%
]]
   \stopluacode
}

\starttext
   aaa

   \startWord
     abc
     def

     ghi
   \stopWord
\stoptext


Unfortunately, I'm not able to define \startWord and \stopWord in a way 
that Ctx would accept.


How to define it?

Any help would be appreciated.


just define a buffer and do something with it afterwards



--

-
  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] Problem defining macro with Lua inside

2018-05-30 Thread Henri Menke
On 05/30/2018 08:19 PM, Procházka Lukáš Ing. wrote:
> Hello,
> 
> I'm trying to define a macro (a MS Word -> clipboard -> Ctx tool), whose
> simplified form is the following:
> 

This cannot work \startluacode has to “see” \stopluacode.  Use buffers:

\unexpanded\def\startWord
  {\grabbufferdata[Word][startWord][stopWord]}

\unexpanded\def\stopWord
  {\startluacode
print(buffers.prepend("Word","context[["))
print(buffers.append("Word","]]"))
  \stopluacode
  \ctxluabuffer[Word]}

\starttext

\startWord
  abc
  def

  ghi
\stopWord

\stoptext


> 
> \def\startWord{%
>   \startluacode
>     context[[
> }
> 
> \def\stopWord{%
> ]]
>   \stopluacode
> }
> 
> \starttext
>   aaa
> 
>   \startWord
>     abc
>     def
> 
>     ghi
>   \stopWord
> \stoptext
> 
> 
> Unfortunately, I'm not able to define \startWord and \stopWord in a way
> that Ctx would accept.
> 
> How to define it?
> 
> Any help would be appreciated.
> 
> Best regards,
> 
> Lukas
> 
> 
> 
> 
> ___
> 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] Problem defining macro with Lua inside

2018-05-30 Thread Procházka Lukáš Ing .

Hello,

I'm trying to define a macro (a MS Word -> clipboard -> Ctx tool), whose 
simplified form is the following:


\def\startWord{%
  \startluacode
context[[
}

\def\stopWord{%
]]
  \stopluacode
}

\starttext
  aaa

  \startWord
abc
def

ghi
  \stopWord
\stoptext


Unfortunately, I'm not able to define \startWord and \stopWord in a way that 
Ctx would accept.

How to define it?

Any help would be appreciated.

Best regards,

Lukas


--
Ing. Lukáš Procházka | mailto:l...@pontex.cz
Pontex s. r. o.  | mailto:pon...@pontex.cz | http://www.pontex.cz | 
IDDS:nrpt3sn
Bezová 1658
147 14 Praha 4

Mob.: +420 702 033 396

t6.log
Description: Binary data


t6.mkiv
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
___

[NTG-context] mtxrun uses 'nil' for platform

2018-04-15 Thread Vladimir Lomov
Hello list,
recent update of context suite (beta) changed something in the code of
'mtxrun' so now it shows me a warning:
  ${CONTEXT}/bin/mtxrun:20683: attempt to concatenate a nil value (field 
'platform')
I didn't notice this warning earilier.

The line 20683 in 'mtxrun' is
local texos="texmf-"..os.platform

To check the return of 'os.platform' I made small lua script and run it
as
  mtxrun --script SCRIPT --platform=linux-64
It returned 'nil nil'. Is this expected behavior?

% SCRIPT.lua
--- 8< 
local plat=os.platform
local plat2=os.getenv("MTX_PLATFORM")
print("platform = ", plat)
print("platform2 = ", plat2)
--- 8< 

---
WBR, Vladimir Lomov


-- 
Hacking's just another word for nothing left to kludge.
___
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] Fwd: Custom sorting of "pseudo-language" in a register

2018-03-22 Thread Hans Hagen

On 3/22/2018 9:25 AM, luigi scarso wrote:

-- Forwarded message --
From: John Grasty <johnpgra...@gmail.com>
Date: Fri, Mar 16, 2018 at 4:15 PM
Subject: [NTG-context] Custom sorting of "pseudo-language" in a register
To: mailing list for ConTeXt users <ntg-context@ntg.nl>


Hello all,

I’m just getting acquainted with ConTeXt, and I am finding it so much
more suitable for my work and needs. Thanks for the great software.
Here’s my situation. I write in Slovene and in English, and I need to
make numerous references to biblical passages. I want to create an
index of these citations, but I want them in the order they appear in
the Bible rather than alphabetical order. Henri Menke provided a
perfectly workable solution on TeX StackExchange[^1], but because this
is a multi-year project, I wanted to find a bit more permanent
solution. I discovered I can use Lua LPEG to parse and normalize my
citations so they are referenced in a uniform style.

My problem comes in the register sorting. Hans, I saw where in the
paste you have recommended a “pseudo-language” to implement a custom
sort in such a situation. I have almost figured out how to accomplish
this. (See the MWE below.) I have no problem with single word sections
(Genesis, Exodus, etc.). I can turn off indicators, do the custom sort
(see below), and I get the intended result. If I have a multiple word
title (Evangelij po Janezu), that technique doesn’t work. The
replacement for more than one word (or if a number is involved, like
1John) doesn’t seem to work. I have no doubt there is a good reason;
I’m just a newbie!

It seems my options are to:

1. Figure out how to do a replacement for a phrase or a book with a
number in its name. Then this technique seems to work ok.
2. Or to add an entries and figure out some way to not print the first
level in the index. So the indicator will be the book name, and
underneath the chapter and verses will be listed with out the book
name being repeated.


Are there any ideas to point me in the right direction?


You're bitten by the cleaner that kind of normalizes entries as you can 
see when you say


\enabletrackers[*sort*]

replacing spaces by \0 can help but that sort of assumes that you know 
what happens inside


So, i added some code to handle that. I also added a helper so that you 
can do:


\startluacode
local list = {
-- old testament
"Genesis", "Exodus", "Leviticus", "Numbers", "Deuteronomy", 
"Joshua",

"Judges", "Ruth", "1 Samuel", "2 Samuel", "1 Kings", "2 Kings",
"1 Chronicles", "2 Chronicles", "Ezra", "Nehemiah", "Esther", 
"Job", "Psalms",

"Proverbs", "Ecclesiastes", "Canticles", "Isaiah", "Jeremiah",
"Lamentations", "Ezekiel", "Daniel", "Hosea", "Joel", "Amos", 
"Obadiah",
"Jonah", "Micah", "Nahum", "Habakkuk", "Zephaniah", "Haggai", 
"Zechariah",

"Malachi",
-- new testament
"Matthew", "Mark", "Luke", "John", "Acts", "Romans", "1 
Corinthians",
"2 Corinthians", "Galatians", "Ephesians", "Philippians", 
"Colossians",
"1 Thessalonians", "2 Thessalonians", "1 Timothy", "2 Timothy", 
"Titus",
"Philemon", "Hebrews", "James", "1 Peter", "2 Peter", "1 John", 
"2 John",

"3 John", "Jude", "Revelation",
}

sorters.definitions['bbt'] = {
replacements = sorters.replacementlist(list),
}
\stopluacode

\defineregister
  [booksort]
  [language=bbt,
   n=1,
   indicator=no]

\starttext

One   \booksort{Genesis+5.2}
Two   \booksort{Exodus+2}
Three \booksort{Genesis+45}
Four  \booksort{Philemon+2}
Five  \booksort{John+45}
Six   \booksort{1 John 1+45}
Seven \booksort{2 John 2+45}

\blank[3*line]

\placeregister[booksort][language=bbt]

\stoptext

It probably makes sense to make this into a module but then we need to 
collect a few lists.


I'll upload a beta.

Hans


Thanks so much for your help,
John Grasty



[1]: 
https://tex.stackexchange.com/questions/418575/custom-ordering-for-a-index-register-in-context/

- - - -

\startluacode

local utfchar, utfbyte  = utf.char, utf.byte
local sorters   = sorters
local definitions   = sorters.definitions
local replacementoffset = sorters.constants.replacementoffset
local variables = interfaces.variabl

[NTG-context] Custom sorting of "pseudo-language" in a register

2018-03-16 Thread John Grasty
Hello all,

I’m just getting acquainted with ConTeXt, and I am finding it so much more 
suitable for my work and needs. Thanks for the great software. Here’s my 
situation. I write in Slovene and in English, and I need to make numerous 
references to biblical passages. I want to create an index of these citations, 
but I want them in the order they appear in the Bible rather than alphabetical 
order. Henri Menke provided a perfectly workable solution on TeX 
StackExchange[^1], but because this is a multi-year project, I wanted to find a 
bit more permanent solution. I discovered I can use Lua LPEG to parse and 
normalize my citations so they are referenced in a uniform style.

My problem comes in the register sorting. Hans, I saw where in the paste you 
have recommended a “pseudo-language” to implement a custom sort in such a 
situation. I have almost figured out how to accomplish this. (See the MWE 
below.) I have no problem with single word sections (Genesis, Exodus, etc.). I 
can turn off indicators, do the custom sort (see below), and I get the intended 
result. If I have a multiple word title (Evangelij po Janezu), that technique 
doesn’t work. The replacement for more than one word (or if a number is 
involved, like 1John) doesn’t seem to work. I have no doubt there is a good 
reason; I’m just a newbie!

It seems my options are to:

1. Figure out how to do a replacement for a phrase or a book with a number in 
its name. Then this technique seems to work ok.
2. Or to add an entries and figure out some way to not print the first level in 
the index. So the indicator will be the book name, and underneath the chapter 
and verses will be listed with out the book name being repeated.


Are there any ideas to point me in the right direction?

Thanks so much for your help,
John Grasty



[1]: 
https://tex.stackexchange.com/questions/418575/custom-ordering-for-a-index-register-in-context/

- - - -

\startluacode

local utfchar, utfbyte  = utf.char, utf.byte
local sorters   = sorters
local definitions   = sorters.definitions
local replacementoffset = sorters.constants.replacementoffset
local variables = interfaces.variables

local gen  = utfchar(replacementoffset + 1), utfchar(replacementoffset + 11)
local exo = utfchar(replacementoffset + 2), utfchar(replacementoffset + 220)
local jn = utfchar(replacementoffset + 4), utfchar(replacementoffset + 27)


sorters.definitions['bbt'] = {
replacements = {
{ "Geneza", gen },
{ "Eksodus", exo }, 
{ "Janez", jn },
},

orders = {
gen, exo, jn
}
}
\stopluacode

\mainlanguage[sl]

\defineregister[booksort]
\setupregister[booksort]
 [language=bbt,
  n=1,
  indicator=yes,
  ]
  

\starttext

\booksort{Janez+5.2}One
\booksort{Eksodus+2}Two
\booksort{Geneza+45}Three

\page

\placeregister[booksort][language=bbt]

\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] Passing two arguments from Lua to Context

2018-02-13 Thread Hans Hagen

On 2/13/2018 10:16 PM, Otared Kavian wrote:

On 13 Feb 2018, at 17:38, Hans Hagen <pra...@wxs.nl> wrote:


[…]


context.goto( "Index", { "ref:index" })

\def\foo#1#2{}

context.foo("a","b")

\def\foo[#1][#2]{}

context.foo( { "a" }, { "b" } )

etc


Hi Hans,

Thanks for your attention, your quick response and the hints, especially 
regarding the definition of a command with brackets.

Indeed, as you may see with the following modified example,
context.goto("Index",{"ref:index"})
generates an error, maybe because of a delimiter issue with the definition of 
\goto.
However, after defining a \MyGoTo command with delimiters being explicitely 
brackets, then
context.MyGoTo({"Index"},{"ref:index"})
works fine, as well as
local s,t = "Index","ref:index"
context.MyGoTo({s},{t})
so that my problem is solved…

Best regards: OK
%% begin test-lua-reference.tex
\setupinteraction[state=start]
\def\MyGoTo[#1][#2]{\goto{#1}[#2]}
\starttext

\startchapter[title={Ward},reference={ch:ward}]

\startluacode
context.index("Knuth")
context.index("Ward")
context("Read Knuth and see also the ")
local s,t = "Index","ref:index"
context.MyGoTo({s},{t})
--  context.goto("Index",{"ref:index"}) -- this does not work
\stopluacode


you need to use

context["goto"]("Index",{"ref:index"}) -- this does not work

because "goto" is a reserved lua word

you can't say foo.if or foo.end either


\input ward.tex

\stopchapter

\starttitle[title={Index}]
\startluacode
local s,t = "ref:","index"
context.pagereference({"ref:index"})
\stopluacode
\placeindex
\stoptitle

\stoptext
%% end test-lua-reference.tex
___
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
___




--

-
  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] Unexpected emergency stop

2018-02-10 Thread Tim Steenvoorden
Thanks Otared! Works like a charm!

Out of curiosity, could you explain the mechanics behind this? I know it is
a commonly used trick in TeX macro definitions, but I don’t know how it
changes TeX’s understanding of the tokes it parses.

Cheers,
Tim

Op vr 9 feb. 2018 om 20:50 schreef Otared Kavian <ota...@gmail.com>:

> Hi Tim,
>
> Welcome back to ConTeXt!
> When one defines a command, in particular when using the brackets […], it
> is wise to put a percent sign at the end of the line if one changes the
> line on which the macro is defined.
> In your case, saying
>
> \definemacro\see[#1:#2]%
> {\dosee{#1}{#2}}
>
> suppresses the problem you are reporting (at least here on my machine
> running MacOS 10.13.3 and the latest beta as yours).
>
> Best regards: OK
>
> On 9 Feb 2018, at 19:03, Tim Steenvoorden <tim.steenvoor...@gmail.com>
> wrote:
>
> Dear all,
>
> After some time I’m back to ConTeXt and I dug up some old macros. I used
> to define a \see macro to automatically insert labels like “chapter”,
> "figure" etc. in front of a reference based on the structure of the label.
> Below you'll find its definition.
>
> It worked in MKIV about two years ago, nevertheless, now ConTeXt hangs
> when placing punctuation after the command. I.e. TeX hangs with an
> emergency stop (“*" on the terminal) after all files have been processed
> (after cont-yes.mkiv is closed).
>
> What am I doing wrong that such a thing happens?
>
> I’m on macOS 10.13.3 with minimals beta 2018.02.09 00:04.
>
> Cheers,
> Tim
>
>
> ––
>
> \starttext
>
> \definemacro\see[#1:#2]
>   {\dosee{#1}{#2}}
>
> \starttexdefinition dosee #1#2
>   \doifdefinedelse{in#1}
> {\getvalue{in#1}[#1:#2]}
> {\writestatus{references}{reference format in#1 not defined}
>  \in[#1:#2]}
> \stoptexdefinition % #3 is optional and gobbled by \in
>
> \definereferenceformat[inchp]
>   [text=\word{\labeltext{chapter}}]
>
> \setuplabeltext[en]
>   [chapter=Chapter~]
>
> \chapter[chp:first]{First}
>
> Works:
> \see[chp:first]
>
> Hangs:
> \see[chp:first],
>
> \stoptext
>
> ––
> --
> 
> T.J. Steenvoorden, MSc
>
> PhD Candidate | Radboud University Nijmegen
> Faculty of Science | Department of Software Science
> Mercator 1 Building | Room 01.08
> Toernooiveld 212 | 6525 EC | Nijmegen | The Netherlands
> +31 24 365 22 91 | t.steenvoor...@cs.ru.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
>
> ___
>
>
>
> ___
> 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
>
> ___

-- 

T.J. Steenvoorden, MSc

PhD Candidate | Radboud University Nijmegen
Faculty of Science | Department of Software Science
Mercator 1 Building | Room 01.08
Toernooiveld 212 | 6525 EC | Nijmegen | The Netherlands
+31 24 365 22 91 | t.steenvoor...@cs.ru.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] Unexpected emergency stop

2018-02-09 Thread Otared Kavian
Hi Tim,

Welcome back to ConTeXt!
When one defines a command, in particular when using the brackets […], it is 
wise to put a percent sign at the end of the line if one changes the line on 
which the macro is defined.
In your case, saying

\definemacro\see[#1:#2]%
{\dosee{#1}{#2}}

suppresses the problem you are reporting (at least here on my machine running 
MacOS 10.13.3 and the latest beta as yours).

Best regards: OK 

> On 9 Feb 2018, at 19:03, Tim Steenvoorden <tim.steenvoor...@gmail.com> wrote:
> 
> Dear all,
> 
> After some time I’m back to ConTeXt and I dug up some old macros. I used to 
> define a \see macro to automatically insert labels like “chapter”, "figure" 
> etc. in front of a reference based on the structure of the label. Below 
> you'll find its definition.
> 
> It worked in MKIV about two years ago, nevertheless, now ConTeXt hangs when 
> placing punctuation after the command. I.e. TeX hangs with an emergency stop 
> (“*" on the terminal) after all files have been processed (after 
> cont-yes.mkiv is closed).
> 
> What am I doing wrong that such a thing happens?
> 
> I’m on macOS 10.13.3 with minimals beta 2018.02.09 00:04.
> 
> Cheers,
> Tim
> 
> 
> –– 
> 
> \starttext
> 
> \definemacro\see[#1:#2]
>   {\dosee{#1}{#2}}
> 
> \starttexdefinition dosee #1#2
>   \doifdefinedelse{in#1}
> {\getvalue{in#1}[#1:#2]}
> {\writestatus{references}{reference format in#1 not defined}
>  \in[#1:#2]}
> \stoptexdefinition % #3 is optional and gobbled by \in
> 
> \definereferenceformat[inchp]
>   [text=\word{\labeltext{chapter}}]
> 
> \setuplabeltext[en]
>   [chapter=Chapter~]
> 
> \chapter[chp:first]{First}
> 
> Works:
> \see[chp:first]
> 
> Hangs:
> \see[chp:first],
> 
> \stoptext
> 
> –– 
> -- 
> 
> T.J. Steenvoorden, MSc
> 
> PhD Candidate | Radboud University Nijmegen
> Faculty of Science | Department of Software Science
> Mercator 1 Building | Room 01.08
> Toernooiveld 212 | 6525 EC | Nijmegen | The Netherlands
> +31 24 365 22 91 | t.steenvoor...@cs.ru.nl 
> <mailto:t.steenvoor...@cs.ru.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
> ___

___
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] Unexpected emergency stop

2018-02-09 Thread Tim Steenvoorden
Dear all,

After some time I’m back to ConTeXt and I dug up some old macros. I used to
define a \see macro to automatically insert labels like “chapter”, "figure"
etc. in front of a reference based on the structure of the label. Below
you'll find its definition.

It worked in MKIV about two years ago, nevertheless, now ConTeXt hangs when
placing punctuation after the command. I.e. TeX hangs with an emergency
stop (“*" on the terminal) after all files have been processed (after
cont-yes.mkiv is closed).

What am I doing wrong that such a thing happens?

I’m on macOS 10.13.3 with minimals beta 2018.02.09 00:04.

Cheers,
Tim


––

\starttext

\definemacro\see[#1:#2]
  {\dosee{#1}{#2}}

\starttexdefinition dosee #1#2
  \doifdefinedelse{in#1}
{\getvalue{in#1}[#1:#2]}
{\writestatus{references}{reference format in#1 not defined}
 \in[#1:#2]}
\stoptexdefinition % #3 is optional and gobbled by \in

\definereferenceformat[inchp]
  [text=\word{\labeltext{chapter}}]

\setuplabeltext[en]
  [chapter=Chapter~]

\chapter[chp:first]{First}

Works:
\see[chp:first]

Hangs:
\see[chp:first],

\stoptext

––
-- 

T.J. Steenvoorden, MSc

PhD Candidate | Radboud University Nijmegen
Faculty of Science | Department of Software Science
Mercator 1 Building | Room 01.08
Toernooiveld 212 | 6525 EC | Nijmegen | The Netherlands
+31 24 365 22 91 | t.steenvoor...@cs.ru.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] bug with special hyphenation?

2018-02-08 Thread Pablo Rodriguez
Dear list,

I have been experiencing an issue with the new hyphenator for months (or
maybe almost a year), but it took me a while to discover what was
triggering it.

First, the mandatory sample:

\startluacode
function document.addfunnyhyphen(tfmdata)
local underscore = utf.byte("_")
local char   = tfmdata.characters[underscore]
if not char then return end
tfmdata.characters[0xFE000]   = {
width= 0,
height   = 0,
depth= 0,
commands = {
{ "right", -char.width },
{ "down", char.depth },
{ "slot", 1, underscore },
}
}
end


utilities.sequencers.appendaction("aftercopyingcharacters",
"after","document.addfunnyhyphen")

local shared = {
start  = 1,
length = 1,
before = utf.char(0xFE000),
after  = nil,
left   = false,
right  = false,
}

local all = table.setmetatableindex({ }, function(t,k)
return shared
end)

languages.hyphenators.traditional.installmethod("sha",
function(dictionary,word,n)
return all
end
)
\stopluacode

\definehyphenationfeatures
   [sha]
   [characters=all,
alternative=sha,
righthyphenchar="FE000]

\unexpanded\def\sha#1%
   {\begingroup\tt
\sethyphenationfeatures[sha]%
\setuphyphenation[method=traditional]%
#1%
\endgroup}

\showframe

\starttext
 some sha
 \sha{8b984688efec2}.\par

 \sha{8b984688efec2}\hskip0pt.\par

 {\sha{8b984688efe3a}\hskip0pt.}\par
\stoptext

Just in case you wonder, I need this to add SHA512 sums of attached
files to PDF documents. (I have mixed the code from different samples
that Hans gave me in replies to diverse questions.)

If I use the \sha command right before a point, I get:

- Only the first and the last character from the especially-hyphenated
text are formatted with the monospaced font. The other ones are
formatted with the Roman font.

- The point outside the command is formatted with the monospaced font,
instead of the Roman one.

- It might be possible that hyphenation could behave wrong in this case.

The simplest way to avoid the issue seems to be to use a zero-width space.

Have I hit an issue with the new hyphenator, or am I simply missing
somehting?

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
___

[NTG-context] issue with \hyphenatedword

2018-01-22 Thread Pablo Rodriguez
Dear list,

I have the following sample:

\setuppapersize[A9]
\starttext
\hyphenatedword{office}
office

\hsize\zeropoint
office
\hyphenatedword{office}
\stoptext

Compiling with latest beta (2018.01.19 13:42), hyphen isn’t used in
\hyphenated word and the character after ffi is removed.

Could anyone confirm the 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
___

[NTG-context] Three problems with ConTeXt standalone for armhf

2018-01-18 Thread Lutz Haseloff
ir/luasocket/src/lua_preload.c:14:0:
../../../source/texk/web2c/luatexdir/luasocket/src/tp_lua.c:7:5: warning: no 
previous prototype for 'luatex_tp_lua_open' [-Wmissing-prototypes]
 int luatex_tp_lua_open (lua_State *L) { 
 ^
In file included from 
../../../source/texk/web2c/luatexdir/luasocket/src/lua_preload.c:15:0:
../../../source/texk/web2c/luatexdir/luasocket/src/url_lua.c:7:5: warning: no 
previous prototype for 'luatex_url_lua_open' [-Wmissing-prototypes]
 int luatex_url_lua_open (lua_State *L) { 
 ^
../../../source/texk/web2c/luatexdir/luasocket/src/lua_preload.c:25:1: warning: 
no previous prototype for 'luatex_socketlua_open' [-Wmissing-prototypes]
 luatex_socketlua_open (lua_State *L) {
 ^
../../../source/texk/web2c/luatexdir/font/writettf.w: In function 
'ttf_copy_encoding':
../../../source/texk/web2c/luatexdir/font/writettf.w:545:14: warning: unused 
variable 'e' [-Wunused-variable]
 ttfenc_entry *e = ttfenc_tab;
  ^
../../../source/texk/web2c/luatexdir/font/writettf.w:543:13: warning: unused 
variable 'buf' [-Wunused-variable]
 static char buf[SMALL_BUF_SIZE];
 ^
../../../source/texk/web2c/luatexdir/font/writettf.w:542:6: warning: unused 
variable 'charcodes' [-Wunused-variable]
 long *charcodes;
  ^
./build.sh: 372: ./build.sh: Syntax error: word unexpected (expecting ")")
___
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] WYSIWYM editor on top of ConTeXt / Lout

2017-12-03 Thread Jonas Baggett

>/A desktop editor, not so much. But it'd be wonderful to have a cloud />/based 
one with Git integration. /
+1 for desktop editor, although I plan to use Emacs for my ConTeXt writing, so
having better support in AUCTeX would be also nice. At the end, I believe that
Emacs is not so scary as it looks, especially for the folks ready to enter into
the world of things like ConTeXt...

As far as Git integration is concerned, not very important feature for me since
I prefer using Fossil. ;)

Btw, Lout is also interesting, but, iirc, it lacks proper Unicode
(UTF-8) support. Recently I was also looking at groff/mom...


Sincerely,
Gour

Hi Gour,

The users I want to target are those currently using Word or alike, and 
would be interested by something that enables them to do more productive 
work, without moving too far away from WYSIWYG. But it could well happen 
that after being introduced to ConTeXt or Lout by such an editor, that 
some of them wish to enter into the world of things ;-).


By the way, I have made a recent update of the concepts in 
https://jonas17b.wixsite.com/monsite/home/wysiwym-editor-on-top-of-context-lout 
point number 7 was added under the mockup (a frame can be displayed to 
configure margins, header, footer and footnotes).
___
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] WYSIWYM editor on top of ConTeXt / Lout

2017-12-02 Thread Jonas Baggett

> Hi Jonas,
> A desktop editor, not so much. But it'd be wonderful to have a cloud 
based

> one with Git integration. I've rolled my own with floobits and my own VM,
> but that doesn't scale and I can't share it with my students.
>
> What you describe has already been worked on by overleaf in terms of a
> realtime option instead of a code option. Maybe extending their work 
would

> be a good place to start?
> Cheers,
> -Brian
Hi Brian,

The type of users that I would like to target, will be those writting 
rather classical documents of more than 10 - 12 pages and wanting to be 
able to focus much more on the content than in the formatting but still 
have good looking results. Typically students or professional that are 
used to write reports with Word but would be interested to use a more 
productive editor, but not ready to move too far away from WYSIWYG.


I didn't made a definitive choice yet, but I believe that being able to 
use the editor offline, independantly of the user internet connection, 
is almost like a must have. But what sounds interesting, as a nice to 
have, would be an editor that can both work in a cloud workflow which 
enables features like instant collaborative editing, and a git-like 
workflow where user can work offline, then publish online, and if 
needed, resolve conflicts.


In regards to the realtime option of overleaf, I guess that after each 
change of the document, it runs LaTeX to export the document to PDF. The 
template edition mode would do something different as first it won't be 
updated realtime: it is only when the user switch to the template 
edition mode that the template as well as the contents will rendered on 
screen by the editor, without doing any export to PDF.


Cheers,
Jonas

___
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] WYSIWYM editor on top of ConTeXt / Lout

2017-12-02 Thread Jonas Baggett

Hi Hraban,

The type of users that I would like to target, will be those writting 
documents of more than 10 - 12 pages. Typically students or professional 
that are used to write reports with Word but would be interested to use 
a more productive editor, but not ready to move too far away from WYSIWYG.


For me, being able to work offline is almost a must have. Having an 
online mode could enable some interesting features, such as 
collaborative editing, but if the application is internet dependant and 
you have a problem with your internet connection, then you cannot do the 
very basics you would expect from a document editor.


From my understanding, Atom is a modified version of Chrome that 
behaves like an offline editor, so that's an option that I would like to 
consider.


Actually I am working for a web development company, I will submit the 
idea, as it could well be that there are other use cases, that I am not 
aware of, where such an editor as a web application could make sense. 
But still, a standalone application makes sense to me for the use cases 
I am considering.


Cheers,
Jonas


Le 02.12.17 à 13:55, Henning Hraban Ramm a écrit :

Am 2017-12-02 um 08:42 schrieb Jonas Baggett <jonas...@gmail.com>:


Hi everyone,

This is a blog post I recently published: 
https://jonas17b.wixsite.com/monsite/home/wysiwym-editor-on-top-of-context-lout.
 It is about some ideas I have for a WYSIWYM editor like LyX, but it would be 
designed for using more than 1 backend (e.g. ConTeXt, Lout), and to give a much 
better user experience.

Anyone interested by the concept?

Hi Jonas,

sounds interesting, there might be overlap with what I tried for an editorial 
system (web-app on which I can’t work for the time being, since the customer 
plays dead and I got other projects):
There I use an usual HTML editor plugin (TinyMCE, CKEditor) and would convert 
its output to ConTeXt and whatever the customer wants, most probably IDML 
(InDesign-XML). User formatting must be restricted to predefined styles (also 
WRT images).
As far as I understood, Pragma has something similar running for educational 
material.

A standalone app like LyX wouldn’t fit my needs. Consider creating it as a 
plugin to some platform like Atom or a web framework?

Greetlings, Hraban
---
http://www.fiee.net
http://wiki.contextgarden.net
GPG Key ID 1C9B22FD




___
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] getting metafun positions within (displayed) math mode

2017-11-17 Thread Sanjoy Mahajan
[Sorry for probably breaking the threading -- long story with not using
the mailing-list administrative interface correctly at first.]

Aditya writes:

> No time for a detailed answer, but what you need is the following:
> ...

Thank you -- that should work.  I won't have many of these equation
beasts, and I can annotate them with \mathop, \mathord, etc. without
much trouble.  If I get ambitious, I'll look into the LuaTeX parsing.
But I fear that there aren't enough such equations to force me into
learning that much of the internals.

Maybe there's even an easier way with \mpos creating some kind of
callback, whereby LuaTeX talks back to it after typesetting the math
node?  Perhaps it adds a field to the node tree (if that's the right
word).  But I am rapidly spiraling beyond my LuaTeX understanding...

Nigel King writes:

> Wow. I learnt about Maxwell's Equation 48 years ago. I never
> understood it then nor on the intervening time despite sometimes
> helping design antennas. The picture and its annotation definitely
> helps creating clarity. For my twopenneth the effort is very
> worthwhile.

The _Maxwell's Equations_ book is really good.  I hope that mine can be
two-thirds as good.

-Sanjoy
___
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] problems with XML export

2017-11-12 Thread Pablo Rodriguez
On 11/12/2017 09:33 AM, Henning Hraban Ramm wrote:
> Am 2017-11-11 um 19:46 schrieb Pablo Rodriguez:
>> \definehighlight[read][color=red, style=\sc]
>> [...]
>> I guess you have to use this instead of \color[]{}.
> 
> Yes, I guess too. I remembered highlight suits color after sending,
> but that means I need to define a new highlight for every color - as
> semantic as that may be, it’s a PITA.

I wonder whether Hans would accept a patch with these definitions to be
applied in the ConTeXt source.

> [...]
> At the state where it exports XML, ConTeXt already knows about page
> breaks, doesn’t it?

You are right. I have almost no experience generating ePubs with ConTeXt
(trying your sample was one of my first attempts to generate an ePub
document with ConTeXt [I use pandoc for that]).

>> [...]
>> Try the approach proposed above. I think it should work.
> 
> No, that was my question in the thread "insert tags in export xml".

Sorry, I overlooked that message.

> \definehighlight only supports style and color, but not command.

I wonder whether this is the right approach.

I mean, you could only (ab)use the style option:

  \setupbackend[export=yes]

  \definehighlight[read][style=\word\sc]
  \starttext
  \starthighlight[read] ROT ROT ROT\stophighlight
  \stoptext

Other approach would be to use your own CSS file:

  .read { text-transform: lowercase; font-variant: small-caps; }

In any case, you need to add the small caps to the class definition in
the CSS file. ConTeXt doesn’t seem to export \sc to anything in the CSS
file.

> I tried to understand its definition and found \dostarttagged, but I
> guess I used it the wrong way, since it breaks the tabulation.

I guess custom CSS is an easier approach.

Just in case 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
___

Re: [NTG-context] ASCII input - non ASCII output

2017-11-08 Thread Henri
How about using the "Transliterator" module by Philipp Gesang?
https://modules.contextgarden.net/cgi-bin/module.cgi/ruid=6004710974/action=view/id=50
Comes with TeXlive and ConTeXt standalone.

On Wed, 2017-11-08 at 16:09 +0100, Mojca Miklavec wrote:
> On 8 November 2017 at 15:36, Thomas A. Schmitz wrote:
> > 
> > On 11/08/2017 11:34 AM, Mojca Miklavec wrote:
> > > 
> > > 
> > > I'm still not arguing that this is the most brilliant idea, but I can
> > > totally imagine a Serbian professor wanting to "auto-generate" a
> > > Cyrillic version of his book on top of the Latin edition with
> > > close-to-zero extra effort.
> > Ok, I can see that this may be a convenient way of producing different
> > output from the same source; I wasn't aware of this (and I was somewhat
> > provocative about Latex, of course :-) From a conceptional point of view, it
> > still feels a bit hackish to do these things on the font level, because they
> > are not/should not be tied to specific fonts - you'd have to rewrite your
> > features or goodies or whatever they are called now for every font you want
> > to use (and you may run into a number of funny inconsistencies in character
> > names or even unicode slots).
> Now for a bit of off-topic-ness.
> 
> Trivia. (Ignoring the attempts to make our own national keyboard) we
> are using "Croatian" keyboard (which is probably the same as Serbian
> layout) which has all the relevant-for-TeX keys ({}[]\) on the third
> plane (alt-gr+), but I learnt computer programming on an US
> keyboard and preferred using US layout to those strange keys in the
> third plane. In computer programming there's basically never the need
> to use non-ascii characters. And in writing texts in native language
> there's no need to use those strange backslashes, so life was mostly
> good until I started using TeX in UTF-8. Back then I was basically
> switching the keyboard a couple of times per sentence (if not per
> word) and somewhat hated typing any TeX in native language for that
> reason. Then I switched to Dvorak and made myself a special layout.
> Now I have all the special keys from US keyboard easily accessible and
> all those strange non-ascii character on the third plane (alt-gr-C to
> get "Č"). That works much better for me now. So at least I know the
> pain of constant need of switching the layouts. Nevertheless I would
> still say that it makes more sense to put some effort to get nice
> UTF-8 documents. (Except, again, giving Serbian a bit of an exception
> due to the fact that the document would still be valid and perfectly
> readable in its Latin form.)
> 
> One could argue in the other direction as well. It should be pretty
> straightforward to "transliterate" all ConTeXt commands into Cyrillic
> (ok, I have no clue what people usually do with q, x, y, w, ... but
> I'm sure there's a solution for that as well) and simply use English
> commands in Cyrillic script to simplify typing :) :) :)
> 
> Mojca
> ___
> 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
___

Re: [NTG-context] ASCII input - non ASCII output

2017-11-08 Thread Mojca Miklavec
On 8 November 2017 at 15:36, Thomas A. Schmitz wrote:
> On 11/08/2017 11:34 AM, Mojca Miklavec wrote:
>>
>> I'm still not arguing that this is the most brilliant idea, but I can
>> totally imagine a Serbian professor wanting to "auto-generate" a
>> Cyrillic version of his book on top of the Latin edition with
>> close-to-zero extra effort.
>
> Ok, I can see that this may be a convenient way of producing different
> output from the same source; I wasn't aware of this (and I was somewhat
> provocative about Latex, of course :-) From a conceptional point of view, it
> still feels a bit hackish to do these things on the font level, because they
> are not/should not be tied to specific fonts - you'd have to rewrite your
> features or goodies or whatever they are called now for every font you want
> to use (and you may run into a number of funny inconsistencies in character
> names or even unicode slots).

Now for a bit of off-topic-ness.

Trivia. (Ignoring the attempts to make our own national keyboard) we
are using "Croatian" keyboard (which is probably the same as Serbian
layout) which has all the relevant-for-TeX keys ({}[]\) on the third
plane (alt-gr+), but I learnt computer programming on an US
keyboard and preferred using US layout to those strange keys in the
third plane. In computer programming there's basically never the need
to use non-ascii characters. And in writing texts in native language
there's no need to use those strange backslashes, so life was mostly
good until I started using TeX in UTF-8. Back then I was basically
switching the keyboard a couple of times per sentence (if not per
word) and somewhat hated typing any TeX in native language for that
reason. Then I switched to Dvorak and made myself a special layout.
Now I have all the special keys from US keyboard easily accessible and
all those strange non-ascii character on the third plane (alt-gr-C to
get "Č"). That works much better for me now. So at least I know the
pain of constant need of switching the layouts. Nevertheless I would
still say that it makes more sense to put some effort to get nice
UTF-8 documents. (Except, again, giving Serbian a bit of an exception
due to the fact that the document would still be valid and perfectly
readable in its Latin form.)

One could argue in the other direction as well. It should be pretty
straightforward to "transliterate" all ConTeXt commands into Cyrillic
(ok, I have no clue what people usually do with q, x, y, w, ... but
I'm sure there's a solution for that as well) and simply use English
commands in Cyrillic script to simplify typing :) :) :)

Mojca
___
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] Difficulties with learning about ConTeXt

2017-10-23 Thread Pablo Rodriguez
On 10/23/2017 12:40 PM, N. Raghavendra wrote:
> I am a mathematician, and have been using LaTeX on a daily basis since
> 1992, when I was a graduate student.  I have recently started using
> ConTeXt, and am very happy with the facilities it provides, and with its
> self-contained system which does not require one to load external
> packages with subtle interactions.

Hi Raghu,

my experience with LaTeX was brief when compared with yours: about seven
years. I think I may be using ConTeXt for almost a decade.

My background is in humanities. I cannot code, although I may read and
understand very basic scripts. I simply don’t do math (it’s all Greek to
me).

The most useful ConTeXt feature for me is the handling of XML files as
source files for text.

> One problem that I am facing is that the documentation of ConTeXt is
> often not enough for me to figure out what to do when a problem arises.
> I understand that documentation is perhaps not a priority for the
> project.  As Hans Hagen wrote in `? Context',
> 
>   "... writing can get a lower priority in a time when quick and dirty
>answers can be found on the internet, mailing list or wiki.  ... For
>what it's worth: whenever I have to solve a problem with a program
>(or language implementation) I run into cases where I have to look
>long to find (non conflicting) information. It just comes with the
>problems one wants to solve and TeX (ConTeXt) is not different."

When I started learning ConTeXt, I thought it wasn’t well documented. I
changed my mind since that.

I understand that writing documentation may not be a priority for Hans,
becase:

- He is the main developer of ConTeXt and LuaTeX.

- He fixes the bugs users or developers report.

- He kindly implements reasonable requests for new features.

- He checks the mailing list and replies to some of the questions.

- He still writes documentation for many of the ConTeXt features (not
  only literate programming).

In my personal case, many bugs and new requests were fixed or
implemented in less than a week. (I wish it would be the same at work,
where we have paid support.)

I’m not the only user that has experienced that. Hans may be not writing
documentation, because he focuses on other (more important) aspects of
ConTeXt development.

I would like to write a manual for ConTeXt. But it will be in Spanish, I
may need years, and it will be limited to my own experience.

The wiki is an informal invitation to the users to document the issues
the were able to solve.

Hans explained his take on the documentation some years ago:
https://mailman.ntg.nl/pipermail/ntg-context/2010/047500.html.

> However, there is not a great deal of information on the Internet about
> solving ConTeXt problems.  Whenever I ran into a LaTeX problem in the
> last several years, I used to find a solution, or a substantial step
> towards one, that was already documented on the TeX-LaTeX Stack
> Exchange.  Unfortunately, it does not contain a similar amount of
> information about ConTeXt.  In any case, I have started posting ConTeXt
> questions there, see https://tex.stackexchange.com/q/397463/146025 and
> https://tex.stackexchange.com/q/397607/146025

There is no secret that ConTeXt is way less popular than LaTeX. It is
even trickier to search for it (since context is also a rather common word).

I don’t know how many ConTeXt users are in the world. Probably the
number of LaTeX users is a hundred times the number of ConTeXt users.
This explains a lot of things in terms of written explanations.

Let me mention a single case. TUGs are TeX Users Groups, but most of its
participants are LaTeX users. The TeX Spanish mailing list has almost
400 participants. There may be other ConTeXt users on that list. But
LaTeX is by far the most common topic in the vast majority of messages.
My impression when I explain there basic ConTeXt features (such as
modes) is that I’m describing Martian life to the generation of my
grandparents (they have no clue of what I’m speaking about).

StackExchange and similar platforms are great, sure. But being
responsive to questions for users in the mailing list and in SE may be
too much for most of the users. At least, my day has only 24 hours ;-).

> As for the mailing list, I posted three requests for help here in the
> last one week.  When I bumped my first message after more than a day
> without any response, Tomas Hala kindly came to my rescue.  The other
> two messages, posted four and two days ago, have not elicited any
> response yet.  This contrasts with Aditya Mahajan's experience, which he
> describes in his interview at
> http://tex-talk.net/2012/08/textalk-an-interview-with-aditya/:
> 
>   "Most questions on the context mailing lists are answered within
>minutes ... look in the main manual and the wiki to see how to
>achieve the particular effects

[NTG-context] Problems with setfirstline

2017-10-18 Thread Rik Kabel
Setfirstline does not seem to be working well with most fonts, perhaps 
all. The example below shows the issue.


   \define \Fonts
    {libertinus,ebgaramond,termes,antykwa,
 cambria,minion,bonum,heros,pagella,iwona}
   \define[1]  \Setupbodyfont{\setupbodyfont[#1,11pt]}
   \define[1] \DisplayExample{\switchtobodyfont[#1]\getbuffer}

   \setupfirstline [alternative=line,
 style=\setfontfeature{smallcaps}]
   \setupinitial   [location=text,n=2,color=darkred]

   \setuphead  [chapter][
   after={\blank[big]\setfirstline\setinitial}]
   \setuphead  [section][continue=yes,
 after=\setfirstline]

   \startbuffer
    \startchapter[title=Initial and first line: \Word{\fontclass}]
    \startparagraph
    \input darwin
    \stopparagraph
 \startsection[title=First line only]
    \startparagraph
    \input montgomery
    \stopparagraph
    \startparagraph
    \input sapolsky
    \stopparagraph
    \stopsection
    \stopchapter
   \stopbuffer

   \expandafter\processcommalist\expandafter[\Fonts]\Setupbodyfont

   \starttext

   \expandafter\processcommalist\expandafter[\Fonts]\DisplayExample

   \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] Fwd: ligature exceptions

2017-10-06 Thread Henning Hraban Ramm

Am 2017-09-28 um 01:16 schrieb Hans Hagen <pra...@wxs.nl>:

> On 9/27/2017 11:08 PM, Thomas A. Schmitz wrote:
>> On 09/27/2017 10:25 PM, Henning Hraban Ramm wrote:
>>> Thank you for the suggestion.
>>> I tried
>>> 
>>> \replaceword[eka][Auflage][Au{fl}age]
>>> \setreplacements[eka]
>>> 
>>> and even converted the german wordlist from the selnolig package, but it 
>>> doesn’t help.
>> Works here. You'll have to make a real example.
> I'll add an extra (simple) definition format:
> 
> \replaceword [eka] [Au{fl}age Shiff{f}ahrt]
> 
> I leave it to others to collect (reasonable) lists of words. We can these to 
> the distribution then.

Thank you very much, it works now.
Here’s* the converted German wordlist from the selnolig package, still in the 
"old" single word syntax.
I just \input it in my environment. I didn’t measure, but I don’t experience a 
delay - great!

I’ll also add a wiki page about ligatures.**

*) The message didn’t make it to the list on the first try, because the 
attachment was too big.
It’s now at http://wiki.contextgarden.net/images/b/be/nolig-german-wordlist.tex
**) http://wiki.contextgarden.net/Ligatures

Greetlings, Hraban
---
http://www.fiee.net
http://wiki.contextgarden.net
GPG Key ID 1C9B22FD


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

2017-09-27 Thread Hans Hagen

On 9/27/2017 5:53 PM, Ulrike Fischer wrote:

Am Wed, 27 Sep 2017 15:10:33 +0200 schrieb Tomas Hala:


 From this point of view, Auf{}lage seems better.


This doesn't prevent the ligature:

\starttext

Auflage Auf{}lage Auf\/lage

\stoptext

This also documented: "The most important change is that adding a
brace group in the middle of a word (like in of{}fice) does not
prevent ligature creation."

With pdftex it does avoid ligatures, but not reliably. There are
cases where the brace group disappear when pdftex tries out
hyphenation points.
in traditional tex hyphenation is integrated in the par builder which 
comes after ligaturing and kerning and tex only hyphenated where it 
'makes sense' and in the process (multi-pass, going into disc nodes) it 
will consult (deconstruct / reconstruct) ligatures and at that point 
it's not known that the input had a {}. Tricks like inserting something 
in between is also unreliable when done at the wrong time and it can 
also prevent for instance kerns of hyphenation.


Anyway, in addition to Thomas answer ... we already have this

\blockligatures[fi,ff] \blockligatures[fl]
\blockligatures[u:fl:age]

\definefontfeature[default:nolig][default][blockligatures=yes]

\startTEXpage[offset=1em]
\definedfont[Serif*default:nolig]
fi ff fl auflage
\definedfont[Serif*default]
fi ff fl auflage
\stopTEXpage

The \blockligatures[u:fl:age] is new and something of a joke experiment 
... I can probably come up with a real advanced and robust mechanism if 
motivated enough


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 exceptions

2017-09-27 Thread Ulrike Fischer
Am Wed, 27 Sep 2017 15:10:33 +0200 schrieb Tomas Hala:

> From this point of view, Auf{}lage seems better.

This doesn't prevent the ligature:

\starttext

Auflage Auf{}lage Auf\/lage 

\stoptext

This also documented: "The most important change is that adding a
brace group in the middle of a word (like in of{}fice) does not
prevent ligature creation."

With pdftex it does avoid ligatures, but not reliably. There are
cases where the brace group disappear when pdftex tries out
hyphenation points. 



-- 
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] Hyphenation with dashes in natural table

2017-09-11 Thread Rik Kabel

On 2017-09-11 14:14, Pablo Rodriguez wrote:

On 09/11/2017 03:10 PM, Christoph Reller wrote:

Hi,

It seems that the hyphenation algorithm for long words with dashes when
typeset in a natural table has changed.
[...]> Could this be a bug or do I have to setup hyphenation differently in
natural tables? Any feedback is welcome.

Hi Christoph,

I don’t know, but the following seems to work:

\starttext
\bTABLE[width=5cm]
\bTR
\bTD super||cali||fragi||listic||expi||ali||docious \eTD
\bTD The longest word known to me that ever had an appearance in a musical.
\eTD
\eTR
\eTABLE
\stoptext

Just in case it helps,

Pablo


|| inserts an en-dash. What you want is |-|, and using that gives a good 
result which agrees with Christoph’s earlier result.


See http://wiki.contextgarden.net/Compound_words.

   \starttext
   \bTABLE[width=5cm]
   \bTR
   \bTD super-cali-fragi-listic-expi-ali-docious \eTD
   \bTD The longest word known to me that ever had an appearance in a
   musical.
   \eTD
   \eTR
   \bTR
   \bTD super||cali||fragi||listic||expi||ali||docious \eTD
   \bTD The longest word known to me that ever had an appearance in a
   musical.
   \eTD
   \eTR
   \bTR
   \bTD super|-|cali|-|fragi|-|listic|-|expi|-|ali|-|docious \eTD
   \bTD The longest word known to me that ever had an appearance in a
   musical.
   \eTD
   \eTR
   \eTABLE
   \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
___

Re: [NTG-context] Hyphenation with dashes in natural table

2017-09-11 Thread Pablo Rodriguez
On 09/11/2017 03:10 PM, Christoph Reller wrote:
> Hi,
> 
> It seems that the hyphenation algorithm for long words with dashes when
> typeset in a natural table has changed.
> [...]> Could this be a bug or do I have to setup hyphenation differently in
> natural tables? Any feedback is welcome.

Hi Christoph,

I don’t know, but the following seems to work:

\starttext
\bTABLE[width=5cm]
\bTR
\bTD super||cali||fragi||listic||expi||ali||docious \eTD
\bTD The longest word known to me that ever had an appearance in a musical.
\eTD
\eTR
\eTABLE
\stoptext

Just in case 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] Hyphenation with dashes in natural table

2017-09-11 Thread Christoph Reller
Hi,

It seems that the hyphenation algorithm for long words with dashes when
typeset in a natural table has changed.

MWE:

\starttext
\bTABLE[width=5cm]
\bTR
\bTD super-cali-fragi-listic-expi-ali-docious \eTD
\bTD The longest word known to me that ever had an appearance in a musical.
\eTD
\eTR
\eTABLE
\stoptext

In earlier versions of ConTeXt, the super-cali... word is hyphenated after
"expi-" and no overfull box occurs. In the currently latest version the
word is hyphenated after "super-" and, since the rest of the word does not
fit the table cell, it overlaps text in the right hand cell.

Could this be a bug or do I have to setup hyphenation differently in
natural tables? Any feedback is welcome.

Cheers,
Christoph
___
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] about "unknown script 'context.lus' or 'max-context.lua'"

2017-09-02 Thread Jeong Dal
Dear Hans van der Meer,

According to your word, I added the PATH to texmf-dist(texlive 2017) to the 
ConTeXt(LuaTex).engine directly.
And, in the terminal, run mtxrun —generate and run luatools —generate once more.
Then ConTeXt(LuaTeX) is working fine.
Now, I can compile ConTeXt files using either texlive-2017 or minimal-beta.

Thank you again.

Best regards,

Dalyoung
___
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] Bibliography in MKIV, custom rendering

2017-08-12 Thread Rik Kabel

On 2017-08-12 11:28, Rik Kabel wrote:

On 2017-08-12 04:54, Hans Hagen wrote:

On 8/11/2017 8:58 PM, Rik Kabel wrote:

On 2017-08-11 10:01, Alan Braslau wrote:

...


2) Apple Inc. is not a name so you should not be using author:
organization is more appropriate.


I do not think that this should be the case.

APA and Chicago/Turbanian (and doubtless others) accept association 
names as author names, and provide rules for handling them.


and as a consequence i bet this is why journals get typeset partly by 
hand (tweak and cheat on these things) ... and why each publisher 
then has its own style (with cheats and tricks)


The lack of either an author or an editor is currently flagged in 
ConTeXt as an error for books and perhaps other bibtex entry types 
as well. Or do you mean to apply this recommendation to only the 
electronic type or some other limited subset of types?


Perhaps it is better to use the association name as an author and 
protect it with a layer of curlies or quotation marks, as {{Apple, 
Inc.}}, "{Apple, Inc.}", or '{Apple, Inc.}', any one of which will do 


one can do that of course (an dit will work) but then someone will 
come along and say that ...


our recomendation is that one spends some time on a proper database 
as it pays off


the job and also serve to prevent what would surely be unwanted 
abbreviation for styles that abbreviate what are parsed as given names.
we really try to get away from fuzzyness ... in fact, the bib format 
or at least the way it's often used is a structural coding nightmare 
(and often tex commands are then used to bypass things) .. i think 
that it never went through a proper 'design, test, review, revise' cycle


reverse engineering what is there + side effects took us quite a 
while and esp the author bit is a pain (this parsing) ... there have 
been proposals for alternatives in the past decades (take mlbibtex) 
but so far we're stuck with historic stuff: making a database in a 
format that is not that suitable (no nesting) using practices that 
are counter intuitive and demand lots of obscure magic


(one day Alan will wrap this up in an article)

Hans


Alan has stated elsewhere that his intent is to provide first an 
APA-compliant subsystem, and to add after that support for other 
regimes. He has also expressed an understandable reluctance to add 
non-standard fields to bibtex. But it is clearly impossible to provide 
an APA-compliant system under such a constraint—for example, for some 
works APA requires an original publication date and bibtex does not 
support that. It is similarly difficult to see how one can comply with 
other requirements of APA, such as square brackets around estimated 
dates for archival sources (how do you identify an estimated date?), 
constructing shortened titles that are then alphabetized by the first 
non-significant word, spelling out author names where two or more 
authors share the same abbreviated names, and so on. Biblatex attempts 
to address some of these issues with an explosion of new fields, and 
still, I think, does not succeed. CSL may do a better job on some of 
these, but again, I do not think that the type of organic standards 
set forth by APA and others are fully amenable to any automated 
parsing. This is why I suggested to Alan (off-line) that we need a 
mechanism to override the generated citation and 
bibliography/reference list entries with customized versions (\citeas, 
or additional fields for \cite).


Clearly bibtex is not compatible with the requirements of current 
documentation standards. Those who require compliant citation to 
whatever standard with which they are burdened need a better database, 
support for conversion from bibtex, and a mechanism to override 
whatever automated result is produced. Of these, the last is most 
crucial.


As to the specific issue of association names as author names: Why is 
widening the definition of the author name field using an 
already-supported protection mechanism worse than overloading the use 
of the organization field, which is intended denote an affiliation and 
is not currently supported in the major entry categories?


Sorry, rereading what I wrote, I see that I mistakenly suggested that 
the btx subsystem does not support origdate. It does, but it is a 
non-standard extension of bibtex, which was my point.


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

Re: [NTG-context] Bibliography in MKIV, custom rendering

2017-08-12 Thread Rik Kabel

On 2017-08-12 04:54, Hans Hagen wrote:

On 8/11/2017 8:58 PM, Rik Kabel wrote:

On 2017-08-11 10:01, Alan Braslau wrote:

...


2) Apple Inc. is not a name so you should not be using author:
organization is more appropriate.


I do not think that this should be the case.

APA and Chicago/Turbanian (and doubtless others) accept association 
names as author names, and provide rules for handling them.


and as a consequence i bet this is why journals get typeset partly by 
hand (tweak and cheat on these things) ... and why each publisher then 
has its own style (with cheats and tricks)


The lack of either an author or an editor is currently flagged in 
ConTeXt as an error for books and perhaps other bibtex entry types as 
well. Or do you mean to apply this recommendation to only the 
electronic type or some other limited subset of types?


Perhaps it is better to use the association name as an author and 
protect it with a layer of curlies or quotation marks, as {{Apple, 
Inc.}}, "{Apple, Inc.}", or '{Apple, Inc.}', any one of which will do 


one can do that of course (an dit will work) but then someone will 
come along and say that ...


our recomendation is that one spends some time on a proper database as 
it pays off


the job and also serve to prevent what would surely be unwanted 
abbreviation for styles that abbreviate what are parsed as given names.
we really try to get away from fuzzyness ... in fact, the bib format 
or at least the way it's often used is a structural coding nightmare 
(and often tex commands are then used to bypass things) .. i think 
that it never went through a proper 'design, test, review, revise' cycle


reverse engineering what is there + side effects took us quite a while 
and esp the author bit is a pain (this parsing) ... there have been 
proposals for alternatives in the past decades (take mlbibtex) but so 
far we're stuck with historic stuff: making a database in a format 
that is not that suitable (no nesting) using practices that are 
counter intuitive and demand lots of obscure magic


(one day Alan will wrap this up in an article)

Hans


Alan has stated elsewhere that his intent is to provide first an 
APA-compliant subsystem, and to add after that support for other 
regimes. He has also expressed an understandable reluctance to add 
non-standard fields to bibtex. But it is clearly impossible to provide 
an APA-compliant system under such a constraint—for example, for some 
works APA requires an original publication date and bibtex does not 
support that. It is similarly difficult to see how one can comply with 
other requirements of APA, such as square brackets around estimated 
dates for archival sources (how do you identify an estimated date?), 
constructing shortened titles that are then alphabetized by the first 
non-significant word, spelling out author names where two or more 
authors share the same abbreviated names, and so on. Biblatex attempts 
to address some of these issues with an explosion of new fields, and 
still, I think, does not succeed. CSL may do a better job on some of 
these, but again, I do not think that the type of organic standards set 
forth by APA and others are fully amenable to any automated parsing. 
This is why I suggested to Alan (off-line) that we need a mechanism to 
override the generated citation and bibliography/reference list entries 
with customized versions (\citeas, or additional fields for \cite).


Clearly bibtex is not compatible with the requirements of current 
documentation standards. Those who require compliant citation to 
whatever standard with which they are burdened need a better database, 
support for conversion from bibtex, and a mechanism to override whatever 
automated result is produced. Of these, the last is most crucial.


As to the specific issue of association names as author names: Why is 
widening the definition of the author name field using an 
already-supported protection mechanism worse than overloading the use of 
the organization field, which is intended denote an affiliation and is 
not currently supported in the major entry categories?


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

Re: [NTG-context] letters in context mkiv

2017-08-01 Thread r . ermers
Hi Thomas,

Thanks for your new suggestions.

As a matter of fact, I yesterday found the following suggestion 
(http://wiki.contextgarden.net/Layers):

\definelayer[AddressBg] [location={right,top},   y=6cm,  x=12cm,  color=red,   
style=\ss\tfa].

I used this in the sample suggested by you yesterday. The address actually 
moves to the desired place!

However, the color and style instructions (\ss\tfa) have no effect. I tried to 
solve that, as a first step, by putting \ss before the \xmlall instruction:

\startxmlsetups xlm:contact
\setlayer[AddressBg]  {\framed[width=55mm,height=30mm,  
align=right,background=color,
  backgroundcolor=lightgray]{\ss\xmlall{#1}{/address}}}
\strut
...
\stopxmlsetups

This works (see pdf), but there are probably other and better ways.



brieven2mkiv.pdf
Description: Adobe PDF document


Another persisting problem is that the commands are still not ‘expanded’ (see 
Pablo’s remarks). According to Pablo for some reason there is only one 
expansion level.

This means that after an \input command, all other commands are not expanded 
(see pdf).

This also applies to your suggestions (see pdf brieven2mkiv5.pdf): in the Knuth 
sample text the only command \TeX\, is not expanded either.



brieven2mkiv5.pdf
Description: Adobe PDF document


Regards,

Robert


\startxmlsetups xml:setups
\xmlsetsetup{#1}{contacts|contact|p}{xml:*}
\stopxmlsetups

\xmlregistersetup{xml:setups}

\startxmlsetups xml:contacts
  \xmlflush{#1}
\stopxmlsetups

\startxmlsetups xml:p
  \xmlflush{#1}\par
\stopxmlsetups

\startxmlsetups xml:contact
  
\setlayer[address][x=20mm,y=40mm]{\framed[width=74mm,height=35mm,frame=on,offset=2mm,align=right]{\ignorespaces\xmltext{#1}{/address}}}
  \strut
  \blank [35mm]
  Subject: your life in \xmltext{#1}{/city}
  \blank [2*line]
  Dear \xmltext{#1}{/prefix} \xmltext{#1}{/formalname},
  \blank [line]
%  \input knuth \relax

  This is a {\bf bold} test. \TeX\
  \startitemize
  \item item
  \item item
  \stopitemize

\input brieftekst-test.tex \relax
\par
%this \par is needed, for the last word of the file merges with Kind regards.

  Kind regards
  \blank [line]
  X
  \page
\stopxmlsetups

\setuppagenumbering [state=stop]

\definelayer[address][width=\paperwidth,height=\paperheight]

\setupbackgrounds [page][background={address}]

\starttext
\xmlprocessbuffer{main}{participants}{}

\stoptext




brieftekst-test.tex
Description: Binary data





> Op 31 jul. 2017, om 23:57 heeft Schmitz Thomas A. 
> <thomas.schm...@uni-bonn.de> het volgende geschreven:
> 
> 
>> On 31. Jul 2017, at 18:58, r.erm...@hccnet.nl wrote:
>> 
>> Would it be wise to perhaps follow the path set out by Thomas? In that case 
>> there should be a way to shift the address.
> 
> What efforts have you made to “shift the address”? Here is one way:
> 
> \startbuffer[participants]
> 
>  
>Hendriks
>Karel
>mr.
>K.
>Arnhem
>
>  Mr. K. Hendriks
>  Grotestraat 5
>  1234 BB Arnhem
>
>1234bb5
>  
>  
>Janssen
>Piet
>P.
>mr.
>Nijmegen
>
> Mr. P. Janssen
> Kortestraat 8
> 1234 AA Nijmegen
>
>1234aa8
>  
> 
> \stopbuffer
> 
> \startxmlsetups xml:setups
> \xmlsetsetup{#1}{contacts|contact|p}{xml:*}
> \stopxmlsetups
> 
> \xmlregistersetup{xml:setups}
> 
> \startxmlsetups xml:contacts
>   \xmlflush{#1}
> \stopxmlsetups
> 
> \startxmlsetups xml:p
>   \xmlflush{#1}\par
> \stopxmlsetups
> 
> \startxmlsetups xml:contact
>   
> \setlayer[address][x=20mm,y=40mm]{\framed[width=74mm,height=35mm,frame=on,offset=2mm,align=right]{\ignorespaces\xmltext{#1}{/address}}}
>   \strut
>   \blank [35mm]
>   Subject: your life in \xmltext{#1}{/city}
>   \blank [2*line]
>   Dear \xmltext{#1}{/prefix} \xmltext{#1}{/formalname},
>   \blank [line]
>   \input knuth \relax
> 
>   Kind regards
>   \blank [line]
>   X
>   \page
> \stopxmlsetups
> 
> \setuppagenumbering [state=stop]
> 
> \definelayer[address][width=\paperwidth,height=\paperheight]
> 
> \setupbackgrounds [page][background={address}]
> 
> \starttext
> \xmlprocessbuffer{main}{participants}{}
> 
> \stoptext
> 
> I still don’t see you trying to learn a new language one step at a time. 
> 
> 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://context.aanhet.net
> archive  : https://bitbucket.org/phg/context-mirror/commits/
> wiki : http://contextgarden.net
> ___

Re: [NTG-context] letters in context mkiv

2017-07-31 Thread r . ermers
Thank you Thomas and Wolfgang,

About startletter / starttext: the contents of my test file reflect a moment. I 
have made numerous tests with and without starttext/stoptext. The state of the 
test file is one in an endless row of tests.

I am not without total experience in programing. I more or less understand 
program scripts when they are not too complicated and I like tweaking them, yet 
I cannot think up a new program from scratch.

But anyway, I will go ahead with your suggestions!

Thank you very much again!

Robert



> Op 30 jul. 2017, om 17:38 heeft Schmitz Thomas A. 
> <thomas.schm...@uni-bonn.de> het volgende geschreven:
> 
> 
>> On 30. Jul 2017, at 14:15, r.erm...@hccnet.nl wrote:
>> 
>> Let me as a turcologist compare my problem to learning Kazakh: I am prepared 
>> to give you a manual with the grammatical rules, provide you with lists of 
>> nouns, verbs, adjectives and postpositions, explain the application of 
>> phonological rules, transliterations of the alphabet, give you a insight in 
>> the nominal cases and verb structure, and read with you a text in Kazakh. 
>> Nevertheless, without being rude, I bet that even then you are unable to 
>> flawlessly produce a poem or even a brief text in Kazakh yourself.
> 
> OK, I see your desperation, and I take your analogy (I’m a scholar myself, 
> not a programmer): if someone came to you with the Iliad and explained that 
> he doesn’t know a word of Kazakh but wants all of Homer’s poem, every line, 
> every word, every nuance, expressed in Kazakh with the help of a grammar and 
> a dictionary, you’d reply that this is not how learning languages works. You 
> begin with simple sentences and work your way up. You have shown us several 
> times examples that don’t work, and I have expressed my suspicion that this 
> may be due to using the correspondence module. You weren’t sure whether you 
> need it or not; which is something only you can know. What does this module 
> offer that can’t be accomplished otherwise? If you look at the documentation 
> of the module, you see that the \startletter … \stopletter pair starts an 
> environment within a \starttext … \stoptext context document. When you look 
> at your setup, you will see that you have a \startletter … \stopletter, then 
> a few setups, and then a \starttext … \stoptext document. I’m not a 
> programmer, but I see that this will not work. 
> 
> So for some simple rules: when you process an xml buffer (or document), you 
> define xmlsetups for the different xml elements. When you write 
> \xmlprocessbuffer, that’s when these elements will be processed - which 
> means: that’s when your document will be built. You can’t go through your xml 
> buffer/document and then add further text (well you can, but that’s more 
> complicated), so what you have to do is add your text (for the sake of this 
> example: \input knuth) WITHING THESE SETUPS. So let’s start with a simple 
> document that will work:
> 
> \startbuffer[participants]
> 
>  
>Hendriks
>Karel
>mr.
>K.
>Arnhem
>
>  Mr. K. Hendriks
>  Grotestraat 5
>  1234 BB Arnhem
>
>1234bb5
>  
>  
>Janssen
>Piet
>P.
>mr.
>Nijmegen
>
> Mr. P. Janssen
> Kortestraat 8
> 1234 AA Nijmegen
>
>1234aa8
>  
> 
> \stopbuffer
> 
> \startxmlsetups xml:setups
> \xmlsetsetup{#1}{contacts|contact|formalname|informalname|prefix|initials|address|city|text|kix|p}{xml:*}
> \stopxmlsetups
> 
> \xmlregistersetup{xml:setups}
> 
> \startxmlsetups xml:contacts
>   \xmlflush{#1}
> \stopxmlsetups
> 
> \startxmlsetups xml:p
>   \xmlflush{#1}\par
> \stopxmlsetups
> 
> \startxmlsetups xml:contact
>   \xmltext{#1}{/address}
>   \blank [3*line]
>   Subject: your life in \xmltext{#1}{/city}
>   \blank [2*line]
>   Dear \xmltext{#1}{/prefix} \xmltext{#1}{/formalname},
>   \blank [line]
>   \input knuth \relax
> 
>   Kind regards
>   \blank [line]
>   X
>   \page
> \stopxmlsetups
> 
> \setuppagenumbering [state=stop]
> 
> \starttext
> \xmlprocessbuffer{main}{participants}{}
> \stoptext
> 
> So you see what I’m doing here: I process every simple  element, and 
> I add all the stuff that will go into the letter for every single contact. 
> Start with this document and then find out what you need in addition: a logo, 
> some fancy lines across the letters, a special placement for the address and 
> the subject, etc.? I’m guessing that it would be easier to do this with 
> simple setup commands rather than using the correspondence module, but we 
> have no idea what you need to accomp

Re: [NTG-context] letters in context mkiv

2017-07-30 Thread Schmitz Thomas A.

> On 30. Jul 2017, at 14:15, r.erm...@hccnet.nl wrote:
> 
> Let me as a turcologist compare my problem to learning Kazakh: I am prepared 
> to give you a manual with the grammatical rules, provide you with lists of 
> nouns, verbs, adjectives and postpositions, explain the application of 
> phonological rules, transliterations of the alphabet, give you a insight in 
> the nominal cases and verb structure, and read with you a text in Kazakh. 
> Nevertheless, without being rude, I bet that even then you are unable to 
> flawlessly produce a poem or even a brief text in Kazakh yourself.

OK, I see your desperation, and I take your analogy (I’m a scholar myself, not 
a programmer): if someone came to you with the Iliad and explained that he 
doesn’t know a word of Kazakh but wants all of Homer’s poem, every line, every 
word, every nuance, expressed in Kazakh with the help of a grammar and a 
dictionary, you’d reply that this is not how learning languages works. You 
begin with simple sentences and work your way up. You have shown us several 
times examples that don’t work, and I have expressed my suspicion that this may 
be due to using the correspondence module. You weren’t sure whether you need it 
or not; which is something only you can know. What does this module offer that 
can’t be accomplished otherwise? If you look at the documentation of the 
module, you see that the \startletter … \stopletter pair starts an environment 
within a \starttext … \stoptext context document. When you look at your setup, 
you will see that you have a \startletter … \stopletter, then a few setups, and 
then a \starttext … \stoptext document. I’m not a programmer, but I see that 
this will not work. 

So for some simple rules: when you process an xml buffer (or document), you 
define xmlsetups for the different xml elements. When you write 
\xmlprocessbuffer, that’s when these elements will be processed - which means: 
that’s when your document will be built. You can’t go through your xml 
buffer/document and then add further text (well you can, but that’s more 
complicated), so what you have to do is add your text (for the sake of this 
example: \input knuth) WITHING THESE SETUPS. So let’s start with a simple 
document that will work:

\startbuffer[participants]

  
Hendriks
Karel
mr.
K.
Arnhem

  Mr. K. Hendriks
  Grotestraat 5
  1234 BB Arnhem

1234bb5
  
  
Janssen
Piet
P.
mr.
Nijmegen

 Mr. P. Janssen
 Kortestraat 8
 1234 AA Nijmegen

1234aa8
  

\stopbuffer

\startxmlsetups xml:setups
\xmlsetsetup{#1}{contacts|contact|formalname|informalname|prefix|initials|address|city|text|kix|p}{xml:*}
\stopxmlsetups

\xmlregistersetup{xml:setups}

\startxmlsetups xml:contacts
\xmlflush{#1}
\stopxmlsetups

\startxmlsetups xml:p
\xmlflush{#1}\par
\stopxmlsetups

\startxmlsetups xml:contact
\xmltext{#1}{/address}
\blank [3*line]
Subject: your life in \xmltext{#1}{/city}
\blank [2*line]
Dear \xmltext{#1}{/prefix} \xmltext{#1}{/formalname},
\blank [line]
\input knuth \relax

Kind regards
\blank [line]
X
\page
\stopxmlsetups

\setuppagenumbering [state=stop]

\starttext
\xmlprocessbuffer{main}{participants}{}
\stoptext

So you see what I’m doing here: I process every simple  element, and I 
add all the stuff that will go into the letter for every single contact. Start 
with this document and then find out what you need in addition: a logo, some 
fancy lines across the letters, a special placement for the address and the 
subject, etc.? I’m guessing that it would be easier to do this with simple 
setup commands rather than using the correspondence module, but we have no idea 
what you need to accomplish. Once you find out what’s missing, you can modify 
the example and ask additional questions. But, to take your analogy: don’t 
start with irregular verbs and special cases that will complicate the picture. 
How is this line

\setuplanguage[nl][date={year, –, mm, –, dd}] % ISO 8601 date

from your original example relevant to your problem? And again: please don’t 
give me the “I’m not a programmer” response; I’m not a programmer either, but I 
know that you have to reduce the complexity in problems to find a solution. 
You’re adding extra complexity.

The way I describe above is the easiest path. There are other approaches, of 
course: you can combine elements from several xml documents, or you can process 
the xml data with Lua. All of this may be unnecessary in your case, but nobody 
will be able to help unless we understand what you need. And to explain this, 
you will have to start with simple examples, not with a complex document.

Sorry for being somewhat stern, but I’m sure you would give similar advice to 
your students…

All best

Thomas

_

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
___

Re: [NTG-context] how to hyphenate SHA512?

2017-07-10 Thread Pablo Rodriguez
On 07/08/2017 01:32 PM, Hans Hagen wrote:
> On 7/7/2017 10:28 PM, josephcan...@gmail.com wrote:
>> A probably quick and dirty « solution », which consists in inserting a 
>> \discretionary node between each digit using some lua code. There are 
>> mostly likely better solutions for this.
> 
> "better" depends on how often such a trick is needed

Many thanks for your help, Hans and Joseph.

I will play with your sample bellow to adapt it to the underscore
hyphenation to the code provided here.

Pablo


> \startluacode
> 
>  -- local shared = {
>  -- start  = 1,
>  -- length = 1,
>  -- left   = false,
>  -- right  = false,
>  -- }
> 
>  local shared = {
>  start  = 1,
>  length = 1,
>  before = utf.char(0xB7),
>  after  = nil,
>  left   = false,
>  right  = false,
>  }
> 
>  -- languages.hyphenators.traditional.installmethod("sha",
>  -- function(dictionary,word,n)
>  -- local t = { }
>  -- for i=1,#word do
>  -- t[i] = shared
>  -- end
>  -- return t
>  -- end
>  -- )
> 
>  -- or more efficient when used often:
> 
>  -- local all = { }
>  -- for i=1,512 do
>  -- all[i] = shared
>  -- end
>  -- languages.hyphenators.traditional.installmethod("sha",
>  -- function(dictionary,word,n)
>  -- return all
>  -- end
>  -- )
> 
>  -- or more obscure:
> 
>  -- local all = table.setmetatableindex({ }, function(t,k)
>  -- t[k] = shared
>  -- return shared
>  -- end)
>  --
>  -- languages.hyphenators.traditional.installmethod("sha",
>  -- function(dictionary,word,n)
>  -- return all
>  -- end
>  -- )
> 
>  -- or just (lua is fast enough anyway)
> 
>  local all = table.setmetatableindex({ }, function(t,k)
>  return shared
>  end)
> 
>  languages.hyphenators.traditional.installmethod("sha",
>  function(dictionary,word,n)
>  return all
>  end
>  )
> \stopluacode
> 
> \definehyphenationfeatures
>[sha]
>[characters=all,
> alternative=sha]
> 
> % \unexpanded\def\sha#1%
> %   {\begingroup
> %\sethyphenationfeatures[sha]%
> %#1%
> %\endgroup}
> %
> % \setuphyphenation[method=traditional]
> 
> \unexpanded\def\sha#1%
>{\begingroup
> \sethyphenationfeatures[sha]%
> \setuphyphenation[method=traditional]%
> #1%
> \endgroup}
> 
> \showframe
> 
> \starttext
> 
> \setupalign[tolerant,stretch]
> 
> \dorecurse {100} {%
>  some sha
>  \sha{8b2f3c087046c3943ace0dc4f958ef2138e58a51b40e%
> ef6fab6fa1aeb845cc257a410ab1b914bc399b4293f%
> 31c76fc2c73e5be5ea4d329f9e6820984688efec2} and
> }
> 
> \stoptext

-- 
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] how to hyphenate SHA512?

2017-07-08 Thread Hans Hagen

On 7/7/2017 10:28 PM, josephcan...@gmail.com wrote:
A probably quick and dirty « solution », which consists in inserting a 
\discretionary node between each digit using some lua code. There are 
mostly likely better solutions for this.


"better" depends on how often such a trick is needed

\startluacode

-- local shared = {
-- start  = 1,
-- length = 1,
-- left   = false,
-- right  = false,
-- }

local shared = {
start  = 1,
length = 1,
before = utf.char(0xB7),
after  = nil,
left   = false,
right  = false,
}

-- languages.hyphenators.traditional.installmethod("sha",
-- function(dictionary,word,n)
-- local t = { }
--     for i=1,#word do
-- t[i] = shared
-- end
-- return t
-- end
-- )

-- or more efficient when used often:

-- local all = { }
-- for i=1,512 do
-- all[i] = shared
-- end
-- languages.hyphenators.traditional.installmethod("sha",
    -- function(dictionary,word,n)
-- return all
-- end
-- )

-- or more obscure:

-- local all = table.setmetatableindex({ }, function(t,k)
-- t[k] = shared
-- return shared
-- end)
--
-- languages.hyphenators.traditional.installmethod("sha",
-- function(dictionary,word,n)
-- return all
-- end
-- )

-- or just (lua is fast enough anyway)

local all = table.setmetatableindex({ }, function(t,k)
return shared
end)

languages.hyphenators.traditional.installmethod("sha",
function(dictionary,word,n)
return all
end
)
\stopluacode

\definehyphenationfeatures
  [sha]
  [characters=all,
   alternative=sha]

% \unexpanded\def\sha#1%
%   {\begingroup
%\sethyphenationfeatures[sha]%
%#1%
%\endgroup}
%
% \setuphyphenation[method=traditional]

\unexpanded\def\sha#1%
  {\begingroup
   \sethyphenationfeatures[sha]%
   \setuphyphenation[method=traditional]%
   #1%
   \endgroup}

\showframe

\starttext

\setupalign[tolerant,stretch]

\dorecurse {100} {%
some sha
\sha{8b2f3c087046c3943ace0dc4f958ef2138e58a51b40e%
ef6fab6fa1aeb845cc257a410ab1b914bc399b4293f%
31c76fc2c73e5be5ea4d329f9e6820984688efec2} and
}

\stoptext





\startluacode

function sha(s)

local out = {}

for i = 1, s:len() do

   out[#out + 1] = s:sub(i, i)

end

context(table.concat(out, '\\discretionary{_}{}{}'))

end

\stopluacode

\starttext

% \hsize\zeropoint

\hyphenation

%%8b2f3c087046c3943ace0dc4f958ef2138e58a51b40eef6fab6fa1aeb845cc25%

%%7a410ab1b914bc399b4293f31c76fc2c73e5be5ea4d329f9e6820984688efec2

\ctxlua{sha([[8b2f3c087046c3943ace0dc4f958ef2138e58a51b40eef6fab6fa1aeb845cc257a410ab1b914bc399b4293f31c76fc2c73e5be5ea4d329f9e6820984688efec2]])}

\stoptext

*De : *Pablo Rodriguez <mailto:oi...@gmx.es>
*Envoyé le :*jeudi 6 juillet 2017 12:00
*À : *mailing list for ConTeXt users <mailto:ntg-context@ntg.nl>
*Objet :*[NTG-context] how to hyphenate SHA512?

Dear list,

I have the following sample:

 \starttext

 \hsize\zeropoint

 hyphenation

 8b2f3c087046c3943ace0dc4f958ef2138e58a51b40eef6fab6fa1aeb845cc25%

 7a410ab1b914bc399b4293f31c76fc2c73e5be5ea4d329f9e6820984688efec2

 \stoptext

I plan to use underscore hyphenation. How can I get the SHA512 string

hyphenated in any of its points?

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
___




--

-
  Hans Hagen | PRAGMA ADE
  Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
   tel: 038 477 53 69 | www.pragma-ade.nl | www.pragma-pod.nl
-
___

Re: [NTG-context] italian index: "I" and "J" under "I", "U" and "V" under "V"

2017-06-26 Thread mf
> in sort-lan.lua you can fix the table:
> 
> definitions["it"] = {
>  entries = {
> 
> (not sure which italian is responsible for it)
> 
> Hans
> 
> 

Thank you, Hans.
Looking at the code, there's a revealing comment before the definitions
for the Latin language: 

-- Treating the post-classical fricatives “j” and “v” as “i” and “u”
-- respectively.

When I saw the bug, I suspected something like that, because "U" and
"V" are written as "V" in Latin, but not in Italian.
The letter "j" replaces "i" also in Italian when it's between vowels
or  when it's at the beginning of a word, followed by a vowel. But this
is the Italian of a century or at least decades ago; in modern Italian
it is rarely used and you won't find it i.e. in newspapers.

Quoting from Wikipedia (https://it.wikipedia.org/wiki/Alfabeto_italiano
):

"Il latino classico non distingueva graficamente la U dalla V (il
latino classico aveva solo la U e scriveva parole come divvs per  per
/ˈdiːwus/); in epoca classica e soprattutto nel latino medievale (che è
arrivato fino a noi tramite l'uso ecclesiastico) iniziò a farsi sentire
una distinzione tra U e V e quindi la nuova consonante venne creata
modificando la V in U..."

Classical latin did not distinguish graphically "U" from "V"
(classical  latin had only the "U" letter and wrote words like "divvus"
for /ˈdiːwus/); during classical antiquity and even more in medieval
latin (which arrived to us through ecclesiastical use) a distinction
between "U" and "V" started to emerge, so the new consonant had been
created modifying the "V" letter into "U"...

"La J inizia ad essere usata nel '500 fino all'inizio del XX secolo,
sia per indicare il suono semiconsonantico della I (jella), ovvero la
"i" intervocalica (grondaja, aja), e come segno tipografico per la
doppia i (principj).
Le lettere I e J erano ancora considerate equivalenti, per quanto 
riguarda l'ordine alfabetico nei dizionari e nelle enciclopedie 
italiani, fino alla metà del XX secolo."

The "J" letter started to be used in XVI century until the beginning of
the XX century, to suggest the semiconsonantic sound of "I" (jella) or
the "i" between vowels (grondaja, aja), and also as a typographic sign
for the double "i" (principj).
"I" and "J" letters were still considered equivalent in the alphabetic
order for italian dictionaries and encyclopedias until the midst of XX
century.

Getting back, to sort-lan.lua, it should be like this:
---
definitions["it"] = {
  entries = {
  ["a"] = "a", ["á"] = "a", ["b"] = "b", ["c"] = "c", ["d"] = "d",
  ["e"] = "e", ["é"] = "e", ["è"] = "e", ["f"] = "f", ["g"] = "g",
  ["h"] = "h", ["i"] = "i", ["í"] = "i", ["ì"] = "i", ["j"] = "j",
  ["k"] = "k", ["l"] = "l", ["m"] = "m", ["n"] = "n", ["o"] = "o",
  ["ó"] = "o", ["ò"] = "o", ["p"] = "p", ["q"] = "q", ["r"] = "r",
  ["s"] = "s", ["t"] = "t", ["u"] = "u", ["ú"] = "u", ["ù"] = "u",
  ["v"] = "v", ["w"] = "w", ["x"] = "x", ["y"] = "y", ["z"] = "z",
  },
---

Thank you again,
best regards,
Massi
___
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] Placing of integral limits

2017-05-25 Thread Mathias Schickel
Dear list,

I think that the placement of the indices of integrals has some issues, at 
least in some fonts. If you try

\setupbodyfont[cambria]
%
\starttext
%
\startformula
%
\int\nolimits_a^b f
%
\stopformula
%
\stoptext

or if you replace Cambria by Stix Two using \setupbodyfont[stixtwo], you will 
notice that the index a is placed a little too far away form the integral sign. 
The reference is the „exponent“ b and the Word output. I think the Word output 
should be the reference here because the font design of Cambria is done by 
Microsoft and Word supports the font as intended. Apart form that you see the 
very same effect using Latin Modern and this font should look similar to 
Computer Modern in LaTeX.

Best regards
Mathias
___
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] setupitemgroup and 'command='

2017-05-24 Thread Thomas Floeren
Hans, thanks for your swift reply…



> On 24. May 2017, at 19:31, Hans Hagen <pra...@wxs.nl> wrote:
> 
> On 5/24/2017 6:28 PM, Thomas Floeren wrote:
>> Hi,
>> I used to use the “command=” parameter when setting up itemize. Now I 
>> noticed that it introduces a spurious horizontal whitespace after the item 
>> symbol when the item is of type “\sym{}”.
>> I also noticed that the problem goes away if I use “inner=” instead of 
>> “command=”.
> 
> command is applied to the text, try command=\WORD and after \sym is a space 
> so it depends on what command does with it


I see, \WORD does not introduce the whitespace. But I don’t understand why 
\setupwhitespace[none] should do anything with the space after \sym, what \WORD 
doesn’t do.


> 
>> Example:
>> \setuppapersize [A6]
>> \starttext
>> \start
>> \setupitemize [each][command={\setupwhitespace[none]}]
>> With \type{\command=}
>> \startitemize
>> \item \dorecurse{20}{bla }
>> \sym{Y} \dorecurse{20}{bla }
>> \stopitemize
>> \stop
>> \setupitemize [each][inner={\setupwhitespace[none]}]
>> With \type{\inner=}
>> \startitemize
>> \item \dorecurse{20}{bla }
>> \sym{Y} \dorecurse{20}{bla }
>> \stopitemize
>> \stoptext
>> This is with ConTeXt 2017.05.15 21:48. With an older ConTeXt, for example 
>> 2015.01.13 15:54, “inner=” and “command=” deliver identical, correct results.
>> So, I’m asking, has “command=” been deprecated or is it just a bug?
>> Or was I using it the wrong way, and “inner=” is the only correct parameter 
>> in the example above?
> \setupitemize [each][nowhite]


Tried that, but it does not the same as \setupwhitespace[none]. (It completely 
annihilates any whitespace.)

Compile this to see what I mean:



\definepapersize[Tmp][width=120mm,height=400mm]
\setuppapersize [Tmp]
\setupwhitespace[2\lineheight]

\startbuffer
bla, bla\crlf bla, bla 
\stopbuffer

\starttext

Normal text:

\getbuffer\par
\getbuffer

Itemize, unmodified:
\startitemize 
\item \getbuffer 
\sym{Y} \getbuffer 
\stopitemize

\start
\setupitemize [each][command={\setupwhitespace[none]}]
Itemize with \type{command={\setupwhitespace[none]}}:
\startitemize 
\item \getbuffer 
\sym{Y} \getbuffer 
\stopitemize
\stop

\start
\setupitemize [each][inner={\setupwhitespace[none]}]
Itemize with \type{inner={\setupwhitespace[none]}}:
\startitemize 
\item \getbuffer 
\sym{Y} \getbuffer 
\stopitemize
\stop

\start
\setupitemize [each][nowhite]
Itemize with \type{nowhite}:
\startitemize 
\item \getbuffer 
\sym{Y} \getbuffer 
\stopitemize
\stop

\stoptext


So it seems the only ways to get the desired result are either 
inner={\setupwhitespace[none]} or command={\setupwhitespace[none]}, where the 
first one seems to work correctly and the latter one introduces the whitespace 
with recent Betas. (well, recent = younger than 2 years or so)

Should I change all my existing documents to “inner”?


Thanks,
best,

– Tom

-- 
For macOS:  
http://dflect.net/context-typeset-tool/
___
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] setupitemgroup and 'command='

2017-05-24 Thread Hans Hagen

On 5/24/2017 6:28 PM, Thomas Floeren wrote:

Hi,


I used to use the “command=” parameter when setting up itemize. Now I noticed 
that it introduces a spurious horizontal whitespace after the item symbol when 
the item is of type “\sym{}”.

I also noticed that the problem goes away if I use “inner=” instead of 
“command=”.


command is applied to the text, try command=\WORD and after \sym is a 
space so it depends on what command does with it



Example:

\setuppapersize [A6]

\starttext
\start
\setupitemize [each][command={\setupwhitespace[none]}]
With \type{\command=}
\startitemize
\item \dorecurse{20}{bla }
\sym{Y} \dorecurse{20}{bla }
\stopitemize
\stop

\setupitemize [each][inner={\setupwhitespace[none]}]
With \type{\inner=}
\startitemize
\item \dorecurse{20}{bla }
\sym{Y} \dorecurse{20}{bla }
\stopitemize

\stoptext


This is with ConTeXt 2017.05.15 21:48. With an older ConTeXt, for example 
2015.01.13 15:54, “inner=” and “command=” deliver identical, correct results.

So, I’m asking, has “command=” been deprecated or is it just a bug?

Or was I using it the wrong way, and “inner=” is the only correct parameter in 
the example above?

\setupitemize [each][nowhite]


-
  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] APA Bibliographic refs. | Hyphenated first names | Lower case first letter of Title

2017-05-22 Thread Richard Mahoney | Indica et Buddhica
On Mon, 22 May 2017 09:09:58 +0200
Alan Braslau <alan.bras...@cea.fr> wrote:

> On Mon, 22 May 2017 11:41:57 +1200
> Richard Mahoney | Indica et Buddhica <rmaho...@fastmail.com> wrote:
> 
> > 2.) And for the initial letter of the title, SGam.po.pa not
> > sGgam.po.pa:
> > 
> > @Book{guenther:sgam,
> >   title ="{s}{G}am.{p}o.{p}a, The Jewel Ornament of
> >   Liberation\,: {D}am.\-{c}hos {y}id.{b}žin.{g}yi
> >   {n}or.{b}u {t}har.{p}a {r}in.{p}o {c}he'i {r}gyan
> >   {ž}es.{b}ya.{b}a {t}heg.{p}a {c}hen.\-{p}o'{i}
> >   {l}am.{r}im.{g}yi {b}śad.{p}a",
> >   publisher ="Rider \& Co.",
> >   shorttitle =   "{s}{G}am.{p}o.{p}a",
> >   year = 1970,
> >   key =  "guenther:70a",
> >   address =  "London",
> >   author =   "H. V. Guenther",
> > }
> > 
> > 
> > I've also tried surrounding the hyphenated names, and their
> > initials, with curly brackets, though without success.
> 
> The "bibtex" practice of "protecting" using surrounding braces does
> not have any effect here. We take fields literally. However, there is
> the setup:
> 
> \setupbtx
>   [apa:list:title]
>   [command=\Word]
> 
> that you can change, setting command=, for example.

Thank you for suggesting this Alan. I've `corrected' the rendering --
SGam.po.pa to sGam.po.pa -- with this:

\setupbtx[apa:list:title:book][command=]
 
 
> As to the spurious space in a hyphenated name, this is a bug that
> needs to be parsed at the lua level (no space following a hyphen)
> that I have asked Hans to look into fixing.

Good to know. Thanks.


Best, Richard




--
  Richard Mahoney | INDICA ET BUDDHICA
 Littledene  Bay Road  Oxford  New Zealand
T: +64-3-312-1699 | www.indica-et-buddhica.org
___
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] APA Bibliographic refs. | Hyphenated first names | Lower case first letter of Title

2017-05-22 Thread Alan Braslau
On Mon, 22 May 2017 11:41:57 +1200
Richard Mahoney | Indica et Buddhica <rmaho...@fastmail.com> wrote:

> 2.) And for the initial letter of the title, SGam.po.pa not
> sGgam.po.pa:
> 
> @Book{guenther:sgam,
>   title =  "{s}{G}am.{p}o.{p}a, The Jewel Ornament of
>   Liberation\,: {D}am.\-{c}hos {y}id.{b}žin.{g}yi
>   {n}or.{b}u {t}har.{p}a {r}in.{p}o {c}he'i {r}gyan
>   {ž}es.{b}ya.{b}a {t}heg.{p}a {c}hen.\-{p}o'{i}
>   {l}am.{r}im.{g}yi {b}śad.{p}a",
>   publisher =  "Rider \& Co.",
>   shorttitle = "{s}{G}am.{p}o.{p}a",
>   year =   1970,
>   key ="guenther:70a",
>   address ="London",
>   author = "H. V. Guenther",
> }
> 
> 
> I've also tried surrounding the hyphenated names, and their initials,
> with curly brackets, though without success.

The "bibtex" practice of "protecting" using surrounding braces does not
have any effect here. We take fields literally. However, there is the
setup:

\setupbtx
  [apa:list:title]
  [command=\Word]

that you can change, setting command=, for example.



As to the spurious space in a hyphenated name, this is a bug that needs
to be parsed at the lua level (no space following a hyphen) that I have
asked Hans to look into fixing.

Alan
___
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] (again) index sorting of accented characters

2017-04-29 Thread Schmitz Thomas A.

> On 29. Apr 2017, at 16:51, Pablo Rodriguez <oi...@gmx.es> wrote:
> 
> An index with classical Greek words (or names) that follows the same
> principle as in German, English or Dutch: word sorting is the same as in
> most important dictionaries.
> 
> This is the main reason of having it as a default.

Sorry, but I still don't see your point here. 

1. You refer to “practice over centuries.” Can you point me to a traditional 
index that contains an entry such as ἐκτὸς (from your example file)?

2. Sorting in ConTeXt may be used for more purposes than for printed books. I 
use it to analyze the content of my TEI xml files.

3. You refer to a new edition of LSJ in 2017. If it sorted words the way you 
suggest, with every possible morphological form as its own entry, you would 
think that was “flawed” too.

So I’m sorry, I still don’t get your point: this is about your personal 
preference, and I still don’t see why you are pushing so hard to have this 
preference as a default. This really is a corner case that is of interest to so 
few users that I wouldn’t consider it a good use of a developer’s time. It’s 
easy to achieve what you want (have you looked into the luatex solution I 
provided?), what is insufficient about this? Who is going to profit from this 
long discussion?

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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___

Re: [NTG-context] (again) index sorting of accented characters

2017-04-29 Thread Pablo Rodriguez
On 04/29/2017 01:42 PM, Schmitz Thomas A. wrote:
>> Could you confirm that the right word order is the second list in this
>> message instead of the first one that ConTeXt generates by default?
> 
> No, I don't see why yours should be “right” and the order that is
> produced now should be “wrong.” It really depends on the purpose of your
> sorting.

Sorry, Thomas, I’m afraid I don’t get your point here.

I mean, if alphabetic sorting makes any sense at all, this is to sort
index and dictionary entries. (If not, please tell me what I am missing
here.)

Imagine that LSJ is edited again in 2017. You purchase the paper edition
and you notice that vowels are sorted considering their diacritics too
(resulting in cases such as ἅλς placed after ἁμαρτία). Wouldn‘t you
think that sorting is somehow “flawed” in that new edition?

The point I’m trying to make is that this isn’t about my personal
preferences, but about conventions used for centuries.

> I don’t know who contributed the current code to sort-ini.lua, but it
> makes consistent choices and produces a possible order. It’s not the
> order you would prefer, granted. It’s not the order I would prefer,
> granted again.
Hans kindly provided them
(https://mailman.ntg.nl/pipermail/ntg-context/2017/088340.html) to a
request of mine.

After using it, I realized that word order wasn’t right, although I
didn’t understand why replacements were needed. Or why replacements
required an unaccented Greek vowel and a Latin letter.

Hans replied that some order was always needed. I needed more samples to
realize that this wasn’t what I wanted.

> But what is the purpose of pushing so hard to have your favorite 
> order included as default? You know what to do to have this order,
> and that’s all that’s important for you.
This isn’t about my favorite order. This is about indices of (ancient)
Greek names or words.

German has five sorting criteria (de, Duden, two DIN and de-AT), but why
is the default criterium to sort (ancient) Greek foreign to practice
over centuries?

That being said, I don’t that Hans intended to establish an new sorting
criterium. The whole problem was that I couldn’t explain this issue better.

> Other users may have different priorities (witness the long list in
> sort-ini.lua: someone went to great lengths to define this order). So I
> still don’t see what you’re trying to accomplish.

An index with classical Greek words (or names) that follows the same
principle as in German, English or Dutch: word sorting is the same as in
most important dictionaries.

This is the main reason of having it as a default.

I hope it is clear now,

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] (again) index sorting of accented characters

2017-04-29 Thread Pablo Rodriguez
On 04/28/2017 06:27 PM, Florian Grammel wrote:
>>> Have you played with the different "methods" defined in sort-ini.lua, 
>>> lines 96-103?
>>
>> Many thanks for your reply, Thomas.
>>
>> The right values seem to be {zm, zc}. This works fine with Spanish and
>> French, […]
> 
> Even with {zm, zc} or any of the predefined methods I don’t really think
> it is working completely as expected, even though the problem might just
> occur in very special cases:

Hi Florian,

a simpler sample would be:

\mainlanguage[es]
\setupregister[language=es, method={zm, zc}]
\starttext
\startTEXpage[offset=2em]
\index{cómodo}
\index{comodos}
\index{cómoda}
\placeindex
\stopTEXpage
\stoptext

I know that "comodos" isn’t a word in Spanish. But it should be the last
word in the sorting.

> It there a way to get this result with „methods“ or would I need to
> modify the sort-rules?

I think that sort-lan.lua might be wrong here. I explain why.

German ("de-DE") has the following code:

replacements = {
{ "ä", 'ae' }, { "Ä", 'Ae' },
{ "ö", 'oe' }, { "Ö", 'Oe' },
{ "ü", 'ue' }, { "Ü", 'Ue' },
{ "ß", 's'  },
},

This is to get Umlaut-forms and eszet sorted as ae, Ae, oe, Oe, ue, Ue
and s (which I wonder whether ß shouldn’t be replaced as ss).

Austrian German ("de-AT") doesn’t contain these replacements.
Umlaut-forms are given different entries.

I guess if we need a similar behavior for Spanish, replacements of
accented glyphs should be created, such as in:

replacements = {
{ "á", 'a' }, { "Á", 'A' }, { "é", 'e' }, { "É", 'E' },
{ "í", 'i' }, { "Í", 'I' }, { "ó", 'o' }, { "Ó", 'O' },
{ "ú", 'u' }, { "Ú", 'u' }, { "ü", 'u' }, { "Ü", 'u' },
},

So you get the right word order:

cómoda
cómodo
comodos

But Hans has to confirm the issue before.

Just in case 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
___

Re: [NTG-context] (again) index sorting of accented characters

2017-04-29 Thread Schmitz Thomas A.

> On 29. Apr 2017, at 13:10, Pablo Rodriguez <oi...@gmx.es> wrote:
> 
> I don‘t know why "α" isn’t the first in sorting, but it is clear that
> letters with different diacritical marks are considered as different
> letters for word sorting.
> 
> Could you confirm that the right word order is the second list in this
> message instead of the first one that ConTeXt generates by default?

No, I don't see why yours should be “right” and the order that is produced now 
should be “wrong.” It really depends on the purpose of your sorting. I don’t 
know who contributed the current code to sort-ini.lua, but it makes consistent 
choices and produces a possible order. It’s not the order you would prefer, 
granted. It’s not the order I would prefer, granted again. But what is the 
purpose of pushing so hard to have your favorite order included as default? You 
know what to do to have this order, and that’s all that’s important for you. 
Other users may have different priorities (witness the long list in 
sort-ini.lua: someone went to great lengths to define this order). So I still 
don’t see what you’re trying to accomplish.

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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___

Re: [NTG-context] (again) index sorting of accented characters

2017-04-27 Thread Thomas A. Schmitz

On 04/27/2017 10:26 PM, Pablo Rodriguez wrote:

Could you please confirm the issue?

Many thanks for your help,



Two remarks:

1. I'm not sure what you're looking for. Do you really want an index 
that sorts every form of every word as an entry? So that ἐμήν and ἐμοῖς 
are different words and not occurrences of the same entry? If that's 
really what you're looking for, you may want to look into a very handy 
luatex function: characters.shaped() returns the unaccented characters 
of a unicode string, see chapter 11.2 of cld-mkiv.pdf. Define your own 
command that uses this lua function to index the unaccented word; that's 
not too hard.


2. If, on the other hand, you want to build a real index that will sort 
morphological forms under their head words, you will have to give the 
sort term explicitly, and then you don't have to rely on ConTeXt's 
abilities to sort accented Greek because you will have something like 
ἐμήν\index{εμοσ} in your text. For the time being, there's no software 
that can reliably parse ancient Greek, I'm afraid.


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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___

Re: [NTG-context] (again) index sorting of accented characters

2017-04-27 Thread Pablo Rodriguez
On 04/27/2017 08:51 PM, Thomas A. Schmitz wrote:
> On 04/27/2017 07:21 PM, Pablo Rodriguez wrote:
>> I mean, if this is the way, I have other two patches for other two
>> languages in which I have indices.
>>
>> And if I’m wrong, I would like to know how to get right word sorting in
>> registers.
> 
> Have you played with the different "methods" defined in sort-ini.lua, 
> lines 96-103?

Many thanks for your reply, Thomas.

The right values seem to be {zm, zc}. This works fine with Spanish and
French, but ancient Greek is more problematic.

I have a source file, http://www.ousia.tk/grc-index.tex. Standard
sorting gives the following results
http://www.ousia.tk/grc-index-standard.pdf#page=3.

When I add replacements (http://www.ousia.tk/grc-replacements.diff) to
sort-lan.lua, sorting order is right
(http://www.ousia.tk/grc-index-modified.pdf#page=3).

Could you please confirm the 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] (again) index sorting of accented characters

2017-04-27 Thread Thomas A. Schmitz

On 04/27/2017 07:21 PM, Pablo Rodriguez wrote:

I mean, if this is the way, I have other two patches for other two
languages in which I have indices.

And if I’m wrong, I would like to know how to get right word sorting in
registers.


Have you played with the different "methods" defined in sort-ini.lua, 
lines 96-103?


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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___

[NTG-context] (again) index sorting of accented characters

2017-04-27 Thread Pablo Rodriguez
Dear list,

sorry for bothering again with this issue, but I need to have indices in
my documents.

I have the following sample:

\mainlanguage[es]
\setupregister[method=default]
\starttext
\startTEXpage[offset=1em]
\index{ámame}\index{arisco}\index{ándrago}
\index{antonia}\index{antón}
\placeindex
\stopTEXpage
\stoptext

Word sorting is the following:

antonia
antón
arisco
ámame
ándrago

Right word order is:

ámame
ándrago
antón
antonia
arisco

In Spanish, as in other languages, an accented letter has no different
sorting that its unaccented counterpart.

I got the right word order adding these replacements in sort-lan.lua:

replacements = {
{ "á", "a" }, { "é", "i"}, { "í", "i" }, { "ó", "o"},
{ "ú", "u" }, { "ü", "u" },
},

Could anyone explain me whether this is the right way of doing it?

I mean, if this is the way, I have other two patches for other two
languages in which I have indices.

And if I’m wrong, I would like to know how to get right word sorting in
registers.

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] \hyphenation command in TL 16

2017-04-16 Thread Florian Grammel
Obviously fixed in new beta. Splendid -- thank you!
Florian.

> Den 14. apr. 2017 kl. 01.20 skrev Florian Grammel
> 
> ok, thanks;
> so I’ll need to get some things to work in the standalone then…
> 
> For one ver: 2017.04.08 12:00 doesn’t seem to hyphenate in \WORDS
> Please compare
> 
> \setuphead[section][style={\WORDS}]
> \section{this is bit of a problem problem problem problem problem problem 
> problem problems}
> 
> on the standalone (last word in the margin) to TL16 (properly hyphenated)
> 
> Can this be fixed?
> 
> Best
> Florian.
> 
>> Den 13. apr. 2017 kl. 22.10 skrev Hans Hagen <pra...@wxs.nl 
>> <mailto:pra...@wxs.nl>>:
>> 
>> On 4/13/2017 9:37 PM, Florian Grammel wrote:
>>> The \hyphenation{}-command is ignored in the texlive 2016 version (ver: 
>>> 2016.05.17 19:20 MKIV). This has obviously been fixed since, as it works in 
>>> the standalone.
>>> 
>>> For other reasons I’d prefer to keep working with the TL16-version -- is it 
>>> possible to patch the hyphenation easily in TL 16?
>> 
>> unlikely
>> 
>> Hans
>> 
>> 
>> -
>>  Hans Hagen | PRAGMA ADE
>>  Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
>>   tel: 038 477 53 69 | www.pragma-ade.nl <http://www.pragma-ade.nl/> | 
>> www.pragma-pod.nl <http://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 <mailto:ntg-context@ntg.nl> / 
>> http://www.ntg.nl/mailman/listinfo/ntg-context 
>> <http://www.ntg.nl/mailman/listinfo/ntg-context>
>> webpage  : http://www.pragma-ade.nl <http://www.pragma-ade.nl/> / 
>> http://context.aanhet.net <http://context.aanhet.net/>
>> archive  : https://bitbucket.org/phg/context-mirror/commits/ 
>> <https://bitbucket.org/phg/context-mirror/commits/>
>> wiki : http://contextgarden.net <http://contextgarden.net/>
>> ___
> 
> 
> 
> Florian Grammel
> 
> Copenhagen, Denmark
> 

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

<    2   3   4   5   6   7   8   9   10   11   >