[NTG-context] \definelayout[pagenumber][layout] behaving strangely

2022-12-08 Thread peter.hopcroft--- via ntg-context
The pdf from the tex below looks wrong to me, screenshot attached. It’s always 
like this when the page number in the second \definelayout is 1 more than the 
page number in the first. For other pairs of numbers, it behaves like I expect: 
the short layout is only on those 2 pages.

I’m using the LMTX I updated a few days ago. ConTeXt online’s pdf is the same.

%==
\showframe
\setuppapersize[A4][A3,landscape] \setuparranging[2SIDE]
\setuplayout[backspace=80mm, width=100mm, topspace=50mm, header=0mm, 
footer=0mm, height=200mm, margindistance=10mm, leftmargin=40mm]

\definelayout[short][backspace=80mm, width=100mm, topspace=50mm, header=0mm, 
footer=0mm, height=80mm, margindistance=10mm, leftmargin=40mm]

\starttext 
\definelayout[2][short]
\definelayout[3][short]
\dorecurse{10}{\input{knuth} }  
\stoptext 
%==

Also, https://wiki.contextgarden.net/Command/definelayout says:
% different layout for first two pages
\definelayout[1][wide]
\definelayout[3][reset]
This does not work for me.

Cheers, Peter

___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / https://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : https://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : https://contextgarden.net
___


[NTG-context] Achieving different \cite styles

2022-12-08 Thread Jethro Djan via ntg-context
Hello everyone

I am interested in being able to cite in different ways. By analogy, I
refer to the \texcite{}, \parencite{} and other options available with
biblatex in LaTeX. How do I achieve something like \textcite{} in ConTeXt?
Here is my MWE:

\startbuffer[ref]

@Article{wn:2017,
  author  = {Who, Nobody and What, Everyone},
  journal = {Good Journal},
  title   = {The Art of Being},
  year= {2017},
}

\stopbuffer

\definebtxdataset[ref]
\usebtxdataset[ref][ref.buffer]
\setupbtx[
  dataset=ref,
]
\definebtxrendering
  [ref]
  [apa]
  [
  dataset=ref,
  ]
\usebtxdefinitions[apa]

\starttext

In \cite[wn:2017], they illustrated that it is impossible to not be them.
\cite[wn:2017] said it was worth the discovery.

\startsection[title={References}, number=no, incrementnumber=no]
\placelistofpublications[ref][method=dataset]
\stopsection

\stoptext

The first sentence is okay. In the second, I would like the parenthesis
around the citation to come off because of the way I am citing it.

Jethro
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / https://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : https://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : https://contextgarden.net
___


Re: [NTG-context] \hpos in math - Half solved

2022-12-08 Thread Hans Hagen via ntg-context

On 12/8/2022 8:54 PM, Otared Kavian via ntg-context wrote:

Hi Hans, Mikael,

These features are amazing! Many many thanks!
Thanks also to Gavin for having stated so precisely these kinds of needs, so 
that Hans and Mikael could come up with this solution.
Gavin, good luck with your project, and plaese share what you get at the end.
For the record: this features is already there for a while, we also have 
some matrix specific trickery as well as for instance annotated fences 
and so. However, the interfaces will evolve and eventually get 
documented in the upcoming (big) math manual. It's mostly a matter of 
consistent interfacing i.e. it has to fit into the way we do things in 
context (it's of course easy to come up with a quick and dirty ugly non 
extensible and non standard interface).


What is new in the latest greatest is (1) namespaces, so that one can 
reuse the references, which Gavin needs, and (2) sourcing a nucleus 
and/or the whole atom including scripts, which Gavin also needs. Some 
more granularity might show up depending on needs. As some depends on 
the tex engine there are limitations (performance, memory and complexity 
constraints: adding features like these might definitely not impact 
performance).


Source and target properties were added in order to avoid interference 
with math spacing but can also be used in text, where they are part of 
the larger package of box properties that was already around.


\startTEXpage[offset=2cm]

\setbox 0 \ruledhbox
source  123
anchors 1 2
{one}
\setbox 2 \ruledhbox
target 123
{test 1}

\dontleavehmode \box2 \box0

\setbox 0 \ruledhbox
target  124
orientation 2
anchors 1 4
xoffset-10pt
{two}
\setbox 2 \ruledhbox
source 124
{test 2}

\dontleavehmode \box2 \box0

\stopTEXpage

With sources and targets one has to keep in mind that they don't 
participate in the box dimensions! Although excessive usage puts some 
strain on the backend in practice it probably goes unnoticed.  Also, be 
careful with the source and target id's! There is currently no low level 
allocation mechanism so stick to positive numbers.


So, lots to play with, if you're in the mood,

Hans

(There is quite some experimental code around but to what extend it ends 
up in the core depends on demand, time, motivation etc. As you can 
guess, Mikael and I having a lot of math fun is motivating.)


-
  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 / https://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : https://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : https://contextgarden.net
___


