Re: [NTG-context] Error: attempt to index a nil value

2021-10-13 Thread Hans van der Meer via ntg-context
>  tex.print("\string\\latinmodern")

should be at least double backslashes: tex.print("\\string\\latinmodern") I 
would think

met vriendelijke groet
dr. Hans van der Meer


> On 13 Oct 2021, at 18:01, Hans Åberg via ntg-context  
> wrote:
> 
> I was suggested a long ago to hack the file
> /usr/local/texlive/2021/texmf-dist/tex/generic/context/luatex/luatex-math.tex
> and use LuaTeX directly, now using Version 1.13.2 (TeX Live 2021), but I get 
> this error:
> (./luaotfload.sty
> (/usr/local/texlive/2021/texmf-dist/tex/latex/base/ltluatex.tex))
> (./luatex-math-modified.tex[\directlua]:1: attempt to index a nil value 
> (global
> 'arguments')
> stack traceback:
>   [\directlua]:1: in main chunk.
> l.132 }
> 
> ? …
> 
> 
> It is from this segment in the modified luatex-math.tex:
> 
> \ifdefined\directlua
>   \directlua {
>   if arguments["mtx:lucidabright"] then
>   tex.print("\string\\lucidabright")
>   else
>   tex.print("\string\\latinmodern")
>   end
>   }
> \fi
> 
> Is there a workaround? —I may ditch this setup in favour of using 'context' 
> directly, so it is not so important if there is no fix.
> 
> 
> ___
> 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] modules not found

2021-09-08 Thread Hans van der Meer via ntg-context
Further investigation seems to indicate that the module files are not found 
when initiating the context run from another directory. Though previously this 
was no problem.
I have moved the whole ConTeXt machinery from $HOME to another volume. Could 
that cause the problem? Allthough I set their location in the .bashrc.
# The current version of the ConTeXt luametatex in use:
CONTEXTLMTX=/Volumes/REALM/TeX/context
export CONTEXTLMTX
PATH=$CONTEXTLMTX/tex/texmf-osx-64/bin:$PATH ; export PATH

dr. Hans van der Meer


> On 8 Sep 2021, at 12:46, Hans van der Meer via ntg-context 
>  wrote:
> 
> Here is something I do not understand about \usemodule.
> 
> My modules are in two places because I wanted development and production 
> separated:
> (1) Volume/TeX/texmf/modules/
> (2) Volume/TeX/texmf/modules-new/
> 
> Unexpected and suddenly loading files from the first directory does not occur 
> any longer: modules > 'hvdm-tak' is not found
> But modules from modules-new load without a hitch:  modules > 'hvdm-load' is 
> loaded
> 
> I have discard the caches and rebuilt them to no avail. Then trying mtxrun 
> --locate filename does not show any location not even from the files that are 
> loaded, just an empty line.
> What happens inside \usemodule to cause this? I confess being baffled. And 
> how to convince ConTeXt to find all my modules?
> 
> 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
> ___

___
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] modules not found

2021-09-08 Thread Hans van der Meer via ntg-context
Here is something I do not understand about \usemodule.

My modules are in two places because I wanted development and production 
separated:
(1) Volume/TeX/texmf/modules/
(2) Volume/TeX/texmf/modules-new/

Unexpected and suddenly loading files from the first directory does not occur 
any longer: modules > 'hvdm-tak' is not found
But modules from modules-new load without a hitch:  modules > 'hvdm-load' is 
loaded

I have discard the caches and rebuilt them to no avail. Then trying mtxrun 
--locate filename does not show any location not even from the files that are 
loaded, just an empty line.
What happens inside \usemodule to cause this? I confess being baffled. And how 
to convince ConTeXt to find all my modules?

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] parameters TeX->LuaTeX

2021-09-05 Thread Hans van der Meer via ntg-context
And \ListSort[[abc]]{value} turns out to be worse: doesn't makes it into LuaTeX 
at all.
dr. Hans van der Meer


> On 5 Sep 2021, at 10:14, Hans van der Meer via ntg-context 
>  wrote:
> 
> There is something I do not understand in the passing of parameters from TeX 
> to LuaTex.
> This is my TeX definition:
> \def\ListSort[#1]#2{\directlua{hvdm.listsort([===[#2]===],[===[#1]===])}}
> 
> Calling \ListSort[sep={ + }]{} delivers the string  'sep={ + }' into LuaTeX 
> as the printout in the logfile shows and as intended.
> However in \ListSort[{ + }]{} the braces have disappeared and transferred is 
> nothing more than ' + '.
> 
> Why is the transfer messing up the character string I am passing by removing 
> the outer braces? Is this a bug or is it an unavoidable consequence of the 
> TeX-LuaTeX interface?
> 
> 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
> ___

___
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] parameters TeX->LuaTeX

2021-09-05 Thread Hans van der Meer via ntg-context
There is something I do not understand in the passing of parameters from TeX to 
LuaTex.
This is my TeX definition:
\def\ListSort[#1]#2{\directlua{hvdm.listsort([===[#2]===],[===[#1]===])}}

Calling \ListSort[sep={ + }]{} delivers the string  'sep={ + }' into LuaTeX as 
the printout in the logfile shows and as intended.
However in \ListSort[{ + }]{} the braces have disappeared and transferred is 
nothing more than ' + '.

Why is the transfer messing up the character string I am passing by removing 
the outer braces? Is this a bug or is it an unavoidable consequence of the 
TeX-LuaTeX interface?

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] Curiosity about math.random in LuaTeX

2021-08-23 Thread Hans van der Meer via ntg-context
I guess the underlying library calls are from Lua5.4? Then it is perhaps useful 
to know that between 5.3 and 5.4 there is mentioned a new implementation for 
math.random. Perhaps it changes the sequence of random values generated? 
Someone who knows?

dr. Hans van der Meer


> On 23 Aug 2021, at 17:13, Hans Hagen via ntg-context  
> wrote:
> 
> On 8/23/2021 4:46 PM, Thierry Horsin via ntg-context wrote:
>> Hi everybody.
>> I wonder how does math.random() work in context. I found that this subject 
>> was discussed more than ten years ago by Otared and Taco and Thomas. It is 
>> clear to me how to obtain new results upon typesetting the same file by 
>> changing the value of math.randomseed (with os.time()).
>> If you don't change the seed, you get the same result upon each typesetting, 
>> and a seed is given in the .tuc file.
>> For example I have this:
>> ["randomseed"]=0x1.0741c18b8a4ep-6
>> How do I use (and is it possible to) this value to have the same result of 
>> math.random() upon typesetting another file (with a different name) ?
>> I could provide a same fixed seed in both files, but for some reasons I 
>> would like to re-use some previous results of math.random() for which no 
>> seed was initially given in another .tex file.
> You have to go low level ...
> 
> % \ctxlua{utilities.randomizer.setseed(0x1.0741c18b8a4ep-6)}
> % \ctxlua{utilities.randomizer.setseed(0x1.6822232009d5p-5)}
> 
> \setrandomseed{123}
> 
> \starttext
>test \randomnumber{1}{100}
>test \randomnumber{1}{100}
>test \randomnumber{1}{100}
> \stoptext
> 
> btw, the 0x representation is lua's low level binary representation of a 
> double.
> 
> 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
___


Re: [NTG-context] lua

2021-08-17 Thread Hans van der Meer via ntg-context
I am still interested in this luacondition 733 allthough the culprit has been 
spotted. Very nasty typo and hard to spot fo me. 
Shudder and enjoy:

\ifxmlatt{#1}{regime}{xml}\let\Flush\ModuleFlushXML\else\let\FlushModuleFlushTEX\fi
instead of
\ifxmlatt{#1}{regime}{xml}\let\Flush\ModuleFlushXML\else\let\FlushModule\FlushTEX\fi

dr. Hans van der Meer


> On 17 Aug 2021, at 15:49, Hans van der Meer via ntg-context 
>  wrote:
> 
> Where is this message on luacondition 733 coming from? I would be glad to get 
> rid of it. The message does not pinpoint the problem location enough for me 
> to find its cause.
> 
> close source> level 2, order 7, name './modules-docs.tex'
> close source> level 1, order 7, name 'cont-yes.mkiv'
> (\end occurred when luacondition 733 on line 8 was incomplete)
> 
> 
> 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
> ___

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

2021-08-17 Thread Hans van der Meer via ntg-context
Where is this message on luacondition 733 coming from? I would be glad to get 
rid of it. The message does not pinpoint the problem location enough for me to 
find its cause.

close source> level 2, order 7, name './modules-docs.tex'
close source> level 1, order 7, name 'cont-yes.mkiv'
(\end occurred when luacondition 733 on line 8 was incomplete)


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
___


[NTG-context] file to buffer

2021-08-17 Thread Hans van der Meer via ntg-context
Is it possible to retrieve the contents of a file directly into a buffer? On 
the Wiki I could not find such a command. That is, equivalent to something like:
\startbuffer[from file]
contents of the file
\stopbuffer

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
___


[NTG-context] nil from TeX to Lua

2021-08-09 Thread Hans van der Meer via ntg-context
In the TeX to Lua interface with

\def\Macro#1{\directlua{luafunction("#1")}}

the transfer from TeX to Lua is by string. However what to do at the Lua end 
when calling \Macro{}?
As I understand it, then on the Lua side an empty argument and an empty string 
are indistinguishable. This is not always wanted, for example when one needs to 
place either a nil or an empty string into a Lua table. I am running in trouble 
when to t.key set to \Macro{} should become nil or when it should become "".
Is there some common understanding about how to handle this situation?

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] How to check if buffer or block has content

2021-08-02 Thread Hans van der Meer via ntg-context
And in pathological cases where even this does not work (as I encountered a few 
days ago): 
\setbox\scratchbox=\vboxx{content}\ifdim\wd\scratchbox>\zeropoint .. \else .. 
\fi
dr. Hans van der Meer


> On 2 Aug 2021, at 17:17, Hans Hagen via ntg-context  
> wrote:
> 
> On 8/2/2021 4:43 PM, Aditya Mahajan via ntg-context wrote:
>> On Mon, 2 Aug 2021, Benjamin Buchmuller via ntg-context wrote:
>>> Hi,
>>> 
>>> How can I check if a buffer or block has content (or is empty) before a 
>>> \useblocks or \getbuffer statement?
>>> 
>>> I would like to typeset a headline only if the buffer/block has been used 
>>> in a particular section and want to avoid headlines with empty sections.
>> There may be more efficient ways to do it (since buffers are stored at the 
>> lua end), but you can always do \doiftextelse(\getbuffer[...]} to test it 
>> buffer creates any output.
> indeed you know there is a way ...
> 
> \starttext
> 
> \startbuffer[test]
> test
> \stopbuffer
> 
> \doifelsebuffer{test} {YES} {NOP}
> 
> \permanent\protected\def\doifelsebuffercontent#1%
>  {\doifelse{\luaexpr{(string.strip(buffers.getcontent("#1")) ~= "" and 
> "yes")}}{yes}}
> 
> \startbuffer[test]
> \stopbuffer
> 
> \doifelsebuffercontent{test} {YES} {NOP}
> 
> \startbuffer[test]
> 
> \stopbuffer
> 
> \doifelsebuffercontent{test} {YES} {NOP}
> 
> \stoptext
> 
> if we can agree on a proper name then i can add a (more efficient) 
> \doifelse...
> 
> 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] date formatting

2021-07-18 Thread Hans van der Meer

From Wikipedia:

In English-language  
outside North America (mostly in Anglophone Europe and some countries in 
Australasia), full dates are written as 7 December 1941 (or 7th December 1941) 
and spoken as "the seventh of December, nineteen forty-one" (exceedingly common 
usage of "the" and "of"), with the occasional [my emphasis] usage of December 
7, 1941 ("December the seventh, nineteen forty-one"). In common with most 
continental European usage, however, all-numeric dates are invariably ordered 
dd/mm/.

From this I infer that \language[en] or \language[en-gb] should format dates 
normally in day-month-year order, reserving mont-day-year for \language[us] 
i.e. language[en-us].

But in ConTeXt both \language[en] and \language[en-gb] produce the us ordering 
for \currentdate. I would be pleased if ConTeXt could be changed to the above 
mentioned normal behaviour for english. That is [en] and [en-gb] produce the 
day-month-year order and that [us] and [en-us] month-day-year.

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
___


[NTG-context] languages

