Re: [NTG-context] two issues with \sciteinlinebuffer

2022-07-07 Thread Hans Hagen via ntg-context

On 7/7/2022 6:19 PM, Pablo Rodriguez via ntg-context wrote:

Hi Hans,

many thanks for the new release.

I experience two issues with scite buffers:

   \usemodule[scite]
   \setuptyping[margin=yes]
   \starttext
   \startbuffer[b]b\stopbuffer
   \startTEXpage[offset=1em]
   no margin

   a \sciteinlinebuffer[none][b] a

   a \typeinlinebuffer[b][option] a
   \stopTEXpage
   \stoptext

1. Margin is applied to \sciteinlinebuffer.

2. An extra unwanted space is added after \sciteinlinebuffer.

Isn’t it intended that \sciteinlinebuffer behaves in a similar way as
\typeinlinebuffer?

Many thanks for your help and your excellent work,

\unexpanded\def\module_scite_buffer[#1][#2]%
  {\begingroup
   \setcatcodetable\ctxcatcodes % needed in xml
   \ifsecondargument
 \clf_scitelexbuffer{#2}{#1}%
   \else
 \clf_scitelexbuffer{#1}{tex}%
   \fi
   \tt
   \installscitecommandsdisplay
   \module_scite_inherit_typing
   \dontcomplain
   \raggedright
   \startscitelines
   \getbuffer[lex]
   \stopscitelines
   \endgroup}

some day i need to make an lmtx version (less code)

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] dorecurse within combination

2022-07-07 Thread Wolfgang Schuster via ntg-context

Henning Hraban Ramm via ntg-context schrieb am 07.07.2022 um 21:25:

Am 07.07.22 um 20:52 schrieb Henning Hraban Ramm via ntg-context:

How can I do this?
Sorry for the noise, I solved it with Lua. The cld manual even 
contains a combinations example.


The Lua method is also simpler than a TeX based alternative.

\starttext

\startcollecting
%
\startcollect
\startcombination[3*1]
\stopcollect
%
\dorecurse{3}
  {\startcollect
   {\externalfigure[dummy]}{}
   \stopcollect}
%
\startcollect
\stopcombination
\stopcollect
%
\stopcollecting

\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] upload

2022-07-07 Thread Hans Hagen via ntg-context

On 7/7/2022 10:48 PM, Aditya Mahajan via ntg-context wrote:

On Wed, 6 Jul 2022, Hans Hagen via ntg-context wrote:


We're pleased to announce the first official release of the new math
code. We're talking of:

-- a reworked math engine (which happened stepwise so some already
trickled into previous uploads)

-- settling on one model for display math but with alignment variants as
well as improving inline math (e.g. wrt linebreaks)

-- redoing bit of the (sub) numbering

-- improving the alignment features (the traditional one and the
text/page mode one)

-- fixing the math font using all kind of tweaks in the goodie file

-- providing means to annotate formulas

-- we ditched support for \over simply because it is too fragile wrt
spacing (one can \usemodule[oldmath] to get it back

-- we might move some more alien stuff to m-oldmath in due time


I played around with it a bit, and everything looks really nice!


Thanks.

Btw, you can run with

\showmakeup[mathglue] % \mathspacingmode=1

to see what math atoms are 'seen' (the spacingmode also injects zero 
spaces) (there are other tracers too but this is the one we use most)


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] upload

2022-07-07 Thread Aditya Mahajan via ntg-context
On Wed, 6 Jul 2022, Hans Hagen via ntg-context wrote:

> We're pleased to announce the first official release of the new math 
> code. We're talking of:
> 
> -- a reworked math engine (which happened stepwise so some already 
> trickled into previous uploads)
> 
> -- settling on one model for display math but with alignment variants as 
> well as improving inline math (e.g. wrt linebreaks)
> 
> -- redoing bit of the (sub) numbering
> 
> -- improving the alignment features (the traditional one and the 
> text/page mode one)
> 
> -- fixing the math font using all kind of tweaks in the goodie file
> 
> -- providing means to annotate formulas
> 
> -- we ditched support for \over simply because it is too fragile wrt 
> spacing (one can \usemodule[oldmath] to get it back
> 
> -- we might move some more alien stuff to m-oldmath in due time

I played around with it a bit, and everything looks really nice! 

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

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


Re: [NTG-context] dorecurse within combination

2022-07-07 Thread Henning Hraban Ramm via ntg-context

Am 07.07.22 um 20:52 schrieb Henning Hraban Ramm via ntg-context:

How can I do this?


Sorry for the noise, I solved it with Lua. The cld manual even contains 
a combinations example.


Hraban

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

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


[NTG-context] dorecurse within combination

2022-07-07 Thread Henning Hraban Ramm via ntg-context

Hi, I’d like to place pages from a multipage PDF in a combination:

\startcombination[3*1]
\dorecurse{3}{%
  {\externalfigure[multipage][width=\textwidth/3,page=\recurselevel]}{}
}
\stopcombination

That doesn’t work, because ConTeXt expects a { after \startcombination. 
(“A left brace was mandatory here, so I've put one in.”)

I guess I need some expansion, but \expanded doesn’t help.

How can I do this?

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

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


[NTG-context] two issues with \sciteinlinebuffer

2022-07-07 Thread Pablo Rodriguez via ntg-context
Hi Hans,

many thanks for the new release.

I experience two issues with scite buffers:

  \usemodule[scite]
  \setuptyping[margin=yes]
  \starttext
  \startbuffer[b]b\stopbuffer
  \startTEXpage[offset=1em]
  no margin

  a \sciteinlinebuffer[none][b] a

  a \typeinlinebuffer[b][option] a
  \stopTEXpage
  \stoptext

1. Margin is applied to \sciteinlinebuffer.

2. An extra unwanted space is added after \sciteinlinebuffer.

Isn’t it intended that \sciteinlinebuffer behaves in a similar way as
\typeinlinebuffer?

Many thanks for your help and your excellent work,

Pablo
___
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] upload

2022-07-07 Thread Hans Hagen via ntg-context

On 7/7/2022 3:15 AM, Max Chernoff via ntg-context wrote:

Hi,

With the latest upload, "tex.linebreak" doesn't return an "info" table.

When running this code:

     \startluacode
     function test(head)
     local new_head, info = tex.linebreak(node.copylist(head))

     print(head, type(head), info, type(info))

     if info == nil then
     print "!!! info is nil !!!"
     end

     return head
     end

     nodes.tasks.appendaction("processors", "after", "test")
     \stopluacode

     \starttext
     Hello!
     \stoptext

with the latest upload I get (also note the small typo in "rigthfill"):

     luatex warning  > linebreak: no [ leftinit | rightinit | leftfill | 
rigthfill] expected
        2353 : par vmodepar>  
userdata    nil nil

     !!! info is nil !!!
        2299 : glue userskip> 
userdata    nil nil

     !!! info is nil !!!

but with live.contextgarden.net I get:

     luatex warning  > tex: left parfill skip is gone
     Underfull \hbox (badness 1) in paragraph at lines 20--1
         929 : par vmode_par>    userdata
table: 0x39a050f7000    table
        1561 : glue userskip>    userdata
nil    nil

     !!! info is nil !!!


This is because you need to pass a list that conforms to what the 
builder expects and the callback that you use doesn't do that for you 
(after all, it also gets hbox content).


There is no 'callback sequence handler' for the par builder (currently i 
see no need for it, also given the extra overhead involved) but this 
what what you can do:


\startluacode
function builders.paragraphs.constructors.methods.preroll_a(head)
local result, info = tex.linebreak(head)
tex.prevdepth = info.prevdepth
tex.prevgraf = info.prevgraf
return result
end
function builders.paragraphs.constructors.methods.preroll_b(head)
local result, info = tex.linebreak(nodes.nuts.copylist(head))
inspect(info)
return true
end
\stopluacode

\defineparbuilder[preroll_a]
\defineparbuilder[preroll_b]

\starttext
\setmainparbuilder[default]   \input tufte \par \input tufte \page
\setmainparbuilder[preroll_a] \input tufte \par \input tufte \page
\setmainparbuilder[preroll_b] \input tufte \par \input tufte \page
\stoptext

The tex.linebreak function gets the properly prepared paragraph and can 
handle it then. On the to do is a to add a 'prepare' helper that adds 
the mandate nodes (par fillers etc) but even then one has to be careful 
where linebreak hackery is applied.


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] Fwd: Malfunctioning of syllabic partitioning of words in Spanish

2022-07-07 Thread Joaquín Ataz López via ntg-context




 Mensaje reenviado 
Asunto: 	Re: [NTG-context] Malfunctioning of syllabic partitioning of 
words in Spanish

Fecha:  Thu, 7 Jul 2022 08:26:49 +0200
De: Joaquín Ataz López 
Organización:   Universidad de Murcia
Para:   Max Chernoff 



Thank you very much for the quick response.

Indeed with the \language[es] command the syllable partitioning is 
correct. I had not included it because in the preamble of the document 
appears the instruction \mainlanguage[es].


After verifying that indeed the syllabic partitioning works well, I have 
been doing several tests to see why the \mainlanguage[es] command in the 
environment file was ignored. In the end I have come to the conclusion 
that this was because I had written in it


\startenvironment

instead of

\startenvironment environment_name

What I do not understand is why, when not putting the name of the 
environment some commands of this one are ignored, but others are executed.



El 7/7/22 a las 7:38, Max Chernoff escribió:

\language[es] % Needed for Spanish hyphenation

    \starttext
    \hsize=0pt % Hack to force hyphenation

    limitarse

    colores

    abstenerse
    \stoptext


--
-
Joaquín Ataz López
Derecho civil
Universidad de Murcia
-
___
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
___