Re: [NTG-context] \hpos in math - Half solved

2022-12-08 Thread Otared Kavian via ntg-context
Hi Hans, Mikael,

These features are amazing! Many many thanks!
Thanks also to Gavin for having stated so precisely these kinds of needs, so 
that Hans and Mikael could come up with this solution.
Gavin, good luck with your project, and plaese share what you get at the end.

Best regards : Otared

> On 8 Dec 2022, at 07:14, Mikael Sundqvist via ntg-context 
>  wrote:
> 
> Hi,
> 
> On Thu, Dec 8, 2022 at 1:07 AM Gavin via ntg-context  
> wrote:
>> 
>> Hi Hans and Mikael,
>> 
>> This is amazing! Mikael's example works for me. I will start using these 
>> tools in my project, and I’ll tell you how it goes.
> 
> Very good that it works and that it gets tested!
> 
>> It might be a couple weeks, because the physics is also quite challenging.
> 
> Haha, I can imagine that the spinors are even more challenging. Good luck!
> 
> /Mikael
> ___
> If your question is of interest to others as well, please add an entry to the 
> Wiki!
> 
> maillist : ntg-context@ntg.nl / 
> https://www.ntg.nl/mailman/listinfo/ntg-context
> webpage  : https://www.pragma-ade.nl / http://context.aanhet.net
> archive  : https://bitbucket.org/phg/context-mirror/commits/
> wiki : https://contextgarden.net
> ___

Otared Kavian
e-mail: ota...@gmail.com
Phone: +33 6 88 26 70 95



___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / https://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : https://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : https://contextgarden.net
___


Re: [NTG-context] extra hyphen in underscore hyphenation

2022-12-08 Thread Pablo Rodriguez via ntg-context
On 12/8/22 13:14, Hans Hagen via ntg-context wrote:
> On 12/8/2022 12:33 PM, Pablo Rodriguez via ntg-context wrote:
>> [...]
>> What am I missing here?
> 
> \setuplanguage
>   [explicitrighthyphenchar=-1]

Many thanks for your fast reply, Hans.

I’m afraid it doesn’t work here:

  \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")
  \stopluacode

  \definehyphenationfeatures
 [underscore]
 [righthyphenchar="FE000]

  \setuphyphenation[method=traditional]%
  \sethyphenationfeatures[underscore]%
  \setuplanguage
[explicitrighthyphenchar=-1]
  \mainlanguage[es]
  \starttext
  \startTEXpage[offset=1em, width=4em]
\hsize\zeropoint\tt
\hyphenatedword{legibility-legible}
  \stopTEXpage
  \stoptext

Results are the same with "\mainlanguage[es]" or "\mainlanguage[nl]".

If "\mainlanguage" is placed after "\setuplanguage", the extra unwanted
hyphen appears.

If "\mainlanguage" is placed before "\setuplanguage", hyphenation for
the second word doesn’t work at all (and the extra unwanted hyphen
appears in my actual document).

I don’t know what I’m missing here and it seems to be a picky issue to
provide a MWE.

Many thanks for your help,

Pablo
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / https://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : https://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : https://contextgarden.net
___


Re: [NTG-context] extra hyphen in underscore hyphenation

2022-12-08 Thread Hans Hagen via ntg-context

On 12/8/2022 12:33 PM, Pablo Rodriguez via ntg-context wrote:

Dear list,

I have the following 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")
   \stopluacode

   \definehyphenationfeatures
  [underscore]
  [righthyphenchar="FE000]

   \sethyphenationfeatures[underscore]%
   \setuphyphenation[method=traditional]%

   \starttext
   \startTEXpage[offset=1em, width=4em]
 \hsize\zeropoint\tt
 \hyphenatedword{legibility-legible}
   \stopTEXpage
   \stoptext

In current latest (and in many versions before), I get an extra hyphen
in the next line after the hyphen, such as:

ity-
-leg

As far as I can remember, I would say this used to work before (no extra
hyphen was added in the next line.

What am I missing here?


\setuplanguage
 [explicitrighthyphenchar=-1]


--

-
  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 / https://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : https://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : https://contextgarden.net
___


[NTG-context] extra hyphen in underscore hyphenation

2022-12-08 Thread Pablo Rodriguez via ntg-context
Dear list,

I have the following 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")
  \stopluacode

  \definehyphenationfeatures
 [underscore]
 [righthyphenchar="FE000]

  \sethyphenationfeatures[underscore]%
  \setuphyphenation[method=traditional]%

  \starttext
  \startTEXpage[offset=1em, width=4em]
\hsize\zeropoint\tt
\hyphenatedword{legibility-legible}
  \stopTEXpage
  \stoptext

In current latest (and in many versions before), I get an extra hyphen
in the next line after the hyphen, such as:

   ity-
   -leg

As far as I can remember, I would say this used to work before (no extra
hyphen was added in the next line.

What am I missing here?

Many thanks for your help,

Pablo
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / https://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : https://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : https://contextgarden.net
___