2021-07-18 Thread Hans van der Meer
Here is something I think that should be added to the documentation.

In the ConTeXt garden (page Command/mainlanguage) the description is:

mainlanguage Set the language of auto-generated language elements, like the 
title of the table of contents or the appendix.

On the Command/language page:

Change the hyphenation rules, quotation marks, all that sort of thing, to that 
of a different language. (The default language is English.)

Testing showed that \mainlanguage sets both \currentlanguage and 
\currentmainlanguage to the same value, while \language sets \currentlanguage 
only.

My suggestion is to add info to this behaviour to the mainlanguage page, 
reflecting the fact that \mainlanguage does set both \currentlanguage and 
\currentmainlanguage.Which is not apparent from the current documentation. 

Another solution would be to separate \language and \mainlanguage completely. 
An option I would prefer for clarity, because now the order of calling 
\language and \mainlanguage makes a difference.

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
___


[NTG-context] hang error

2021-07-08 Thread Hans van der Meer
Why this: normal plain TeX macro \hang giving an Undefined control sequence 
error in ConTeXt?
This MWE shows it:
\starttext
\hang
\stoptext

I would not expect basic plain macro's to crash. If it is intended behaviour I 
do not think that is the road to go, because this invalidates older documents. 
But maybe it is just an error in the distribution.

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
___


[NTG-context] xmldisplayverbatim

2021-07-08 Thread Hans van der Meer
I get the impression that \xmldisplayverbatim changes ' (apostroph) into  
and " (quotation mark) into  etc.
How can I get rid of this translation?
I would prefer to have typeset ' and " instead of the entity representations.

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] whiteline before xmldisplayverbatim

2021-07-05 Thread Hans van der Meer
Found the problem: should not be preceded by \crlf but by \par.
dr. Hans van der Meer


> On 5 Jul 2021, at 19:21, Hans van der Meer  wrote:
> 
> I cannot get rid of the whiteline that \xmldisplayverbatim generates before 
> its output. Changing to other \xmldisplay macro's did not change this. How to 
> get rid of the whitespace?
> MWE:
> \startxmlsetups hvdm:docs:texcode
>   abc\crlf
>   \xmlstripnolines{#1}{.}% <- with or without: no change
>   \xmldisplayverbatim{#1}
> \stopxmlsetups
> 
> result, see the empty lines between abc and the \new..
> 
> 
> 
> 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
> ___

___
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] whiteline before xmldisplayverbatim

2021-07-05 Thread Hans van der Meer
I cannot get rid of the whiteline that \xmldisplayverbatim generates before its 
output. Changing to other \xmldisplay macro's did not change this. How to get 
rid of the whitespace?
MWE:
\startxmlsetups hvdm:docs:texcode
abc\crlf
\xmlstripnolines{#1}{.}% <- with or without: no change
\xmldisplayverbatim{#1}
\stopxmlsetups

result, see the empty lines between abc and the \new..



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
___


[NTG-context] Bug in Luatex file handling?

2021-06-15 Thread Hans van der Meer
This I cannot explain. Opening a file directly from its full name in a string 
succeeds. But doing the same from a parameter transferred from ConteXt to Lua 
succeeds if the file is in one directory deeper but fails if the file is two 
directories deeper.
I suspect there is something not ok in LuaTeX.
The lines with  and >>>> directly come from print statements inserted in 
the Lua code.

dr. Hans van der Meer

Open file in directory 1 and 2 levels deep - direct call succeeds
..io.open("events/hga-0372-345-62.xml","r")=>file (0x7fff97415f88)
..io.open("events/transcripten/hga-0372-345-62.xml","r")=>file 
(0x7fff97416020)

Idem but now from parameter filename transferred from ConTeXt into Lua:
Open file one level deeper succeeds (printed filename comes from the call):
>>>>>>>>>>io.open(filename,"r") filename=events/hga-0372-1764-63.xml=>file 
>>>>>>>>>>(0x7fff974160b8)
Open file two levels deeper fails:
>>>>>>>>>>io.open(filename,"r") 
>>>>>>>>>>filename=events/transcripten/hga-0372-1764-63.xml=>nil

Caller:
\def\FileExist#1{\cldcontext{hvdm.existfile([===[#1]===])}}
Lua code:
hvdm.existfile = function (filename)
-- The test code was inserted here --
local file = io.open(filename, "r")
if file then
file:close()
end
return file ~= nil and "true" or "false"
end

___
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] keep text strictly inside box

2021-06-07 Thread Hans van der Meer
As can be seen in this screenshot, the text overshoots on the right side the 
boundary of the fairly narrow \framedtext.
My intent is to not hyphenate the names, even if that means a ragged edge on 
the right side.
But at the same time the text must absolutely stay within the confines of the 
framedtext.
I played with \raggedright, \tolerance, \looseness, \emergencystretch but no 
combination of them seems sufficient fto force all gtext inside.

Is there another solution to force the text inside the box or do I have to 
insert linebreaks manually (a nuisance to be avoided, of course.)



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
___


[NTG-context] frameoffset in textbackground?

2021-06-07 Thread Hans van der Meer
In the following MWE for a textbackground the parameter backgroundoffset has the expected effect. But for positive values only. A backgroundoffset=-10pt has no visible effect.But the real problem is the parameter frameoffset. No effect at all, whatever frameoffset= is set to.
dr. Hans van der Meer




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


[NTG-context] setup parameter problem

2021-06-07 Thread Hans van der Meer
The code below seems ok in \startsection[title=] but not when I program the 
parameter collection with \def\setupparameters{\getparameters[prefix]}
In that case even [title={enclosed value}] crashes with error message: Use of 
\doMacro doesn't match its definition.
Obviously I am missing something here. What?

\def\Macro{\dosingleargument\doMacro}
\def\doMacro[#1]#2{#1X#2}

The code below shows that it should be possible.
\startsection[title=\Macro{arg} no braces needed]\stopsection
\startsection[title={\Macro[arg1]{arg2} enclosed in braces}]\stopsection
\stoptext


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
___


[NTG-context] yscale not working

2021-06-05 Thread Hans van der Meer
Why is there no effect of the yscale parameter in \externalfigure when the width-parameter is given? In the MWE it is the intention to stretch the height of the figure by a factor of two. But nothing happens. Leaving out the width does stretch the height, but then it becomes too wide.\starttextTest \tex{externalfigure} scaling - \ConTeXt\ \contextversion\blank\type{\externalfigure[test][width=0.50\textwidth]}\crlf\externalfigure[test][width=0.50\textwidth]\blank\type{\externalfigure[test][width=0.50\textwidth,yscale=2000]}\crlf\externalfigure[test][width=0.50\textwidth,yscale=2000]\stoptext

scaling.pdf
Description: Adobe PDF document

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] chapter number sought

2021-05-30 Thread Hans van der Meer
Thanks. This helps.
dr. Hans van der Meer


> On 30 May 2021, at 13:40, Adam Reviczky  wrote:
> 
> Hi Hans,
> 
> Does this help: 
> https://tex.stackexchange.com/questions/134474/context-part-chapter-section-and-subsection-names
>  
> <https://tex.stackexchange.com/questions/134474/context-part-chapter-section-and-subsection-names>
>  ?
> 
> \starttext
> \startchapter[title={First chapter}]
> \structurenumber\ - \structuretitle
> \stopchapter
> \stoptext
> 
> Although getmarking is probably what you're really after: 
> \getmarking[chapternumber] and \getmarking[chapter].
> 
> \starttext
> \startchapter[title={First chapter}]
> \getmarking[chapternumber][current]\ - \getmarking[chapter][current]
> \stopchapter
> \stoptext
> 
> Adam
> 
> On Sun, May 30, 2021 at 11:12 AM Hans van der Meer  <mailto:havdm...@ziggo.nl>> wrote:
> With \pagenumber I can call up the current pagenumber and typeset it.
> But \chapternumber is not defined.
> How can I typeset the current chapternumber or even the current 
> chapternumber.sectionnumber.subsectionnumber, for example?
> 
> 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 <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/>
> ___
> ___
> 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] chapter number sought

2021-05-30 Thread Hans van der Meer
With \pagenumber I can call up the current pagenumber and typeset it.
But \chapternumber is not defined.
How can I typeset the current chapternumber or even the current 
chapternumber.sectionnumber.subsectionnumber, for example?

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
___


[NTG-context] no leavevmode

2021-05-27 Thread Hans van der Meer
Why is there not implemented in \subsection a \leavevmode at the end of it? 
Here a minimal example showing that starting with the first word in an \hbox 
encounters vertical mode. Thus requiring a \leavevmode to put it on line with 
the following text. Whereas not starting with an \hbox does an implicite switch 
to horizontal mode.
I can imagine that this behaviour could be confusing for users not well versed 
in the different behaviour of the horizontal and vertical modes.
Therefore my question: Wouldn't it be wise to implement that \leavevmode?

\startsubsection[title=TEST]
\hbox{abc} def\crlf
ghi jkl xyz
\stopsubsection


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
___


[NTG-context] setupindentations

2021-05-27 Thread Hans van der Meer
This macro \setupindentations  is mentioned in my ConText the manual from 
november 12, 2001.
It seems to have disappeared.
Is that so? Then why? What replacement?

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
___


[NTG-context] font message?

2021-04-26 Thread Hans van der Meer
I get the following message in the log (latest beta):

fonts   > !
fonts   > ! check count_components with mkiv !
fonts   > !

These are my font settings:

\definefontfeature [default] [default] [itlc=yes]
\setupbodyfont[schola,10pt]
\setupitaliccorrection [text]

What does it mean? Is there something I should do?

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] How to write readable source files?

2021-04-24 Thread Hans van der Meer
>> Is there a best practice for ConTeXt source files, at all?

Readable code is not just about formatting. Adding clear and complete comments 
that document the code can be considered even more important.

dr. Hans van der Meer


> On 24 Apr 2021, at 13:55, Henning Hraban Ramm  wrote:
> 
> 
>> Am 24.04.2021 um 11:45 schrieb Jan U. Hasecke :
>> 
>> Do you know of any prettifying tool?
> 
> I don’t know one.
> 
>> Is there a best practice for ConTeXt source files, at all?
> 
> I guess many of us adhere to Hans’ style, as shown in the sources.
> 
> i.e. e.g.
> \setupsomething
>  [name]
>  [key=value,
>   otherkey=value]
> 
> while I prefer:
> 
> \setupsomething[name][
>  key=value,
>  otherkey=value,
> ]
> 
> That looks clearer to me and works a bit better with automatic indenting in 
> editors.
> 
> But source code formatting is a matter of taste in most cases.
> 
> 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
> ___

___
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] nbsp in XML (S01E01)

2021-04-21 Thread Hans van der Meer
> Why tilde is displayed?

Wouldn't the simple answer not be: because XML is not TeX?

dr. Hans van der Meer


