Re: [NTG-context] xtable in def or setups

2021-05-18 Thread Werner Hennrich

Hi Adam,
no, I hadn't tried that -
even tough I had skimmed over that part way back, it now escaped me.

   \long\def\iconblock[#1]#2{%
   \ignorespaces
   *\startembeddedxtable[icbtable]*
   \startxrow
   \startxcell[width=17mm]
   \externalfigure[img/#1.svg][height=15mm,width=15mm]
   \stopxcell
   \startxcell #2 \stopxcell
   \stopxrow
   *\stopembeddedxtable*
   \removeunwantedspaces
   }

that did the job.

Thanks a lot Adam!
Cheers, W


Am 18.05.21 um 20:17 schrieb Adam Reviczky:

Hi Werner,

Did you try startembeddedxtable ?

See Section 5 in the manual
(https://www.pragma-ade.com/general/manuals/xtables-mkiv.pdf
).

Adam

On Tue, May 18, 2021 at 6:38 PM Werner Hennrich mailto:w...@gmx.at>> wrote:

Hello everyone,

I'm trying to create an xtable from within a \def (or within a
\setups)
but always run into "runaway error: end of file encountered"
whenever the xtable-commands are in there.

\definextable[icbtable]
\setupxtable[icbtable]
[frame=off,
top=\vskip7mm]
\long\def\iconblock[#1]#2{%
\ignorespaces
\startxtable[icbtable]
\startxrow
\startxcell[width=17mm]
\externalfigure[img/#1.svg][height=15mm,width=15mm]
\stopxcell
\startxcell #2 \stopxcell
\stopxrow
\stopxtable
\removeunwantedspaces
}

Is this simply not possible or am I doing something wrong there?

system  > ConTeXt  ver: 2021.05.15 22:45 LMTX fmt:
2021.5.18  int: english/english

Thank you,
Werner

__



___
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] xtable in def or setups

2021-05-18 Thread Adam Reviczky
Hi Werner,

Did you try startembeddedxtable ?

See Section 5 in the manual (
https://www.pragma-ade.com/general/manuals/xtables-mkiv.pdf).

Adam

On Tue, May 18, 2021 at 6:38 PM Werner Hennrich  wrote:

> Hello everyone,
>
> I'm trying to create an xtable from within a \def (or within a \setups)
> but always run into "runaway error: end of file encountered"
> whenever the xtable-commands are in there.
>
> \definextable[icbtable]
> \setupxtable[icbtable]
> [frame=off,
> top=\vskip7mm]
> \long\def\iconblock[#1]#2{%
> \ignorespaces
> \startxtable[icbtable]
> \startxrow
> \startxcell[width=17mm]
> \externalfigure[img/#1.svg][height=15mm,width=15mm]
> \stopxcell
> \startxcell #2 \stopxcell
> \stopxrow
> \stopxtable
> \removeunwantedspaces
> }
>
> Is this simply not possible or am I doing something wrong there?
>
> system  > ConTeXt  ver: 2021.05.15 22:45 LMTX  fmt: 2021.5.18
> int: english/english
>
> Thank you,
> Werner
>
> ___
> 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] xtable in def or setups

2021-05-18 Thread Werner Hennrich

Hello everyone,

I'm trying to create an xtable from within a \def (or within a \setups)
but always run into "runaway error: end of file encountered"
whenever the xtable-commands are in there.

   \definextable[icbtable]
   \setupxtable[icbtable]
   [frame=off,
   top=\vskip7mm]
   \long\def\iconblock[#1]#2{%
   \ignorespaces
   \startxtable[icbtable]
   \startxrow
   \startxcell[width=17mm]
   \externalfigure[img/#1.svg][height=15mm,width=15mm]
   \stopxcell
   \startxcell #2 \stopxcell
   \stopxrow
   \stopxtable
   \removeunwantedspaces
   }

Is this simply not possible or am I doing something wrong there?

system  > ConTeXt  ver: 2021.05.15 22:45 LMTX  fmt: 2021.5.18 
int: english/english

Thank you,
Werner

___
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] TeX capacity exceeded

2021-05-18 Thread Hans Hagen

On 5/17/2021 11:43 PM, Thomas A. Schmitz wrote:

Is texmfcnf.lua still the configuration file I need to look at for this 
kind of problem? Which variable could I change?

Normally not needed but this is the section for luatex:

["luatex.errorline"] =250, -- no need to change
["luatex.halferrorline"] =125, -- no need to change
["luatex.expanddepth"]   =  1, -- no need to change
["luatex.hashextra"] = 10, -- rarely more is needed
["luatex.nestsize"]  =   1000, -- often an error if more needed
["luatex.maxinopen"] =500, -- i use 2000
["luatex.maxprintline"]  =  1, -- no need to change
["luatex.maxstrings"]= 50, -- maybe sometimes
["luatex.paramsize"] =  25000, -- seldom
["luatex.savesize"]  = 10, -- often an error if more needed
["luatex.stacksize"] = 10, -- often an error if more needed

not, in luametatex we have some more and also more control; this is what 
the next version will support (the above method is how it currently 
goes, max values that use the preset allocations steps)



["luametatex.errorlinesize"] = { size =  250 }, 
-- max =   255
["luametatex.halferrorlinesize"] = { size =  250 }, 
-- max =   255
["luametatex.expandsize"]= { size =1 }, 
-- max =   100
["luametatex.stringsize"]= { size =   50, step =  10 }, 
-- max =   2097151 -- number of strings
["luametatex.poolsize"]  = { size = 1000, step = 100 }, 
-- max = 1 -- chars in string
["luametatex.hashsize"]  = { size =   25, step =  10 }, 
-- max =   2097151
["luametatex.nodesize"]  = { size = 5000, step =  50 }, 
-- max =  5000
["luametatex.tokensize"] = { size = 1000, step =  25 }, 
-- max =  1000
["luametatex.buffersize"]= { size = 1000, step = 100 }, 
-- max = 1
["luametatex.inputsize"] = { size =   10, step =   1 }, 
-- max =10 -- aka stack
["luametatex.filesize"]  = { size = 2000, step = 200 }, 
-- max =  2000
["luametatex.nestsize"]  = { size =1, step =1000 }, 
-- max = 1
["luametatex.parametersize"] = { size =   10, step =   1 }, 
-- max =10
["luametatex.savesize"]  = { size =   50, step =   1 }, 
-- max =50
["luametatex.fontsize"]  = { size =  250, step = 250 }, 
-- max =10
["luametatex.languagesize"]  = { size =  250, step = 250 }, 
-- max = 1
["luametatex.marksize"]  = { size =   50, step =  50 }, 
-- max = 1


One can just define the max if needed because we bump memory stepwise 
(on demand). It depends on the kind of projects you have. One can also 
sey { plus = 1 } to add more to the set size without bothering about 
existing values. Now, if you watch closely you'll see that most max 
values are high already (initial values cannot be set) but token and 
node memory as well as string related values can be set much larger. 
However, it makes sense to limit. Actually for some scenarios one might 
even want to go lower.


When you compare mkiv and mkxl you'll notice that we use less memory 
anyway (for various reasons / optimizations). The format file is also 
smaller (esp when you take into account that the mkiv one is zip 
compressed and the lmtx one isn't).


But ... your problem was not related to the above.

The next upload will also mention detailed mem usage in the log file. If 
you want to see how your document behaves you can say


\enabletrackers[system.usage]

at the top (is already there for a while).

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] TeX capacity exceeded

2021-05-18 Thread Hans Hagen

On 5/17/2021 11:43 PM, Thomas A. Schmitz wrote:


Hi all,

I have a rather large (almost 120,000 lines) xml file, processing pulls 
in another large xml file. The project compiles under mkiv; with lmtx, I 
get


tex error   > tex error on line 8 in file : TeX capacity exceeded, 
sorry [reference count=32767]


This is not the normal memory consumption that bothers you

\enabletrackers[system.usage]

will show you more detail. Normally the default context configuration 
will provide enough. In lmts memory is abit more dynamic so we start otu 
smaller and then stepwise grow. And one can configure even more 
(actually i just updated some configuration options for that).


Anyway: this more smells like some nesting going wrong and therefore 
excessive token sharing



 \reallanguagetag

just twenty pages shy of the end of the document.

There is an error log with this content:

return {
  ["errortype"]=3,
  ["filename"]="",
  ["lastcontext"]="\n\n\n \\reallanguagetag \n    \n 
\\reallanguagetag #1->\\ifcsname \\??languagelinked #1\n    \\endcsname 
\\lastnamedcs \\else #1\\fi \n \\setusedlanguage #1->\\edef 
\\currentusedlanguage {\\reallanguagetag {#1}\n    }\\ifempty 
\\currentusedlanguage \\let \\currentusedlanguage \\currentlanguage 
\\always\\let \\usedlanguageparameter \\languageparameter \\orelse \\ifx 
\\currentusedlanguage \\v!global \\let \\currentusedlanguage\n\n 
\\typo_delimited_push ...\\currentdelimitedtext {#1}\\edef 
\\m_delimited_argument {#2}\\ifempty \\m_delimited_argument 
\\typo_delimited_set_language_nop \n    \\else 
\\typo_delimited_set_language_yes \\fi \\let 
\\currentparentdelimitedtext \\currentdelimitedtext \\global \\advance 
\\c_typo...\n\n \\delimitedtext [#1]#*[#2]->\\dontleavehmode 
\\typo_delimited_push {#1}{#2}\n    \\edef \\p_delimited_method 
{\\delimitedtextparameter \\c!method }\\ifx \\p_delimited_method 
\\v!font \\expandafter \\typo_delimited_fontdriven \\else \\expandafter 
\\typo_delimited_other \\fi \n\n \n 
{\n...\n\n \n    ",

  ["lastluaerror"]="",
  ["lasttexerror"]="TeX capacity exceeded, sorry [reference count=32767]",
  ["lasttexhelp"]="If you really absolutely need more capacity, you can 
ask a wizard to enlarge me.",

  ["linenumber"]=8,
  ["offset"]=10,
  ["skiplinenumber"]=8,
}

  In mkiv, these are the stats at the end of the run:


mwe ...

mkiv lua stats  > used config file: 
selfautoparent:/texmf/web2c/texmfcnf.lua
mkiv lua stats  > used cache path: 
/mnt/shared/lmtx/tex/texmf-cache/luatex-cache/context/5fe67e0bfe781ce0dde776fb1556f32e 

mkiv lua stats  > resource resolver: loadtime 0.009 seconds, 1 scans 
with scantime 0.005 seconds, 0 shared scans, 27 found files, scanned 
paths: /home/tas/texmf
mkiv lua stats  > stored bytecode data: 455 modules (0.122 sec), 96 
tables (0.007 sec), 551 chunks (0.130 sec)
mkiv lua stats  > traced context: maxstack: 1422, freed: 2, unreachable: 
1420

mkiv lua stats  > cleaned up reserved nodes: 63 nodes, 9 lists of 442
mkiv lua stats  > node memory usage: 17 attribute, 4 attribute_list, 1 
glue, 51 glue_spec, 3 kern, 2 penalty, 2 temp, 2 user_defined
mkiv lua stats  > node list callback tasks: 8 unique task lists, 9336 
instances (re)created, 177413 calls

mkiv lua stats  > h-node processing time: 4.800 seconds including kernel
mkiv lua stats  > attribute processing time: 0.617 seconds front- and 
backend

mkiv lua stats  > driver time: 0.886 seconds
mkiv lua stats  > used backend: pdf (backend for directly generating pdf 
output)

mkiv lua stats  > jobdata time: 0.161 seconds saving, 0.052 seconds loading
mkiv lua stats  > callbacks: internal: 261417, file: 319, direct: 3, 
late: 31831, function 200128, total: 493698 (464 per page)

mkiv lua stats  > randomizer: resumed with value 0.47143577262518
mkiv lua stats  > positions: 9535 collected, 9535 regular, 0 special
mkiv lua stats  > v-node processing time: 0.401 seconds
mkiv lua stats  > result saved in file: plutarchusvitae.pdf, 
compresslevel 3, objectcompresslevel 1

mkiv lua stats  > loaded patterns: de::3 en::1 la::65, load time: 0.000
mkiv lua stats  > xml load time: 0.648 seconds, 4 files, 4 converted
mkiv lua stats  > lxml preparation time: 0.626 seconds, 233814 nodes, 
578788 lpath calls, 578743 cached calls

mkiv lua stats  > interactive elements: 0 references, 37 destinations
mkiv lua stats  > margin data: 10798 entries, 0 pending
mkiv lua stats  > loaded fonts: 9 files: garamondpremrpro.otf, 
sabonltstd-bold.otf, sabonltstd-italic.otf, sabonltstd-roman.otf, 
kadmosu.otf, oldstandard-bold.otf, oldstandard-italic.otf, 
xitsmath-regular.otf, dejavusansmono.ttf
mkiv lua stats  > font engine: otf 3.113, afm 1.513, tfm 1.000, 17 
instances, 6 shared in backend, 0 common vectors, 6 common hashes, load 
time 0.146 seconds
mkiv lua stats  > used platform: linux-64, type: unix, binary subtree: 
texmf-linux-64
mkiv lua stats  > used engine: luatex version: 1.13, functionality 
level: 7420, banner: this is luatex, version 1.13.0 (tex live 2021)

mkiv lua 

Re: [NTG-context] \setcharacterspacing

2021-05-18 Thread Alan Bowen
Hi, Wolgang—

The mwe files in a product/component structure are attached.

Everything works as desired with the current env file.

If one comments out the startsetups...\stopsetups, the guillemets are not
properly spaced in the body text, while those in the footnote are fine.

If one comments out the \setup line, the guillemets are not properly placed
anywhere.

Please let me know if this is expected behavior— and I will try
troubleshooting my own files to see why my env file has to have the
\startsetups...\stopsetups line and the component file, the \setup line if
I am to get what I need.

Alan

On Mon, May 17, 2021 at 4:00 PM Wolfgang Schuster <
wolfgang.schuster.li...@gmail.com> wrote:

> Alan Bowen schrieb am 17.05.2021 um 21:50:
>
> That is very good to know and it works in simple cases. But I am finding
> that in a product/component structure, I get the proper spacing only when
> • the environment file has the \startsetups...\stopsetups
> • either \setup[test] or \setuplanguage[fr][setups=test] is in the
> component file.
>
> Is this expected behavior?
>
> (Before I just \setcharacterspacing[test] in the env file but now it only
> works when in the component file)
>
>
> Can you make a simple example, it's possible there is a reset somewhere
> which disables the feature at the end of the environment or the start of
> the component file.
>
> 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
>
> ___
>


c_CharSpTest.tex
Description: TeX document


prd_CharSpTest.tex
Description: TeX document


env_CharSpTest.tex
Description: TeX 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] \char not working with private unicodes

2021-05-18 Thread Sergio Callegari

Hi,

On 13/05/21 09:16, Hans Hagen wrote:
A next upload will scan the names (read: i commented the possible 
catch for issues, let's see when the font that needed that pops up 
again).

Good news! Looking forward to seeing luaotfload catch up on this.


The renaming of bad glyphs can technically be fixed but a runtime hack 
but i try to avoid that .. the more heuristics, the harder to fight.


If I understand correctly the matter, I'd like to still advocate for an 
attempt. If there is something bad that must be discarded to avoid 
renaming heuristics, that is OK, but at least it would be nice to "leave 
the gap" in the codepoints, to avoid breaking the codepoint->glyph 
published correspondence.


It is PUA, but "private" is not really "personal" and agreements about 
how some fonts put stuff here are probably expected to work across more 
than one individual, e.g. across organization or even at a wider level 
(think CSUR). I think that it is really important to assure that those 
work. The breakage of cut and paste seems particularly bad.




You can try to patch luaotfload. Locate the 'report' line and comment 
those two as below.



 local length = readbyte(f)
   if length > 0 then
   glyphs[mapping].name = readstring(f,length)
   else
    -- report("quit post name fetching at %a of %a: 
%s",i,maxnames,"overflow")

    -- break
   end

I'll try that... With the names, there is the problem that as of today 
lualatex does not provide a LaTeX command to access the glyphs by name 
out of the box (as I understand it is the case in ConTeXt) so you need 
to write some Lua code. I'll make some experiment and if that works, 
I'll make a small package for that.

Did you try to use the regular variant:

\starttext
    \definefontfeature[materialicons][default][rlig=yes]
    \definedfont[file:materialiconsregular.ttf*materialicons]
    baby_changing_station % selects symbol as ligature
\stoptext

(in latex equivalent) .. keep in mind that 'web' fonts are often more 
minimalistic, so i never use them (when there's a real one).


The problem here is that the "regular variant" is the official one (I 
understand from google), while the "webfont" is a community project that 
incorporates the /official/ material design icons with many 
contributions drawn to be fully consistent with the official icons. And 
my problem is that I need to make use of some of these contributions.  
So I really have no choice.


In any case, I have opened a bug at the webfont developer to see if they 
can get more ConTeXt friendly by at least fixing the font->cheatsheet 
correspondence and the duplicate names. See 
https://github.com/Templarian/MaterialDesign-Webfont/issues/78


Thanks,

Sergio

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