> On 21 Apr 2021, at 20:17, Jano Kula  wrote:
> 
> Dear list,
> 
> first episode of series on nbsp of XML in lmtx.
> Unfortunately, not that catchy as Netflix.
> 
> Used XML input has two types of non-breakable space:
> unicode character
> html entitity (in fact an ugly output of HTML editor)
> HTML is preprocessed with ctx preprocessor (great feature!) and substituted 
> for unicode char nbsp or tilde.
> 
> MWE shows unichar spaces are non-breakable (see end of the first lines), 
> however they are not stretchable (see second line of the paragraphs).
> 
> Does unicode nbsp have fixed with in ctx?
> 
> When tilde is the replacement in preprocessor (uncomment first replacement in 
> preprocessor), xmlfush will display tilde (which is, as character, 
> non-breakable and unstretchable, no surprise).
> 
> Why tilde is displayed?
> 
> Replacing or adding nbsp (tilde) with finalizers have different results, see 
> next episode after this one is understood.
> 
> Thank you,
> Jano
> 
> MWE (rather use attached file not to loose invisible characters):
> 
> \startbuffer[doc]
> 
> 
> Temperature 20 °C 20 °C 20 °C 20 °C average.
> Altitude 6000nbsp;m 6000nbsp;m 6000nbsp;m 
> 6000nbsp;m average.
> 
> \stopbuffer
> 
> \startluacode
> function lxml.preprocessor(data)
> -- data = string.gsub(data, "nbsp;", "~")
> -- replacement nbsp invisible in luacode
> data = string.gsub(data, "nbsp;", " ")
> return data
> end
> \stopluacode
> 
> 
> \startxmlsetups xml:name
> \xmlsetsetup{\xmldocument}{*}{-}
> \xmlsetsetup{\xmldocument}{document|p}{xml:name:*}
> \stopxmlsetups
> \xmlregistersetup{xml:name}
> 
> \startxmlsetups xml:name:document
> \xmlflush{#1}\par
> \stopxmlsetups
> 
> \startxmlsetups xml:name:p
> \parfillskip0pt\xmlflush{#1}\par
> \stopxmlsetups
> 
> \startTEXpage[offset=5mm,width=60mm]
> \xmlprocessbuffer{xml:name}{doc}{}
> \stopTEXpage
> ___
> 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] autopdf on MacOS?

2021-04-15 Thread Hans van der Meer
Thanks. At least worked twice 

met vriendelijke groet
dr. Hans van der Meer


> On 15 Apr 2021, at 11:45, Henning Hraban Ramm  wrote:
> 
> 
> 
>> Am 15.04.2021 um 10:26 schrieb Hans van der Meer :
>> 
>> When running the command: context --autopdf --run myfile.tex I had hoped the 
>> pdfviewer Preview on my MacOS system (version Catalina) would open the pdf 
>> for viewing.
> 
> It works with --autopdf=auto
> 
>> Allthough a new pdf is created, this is not opened. If the pdf is open in 
>> Preview already, it is not updated unless switching to the Preview 
>> application.
>> 
>> It something wrong here? Is it not functional in MacOS? Am I missing some 
>> clue?
> 
> Apple’s Preview updates only on activation, and not reliably (for me, it 
> often crashes).
> 
> That it doesn’t update in the background is more a feature than a bug, 
> otherwise it would complain about broken/unavailable files during the TeX 
> runs.
> 
> 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
> ___

___
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] autopdf on MacOS?

2021-04-15 Thread Hans van der Meer
When running the command: context --autopdf --run myfile.tex I had hoped the 
pdfviewer Preview on my MacOS system (version Catalina) would open the pdf for 
viewing. Allthough a new pdf is created, this is not opened. If the pdf is open 
in Preview already, it is not updated unless switching to the Preview 
application.

It something wrong here? Is it not functional in MacOS? Am I missing some clue?

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] latest lmtx, \startitemeze and Multipage TABLEs no longer works

2020-11-16 Thread Hans van der Meer
Shouldn't it be \startitemize ? Or is there another problem?
dr. Hans van der Meer


> On 16 Nov 2020, at 14:29, Bertrand Masson  wrote:
> 
> Hello
> With the latest version of lmtx (ConTeXt  ver: 2020.11.04 09:40 LMTX  fmt: 
> 2020.11.14) \ startitemeze [2] no longer works. Bullets (-) no longer appear!
> 
> Multipage TABLEs with \bTABLE[split=repeat,option=stretch] no longer works.
> 
> Bertrand
> 
> ___
> 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] Unwanted whitespace at beginning of document

2020-09-29 Thread Hans van der Meer
Of old I have found the wolf fence tactics useful: Put for example an X at the 
beginning of a suspected section and somewhat further a Y. OIf they bracket the 
culprit the offending space will be between them. Otherwise narrow the fence.

dr. Hans van der Meer


> On 29 Sep 2020, at 14:26, Denis Maier  wrote:
> 
> Hi,
> 
> I have ended up with unwanted whitespace at the beginning of my document. The 
> environment definition is already quite complex, so I cannot easily tell 
> where the whitespace is coming from. Any advice how I could track that down? 
> Are there some tricks for this?
> 
> Best,
> Denis
> 
> ___
> If your question is of interest to others as well, please add an entry to the 
> Wiki!
> 
> maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
> webpage  : http://www.pragma-ade.nl / http://context.aanhet.net
> archive  : https://bitbucket.org/phg/context-mirror/commits/
> wiki : http://contextgarden.net
> ___

___
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] Best way to store text for later use

2020-09-18 Thread Hans van der Meer
A possibility is saving the data as text in a Lua-table. If you are not afraid 
to use some Lua, I can send my code for saving files and data for repeated use.

dr. Hans van der Meer


> On 18 Sep 2020, at 15:36, Denis Maier  wrote:
> 
> Hi,
> 
> For typesetting XML I'm wondering how to best store text for later use:
> 
> I've tried using buffers, but this here doesn't work:
> 
> ==
> \startxmlsetups xml:article-meta
> \setupdocument [
> pub-year=\xmlfilter{#1}{/pub-date/year/command(xml:article-meta:pubdate:year)},
> volume=\xmlfilter{#1}{/volume/command(xml:article-meta:volume)},
> doi=\xmlfilter{#1}{/article-id[@pub-id-type='doi']/command(xml:article-meta:doi)},
> elocation-id=\xmlfilter{#1}{/elocation-id/command(xml:article-meta:elocation-id)},
> title=\xmlfilter{#1}{/title-group/article-title/command(xml:article-meta:title-group:article-title)},
> author={\AuthorList},
> ]
>   \startbuffer[abstract]
>   \xmlfilter{#1}{/abstract/command(xml:article-meta:abstract)}
>   \stopbuffer
>\xmlflush{#1}
> \stopxmlsetups
> 
> \startxmlsetups xml:article-meta:abstract
> \xmlflush{#1}
> \stopxmlsetups
> ===
> 
> This here works:
> 
> ==
> \startxmlsetups xml:article-meta
> \setupdocument [
> pub-year=\xmlfilter{#1}{/pub-date/year/command(xml:article-meta:pubdate:year)},
> volume=\xmlfilter{#1}{/volume/command(xml:article-meta:volume)},
> doi=\xmlfilter{#1}{/article-id[@pub-id-type='doi']/command(xml:article-meta:doi)},
> elocation-id=\xmlfilter{#1}{/elocation-id/command(xml:article-meta:elocation-id)},
> title=\xmlfilter{#1}{/title-group/article-title/command(xml:article-meta:title-group:article-title)},
> author={\AuthorList},
> abstract=\xmlfilter{#1}{/abstract/command(xml:article-meta:abstract)},
> ]
>\xmlflush{#1}
> \stopxmlsetups
> 
> \startxmlsetups xml:article-meta:abstract
> \xmlflush{#1}
> \stopxmlsetups
> ===
> 
> But has using a variable for the abstract any drawbacks? (The abstract might 
> contain multiple paragraphs.)
> 
> Best,
> Denis
> ___
> If your question is of interest to others as well, please add an entry to the 
> Wiki!
> 
> maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
> webpage  : http://www.pragma-ade.nl / http://context.aanhet.net
> archive  : https://bitbucket.org/phg/context-mirror/commits/
> wiki : http://contextgarden.net
> ___

___
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] catch % in gsub("%", "\\letterpercent")

2020-08-27 Thread Hans van der Meer
In Lua patterns % is a socalled magic character like ^$ etc. These are esacped 
with a %. Thus %% is what you need in the first string.
dr. Hans van der Meer


> On 27 Aug 2020, at 17:11, Pablo Rodriguez  wrote:
> 
> Dear list,
> 
> I have and \xmlraw command that gives some text with percent signs.
> ConTeXt parses them as comments (so no output).
> 
> Using Lua gsub(), I need to replace something like:
> 
>  string.gsub([[\xmlraw{#1}{.}]], "%", "\\letterpercent")
> 
> How do I need to invoke % to get the character found?
> 
> 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
___


Re: [NTG-context] please explain

2020-08-07 Thread Hans van der Meer
> It is because ffi is a multi-part ligature.

Indeed, of course. I am getting old, I fear. It kept me awake in bed yesterday 
until I realised (far too late) it must be the ffi ligature. 

dr. Hans van der Meer


> On 7 Aug 2020, at 09:29, Taco Hoekwater  wrote:
> 
> 
> 
>> On 6 Aug 2020, at 21:30, Hans van der Meer  wrote:
>> 
>> This MWE is an example of strange font behaviour according to the log and I 
>> do not understand what is causing it.
>> ConTeXt complains "check count_components with mkiv" when the word 'suffi' 
>> is present (see log message below).
>> 
>> Now comes the most strange: remove 'suffi' or shorten to 'suff' and the 
>> message goes away.
>> I have put the full set of files inside the zip.
> 
> Looks like it is a warning from Hans, mostly for himself. It is because ffi 
> is a multi-part ligature.
> As long as the output looks ok, I do not think you have to pay attention.
> 
> Best wishes,
> Taco
> 
> ___
> If your question is of interest to others as well, please add an entry to the 
> Wiki!
> 
> maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
> webpage  : http://www.pragma-ade.nl / http://context.aanhet.net
> archive  : https://bitbucket.org/phg/context-mirror/commits/
> wiki : http://contextgarden.net
> ___

___
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] please explain

2020-08-06 Thread Hans van der Meer
This MWE is an example of strange font behaviour according to the log and I do not understand what is causing it.ConTeXt complains "check count_components with mkiv" when the word 'suffi' is present (see log message below).Now comes the most strange: remove 'suffi' or shorten to 'suff' and the message goes away.I have put the full set of files inside the zip.
dr. Hans van der Meer

\setupbodyfont[termes]\starttext%=ConTeXt versie \contextversion \crlf%=this here: suffi (but suff is ok!)%=\starttypingfonts/mkiv/type-imp-texgyre.mkiv'close source    > level 3, order 4, name '/Users/hansm/TeX/context/tex/texmf-context/tex/context/fonts/mkiv/type-imp-texgyre.mkiv'fonts           > !fonts           > ! check count_components with mkiv !fonts           > !\stoptyping\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 with \margindata

2020-07-15 Thread Hans van der Meer
I didn't miss that argument, of course, my actual code was:
\margindata[outer][hoffset=\marginoffset]

dr. Hans van der Meer


> On 15 Jul 2020, at 22:10, Wolfgang Schuster 
>  wrote:
> 
> Hans van der Meer schrieb am 15.07.2020 um 21:48:
>> Using the following:
>> \margindata{some macro expansions}
> 
> You're missing the first mandatory argument, e.g. \margindata[inright]{...}.
> 
>> I know that \margindata is typeset at a later moment than its place in the 
>> code suggests. The problem is that macro expansions inside the {}'s are 
>> expanded twice. This interferes badly with the things I want to happen.
> 
> No, the content is stored in a box and placed later.
> 
> \definecounter[test]
> 
> \starttext
> 
> \dorecurse{10}
>  {\inleft{\incrementedcounter[test]}Line \recurselevel\par}
> 
> \stoptext
> 
>> Tracing what happens, I conclude that the result of the first expansion is 
>> lost and is not carried into the actual placement of the marginnote.
>> The question this is: how to solve this problem?
> 
> Provide a working minimal example.
> 
> 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
> ___

___
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] how to with \margindata

2020-07-15 Thread Hans van der Meer
Using the following:

\margindata{some macro expansions}

I know that \margindata is typeset at a later moment than its place in the code 
suggests. The problem is that macro expansions inside the {}'s are expanded 
twice. This interferes badly with the things I want to happen.

Tracing what happens, I conclude that the result of the first expansion is lost 
and is not carried into the actual placement of the marginnote.

The question this is: how to solve this problem?

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
___


[NTG-context] lmtx install fails to run

2020-07-09 Thread Hans van der Meer
After doing just now the standard: sh install.sh context will not run. Why, 
because in the past it worked without a hitch.
Now there is no format cont-en.

Did all sorts of the ususal things like remove the current cache, context 
--make en, etc.

I guess the error is in the missing file. An overfsight somewhere?
Below the last part of the context --make en run.
Mark the lang-mis.mkxl is not found line.

met vriendelijke groet
dr. Hans van der Meer

resolvers   > lua > loading file 
'/Users/hansm/TeX/context-lmtx/tex/texmf-context/tex/context/base/mkiv/node-bck.lua'
 succeeded
close source> level 1, order 83, name 'node-bck.mkiv'
open source > level 1, order 84, name 'pack-cut.mkiv'
close source> level 1, order 84, name 'pack-cut.mkiv'
runtime error : input file 'lang-mis.mkxl' is not found, quitting
resolvers   | formats |
resolvers   | formats | binary path  : 
/Users/hansm/TeX/context-lmtx/tex/texmf-osx-64/bin
resolvers   | formats | format path  : 
/Users/hansm/TeX/context-lmtx/tex/texmf-cache/luatex-cache/context/5fe67e0bfe781ce0dde776fb1556f32e/formats/luametatex
resolvers   | formats | luatex engine: luametatex
resolvers   | formats | lua startup file : 
/Users/hansm/TeX/context-lmtx/tex/texmf-context/tex/context/base/mkiv/luat-cod.lua
resolvers   | formats | context file : 
/Users/hansm/TeX/context-lmtx/tex/texmf-context/tex/context/base/mkiv/cont-en.mkxl
resolvers   | formats | run time : 0.499 seconds
resolvers   | formats | return value : error
resolvers   | formats |
system  | total runtime: 0.500 seconds of 0.604 seconds

___
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] overfull message

2020-07-03 Thread Hans van der Meer
I would very much like to get rid of the overfull hbox messages in the log. They clutter the log and I have not much use for themSetting \hbadness to a large enough value should suppress them below the threshold. But this does not happen. At least not in the minimal example  enclosed herby.Is there a remedy making these messages disappear from the log?
dr. Hans van der Meer

hbadness.tex
Description: Binary data




hbadness.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] explain please

2020-06-24 Thread Hans van der Meer
\\currentdate 
Neat solution, worked without a hitch. Now I have to remember this for future 
use ...

dr. Hans van der Meer


> On 24 Jun 2020, at 21:10, Hans Hagen  wrote:
> 
> On 6/24/2020 9:00 PM, Hans van der Meer wrote:
>> How can the crash in the minimal example here be explained? And is there a 
>> solution to avoid this and make the crash going away "without having to jump 
>> through special hoops"?
> because \currentdate is a macro thatv does some magic ... it's nor fully 
> expandable
> 
> so, lua sees \currentdate == \c as first escaped character coming in and 
> that's invalid (\\currentdate would work)
> 
> just try
> 
> print("\come on") in pure lua
> 
> 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] explain please

2020-06-24 Thread Hans van der Meer
How can the crash in the minimal example here be explained? And is there a solution to avoid this and make the crash going away "without having to jump through special hoops"?
dr. Hans van der Meer



currentdate.pdf
Description: Adobe PDF document


currentdate.tex
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] loading xml error

2020-06-23 Thread Hans van der Meer
Please can someone explain the following error and why the one specific XML 
input fails?
It turns out that a single node  is not accepted by the core whereas 
others are ok.

This is the error message in the log, first line from my debug statement: 
HVDM-VOC> load vocabulary from buffer "german"
xml > core > load error in [buffer: german]: invalid xml file - 
parsed text

Minimal code to explain what is done:

% Loading from buffer.
\def\loadvocabularyfrombuffer#1{%
\writestatus{HVDM-VOC}{load vocabulary from buffer "#1"}%
\XMLProcessBuffer{#1}%
% simply does an \xmlprocessbuffer{}{}{}
}

The following buffer gives the error:
\startbuffer[german]

\stopbuffer
\loadvocabularyfrombuffer{german}

But the others below are ok and load as expected.

\startbuffer[german]

\stopbuffer

and

\startbuffer[german]

\stopbuffer

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] Checking existence of a macro (control sequence) by Lua - problem after updating MkIV

2020-06-18 Thread Hans van der Meer
Why can you not simply use one of the doifundefined macro's? Something for 
example:
\doifundefined{ExitStatus}{\gdef\ExitStatus{0}} % default to ok as in UNIX

dr. Hans van der Meer


> On 18 Jun 2020, at 10:27, Lukas/ConTeXt  wrote:
> 
> Hello,
> I'm using Hans' macro suggested some time before.
> I've just updated Ctx MkIV and my sample code:
> 
> 
> \starttext
>  \def\MyMacro{Ahoj}
> 
>  \def\MyMacWithPars#1#2{Something}
> 
>  \def\Undefined{}
>  \let\Undefined\undefined
> 
>  \def\DoNothing{}
>  \let\DoNothing\donothing
> 
>  \startluacode
>if CONTEXTLMTXMODE == 0 then
>local d = tokens.defined
>local c = tokens.create
> 
>function tokens.defined(s,b)
>if b then
>return d(s)
>else
>return c(s).cmd_name == "undefined_cmd"
>end
>end
>end
> 
>--
> 
>local defined = tokens.defined
> 
>for _, v in ipairs{ "MyMacro", "MyMacWithPars", "Undefined", "DoNothing", 
> "NonExisting" } do
>  print(string.format("\letterpercent-12s", v), defined(v), defined(v, 
> true), defined(v, false))
>end
>  \stopluacode
> 
>  Aaa
> \stoptext
> 
> 
> gives:
> "
> MyMacro false   false   false
> MyMacWithPars   false   false   false
> Undefined   false   false   false
> DoNothing   false   false   false
> NonExisting false   false   false
> "
> 
> IOW, I'm not able to determine whether a control sequence has not been 
> defined (or has \undefined value) or not.
> 
> Am I doing a trivial mistake or has anything changed?
> 
> Thank you for patience...
> 
> 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
___


Re: [NTG-context] problem since previous versions

2020-06-07 Thread Hans van der Meer
Wolfgang,

I did define the various variants in order to parametrize vtop, vbox and 
vcenter through parameters top, bottom, center.
 
Happily there proved to be a remedy: place everything inside an \hbox and the 
error goes away. Without problematic whitespace or other nasty side effects, it 
seems.  But, although the panic is over now :-), I am still curious to know why 
it worked before and raises an error now.

as for the definition of \placexlocation, it comes from:
\def\setupplacex{\getparameters[placex]}
\setupplacex[%  default parameters
...
location=center,%
...
]%
and I checked that it had the value: center.

But if you are interested, I can send you the module code.

dr. Hans van der Meer


> On 7 Jun 2020, at 12:20, Wolfgang Schuster 
>  wrote:
> 
> Hans van der Meer schrieb am 07.06.2020 um 12:07:
>> A problem has arisen up since previous versions, where code without a 
>> problem now raises an error.
>> This is the afflicted code:
>> % Assign values to \locationbox.
>> \doif{top}{\placexlocation}%
>> {\def\startlocationbox{\vtop\bgroup\vss}}%
>> \doif{center}{\placexlocation}%
>> {\def\startlocationbox{\vcenter\bgroup}}%
>> \doif{bottom}{\placexlocation}%
>> {\def\startlocationbox{\vbox\bgroup}}%
>> And it is used here:
>> \setbox\placexbox=\startlocationbox
>> \ignorespaces
>> Previously this worked without a hitch, now the error is:
>> tex error   > tex error on line 9 in file ./familie-events.tex: ! A 
>>  was supposed to be here
>> 
>> \vcenter
>> \startlocationbox ->\vcenter
>>  \bgroup
>> \dostartcontentplacexinline ...ables \par \setbox \placexbox 
>> =\startlocationbox
>>  
>> \ignorespaces
>>  \syst_helpers_single_empty_one_nop
>>\xmlflush
>> \21>:xmlplc:placexcontent ...le=\xmlatt {#1}{alttitle}]}\startcontent 
>> \xmlflush
>>  
>> {#1}\stopcontent
>> l.9 }
>> I can try to make a minimal example, but not without the afflicted module of 
>> some 800 lines. So perhaps the problem will be located by the experts at 
>> first sight. It is of course the \vcenter playing havoc, because replacing 
>> it by \vtop or \vbox makes the error disappear.
>> Thanks for looking into it, because my work more or less depends on this 
>> code working in good order.
> 
> How so you define \placexlocation?
> 
> 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
> ___

___
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 since previous versions

2020-06-07 Thread Hans van der Meer
A problem has arisen up since previous versions, where code without a problem 
now raises an error.

This is the afflicted code:
% Assign values to \locationbox.
\doif{top}{\placexlocation}%
{\def\startlocationbox{\vtop\bgroup\vss}}%
\doif{center}{\placexlocation}%
{\def\startlocationbox{\vcenter\bgroup}}%
\doif{bottom}{\placexlocation}%
{\def\startlocationbox{\vbox\bgroup}}%

And it is used here:
\setbox\placexbox=\startlocationbox
\ignorespaces

Previously this worked without a hitch, now the error is:
tex error   > tex error on line 9 in file ./familie-events.tex: ! A  
was supposed to be here
 
\vcenter 
\startlocationbox ->\vcenter 
 \bgroup 
\dostartcontentplacexinline ...ables \par \setbox \placexbox =\startlocationbox 

\ignorespaces 
 \syst_helpers_single_empty_one_nop 
   \xmlflush 
\21>:xmlplc:placexcontent ...le=\xmlatt {#1}{alttitle}]}\startcontent \xmlflush 

{#1}\stopcontent 
l.9 }

I can try to make a minimal example, but not without the afflicted module of 
some 800 lines. So perhaps the problem will be located by the experts at first 
sight. It is of course the \vcenter playing havoc, because replacing it by 
\vtop or \vbox makes the error disappear.

Thanks for looking into it, because my work more or less depends on this code 
working in good order.

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
___


[NTG-context] errors in margindata?

2020-06-07 Thread Hans van der Meer
I gues there are errors in \margindata. See the minimal example. The contextversion is fresh loaded just before this test.(1) \margindata{test} gives an error. The log message is:	tex error   > tex error on line 9 in file ./margindata.tex: ! Use of \typo_margins_data_yes doesn't match its definition

l.9 \margindata{
  text1}% One has to use \margindata[]{test} to avoid the error.(2) \margindata[]{test} has spurious whitespace,  \margindata[]{test}% must be used to avoid that.Below the minimal example and the output.
met vriendelijke groetdr. Hans van der Meer



margindata.tex
Description: Binary data


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


[NTG-context] mtxrun exit code

2020-05-29 Thread Hans van der Meer
I am producing a series of files in a shell script with mtxrun --autogenerate 
--script context input
Doing exit mtxrun... shows there is no exit number to test in the shell, or to 
ste a shell variable to that value.

I can set a global macro \ExitStatus to an exit value depending on success or 
failure, pass that on to mtxrun as exit statusd and test that in the script.

For example:
\starttext
  \xmlprocessbuffer{notes}{notes}{}
  \doif{\ExitStatus}{notok}{"let mtxrun return value 1 as error in UNIX"}
\stoptext

After that it would be possible in the shell script to delete the pdf produced, 
what is my intention in this case.

Is this an option or is there presently another (standard) procedure to 
communicate from ConTeXt to the shell.

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] Is it possible to make xml.load a bit more 'verbose' when it encounters errors?

2020-05-14 Thread Hans van der Meer
Gerben,Maybe this is of some use. The Lua code in the file checks the xml and returns info when something is wrong.I am using it for example in my takenotes module as:And this is a sketch of how it is embedded in that module:	% Prerun an xml check.	\doifinset{\xmlatt{#1}{checkxml}}{yes,on,true}%		{\xmlcommand{#1}{.}{xmlcommon:checkxml}}	% Execute this code if no error was found.		etc.
dr. Hans van der Meer

\startluacode
-- Define our namespace as hvdm
hvdm = hvdm or {}

-- Function checks the correctness of an XML tree.
hvdm.checkXMLtree = function (xml, linesep)

local xml = xml and xml or ""
local linesep = linesep and linesep or "\n"
local badspace = {}

-- Empty files do not need processing.
if xml == "" then
return ""
end

-- Step one is remove leading characters before first node.
local leadingnode = string.find(xml, "<", 1) or 1
if leadingnode ~= 1 then
xml = string.sub(xml, leadingnode, -1)
end

-- Strip all comments  but node pairs inside make it 
complicated.
local c1, c2 = string.find(xml, "", c2 + 1, true)
if c3 then
-- Remove comment.
xml = string.sub(xml, 1, c1 - 1) .. string.sub(xml, c4 
+ 1, -1)

-- Search for next comment.
c1, c2 = string.find(xml, "

Re: [NTG-context] Bug (Lua) ?

2020-03-19 Thread Hans van der Meer
Lua strings can be split across lines by using so called long brackets 
according to the Lua Reference Manual:
[[split
string]]

or (very first newline ignored):
[[
split
string]]

or with matched levels: [==[  ]==]

dr. Hans van der Meer


> On 19 Mar 2020, at 14:29, Aditya Mahajan  wrote:
> 
> On Thu, 19 Mar 2020, mf wrote:
> 
>> Il 19/03/20 11:20, Fabrice Couvreur ha scritto:
>>> Hi,
>>> this file did not pose any problems but today yes.
>>> Thank you.
>>> Fabrice
>>> \starttext
>>> \startluacode
>>> local letters_1 = { "A", "B", "C", "D", "E", "F", "G", "H", "I", "J" }
>>> local letters_2 = { "1", "Année", "1998", "1999", "2000", "2001", "2002",
>>> "2003", "2004", "2005","2006" }
>>> context.startxtable({"align={middle,lohi},
>>> width=1.2cm,offset=0.8ex,bodyfont=9pt"})
>> 
>> context.startxtable( { align = "middle,lohi", width = "1.2cm", offset = 
>> "0.8ex", bodyfont = "9pt" } )
>> 
>> The argument is a lua table. Values are usually strings.
>> 
>>> context.startxrow({"background=color,backgroundcolor=green"})
>> 
>> context.startxrow( { background = "color", backgroundcolor = "green" } )
>> 
>> ... and so on.
> 
> A table with just one string entry also works, but lua strings cannot be 
> split across lines. So, if you remove the newline after "align={middle,lohi}, 
> that also works.
> 
> 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
> ___

___
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] unwanted with epub

2020-03-05 Thread Hans van der Meer
I was wrong. The \penalty is not the culprit, but it turns out to be the \Word 
macro that introduces the  through a parfillskip_code in the internal 
list.

dr. Hans van der Meer


> On 5 Mar 2020, at 09:33, Hans van der Meer  wrote:
> 
> Found the cause in my case: a \penalty0 statement.
> 
> dr. Hans van der Meer


> On 3/3/2020 16:51, Hans van der Meer wrote:
>> In producing epub s are appearing (on the -raw.xml file) that are 
>> unwanted and seem spurious to me. For example aftersome macro's. 
>> Can someone tell me what triggers a ? In the pdf output such breaks 
>> are absent.
>> 
>> 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] unwanted with epub

2020-03-05 Thread Hans van der Meer
Found the cause in my case: a \penalty0 statement.

dr. Hans van der Meer


> On 5 Mar 2020, at 03:08, Rik Kabel  wrote:
> 
> 
> 
> On 3/3/2020 16:51, Hans van der Meer wrote:
>> In producing epub s are appearing (on the -raw.xml file) that are 
>> unwanted and seem spurious to me. For example aftersome macro's. 
>> Can someone tell me what triggers a ? In the pdf output such breaks 
>> are absent.
>> 
>> dr. Hans van der Meer
>> 
> There are many situations in which the export contains break elements that 
> don't appear to be associated with aspects of the pdf output.  See, for 
> example, the following messages from 2018 in which I noted a few of them:
> 
> Spurious breaks in export when blank line ends paragraph 
> <https://www.mail-archive.com/ntg-context@ntg.nl/msg88729.html>
> More spurious problems in exports 
> <https://www.mail-archive.com/ntg-context@ntg.nl/msg88311.html>
> Unexpected  in XML output 
> <https://www.mail-archive.com/ntg-context@ntg.nl/msg88268.html>
> If you provide an example of your ConTeXt source demonstrating the problem, 
> perhaps someone on the list can help.
> 
> -- 
> 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
> ___

___
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] epub and pdf not the same

2020-03-04 Thread Hans van der Meer

On 3 Mar 2020, at 22:04, Rik Kabel  wrote:Instructions for creating the .epub from the export are contained in the log file.In the log comes:    create epub with: mtxrun --script epub --make "kookboek" --purge --rename --svgmathThis I did.The log gives: adding: mimetype (stored 0%)  adding: META-INF/ (stored 0%)  adding: META-INF/container.xml (deflated 32%)  adding: OEBPS/ (stored 0%)  adding: OEBPS/nav.xhtml (deflated 49%)  adding: OEBPS/images/ (stored 0%)  adding: OEBPS/kookboek.opf (deflated 65%)  adding: OEBPS/styles/ (stored 0%)  adding: OEBPS/styles/kookboek-styles.css (deflated 35%)  adding: OEBPS/styles/kookboek-defaults.css (deflated 80%)  adding: OEBPS/styles/kookboek-images.css (deflated 7%)  adding: OEBPS/cover.xhtml (deflated 38%)  adding: OEBPS/kookboek-div.html (deflated 67%)  adding: OEBPS/toc.ncx (deflated 53%)mtx-epub        | epub archive made using zip: kookboek.epubBut, the resulting epub is bad. Compare the output as pdf with the output as epub and it is immediately clear that something is wrong in the production of the epub. See also the corresponding -raw.xml. Unless I am making a gross mistake.

kookboek.epub
Description: application/epub


kookboek.pdf
Description: Adobe PDF document


kookboek-raw.xml
Description: XML document
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
___


[NTG-context] unwanted with epub

2020-03-03 Thread Hans van der Meer
In producing epub s are appearing (on the -raw.xml file) that are 
unwanted and seem spurious to me. For example aftersome macro's. 
Can someone tell me what triggers a ? In the pdf output such breaks are 
absent.

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] Why mode not recognized?

2020-03-03 Thread Hans van der Meer

> On 3 Mar 2020, at 22:21, Wolfgang Schuster 
>  wrote:
> 
> On Tue, 3 Mar 2020 22:07:51 +0100
> Hans van der Meer  wrote:
> 
>> Calling ConTeXt with:
>> 
>> mtxrun --autogenerate --mode=epub --script context "$1"
>> 
>> and in the tex-file called:
>> \starttext
>> \startmode[epub]
>>  Producing EPUB\crlf
>> \stopmode
>> \startnotmode[epub]
>>  Not producing EPUB\crlf
>> \stopnotmode
>> \stoptext
>> 
>> This produces "Not producing EPUB" Why?
> 
> I guess parameters which are passed to the context script have to come after 
> you call the script, e.g.
> 
> mtxrun --autogenerate --script context --mode=epub "$1"
> 
> Wolfgang

Indeed. That sets the mode. Thanks.

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

___
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] Why mode not recognized?

2020-03-03 Thread Hans van der Meer
Calling ConTeXt with:

mtxrun --autogenerate --mode=epub --script context "$1"

and in the tex-file called:
\starttext
\startmode[epub]
Producing EPUB\crlf
\stopmode
\startnotmode[epub]
Not producing EPUB\crlf
\stopnotmode
\stoptext

This produces "Not producing EPUB" Why?

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] Quick question about dual output pdf and epub

2020-03-03 Thread Hans van der Meer
I followed your advice and added the setup:

> You need
>  \setupbackend[export=yes]
> in your document. 

This, however, does not result in an .epub file but an export directory 
containing an html and xhtml file (only partially conformant to the equivalent 
pdf).

Can I get the output as an .epub file? Some more changes needed?

> 
> On Tue, 3 Mar 2020 19:37:47 +0100
> Hans van der Meer  wrote:
> 
>>> 
>>> and then run with --mode=epub
>> 
>> I am running with:
>>mtxrun --autogenerate --mode=epub --script context "$1"
>> but no epub document is generated, just the same result.pdf I get without 
>> that mode.
> 
> You need
> 
>  \setupbackend[export=yes]
> 
> in your document. When you put the setup above in a "epub"
> mode you create a epub-document only when you enable the mode
> which is recommended because it can have side effects for
> the normal PDF.
> 
> To avoid these side effects make an extra ConTeXt run
> by enabling the mode to get the epub 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
> ___

___
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] Quick question about dual output pdf and epub

2020-03-03 Thread Hans van der Meer
> 
> and then run with --mode=epub

I am running with:
mtxrun --autogenerate --mode=epub --script context "$1"
but no epub document is generated, just the same result.pdf I get without that 
mode.

In .bashrc using:
# The current version of the ConTeXt luametatex in use:
CONTEXTLMTX=$HOME/TeX/context-lmtx ; export CONTEXTLMTX
CONTEXTCURRENT=$CONTEXTLMTX ; export CONTEXTCURRENT
MYTEXMFHOME=$HOME/TeX/texmf ; export MYTEXMFHOME
TEXMF=$MYTEXMFHOME:$CONTEXTCURRENT/tex ; export TEXMF
PATH=$CONTEXTCURRENT/tex/texmf-osx-64/bin:$PATH ; export PATH

Log shows: ConTeXt  ver: 2019.10.02 12:53 MKIV beta  fmt: 2019.10.2

I am doing something wrong here?

dr. Hans van der Meer


> On 28 Feb 2020, at 12:07, Hans Hagen  wrote:
> 
> On 2/28/2020 11:48 AM, Christoph Hintermüller wrote:
>> Hi
>> Hust not to miss something or mess up every thing.
>> Can i setup my document preamble such that i can without any switching
>> create pdf and epub output at the same time.
>> Want to provide my lecture notes in pdf and epub format.
>> In other words does it have any side effects on pdf output, if i put
>> \setuptoutput command preparing document for xhtml/epub output in my
>> document preamble/main document?
>> Or would i have to enclose this in some \ifelse conditional block? If
>> is there a possibility to control condition from mtxrun command line?
> Currently it is created at the same time but it runs slower. Indeed using 
> some mode makes sense because you might also want to have a different layout 
> (the simpler, the less possible side effects, actually when doing epub or 
> export using some very large page also makes sense as then there can be less 
> interference of page breaks and so).
> 
> \startmode [epub]
>  
> \stopmode
> 
> and then run with --mode=epub
> 
> 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
___


Re: [NTG-context] beta

2019-10-02 Thread Hans van der Meer
You can add to the end of the install script:

echo "Removing luatex-cache/context"
rm -r tex/texmf-cache/luatex-cache/context

dr. Hans van der Meer


> On 2 Oct 2019, at 15:32, Alan Bowen  wrote:
> 
> Hi, Hans—
> 
> The latest lmtx now processes my docs as it should when texmf-cache was 
> deleted before installation. So, where is this zip that has the revised 
> install.sh script?
> 
> Alan
> 
> On Wed, Oct 2, 2019 at 7:06 AM Hans Hagen  <mailto:j.ha...@xs4all.nl>> wrote:
> On 9/30/2019 2:11 PM, Thomas A. Schmitz wrote:
> > On 29.09.19 16:31, Hans Hagen wrote:
> >> Hi,
> >>
> >> A week ago we had the (nice and pleasant) annual context meeting and 
> >> as usual some new stuff has been presented there which was not yet in 
> >> the distribution at that moment. Some pending code is now being moved 
> >> into the distribution. Part is font related (lmtx only, not relevant 
> >> for most users), most is metafun (luametafun or metafun xl or whatever 
> >> name suits) related (including a new preliminary manual) which uses 
> >> some new interfaces and therefore (currently) is lmtx only.
> > 
> > Hi Hans,
> > 
> > I just updated. I had to delete the cache for context to work again, got 
> > weird errors compiling a file that works normally. So my question: since 
> > creating a new cache and format takes only a few seconds, wouldn't it 
> > make sense to include it in install.sh ?
> I've added that feature but one needs the new install.sh script then 
> (from the zip).
> 
> (We also added openbsd installers.)
> 
> 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/>
> ___
> ___
> 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] coloring the logfile

2019-08-29 Thread Hans van der Meer
> On 29/08/19 5:35 PM, Henning Hraban Ramm wrote:
> This will need engine support but is in principle dead easy.

So it seems doable if someone is willing to provide the engine support. I 
sincerely hope it will be done. With many thanks, of course.

dr. Hans van der Meer


> On 29 Aug 2019, at 09:39, Henri Menke  wrote:
> 
> 
> 
> On 29/08/19 5:35 PM, Henning Hraban Ramm wrote:
>> 
>>> Am 2019-08-28 um 21:54 schrieb Hans van der Meer :
>>> 
>>> Is it possible to force lines  written in the log with \writestatus to have 
>>> a specific color? The log can be very substantial and it would be nice to 
>>> have some lines brought to attention by a different color.
>> 
>> As a text file, the log can’t have colors.
>> 
>> Only the output to your terminal could have ANSI color codes.
>> I’d welcome this, too, but then we need additional configuration, color 
>> breaks easily on some shells, the feature should adhere to the usual shell 
>> variables etc. Don’t know it it would be worth the effort.
> 
> This will need engine support but is in principle dead easy.
> 
> #include 
> 
> if (isatty(fileno(stdout))) {
>// color
> } else {
>// no color
> }
> 
>> 
>> Greetlings, Hraban
>> ---
>> https://www.fiee.net
>> http://wiki.contextgarden.net
>> https://www.dreiviertelhaus.de
>> 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
>> ___
>> 
> 
> ___
> 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] coloring the logfile

2019-08-28 Thread Hans van der Meer
Is it possible to force lines  written in the log with \writestatus to have a 
specific color? The log can be very substantial and it would be nice to have 
some lines brought to attention by a different color.

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
___


[NTG-context] newlines in return Lua string

2019-06-15 Thread Hans van der Meer
From\ctxlua{tex.print(hvdm.myluacall("\xmlatt{#1}{argument}"))}
Lua returns a string containing newline characters '\n'.

In ConTeXt this returned string is printed as one line, the embedded newlines 
are not honoured.
I thought to replace with \crlf in this manner: string1 .. "\\crlf" .. string2 
but the returned \crlf are not executed as such.

How to force \crlf's in the executed return?

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] error in LMTX?

2019-06-11 Thread Hans van der Meer
Found the origin of the curious error message containing my name.
Comes from the inclusion of a file named type-loc.mkiv residing in a directory 
~/TeX/texmf/tex/context/user/ and containing:

\endinput

Op NTG ConTeXt nieuwsgroep, antwoord van Hans Hagen.

On 1/3/2014 2:33 PM, H. van der Meer wrote: (etc.)

How this got included? I have no idea.
But removing it did not make a difference, even after calling mtxrun --generate.


> On 10 Jun 2019, at 22:21, Hans van der Meer  wrote:
> 
>> 
>> On 10 Jun 2019, at 12:04, Hans van der Meer > <mailto:havdm...@ziggo.nl>> wrote:
>> 
>> This looks to me as an error in the LMTX distribution:
>> 
>> tex error   > tex error on line 6 in file 
>> /Users/hansm/TeX/context-lmtx/tex/texmf-context/tex/context/fonts/mkiv/type-imp-dejavu.mkiv:
>>  ! Missing } inserted
>> 
>>  
>> }
>>  
>> \aligntab 
>> l.6 fontclass\aligntab
>> \fontclass\cr
>> 
>> Because running under my old ConTeXtBeta does not aborts with the error.
>> system  > ConTeXt  ver: 2019.06.01 19:11 MKIV beta  fmt: 2019.6.4  
>> int: english/english
>> 
>> I looked into that file but could not see what causes the error.
> 
> I did some more research and as a result now wonder what is happening.
> 
> The error occurred in this piece of code of mine:
> 
> \tabskip=1em\halign{%
> \alignmark\hfil\aligntab\alignmark\hfil\cr
> fontclass\aligntab\fontclass\cr
> Regular\aligntab\truefontname{Regular}\cr
> }
> 
> \aligntab and \alignmark were advertised as LuaTeX equivalents for & and # 
> respectively.
> 
> Then I took the following example from Victor Eijkhout's book "TeX by Topic", 
> page 197, last example.
> That surely should work, was the idea.
> 
> \starttext
> \halign{a###\cr 1&2\cr 1\cr}
> \stoptext
> 
> However this fails! How can such a basic example in pure TeX fail? I wonder 
> and am curious what is happening here.
> 
> This is LuaMetaTeX, Version 2.00.0 
> tex error   > tex error on line 3 in file 
> /Users/hansm/TeX/texmf/tex/context/user/type-loc.mkiv: ! Only one # is 
> allowed per tab
> 
> l.3 \halign{a##
>#\cr 1&2\cr 1\cr}
> 
>  1 \endinput
>  2 
>  3 >>  Op NTG ConTeXt nieuwsgroep, antwoord van Hans Hagen.
>  4 
>  5 On 1/3/2014 2:33 PM, H. van der Meer wrote:
>  6 Has someone an idee what causes the unknown library message as in the
>  7 log below? Is it harmful?
>  8 
>  9 fonts   > typescripts > unknown library 'loc'
> 10 
> 11 you can add a file type-loc.mkiv someplace in your local tree with
> 12 
> 13 % dummy file
> 
> There should be exactly one # between &'s, when an
> \halign or \valign is being set up. In this case you had
> more than one, so I'm ignoring all but the first.
> 
> mtx-context | fatal error: return code: 256
> 
> and using \alignmark and \aligntab this results in:
> 
> \starttext
> \halign{a\alignmark\aligntab b\alignmark\aligntab c\alignmark\cr 1\aligntab 
> 2\cr 1\cr}
> \stoptext
> 
> And I am most curious how my name could turn up in the error message produced!
> 
> tex error   > tex error on line 3 in file 
> /Users/hansm/TeX/texmf/tex/context/user/type-loc.mkiv: ! Missing } inserted
> 
>  
> }
>  
> \aligntab 
> l.3 ...\alignmark\aligntab c\alignmark\cr 1\aligntab
>2\cr 1\cr}
> 
>  1 \endinput
>  2 
>  3 >>  Op NTG ConTeXt nieuwsgroep, antwoord van Hans Hagen.
>  4 
>  5 On 1/3/2014 2:33 PM, H. van der Meer wrote:
>  6 Has someone an idee what causes the unknown library message as in the
>  7     log below? Is it harmful?
>  8 
>  9 fonts   > typescripts > unknown library 'loc'
> 10 
> 11 you can add a file type-loc.mkiv someplace in your local tree with
> 12 
> 13 % dummy file
> 
> I've put in what seems to be necessary to fix
> the current column of the current alignment.
> Try to go on, since this might almost work.
> 
> mtx-context | fatal error: return code: 256
> 
> 
> 
>> 
>> 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 <mailto:ntg-context@ntg.nl> / 
>> http://www.ntg.nl/mailman/listinfo/ntg-context 
>> <http://www.ntg.nl/mailman/listinfo/ntg-context>
>> webpage  : http://www.pr

Re: [NTG-context] error in LMTX?

2019-06-10 Thread Hans van der Meer

> On 10 Jun 2019, at 12:04, Hans van der Meer  wrote:
> 
> This looks to me as an error in the LMTX distribution:
> 
> tex error   > tex error on line 6 in file 
> /Users/hansm/TeX/context-lmtx/tex/texmf-context/tex/context/fonts/mkiv/type-imp-dejavu.mkiv:
>  ! Missing } inserted
> 
>  
> }
>  
> \aligntab 
> l.6 fontclass\aligntab
> \fontclass\cr
> 
> Because running under my old ConTeXtBeta does not aborts with the error.
> system  > ConTeXt  ver: 2019.06.01 19:11 MKIV beta  fmt: 2019.6.4  
> int: english/english
> 
> I looked into that file but could not see what causes the error.

I did some more research and as a result now wonder what is happening.

The error occurred in this piece of code of mine:

\tabskip=1em\halign{%
\alignmark\hfil\aligntab\alignmark\hfil\cr
fontclass\aligntab\fontclass\cr
Regular\aligntab\truefontname{Regular}\cr
}

\aligntab and \alignmark were advertised as LuaTeX equivalents for & and # 
respectively.

Then I took the following example from Victor Eijkhout's book "TeX by Topic", 
page 197, last example.
That surely should work, was the idea.

\starttext
\halign{a###\cr 1&2\cr 1\cr}
\stoptext

However this fails! How can such a basic example in pure TeX fail? I wonder and 
am curious what is happening here.

This is LuaMetaTeX, Version 2.00.0 
tex error   > tex error on line 3 in file 
/Users/hansm/TeX/texmf/tex/context/user/type-loc.mkiv: ! Only one # is allowed 
per tab

l.3 \halign{a##
   #\cr 1&2\cr 1\cr}

 1 \endinput
 2 
 3 >>  Op NTG ConTeXt nieuwsgroep, antwoord van Hans Hagen.
 4 
 5 On 1/3/2014 2:33 PM, H. van der Meer wrote:
 6 Has someone an idee what causes the unknown library message as in the
 7 log below? Is it harmful?
 8 
 9 fonts   > typescripts > unknown library 'loc'
10 
11 you can add a file type-loc.mkiv someplace in your local tree with
12 
13 % dummy file

There should be exactly one # between &'s, when an
\halign or \valign is being set up. In this case you had
more than one, so I'm ignoring all but the first.

mtx-context | fatal error: return code: 256

and using \alignmark and \aligntab this results in:

\starttext
\halign{a\alignmark\aligntab b\alignmark\aligntab c\alignmark\cr 1\aligntab 
2\cr 1\cr}
\stoptext

And I am most curious how my name could turn up in the error message produced!

tex error   > tex error on line 3 in file 
/Users/hansm/TeX/texmf/tex/context/user/type-loc.mkiv: ! Missing } inserted

 
}
 
\aligntab 
l.3 ...\alignmark\aligntab c\alignmark\cr 1\aligntab
   2\cr 1\cr}

 1 \endinput
 2 
 3 >>  Op NTG ConTeXt nieuwsgroep, antwoord van Hans Hagen.
 4 
 5 On 1/3/2014 2:33 PM, H. van der Meer wrote:
 6 Has someone an idee what causes the unknown library message as in the
 7 log below? Is it harmful?
 8 
 9 fonts   > typescripts > unknown library 'loc'
10 
11 you can add a file type-loc.mkiv someplace in your local tree with
12 
13 % dummy file

I've put in what seems to be necessary to fix
the current column of the current alignment.
Try to go on, since this might almost work.

mtx-context | fatal error: return code: 256



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

___
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] error in LMTX?

2019-06-10 Thread Hans van der Meer
This looks to me as an error in the LMTX distribution:

tex error   > tex error on line 6 in file 
/Users/hansm/TeX/context-lmtx/tex/texmf-context/tex/context/fonts/mkiv/type-imp-dejavu.mkiv:
 ! Missing } inserted

 
}
 
\aligntab 
l.6 fontclass\aligntab
\fontclass\cr

Because running under my old ConTeXtBeta does not aborts with the error.
system  > ConTeXt  ver: 2019.06.01 19:11 MKIV beta  fmt: 2019.6.4  int: 
english/english

I looked into that file but could not see what causes the error.

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
___


[NTG-context] Test XML node registration

2019-05-17 Thread Hans van der Meer
Having a series of nodes in setups in a helper module:
\startxmlsetups xmlcommon:setups
\xmlsetsetup{#1}{error|comment|... etcetera}{xmlcommon:*}
\stopxmlsetups
\xmlregistersetup{xmlcommon:setups}

I would like to check if a certain node is in that series of nodes. For example 
doing \doifelse{\xmltag{#1}}... where the true branch is taken when \xmltag{#1} 
is one of those registered in the xmlcommon:setups.

Is that possible? Then what macro has to be called?

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
___


[NTG-context] Bug or not?

2019-05-16 Thread Hans van der Meer
There is an interaction in the placement of float captions when their width is set and background coloring switched.Minimal example included here, the jpeg is arbitrary of course. Output shown.Setting the width of the caption effectively shifts the caption to the left.See the change between the last two floats where [background=] changes the game.I wonder, is this intended behaviour? Or should one expect something different?\starttextTesting figure captions with \tex{setupframed[background="">\setupframed[background="">\placefigure[][]{\tex{setupframed[background="">Add \tex{setupcaption[align=middle,width=\makeupwidth]} as setting here:\par\setupcaption[align=middle,width=\makeupwidth]\setupframed[background="">\placefigure[][]{\type{\setupcaption[align=middle,width=\makeupwidth]}}{\externalfigure[test.jpg]}\setupframed[background="">\placefigure[][]{\tex{setupframed[background="">\stoptext
dr. Hans van der Meer



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


[NTG-context] filling page to bottom

2019-05-15 Thread Hans van der Meer
I find that the current (default) settings tend to break pages early, leaving a 
fairly large amount of whitespace at the bottom of the pages. Obviously in 
order to avoid breaking paragraphs or to avoid small parts of a paragraph at 
the top of the page.

What parameters do I have to tweak to fill the pages more completely? Because I 
planned already to examine all pages individually for their appearance, 
inserting breaks by hand is not the problem here.

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] inserting figure labels

2019-05-12 Thread Hans van der Meer
Can I be absolutely sure that \placefigure[here,force] will not invoke the 
float mechanism, but instead always effects an in-place insertion?

dr. Hans van der Meer


> On 12 May 2019, at 14:32, Henning Hraban Ramm  wrote:
> 
> Am 2019-05-11 um 21:39 schrieb Hans van der Meer  <mailto:havdm...@ziggo.nl>>:
> 
>> Placing a float figure with
>>  \placefigure[][]{labeltext}{\externalfigure[]}
>> delivers a figure with a label like "Figure V.3 labeltext" (depending on the 
>> setup)
>> 
>> Now I want to intersperse this with an \externalfigure[] not within a 
>> placefigure but still accompanied by a label in the current running series.
>> For example an uninterrupted series of figure numbers with:
>>  \placefigure[][]{labeltext-1}{\externalfigure[figure1]} % -> Figure 1 
>> labeltext-1
>>  \externalfigure[figure-2] \macrocall{labeltext-2}   % -> Figure 2 
>> labeltext-2
>>  \placefigure[][]{labeltext-3}{\externalfigure[figure3]} % -> Figure 3 
>> labeltext-3
>> 
>> I could not find what macro to call as the instance for \macrocall.
> 
> Can’t you just use \placefigure with {here,force}?
> 
> Greetlings, Hraban
> ---
> https://www.fiee.net <https://www.fiee.net/>
> http://wiki.contextgarden.net <http://wiki.contextgarden.net/>
> https://www.dreiviertelhaus.de <https://www.dreiviertelhaus.de/>
> 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
> ___

___
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] inserting figure labels

2019-05-11 Thread Hans van der Meer
Placing a float figure with
\placefigure[][]{labeltext}{\externalfigure[]}
delivers a figure with a label like "Figure V.3 labeltext" (depending on the 
setup)

Now I want to intersperse this with an \externalfigure[] not within a 
placefigure but still accompanied by a label in the current running series.
For example an uninterrupted series of figure numbers with:
\placefigure[][]{labeltext-1}{\externalfigure[figure1]} % -> Figure 1 
labeltext-1
\externalfigure[figure-2] \macrocall{labeltext-2}   % -> Figure 2 
labeltext-2
\placefigure[][]{labeltext-3}{\externalfigure[figure3]} % -> Figure 3 
labeltext-3

I could not find what macro to call as the instance for \macrocall.

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
___


[NTG-context] how to call chapter title and chapter number

2019-04-26 Thread Hans van der Meer
This does not what I have in mind:
\setupheadertexts[text][chapter][\pagenumber chapter][pagenumber][chapter]

Instead of [\pagenumber chapter] I thought [\pagenumber \chapter] would give me 
in the header both the pagenumber and the recorded chapter title.
However \chapter turns out to be undefined, neither did \chaptertitle. What is 
the macro to be called?

In my previous post I forgot to ask the same question about [chapternumber] 
where also \chapternumber does not exists. (sorry for the noise)

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
___


[NTG-context] calling up chapter title

2019-04-26 Thread Hans van der Meer
This does not what I have in mind:
\setupheadertexts[text][chapter][\pagenumber chapter][pagenumber][chapter]

Instead of [\pagenumber chapter] I thought [\pagenumber \chapter] would give me 
in the header both the pagenumber and the recorded chapter title.
However \chapter turns out to be undefined, neither did \chaptertitle. What is 
the macro to be called?

In my previous post I forgot to ask the same question about [chapternumber] 
where also \chapternumber does not exists. (sorry for the noise)

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
___


[NTG-context] calling up chapter title

2019-04-26 Thread Hans van der Meer
This does not what I have in mind:
\setupheadertexts[text][chapter][\pagenumber chapter][pagenumber][chapter]

Instead of [\pagenumber chapter] I thought [\pagenumber \chapter] would give me 
in the header both the pagenumber and the recorded chapter title.
However \chapter turns out to be undefined, neither did \chaptertitle. What is 
the macro to be called?

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
___


[NTG-context] endnotes customizing how?

2019-04-09 Thread Hans van der Meer
In typesetting my endnotes with \placenotes[endnote] I seem unable to unfluence 
the text characteristics.
I tried things like
(1) \setupnotes[endnote][textcolor=blue]
(2) changed fonts before the \ bgroup\bf\placenote\egroup call
(3)
\startsetups[setups:endnotes]
\setupwhitespace[0pt]
\stopsetups
% textstyle influences endnotemarker in the text.
\setupnote[endnote][textcommand=\hifnmarker,before=\directsetup{setups:endnotes}]

(4) \setupnotes[endnote][bodyfont=italic]

Where (3) made a difference in linespacing, nothing else does.
How can one determine the text characteristics of the endnotes?

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] LuaJitTeX doesn’t work any more

2019-03-20 Thread Hans van der Meer
Last login: Wed Mar 20 08:23:38 on ttys000
Wed Mar 20 18:17:51 CET 2019
21 ~: cdg
22 Genealogie: contexjit family-note.tex
-bash: contexjit: command not found
23 Genealogie: 

mmm... contextjit doesn't come with the beta install? Or do I miss something?

dr. Hans van der Meer


> On 20 Mar 2019, at 18:03, Wolfgang Schuster 
>  wrote:
> 
> Henning Hraban Ramm schrieb am 20.03.19 um 17:27:
>> With the latest beta, context --jit stopped working on my Mac (OSX 10.9.5):
>> 
>> 
>> This is LuajitTeX, Version 1.09.2 (TeX Live 2019/dev)
>>  system commands enabled.
>> 
>> ---! 
>> /Users/hraban/Library/texmf/tex/texmf-cache/luatex-cache/context/5fe67e0bfe781ce0dde776fb1556f32e/formats/luatex/cont-en.fmt
>>  was written by luatex
>> (Fatal format file error; I'm stymied)mtx-context | fatal error: return 
>> code: 1
>> 
>> 
>> I can simply not use JIT, but maybe there’s something to fix?
> 
> contextjit 
> 
> 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
> ___

___
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] ConTeXT install failing [solved]

2019-03-13 Thread Hans van der Meer
My fault. A spurious older version of luatex too early in the search path. 
Became disastrous only after the luatex version in the betas changed at some 
point in time.
However in search of the problem I stumbled on a few statements invoking a Lua 
error that can be avoided by safer coding, thus sparing non-programmers a 
problem.

The error message is:
/tex/texmf-context/scripts/context/lua/mtx-context.lua:1819: attempt to index a 
nil value (field 'filenames')

originates from:
elseif environment.filenames[1] or getargument("nofile") then
scripts.context.timed(scripts.context.autoctx)

I suggest to change this to (change highlighted)
elseif environment.filenames and environment.filenames[1] or 
getargument("nofile") then
scripts.context.timed(scripts.context.autoctx)

The same applies to lines 1208, 1795, 1802

In line 1188 I recommend interchanging the operands for a more natural order; 
here the check is already done.
local list = (name and { name }) or (environment.filenames and 
environment.filenames[1]) or defaultformats

dr. Hans van der Meer

> On 11 Mar 2019, at 22:53, Hans van der Meer  wrote:
> 
> I cannot get ConTeXt working on my other machine though I mimicked everything 
> there from the working one.
> Installed the contextbeta with the script than try to run but this fails. See 
> the output from what has been done and what results. Also attached the 
> .bashrc setup sofar as regarding TeX. These are the same on both machines.
> I am stymied of what happened here or what could be amiss.
> Any pointers to the solution will be very much appreciated.
> 
> 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
___


[NTG-context] ConTeXT install failing

2019-03-11 Thread Hans van der Meer
ibtex/bst/context/mkii
export BSTINPUTS
alias contextrun='mtxrun --script context'
alias contextformat='context --make en'


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] Modes and conditional part of the source

2019-03-01 Thread Hans van der Meer
I used  \doifmode and friends for selection of mode dependent code.

dr. Hans van der Meer


> On 1 Mar 2019, at 01:24, Hans Hagen  wrote:
> 
> On 2/28/2019 11:29 AM, Procházka Lukáš Ing. wrote:
>> Hello,
>> I'm struggling with using modes to make a part of the text conditional.
>> Here is my code:
>> 
>> \def\b#1{\startmode[#1]}
>> \def\e{\stopmode}
>> % \enablemode[100] % For optional usage
>> \starttext
>>   A
>>   \b{100} % Should be start of some conditional text from here ...
>> B
>>   \e % ... to here
>> \stoptext
>> 
>> Compilation fails with:
>> "
>> tex error   > tex error on line 0 in file : ! Emergency stop
>> <*> cont-yes.mkiv
>> 
>> *** (job aborted, no legal \end found)
>> "
>> How to make the sample work?
> modes are like buffers ... don't wrap them in macros
> 
> (using names like \b \e is a bad idea anyway)
> 
> 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] Intrusion in footnotes

2019-01-27 Thread Hans van der Meer
De following intrusion of a twocolumn placement of endnotes in the footnote 
area is to be avoided, of course.
The code is:

text with footnotes.
\placefootnotes
\placefloats
\startcolumns
\placenotes[endnote]
\stopcolumns

Can this be avoided? How?



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] textext with plain MetaFun

2019-01-21 Thread Hans van der Meer
The following always worked for me:

\starttext
\startMPpage
.. metapost code ..
\stopMPpage
\stoptext

and delivered from a ConTeXt-run a separate pdf.

dr. Hans van der Meer


> On 21 Jan 2019, at 09:43, Henri Menke  wrote:
> 
> On 1/21/19 9:29 PM, Hans Hagen wrote:
>> On 1/21/2019 8:57 AM, Henri Menke wrote:
>>> Dear list,
>>> 
>>> When I process the short MetaFun example
>>> 
>>>  beginfig(1)
>>>  draw textext("MetaFun") ;
>>>  endfig;
>>>  end
>>> 
>>> with plain MetaFun, i.e.
>>> 
>>>  mpost '' test.mp
>>> 
>>> the resulting file only contains “unknown”.  How can I get the expected
>>> output?
>> context foo.mp
>> 
>> (in mkii one could use mptopdf but i have no interest in figuring out
>> some pure metapost solution when we can do the job with simple wrapping
>> in mkiv as mentioned)
> 
> I tried
> 
>mpost '' test.mp
>mptopdf test.1
> 
> and now I have a PDF which says “unknown“.  Maybe I didn't understand
> what you meant.
> 
> Cheers, Henri
> 
>> 
>> 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
___

Re: [NTG-context] setting up itemize

2019-01-03 Thread Hans van der Meer
Bedankt Taco. Maar had ik dit kunnen weten?
met vriendelijke groet
dr. Hans van der Meer


> On 3 Jan 2019, at 10:49, Taco Hoekwater  wrote:
> 
> It needs ‘each’ instead of an empty group:
> 
> \setupitemgroup[itemize][each][3,joinedup,packed][color=blue,inbetween=]
> 
> Best wishes,
> Taco
> 
> 
>> On 3 Jan 2019, at 10:27, Hans van der Meer  wrote:
>> 
>> I cannot get the general setup macros of itemize right. I suppose I am 
>> missing some clues although I tried to follow the Command Reference 
>> distributed with the contextbeta. Here my minimal working example.
>> 
>> 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
>> ___
> 
> Taco Hoekwater
> Elvenkind BV
> 
> 
> 
> 
> ___
> 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] setting up itemize

2019-01-03 Thread Hans van der Meer
I cannot get the general setup macros of itemize right. I suppose I am missing some clues although I tried to follow the Command Reference distributed with the contextbeta. Here my minimal working example.
dr. Hans van der Meer




itemizesetup.pdf
Description: Adobe PDF document


itemizesetup.tex
Description: Binary data
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

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

Re: [NTG-context] double followtokens?

2019-01-01 Thread Hans van der Meer
Is followtext(“string”,path) not yet implemented?

Because I get an error when running:
\startMPcode
path p; p:=reverse halfcircle xyscaled 25mm; draw p;
followtext("some text but not that long",p); % <- causes error
\stopMPcode

Or do I need to call followtext in some other way that is not clear to me.

dr. Hans van der Meer


> On 8 Apr 2018, at 16:41, Hans Hagen  wrote:
> 
> On 4/8/2018 12:11 AM, Pablo Rodriguez wrote:
>> On 04/07/2018 11:25 PM, Hans Hagen wrote:
>>> On 4/7/2018 11:04 PM, Pablo Rodriguez wrote:
>>>> Dear list,
>>>> 
>>>> I have the following sample:
>>>> 
>>>>\useMPlibrary[txt]
>>>> 
>>>>\starttext
>>>> 
>>>>\startuseMPgraphic{followtokens}
>>>> path RotPath ; RotPath := reverse halfcircle ;
>>>> % path RotPath ; RotPath := halfcircle rotatedaround (origin, 180) ;
>>>>\stopuseMPgraphic
>>>> 
>>>>\followtokens{Just follow the tokens}
>>>>\stoptext
>>>> 
>>>> How can I get both paths (in diverse directions)?
>>>> 
>>>> I would like to repeat the same text twice, separating both sentences
>>>> with a character.
>>>> 
>>>> I have to ask this, beause MetaPost is all Greek to me.
>>> i have no clue what you mean but this will change the direction
>> Many thanks for your reply, Hans.
>> I attach an image of what I mean.
>> I want a full circle in two halves with the same duplicated sentence.
>> The first one written clockwise and the second one written
>> counterclockwise (as in the commented path above).
>> I hope it is clearer now.
> 
>path p ; p := reverse halfcircle scaled 5cm ;
>path q ; q := reverse halfcircle scaled 5cm rotated 180 ;
> 
>path q ; q := reverse halfcircle scaled 5cm rotated 180 ;
> 
>\followtokens{~this way~}
>\followtokens{\reversedtext{~this way~}}
> 
> we will have this in metafun:
> 
>followtext("this way",p) ;
> 
> so that one can do it all in mp ... a nice gimmick for the ctx meeting
> 
> 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] \startnarrower

2018-12-13 Thread Hans van der Meer
Is it possible to not indent the very first line of narrower content?

Thus
\startnarrower
first line
second line
etc.
\stopnarrower

resulting in:
first line
second line
etc.

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
___

[NTG-context] \xmlfunction

2018-12-12 Thread Hans van der Meer
How can one transmit argument values to \xmlfunction in order to be used by the 
Lua function called?

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
___

[NTG-context] finding content of xml elements

2018-12-12 Thread Hans van der Meer
Having a string pointing to an element in the XML-tree, for example IDENT::3 as 
the third element of the tree IDENT.
How can access this element in a Lua function as function examine(element)…end 
called with value element =  IDENT::3?
Or formulated otherwise: how can I reach from that string into the XML-tree?

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
___

[NTG-context] searching in nodes

2018-12-12 Thread Hans van der Meer
In a Lua function called from within an \startxmlsetups..\stopxmlsetups code 
block I would like to search through the current node and all below.
Using string.match("to-be-searched”,”pattern”).
The Lua function being called through 
\def\findmypattern#1#2{\ctxlua{tex.print(hvdm.findmypattern("#1","#2",))}

But I do not seem to get the node contents in the first argument #1. Using 
\xmlverbatim{#1} fails with Lua error "hexadecimal digit expected near '"\xm’”. 
\xmlflushpure{#1} fails with Lua error "invalid escape sequence near …”

Any help?

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
___

[NTG-context] disableXML

2018-12-09 Thread Hans van der Meer
I remember there existed a macro \disableXML, which at this time is undefined.
Or does my memory fails me here?

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] indenting after placefigure

2018-12-06 Thread Hans van der Meer
Thanks, indeed this does the trick.
But I wonder:  Has \placefigure then a default [indentnext=no] instead of 
abstaining from meddling with the indent setting?

dr. Hans van der Meer


> On 6 Dec 2018, at 21:25, Pablo Rodriguez  wrote:
> 
> On 12/6/18 6:10 PM, Hans van der Meer wrote:
>> I used \setupindenting[always,medium]. This works everywhere except
>> after a figure placed with \placefigure. Why does placing the figure
>> suppress the indent after it? And how can this behaviour be changed?
> 
> I wonder whehter \setupfloat[figure][indentnext=yes] would work here.
> 
> I hope it may help,
> 
> Pablo
> -- 
> http://www.ousia.tk
> ___
> If your question is of interest to others as well, please add an entry to the 
> Wiki!
> 
> maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
> webpage  : http://www.pragma-ade.nl / http://context.aanhet.net
> archive  : https://bitbucket.org/phg/context-mirror/commits/
> wiki : http://contextgarden.net
> ___

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

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

[NTG-context] indenting after placefigure

2018-12-06 Thread Hans van der Meer
I used \setupindenting[always,medium]. This works everywhere except after a 
figure placed with \placefigure. Why does placing the figure suppress the 
indent after it? And how can this behaviour be changed?

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] 'figures.getinfo()' not to exit ConTeXt

2018-12-06 Thread Hans van der Meer
Are you sure that data is not nil here?
 If so, this function returns nil.
dr. Hans van der Meer


> On 6 Dec 2018, at 11:20, Procházka Lukáš Ing.  wrote:
> 
> Hello,
> 
> I'm using the following code, mentioned here some time ago, to get some info 
> about PDF:
> 
> 
> \startluacode
> figures.getinfo = function(name, page)
>if type(name) == "string" then
>name = { name = name, page = page }
>end
>if name.name then
>local data = figures.push(name)
> 
>--figures.identify()
> local ok, res = pcall(figures.identify)
> print(">>1", ok, res)
> 
>--figures.check()
> local ok, res = pcall(figures.check)
> print(">>2", ok, res)
> 
>figures.pop()
>return data
>end
> end
> 
> local data = figures.getinfo("NonExisting.pdf")
> 
> \stopluacode
> 
> 
> The problem is that once the PDF file doesn't exist, the function causes 
> ConTeXt to exit, even when I enclose 'figure.check()' into the 'pcall' (to be 
> handled like try/catch mechanism).
> 
> Is there a way so that the function 'figures.getinfo()' does't exit ConTeXt, 
> it just returns 'nil', or even gives info which directories (or even which 
> file types) were searched?
> 
> TIA.
> 
> 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 | IČO: 40763439
> 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
> ___

___
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] directlua question

2018-12-04 Thread Hans van der Meer


On 4 Dec 2018, at 13:29, Hans van der Meer  wrote:

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

Also I tried to no avail

\begingroup\catcode`\%=12\relax\directlua{tex.print(string.match(“This is a 
string","%s%a$"))}\endgroup

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
___

[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] \framed regression

2018-10-30 Thread Hans van der Meer
> 
> So, \offinterlineskip disables the interline skip completely? 

Indeed, it is just plain TeX. In order to inhibit the interline glue in front 
of the next line only, use \nointerlineskip.

dr. Hans van der Meer


> On 30 Oct 2018, at 14:08, Henning Hraban Ramm  wrote:
> 
> Am 2018-10-29 um 16:47 schrieb Herbert Voss :
> 
>> Am 29.10.18 um 16:13 schrieb Henning Hraban Ramm:
>> 
>>> But it doesn’t help with my labels.
>> 
>> you have a
>> 
>> \setupinterlinespace[2ex]
>> 
>> so \offinterlinespace has no real meaning here. Try it without and
>> 
>> \setupinterlinespace[0.1pt]
>> 
>>> And why did it work without \offinterlineskip before?
>> 
>> No idea ...
>> 
>> Herbert, hope that I understand your problem well
> 
> I already tried without \setupinterlinespace, no change.
> 
> Greetlings, Hraban
> ---
> https://www.fiee.net
> http://wiki.contextgarden.net
> https://www.dreiviertelhaus.de
> 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
> ___

___
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

2018-10-26 Thread Hans van der Meer
Using roman numbers in figures I encountered a case where XIII.9 was hyphenated 
into XI-II.9. A bit unclear, in my opinion. 

Easily repairable with something like 
\def\myfigure[#1]{{\nohyphens\in{figure}[#1]}}
Just an observation, not really a problem but maybe something waiting to be 
fixed.

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] linking to an external PDF file

2018-10-08 Thread Hans van der Meer
I am embedding links to an UR in my documents. Although it is used in 
XML-documents, you might be able to use the gist of this code that generates a 
clickable link. Perhaps you find it useful. 

dr. Hans van der Meer

% Return the code when clicking the link.
\def\URIReturnCode#1{\ctxlua{tex.print(hvdm.urireturncode("#1"))}}

— Some Lua code needed:
-- Check URI

socket.http.TIMEOUT = 5 -- set URI 
timeout in seconds
hvdm.urireturncode = function (theuri)
-- Differentiate between file and http protocols.
local first,last = string.find(theuri, "file://")
if first == nil then
-- We have http to search for.
local content, status, authinfo = socket.http.request{
method = "HEAD",
url = theuri,
}
return type(status) == "number" and status or "failure"
else
-- We must ascertain the existence of the file.
local thefile = io.open(string.sub(theuri, last+1, -1), 
"r")
if thefile then
io.close(thefile)
return "200"
else
return "404"
end
end
end

% . Place an url link .

% BEWARE: spaces in file names must be %20 in the link !!!

% This global definition of the URLbase cannot be missed.
\def\THEURLBASE{http://}

% Signal the occurence of timeout on URI search.
\newif\ifURItimeout

\startxmlsetups xmlcommon:urlbase
\edef\THEURLBASE{\xmlstrippednolines{#1}{.}}

% Reset the URI timeout for new URLbase.
\global\URItimeoutfalse
\stopxmlsetups

\startxmlsetups xmlcommon:url

% Define the full uri.
\edef\theurl{\THEURLBASE\xmlatt{#1}{link}}

 % File suffix should be one of the list.
\doifelse{\FileSuffixList{\xmlatt{#1}{link}}
{pdf,jpg,jpeg,html,png,tif,tiff}}{\empty}
{\def\suffix{.impossible}}% no suffix from the list here
{\def\suffix{\empty}}% one of the list is present

% First try link as given, beware of unreachable site.
\ifURItimeout
% For previously timeout on this site.
\else
\edef\returncode{\URIReturnCode{\theurl}}
\doif{\returncode}{failure}
{
\global\URItimeouttrue
\errorcall{#1}{url access fails for 
\THEURLBASE\xmlatt{#1}{link}}
}
\fi

% On URI timeout there is no hope to find the file.
\ifURItimeout
\else
% When there is no suffix from the list, try several.
\doifnot{\suffix}{\empty}
{
\scratchcounter=200\relax
\ifnum\returncode=\scratchcounter\else
\def\suffix{.pdf}
\edef\returncode{\URIReturnCode{\theurl\suffix}}
\fi
\ifnum\returncode=\scratchcounter\else
\def\suffix{.jpg}
\edef\returncode{\URIReturnCode{\theurl\suffix}}
\fi
\ifnum\returncode=\scratchcounter\else
\def\suffix{.jpeg}
\edef\returncode{\URIReturnCode{\theurl\suffix}}
\fi
\ifnum\returncode=\scratchcounter\else
\def\suffix{.html}
\edef\returncode{\URIReturnCode{\theurl\suffix}}
\fi
\ifnum\returncode=\scratchcounter\else
\def\suffix{.png}
\edef\returncode{\URIReturnCode{\theurl\suffix}}
\fi
\ifnum\returncode=\scratchcounter\else
\def\suffix{.tiff}
\edef\returncode{\URIReturnCode{\theurl\suffix}}
\fi
\ifnum\returncode=\scratchcounter\else
\def\suffix{.tif}
\edef\returncode{\URIReturnCode{\theurl\suffix}}
\fi
}

% Give up if returncode other then 200.
\ifnum\returncode=200\relax
% Page number might be added.
\doifelse{\xmlatt{#1}{page}}{\empty}
  

[NTG-context] xmlstrippednolines

2018-09-17 Thread Hans van der Meer
This completely escapes me: \xmlstrippednolines behaves differently for:(1) no embedded nodes - just the node content(2) embedded nodes - outer node encloses node contentSee the minimal example.For me this works out a disaster, because in the second case the outer node is added, throwing my program completely off track.Questions:Is this the defined behaviour? Then what other means can be used to get the node content and nothing but the node content in both cases?Why does \xmlstrippednolines behaves in this manner?
dr. Hans van der Meer



test.pdf
Description: Adobe PDF document


test.tex
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] reference manual

2018-09-17 Thread Hans van der Meer
My most recent version of the "ConTeXt reference manual” is Hans Hagen, Taco 
Hoekwater September 27, 2013.
Is there a newer edition available? I could not find one in the (beta) 
distribution in texmf-context/doc.

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
___

[NTG-context] coupling node name to xmlsetup

2018-09-12 Thread Hans van der Meer
Suppose we have node  and want to execute the xmlsetup: 
mysetups:examplehandler on it. The idea is not to hardcode this but to do it on 
the fly from .

The following \xmlsetup comes into mind:

\startxmlsetups mysetups:definesetup
\xmlsetsetup{#1}{\xmlatt{#1}{name}}{mysetups:examplehandler}
\stopxmlsetups
\startxmlsetups mysetups:examplehandler
...
\stopxmlsetups

But this is either the wrong call or there is something missing, because on 
input of  the examplehandler is not invoked.
How to?

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
___

  1   2   3   4   5   6   7   >