Re: [NTG-context] Units of xpart and ypart of a pair in MetaFun

2020-11-27 Thread Taco Hoekwater


> On 26 Nov 2020, at 16:09, Keith McKay  wrote:
> 
> Hi,
> 
> I have been using xpart and ypart to extract these values from pairs of 
> points in a path but I wasn't getting the correct result. I was expecting:
> 
> pair (2cm, 11cm) to give xpart 2 and ypart 11

As explained by various people, Metapost does not have dimensions. All lengths 
are implicit Postscript big points
(72/inch). Variables like “cm” just add a multiplication factor to your 
expressions, at no point is a dimension stored inside Metapost. 

Your equation:

  a0 = (2cm,11cm)

first expands into 
  
  a0 = (2*28.34645,11*28.34645)

because “cm” is a variable with a value (Its definition in plain.mp is "cm = 
28.34645”)

Then, the two expressions in the a0 equation are resolved before the 
assignment, so what you actually wrote at the statement level is

  a0 = (56.6929, 311.8096);

At no point is there a “cm”-sized dimension.

===

Perhaps another option would be for you to do all your work without units, e.g. 

  a0 = (2,11) % assume scaling will happen later

and then in the end do the drawing on a scaled path:

  draw (pp scaled cm) …

as that may be less confusing? If the precision is an issue, you could counter 
the loss of precision you could use implied millimeters instead of centimeters.

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
___


Re: [NTG-context] color epub reader

2020-11-09 Thread Taco Hoekwater


> On 6 Nov 2020, at 20:22, Hans Hagen  wrote:
> 
> Hi,
> 
> Playing with a pocketbook color epub reader (I just put some manuals on it):
> 
> - the colors are not bright enough, also not with lights on, why rgb and not 
> cmyk (i only tested pdf)

If I understand the tech right, it uses traditional e-ink pigments and a 
filter. The filter is subtractive, which means rgb, and that is also why it is 
not all that bright.

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
___


Re: [NTG-context] Bug: context/mtxrun makes Firefox eat up cpu

2020-11-05 Thread Taco Hoekwater


> On 5 Nov 2020, at 11:48, Sylvain Hubert  wrote:
> 
> After dozens of compilations of various minimal examples using the newly 
> installed context, the problem reappeared.
> 
> Removing tex/texmf-cache does not help.
> 
> Does anyone know what files context modifies apart from tex/texmf-cache?

None. 

Are you sure your disk(-driver) is OK?

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
___


Re: [NTG-context] Bug: context/mtxrun makes Firefox eat up cpu

2020-10-30 Thread Taco Hoekwater


> On 30 Oct 2020, at 09:34, n...@scorecrow.com wrote:
> 
> Hi Sylvain,
> 
> This bug tracker report 
>  describes lagging / 
> freezing (which are symptoms of excessive CPU usage, of course) for versions 
> of Firefox from 70 to 74 inclusive on Manjaro. They also report Chromium 
> seeing the same problem.

This basically says it is a bug in the video driver. 

You could test that theory by switching to a text terminal for running the 
‘context’ command (assuming the text-only terminal is still accessible in 
Manjaro) and see whether the output of ‘context —help’ causes lag there as 
well. Even a really, really crappy video driver should be able to handle the 
output stream in full-screen text mode, so if it still lags in that 
environment, that moves the needle toward a problem in ConTeXt (however 
unlikely Hans and I think that is).

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
___


Re: [NTG-context] Bug: context/mtxrun makes Firefox eat up cpu

2020-10-29 Thread Taco Hoekwater


> On 29 Oct 2020, at 15:14, Sylvain Hubert  wrote:
> 
> > But it seems to be a big problem only on your machine
> I fail to see what this implies.

The point is that if this was a common problem, many users would complain or at 
least respond to your message with a “me too”. So it seems likely that there is 
something special going on with exactly your computer or your context 
installation.

What binary are you using for luametatex ? The normal linux 64-bit one from the 
lmtx distribution?

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
___


Re: [NTG-context] Bug: context/mtxrun makes Firefox eat up cpu

2020-10-29 Thread Taco Hoekwater


> On 29 Oct 2020, at 12:44, Sylvain Hubert  wrote:
> 
> I've just tried chromium which behaves a bit better but still experiences a 
> sudden raise of cpu usage from <10% to >70% during ~1s.
> I've also noticed that, even without any browser running, each time after I 
> compile a file with `context`, my terminal get stuck for ~1s.
> So I'm pretty sure this is a context bug, probably caused by unnecessary 
> excessive disk operations or something.

But it seems to be a big problem only on your machine. What hardware are you 
running on? Is it a Raspberry PI?

Like any TeX-related program, ConTeXt does a fair bit of disk access while 
starting up, but I haven’t heard of that being an actual problem since the age 
of single-core CPUs. And it certainly should not have an effect on the CPU 
usage of any other program (it could affect system responsiveness, though).

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
___


Re: [NTG-context] Bug: context/mtxrun makes Firefox eat up cpu

2020-10-29 Thread Taco Hoekwater


> On 29 Oct 2020, at 12:19, Sylvain Hubert  wrote:
> 
> And using safe mode here is just to make sure that the problem is not caused 
> by extensions.
> The annoyance started long before I bothered opening firefox with an extra 
> argument.

I am baffled then. I do not see the connection, at all. 

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
___


Re: [NTG-context] Bug: context/mtxrun makes Firefox eat up cpu

2020-10-29 Thread Taco Hoekwater


> On 29 Oct 2020, at 11:29, Sylvain Hubert  wrote:
> 
> Hi,
> 
> sorry if this is not the best place to file a bug but I found no working bug 
> tracker for context.

Should you not be looking for a bug tracker for firefox instead?

It looks like firefox in safe mode is perhaps trying to do something with (or 
waiting for ?) a shell command called ‘context’, which is presumably not 
related to ‘our’ ConTeXt.

You can test that by (temporarily) redirecting the ‘context’ command from 
‘luametatex’ to ‘ls’ (but keep it at the same path), and see if the problem 
persists. If so, then it is the actual name giving problems, and then can you 
should file a firefox bug report because then it has nothing to do with ConText 
itself.

But even if the above is not the actual issue, it still sounds like a firefox 
problem to me.

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
___


Re: [NTG-context] troubles with cutafter

2020-10-27 Thread Taco Hoekwater


> On 27 Oct 2020, at 14:06, Damien Thiriet  wrote:
> 
> Hello,
> 
> 
> I went into some troubles with cutafter.
> Must have missed something obvious.

Not so obvious: due to rounding/precision errors, the result of 
“intersectionpoint”
is rarely the actual point. It finds a point “close to” the actual intersection
of the two paths.

The intersectionpoint calculation works by limited recursive bisection of the 
two paths, 
and thus it  finds imprecise results in all but the most trivial cases. The 
result may
be an actual point on p1 or p2, or on both, or even on neither.

The better solution is to use intersectiontimes and subpath:

  draw subpath (0, xpart (p1 intersectiontimes p2)) of p1 withcolor red;

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
___


Re: [NTG-context] Hyphenation patterns

2020-10-09 Thread Taco Hoekwater


> On 9 Oct 2020, at 08:52, Denis Maier  wrote:
> 
> Am 08.10.2020 um 19:05 schrieb Henning Hraban Ramm:
>> \starttext
>> 
>> {EN: \en\hyphenatedcoloredword{applicable}}
>> 
>> {DE: \de\hyphenatedcoloredword{applicable}}
>> 
>> \stoptext
>> 
> Wow, that's super helpful. The English pattern seems to be "ap-plic-a-ble"
> According to Meriam-Webster it should just be "ap·​pli·​ca·​ble".
> 
> {EN: \en\hyphenatedcoloredword{obligate}} gives me "ob-lig-ate"
> According to Meriam-Webster it should be "ob·​li·​gate".
> 
> I've had a look at the files mentioned by Tomáš, but as these are not just 
> wordlists I can not really tell what is happening.
> 
> So, is that a bug? 

Not really. hyphenation patterns are a bit like applying JPEG compression to 
a dictionary. It makes the data size smaller by recognising patterns while
ignoring outliers. 

Occasional errors are to be expected, which is why \hyphenation exists.

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
___


Re: [NTG-context] Citeproc

2020-10-06 Thread Taco Hoekwater


> On 5 Oct 2020, at 22:26, Denis Maier  wrote:
> 
> Am 05.10.2020 um 22:04 schrieb Hans Hagen:
>> if it's an xml spec then using lua makes not that much sense (no gain) .. 
>> just process the xml 
> Hmm, but the XML is just a descriptive grammar of how bibliographies and 
> citations should be rendered. As Aditya has pointed out it's quite similar to 
> the role of bst style files for bibtex. So, a citeproc will take a style file 
> (in xml) and apply it to the metadata (based on the items actually cited in a 
> document).

I recall discussing this idea with Bruce D’Arcus a long time ago (somewhere in 
the early 00-es, maybe).

The CSL files look like XML, but really they are more like a macro processing 
language. Parsing and interpreting that should not be all that hard, I expect. 
If I had to do this, I would convert the XML  tags into actual lua 
functions while parsing the XML. The implied processing language is quite 
straightforward (unlike the stack-based postfix language in bibtex bst files). 
I don’t have time right now, but if someone reminds me in two months or so, I 
might have a go at it.

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
___


Re: [NTG-context] color problem

2020-10-02 Thread Taco Hoekwater
Hi,

> On 1 Oct 2020, at 20:55, Susanne G. Loeber  wrote:
> 
> Dear Reader, 
> 
> I have a colored section, text in another color and a TikZ picture with a 
> differently colored node, following each other. However, either the node gets 
> the wrong color or the following paragraph, see example below. 
> 
> Is there something wrong with the section settings? How do I get all the 
> colors right without using a paragraph in between? 

Some of the blackbox magic in the tikz module is confusing ConTeXt, it seems. 
This works:

  \draw (0,0) rectangle (2,1) node[right] {\color[A6plus]{node text should be 
orange}}; 

But that’s all I know. I do not understand the tikz module at all.

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
___


Re: [NTG-context] no frontmatter head on recto page

2020-09-30 Thread Taco Hoekwater


> On 30 Sep 2020, at 11:46, jbf  wrote:
> 
> For some reason that I cannot work out, the recto page header is not 
> appearing in frontmatter sections like Foreword. It is important to note that 
> for this item I am using:
> 
> \definehead
>   [foreword] [chapter]…

‘chapter' suppresses the header by default on the first page.

at a guess:

  \setuphead[foreword][header=start]

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
___


Re: [NTG-context] page counter problem

2020-09-30 Thread Taco Hoekwater
Hi Alan,

> On 30 Sep 2020, at 12:50, Alan Bowen  wrote:
> 
> he page counter does not increase in the first iteration an PDf inclusion but 
> seems to work properly after that. Have attached a sample file (69K) that 
> will serve to show the problem—at least, on my machine.

It is not the iteration itself. Try with another pdf with more than 2 pages and 
you
will see that it happens in the first page(s).

The problem is that you are not giving ConTeXt a fair chance to update the page 
number,
because a series of \vbox to \paperheight {}’s cannot cleanly be broken into 
separate
pages. The solution is to use 

\dorecurse{\noffigurepages}
   {\vbox to \paperheight 
{\vskip-\dimexpr\headerheight+\headerdistance+\topspace\relax
 \hbox to \hsize
 {\hskip-\backspace
\layeredtext[]
[boffset=3pc]   
{\red\userpagenumber}
{\externalfigure[HannahBW.pdf][page=#1]}%
  \hss}%
\vss}\page
  }

where the extra \page command allows ConTeXt to properly process the page 
breaks.

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
___


Re: [NTG-context] scaling images

2020-09-27 Thread Taco Hoekwater


> On 27 Sep 2020, at 11:42, Henning Hraban Ramm  wrote:
> 
> Hi,
> I’m struggling with scaling images:
> 
> \externalfigure[hacker][width=0.5\textwidth]
> 
> looks right.
> 
> 
> If I use the scale / xscale / yscale options, the image gets smaller, 
> regardless of height/width settings

Have you tried with factor/vfactor/hfactor?

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
___


Re: [NTG-context] Full page image and caption in another page?

2020-09-23 Thread Taco Hoekwater
Hi,

This sounds quite complicated, really. 

I am not at all sure how this page rotation should work but I assume you plan a 
pdf-only document then?  Otherwise, I would expect rotating the figure instead 
of the whole page. Also, rotating the paper does not rotate the layout, at 
least not if you use a fixed height and width. You would need something like 
this for auto-resizing \textheight and \textwidth:

\definelayout[default][topspace=0.6cm, topdistance=0cm, header=1cm, 
headerdistance=0cm,
   height=fit, footer=0cm,
   backspace=4.2cm, width=fit]

Another problem is that setting the width and height of a float does not affect 
any externafigure side. You need to do a \setupexternalfigure for that.

And there is (afaik) no support for having a “two-page” float. The “opposite” 
key is used to put the float (including caption) on the opposite side of the 
current page.

But at least there is a command to typeset a caption standalone, so perhaps 
that will help? You would then *not* use the \startplacebigfigure, but place 
the caption and the image manually:

\page
\placefloatcaption[bigfigure][title={A cow}]
\page
\externalfigure[cow]
\page

Best wishes,
Taco


> On 22 Sep 2020, at 19:42, José de Mattos Neto  wrote:
> 
> Hi, it's my first message on this list.
> I've searched in ConTeXt manuals, TeX.SX and here, but couldn't find a way to 
> achieve these 4 requirements altogether:
> 
>   • Place a figure as full-page figure
>   • Change orientation accordingly (if it's a landscape PDF, for instance)
>   • Make that using \setupfloat (or other setup), not directly in 
> \placefloat
>   • Place captions in another page (ideally on opposite page)
> Problems:
>   • I can't get # 1 and # 3 at same time
>   • \setupfloat doesn't have before option, which I could use to change 
> orientation
>   • I have no idea how to accomplish # 4
> A minimal working example (PDF in attachment):
> 
> %%%
> \definepapersize[default][A4, portrait]
> \definelayout[default][topspace=0.6cm, topdistance=0cm, header=1cm, 
> headerdistance=0cm,
>height=27.3cm, footer=0cm,
>backspace=4.2cm, width=13.6cm]
> \setuppapersize[default]
> \setuplayout[default]
> \setuppagenumbering[alternative=doublesided, location={header}]
> \setupexternalfigures[location={default}]
> 
> \definepapersize[rotate][A4, landscape]
> \definefloat[bigfigure][bigfigures][figure]
> \setupfloat[bigfigure][default={page},
>width=1\textwidth, height=1\textheight,
>before={\setuppapersize[rotate]}] % there's no before 
> in setupfloat
> \setupcaption[bigfigure][location={opposite}] % there's no opposite location 
> in setupcaption
> 
> \starttext
> \showframe
> \dorecurse{2}{\input{knuth}}
> 
> \setuppapersize[rotate] % this doesn't work because is in same page
> \startplacebigfigure[title={A cow}]{\externalfigure[cow]}\stopplacebigfigure
> \setuppapersize[default]
> 
> \dorecurse{2}{\input{knuth}}
> \stoptext
> %%%
> 
> Thanks in advance!
> José Neto
> ___
> If your question is of interest to others as well, please add an entry to the 
> Wiki!
> 
> maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/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
___


Re: [NTG-context] issue with interaction=all and \insertpages

2020-09-23 Thread Taco Hoekwater
Hi Pablo,

> On 20 Sep 2020, at 18:29, Pablo Rodriguez  wrote:
> 
> Dear list,
> 
> I have the following sample:
> 
>  \setuplayout[page]
>  \setupinteraction
> [state=start, color=, contrastcolor=, focus=standard]
>  \enabledirectives[references.border=red]
>  \setupexternalfigures[interaction=all, method=pdf]
>  \setupinteractionscreen[option={portrait, paper}]
>  \starttext
>  %~ \insertpages[http://gaceta.rsme.es/abrir.php?id=1495][width=0pt]
>  \insertpages[GacRSocMatEsp.pdf][width=0pt]
>  \stoptext
> 
> I have some issues with it.

Yes, various issues indeed.

> 1. For some strange reason, the first \insertpages command with a remote
> file cannot deal with the interaction from the file (no internal or
> external links).

The problem with that one is that the url does not end in .pdf, which 
means context is too late in discovering that it really is a pdf. The

  \setupexternalfigures[interaction=all, method=pdf]

doesn’t help enough, it seems. I could get it to ‘work’ with

  \insertpages[http://gaceta.rsme.es/abrir.php?id=1495&=f.pdf][width=0pt]

but I assume that is a bug, and that ConTeXt should have listened to the
method=pdf.

> 2. The local file includes internal destinations to page parts. After
> imposition, destinations to page for internal links cannot reach the
> page parts as links in original document do.

Interaction=all actually converts the internal links in the pdf into a
normal ConTeXt layer. In that process, the target is lost, and all the
links are converted to page number references. That is a limitation
of the current (MkIV) implementation. In lmtx it should be possible
to be smarter about this, but it needs an extension to ConTeXt.

> 
> 3. Even external links are converted. On last page,
> https://www.cs.umb.edu/~offner/files/pi.pdf is rewritten as
> https://www.cs.umb.edu/õffner/files/pi.pdf.

This is a bug for sure. In the process of converting the link to the
ConTeXt layer (it actually becomes a \button) it is necessary to
convert some of the characters in the PDF link into ’TeX’ by escaping
some special characters like \ and #, or the \button would fail.

ConTeXt does the TeX escaping by prepending a backslash. While that
works fine for most of the special characters, it fails for a few others.

It fails for ~ and ^ because \~ and \^ are accent commands, not character 
escapes. 
The replacer should be using \texttilde and \textcircumflex for those.

It also fails for \, but that character is rejected in URIs anyway.

===

However, in fact, most of the special characters don't need escaping for 
inclusion 
at all any more (at least not with the standard catcodes). The only ones that 
do need escaping to please ConTeXt are:

  # % \ { }

(of those, only # and % can actually happen in a wellformed URI)

The other ‘old’ special characters: 

  ~ $ ^ & _ |

do not need to be escaped by ConTeXt at all any more, \button handles them just 
fine.

(also, bare ^ and | are disallowed in a wellformed URI)


Summarized: 

In link_uri() in lpdf-epa.lua, the line

  url = escapetex(url)

can be replaced with 

  url = string.gsub(url,"#", "\\#")
  url = string.gsub(url,"%%", "\\%%")

if only correct URIs need to be considered. 


Otherwise (if bad URIs should be processed correctly), then a special 
escapeurl()
is needed in char-tex.lua to make sure that besides the prefixed backslashes
for the list of escaped characters, there is this override:

  ^ => “\textcircumflex "
  ~ => “\texttitlde "
  \ => “\textbackslash “

In that case, the \ handling needs fixing as well, because ConTeXt currently 
rejects
URIs with backslashes in them. This latter option may be wise, because I know 
from
experience that there are many bad URIs in external PDFs.

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
___


Re: [NTG-context] ZapfDingbats Unicode differences MKIV vs LMTX

2020-09-22 Thread Taco Hoekwater


> On 22 Sep 2020, at 13:51, Hans Hagen  wrote:
> 
> On 9/22/2020 7:19 AM, Christoph Reller wrote:
>> On Mon, Sep 21, 2020 at 3:27 PM Hans Hagen > > wrote:
>>On 9/21/2020 2:55 PM, Christoph Reller wrote:
>> >
>>\definefontsynonym[ZapfDingbats][file:ZapfDingbats][features=dingbats]
>>I don't know what the previous line does ... but it works ok here when
>>you remove it.
>> This line loads the font from a file ZapfDingbats.ttf. Without this line I 
>> get no check marks in the output and the following log messages:
> 
> i don't know that one

MacOS has it.



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

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/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 get the last item from an XML node

2020-09-22 Thread Taco Hoekwater


> On 21 Sep 2020, at 18:31, Denis Maier  wrote:
> 
> Hi
> 
> struggling again: Shouldn't the code below give me the last element under 
> ? Right now \xmlfilter{#1}{/tr/last()/command(xml:table:tbody:tr)} 
> gives me nothing...
> 
> (Use case is that I want to have a frame above the table and one bar below. 
> So I think I should wrap the last line in the \startxtablefoot 
> ...\stopxtablefoot, i.e., I need one command for the last element, and one 
> for the rest (Or is there a better way?). What would be the everything but 
> the last?
> 
> What am I missing?

You need to read some more on the "Expressions and filters” chapter of the xml 
manual, as it does not work quite the way you think. Here is a quick fix:

> 
> 
> \startxmlsetups xml:table:tbody
> \xmlfilter{#1}{/tr/last()/command(xml:table:tbody:tr)}

\xmlfilter{#1}{/tr[position()==last()]/command(xml:table:tbody:tr)}

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
___


Re: [NTG-context] 2020 Meeting recordings?

2020-09-21 Thread Taco Hoekwater
No. I post what I have ;)

Taco

> On 21 Sep 2020, at 16:40, Denis Maier  wrote:
> 
> Thanks! But not recordings, right?
> 
> Am 21.09.2020 um 15:50 schrieb Taco Hoekwater:
>> Hi,
>> Most of the available slides are now integrated with the abstracts page:
>> https://meeting.contextgarden.net/2020/abstracts.shtml
>> Best wishes,
>> Taco
>>> On 17 Sep 2020, at 19:03, Marcus Vinicius Mesquita 
>>>  wrote:
>>> 
>>> So do I.
>>> 
>>> Marcus Vinicius
>>> 
>>> On Thu, Sep 17, 2020, 13:07 Denis Maier  
>>> wrote:
>>> Hi,
>>> 
>>> unfortunately, I wasn't able to come to this years meeting. Have the
>>> presentations and demos been recorded? I would very much like to watch
>>> some of those.
>>> 
>>> 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
>>> ___
>> 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
> ___

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
___


Re: [NTG-context] Extreme tables and XML conflict?

2020-09-21 Thread Taco Hoekwater


> On 21 Sep 2020, at 16:38, Denis Maier  wrote:
> 
> Hi,
> 
> I'm a bit confused, but this here won't compile:
> 
> =
> 
> \startxmlsetups xml:table
>   \startxtable
> \startxrow
>   \startxcell one \stopxcell
>   \startxcell two \stopxcell
> \stopxrow
>   \stopxtable
> \stopxmlsetups

The normal xtables don’t like to be called from inside other constructs. Use 
this instead:

\startxmlsetups xml:table
  \message{xml:table}
  \startembeddedxtable
\startxrow
  \startxcell one \stopxcell
  \startxcell two \stopxcell
\stopxrow
  \stopembeddedxtable
\stopxmlsetups


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
___


Re: [NTG-context] 2020 Meeting recordings?

2020-09-21 Thread Taco Hoekwater
Hi,

Most of the available slides are now integrated with the abstracts page:

https://meeting.contextgarden.net/2020/abstracts.shtml

Best wishes,
Taco

> On 17 Sep 2020, at 19:03, Marcus Vinicius Mesquita 
>  wrote:
> 
> So do I.
> 
> Marcus Vinicius 
> 
> On Thu, Sep 17, 2020, 13:07 Denis Maier  wrote:
> Hi,
> 
> unfortunately, I wasn't able to come to this years meeting. Have the 
> presentations and demos been recorded? I would very much like to watch 
> some of those.
> 
> 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
> ___

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
___


Re: [NTG-context] Parallel text support

2020-09-21 Thread Taco Hoekwater


> On 21 Sep 2020, at 12:21, Denis Maier  wrote:
> 
> 
> However, as it turns out, split only seems to mean that the table is split 
> between rows, individual rows stay on the same page.
> 
> Is there a better approach? I've found the page-streams, but that seems to be 
> too much…

\starttabulate

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

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/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] https

2020-09-10 Thread Taco Hoekwater
Hi,

The certificate for *.contextgarden.net expired this morning. I installed a new 
certificate just now, but it is possible that I missed one of the uses of the 
old certificate.

If you find that you get an error about ‘Connection is not private’ still, even 
after a hard reload, please send me message as I likely forgot to update some 
file.

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
___


Re: [NTG-context] Can't output direct glyphs either in MKIV or LMTX

2020-09-07 Thread Taco Hoekwater
Hi,

> On 7 Sep 2020, at 22:05, Andres Conrado Montoya  
> wrote:
> 
> 
> Hello list. I'm trying to call a direct glyph from the Phaistos font, but it 
> seems it doesn't work. The font is loaded, the log file says it so:
> 
> system  >   12: filename=/home/vantta/.fonts/Phaistos.otf format=otf 
> foundname=/home/vantta/.fonts/Phaistos.otf 
> fullname=/home/vantta/.fonts/Phaistos.otf usedmethod=direct
> 
> However, the glyph is not displayed in the pdf. I've tried both in MKIV and 
> LMTX with no luck. Maybe someone here will have a clue.

I don’t have the font, but is u101F2 the glyphs’ name, or its code point?

Try this:

   \starttext
   \usemodule [fnt-10]
   \ShowCompleteFont{name:phaistos}{14pt}{1}
   \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] Quotation with footnote

2020-09-04 Thread Taco Hoekwater

Something like this?


\definenarrower[myquote]
\setupnarrower[myquote]
  [left=2em,
   right=1.5em,
   before=\dontleavehmode\hskip-0.33em\startquote,
   after=\stopquote]

\startmyquote
Im übrigen ist der Mensch ein Lebewesen, das klopft, schlechte Musik macht und 
seinen Hund bellen läßt. Manchmal gibt er auch Ruhe, aber dann ist er tot.
\stopmyquote \footnote[f:9]{Kaspar Hauser (Kurt Tucholsky), Weltbühne 24, 
16.\,6.\,1931}


But there may be smarter solutions.

Best wishes,
Taco

> On 4 Sep 2020, at 13:25, Henning Hraban Ramm  wrote:
> 
> My current book contains a lot of quotations with their sources marked as 
> footnotes, e.g.
> 
> 
> \definedelimitedtext[Zitat][
>  %setups=Zitat, % doesn’t work!?
>  left=»,
>  right=«,
>  leftmargin=2em,
>  rightmargin=1.5em,
> ]
> 
> \startZitat
> A rose is a rose is a rose.\footnote{Marx brothers}
> \stopZitat
> 
> 
> Now, since the quotations are whole sentences or paragraphs, the footnote 
> marker needs to be placed _after_ the closing quotation mark. (German 
> typography, I learned it’s different at least in US English.)
> 
> I tried several approaches e.g. with my own single start/stop macros that 
> call \start/stopnarrower or \start/stopZitat – that always lead to unclosed 
> environments.
> 
> * Only the delimitedtext approach gives a hanging opening quotation mark 
> (which looks nice and I’d like to have).
> 
> * \stopnarrower within a macro doesn’t seem to work (all following text stays 
> narrower).
> 
> * I can’t get rid of that space introduced by the CR before \stop – didn’t 
> find a place where \gobblespacetokens works, maybe that’s the wrong command.
> 
> 
> Most preferred would be a solution that checked if there’s a footnote in 
> front of \stopZitat and would put the closing quotation mark in front instead 
> of after. Without a footnote it would just place the mark.
> 
> Something like \stopZitat\footnote{...} would also be nice, but I guess 
> that’s too far outside of TeX’s logic.
> 
> In the worst case I’d need to typeset the closing mark manually.
> 
> Some hints please?
> 
> 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
> ___

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
___


Re: [NTG-context] Typing efficiency

2020-09-04 Thread Taco Hoekwater

Hi,

Sounds like a job for the blocks mechanism more so than buffers:


\defineblock[entext]
\defineblock[nltext]
  
\defineselector [language] [max=2,n=1]
\startmode[en]
\setupselector[language][n=1]
\keepblocks[entext]
\stopmode
\startmode[nl]
\setupselector[language][n=2]
\keepblocks[nltext]
\stopmode
 
\starttext
 
\startsection[title=\select{language}{English title}{Dutch title}]
 
\beginentext
This is English text.
\endentext
\beginnltext
This is Dutch text.
\endnltext
 
\stopsection
 
\stoptext


Best wishes,
Taco

> On 4 Sep 2020, at 14:02, Jan Willem Flamma  wrote:
> 
> Dear list member,
>  
> Following up from:
> https://www.mail-archive.com/ntg-context@ntg.nl/msg94719.html
>  
> The below MWE works but how can I avoid having to type
> \startmode[en]
> \getbuffer[en]
> \stopmode
> \startmode[nl]
> \getbuffer[nl]
> \stopmode
>  
> after every block of text? 
>  
> I tried to define a new start/stop pair as follows:
> \definestartstop[Bufen][
> before={\startmode[en]
> \startbuffer[en]},
> after={\stopbuffer
> \getbuffer[en]
> \stopmode}]
>  
> but that fails.
>  
> No doubt a clever solution exists that minimizes the typing. 
>  
> Kind regards,
> Jan Willem
>  
>  
> ===
> \setupinteraction[state=start]
>  
> %\enablemode[nl]
> \enablemode[en]
>  
> \defineselector [language] [max=2,n=1]
> \startmode[en]
> \setupselector[language][n=1]
> \stopmode
> \startmode[nl]
> \setupselector[language][n=2]
> \stopmode
>  
> \starttext
>  
> \startsection[title=\select{language}{English title}{Dutch title}]
>  
> \startbuffer[en]
> This is English text.
> \stopmode
> \stopbuffer
> \startbuffer[nl]
> This is Dutch text.
> \stopbuffer
>  
> \startmode[en]
> \getbuffer[en]
> \stopmode
> \startmode[nl]
> \getbuffer[nl]
> \stopmode
>  
> \stopsection
>  
> \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
> ___

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
___


Re: [NTG-context] Import a metapost extension

2020-09-01 Thread Taco Hoekwater
Hi,

> On 1 Sep 2020, at 16:46, Hans Hagen  wrote:
> 
> On 9/1/2020 3:04 PM, Fabrice Couvreur wrote:
>> Hi Taco,
>> Thank you for your help. I specify that this extension works perfectly by 
>> compiling the following file.

A logfile of a failed run would have been more helpful in trying to track down 
the problem. But I did notice that there is a LaTeX file loaded in your 
succesful run. So perhaps the extension depends on LaTeX?
> 
>  input "mp-scratch.mp" ;
> 
> maybe the path you look for is not part of the search path either
> 
>   mtxrun --expand-path MPINPUTS
> 
> 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] Import a metapost extension

2020-09-01 Thread Taco Hoekwater
Hi,

I think you need this:

\startMPinclusions
  input mp-scratch;
\stopMPinclusions

\startMPcode
  Scratchversion:=3;
  ….

If that also doesn’t work, perhaps attach the log file / terminal output to a 
new message.

Best wishes,
Taco

> On 1 Sep 2020, at 13:07, Fabrice Couvreur  wrote:
> 
> Hello
> Is it possible to import a metapost extension into a file compiled with the 
> lmtx engine ?
> I tried unsuccessfully with this example :
> 
>  begin test.tex
> 
> \starttext
> \startMPcode
>   input mp-scratch;
> 
> Scratchversion:=3;
> 
> draw Drapeau;
> draw Repeter("4");
> draw Avancer("50");
> draw Tournerd("90");
> draw FinBlocRepeter;
>  
> \stopMPcode
> \stoptext
> 
>  end test.tex
> 
> Thanks
> Fabrice
> ___
> If your question is of interest to others as well, please add an entry to the 
> Wiki!
> 
> maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/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
___


Re: [NTG-context] Wiki New Extension: ConTeXtXML

2020-08-27 Thread Taco Hoekwater
Hi again,

Just now, I installed and update of the extension that replaces the default 
edit form  for Command pages by a dedicated form. This should make editing a 
lot easier, since there is no longer any visible XML code to confuse you.

Best wishes,
Taco

> On 20 Aug 2020, at 14:04, Taco Hoekwater  wrote:
> 
> Hi,
> 
> As announced last week, I have been working on a wiki extension to control 
> the editing of /Command pages. That extension is now installed on the main 
> wiki.
> 
> In short, we will switch to XML as the page model for newly created /Command 
> pages. This makes editing a bit harder, but it allows much better quality 
> control and (fairly) easy export and import.
> 
> The goal is to eventually be able to easily export all of the reference 
> documentation in the wiki to a separate system (for instance, Paul Mazaitis 
> plans to create a full-blown reference manual). In the current situation, 
> this is nearly impossible because there is so much variation in the content 
> and quality of the wiki /Command pages (not to mention that many are 
> missing). We also want it to be possible to merge improvements to the 
> interface xml definitions by Wolfgang without loosing any existing 
> documentation work.
> 
> The documentation pages are here:
> 
>   https://wiki.contextgarden.net/Command
>   https://wiki.contextgarden.net/Help:Command
>   https://wiki.contextgarden.net/Extension:ConTeXtXML
> 
> After reading those, have a look at the three ‘work pages’:
> 
>   https://wiki.contextgarden.net/Document_level_commands_work_page
>   https://wiki.contextgarden.net/Style_level_commands_work_page
>   https://wiki.contextgarden.net/System_level_commands_work_page 
> 
> All the bright red links are currently undocumented commands. Clicking on one 
> should bring you to the edit screen automatically, with a blob of XML 
> preloaded, ready for you to start writing.
> 
> All the dark red links are existing /Command pages. All of those are 
> traditional wiki text pages. Following those links will bring you to a normal 
> /Command page just like on the main wiki. If you want to see how one of those 
> pages would look like in the new system, you’ll have to rename the existing 
> page first (as explained in 
> https://wiki.contextgarden.net/Command#Pre-existing_pages ) 
> 
> If you do some work, please update those work pages!
> 
> 
> Comments, suggestions and bug reports are more than welcome. 
> 
> Please direct those to me personally or (better) to the wiki mailing list:
> 
>   https://lists.contextgarden.net/mailman/listinfo/wiki
> 
> Have fun!
> 
> 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
> ___

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
___


Re: [NTG-context] catch % in gsub("%", "\\letterpercent")

2020-08-27 Thread Taco Hoekwater
Hi,

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

Double it: %%

See also https://www.lua.org/manual/5.3/manual.html#6.4.1 , but the mention of 
%% is a bit hidden.

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
___


Re: [NTG-context] Overriding the number on a float

2020-08-24 Thread Taco Hoekwater


> On 24 Aug 2020, at 19:59, Wolfgang Schuster 
>  wrote:
> 
>> 
>> 
>> \setcounter[figure][5] % next figure is no.6

For this subfigure stuff, perhaps this is useful?

% setup definitions
\definecounter[subfigure][way=bytext,prefix=no]
\setupcounter[subfigure][state=start,numberconversion=a]
\setcounter[subfigure][1]

\def\setsubfigures
  {\setcounter[subfigure][1]
   \incrementcounter[figure]
   
\setupcaption[figure][state=stop,numberstopper={\convertedcounter[subfigure]}]}

\def\unsetsubfigures
  {\setupcaption[figure][state=start,numberstopper=]}

%usage
\setsubfigures

\startplacefigure[title=Test figure]
\externalfigure[dummy]
\stopplacefigure

\incrementnumber[subfigure]

\startplacefigure[title=Test another figure]
\externalfigure[dummy]
\stopplacefigure

\unsetsubfigures


I could not find a safe way to increment the subfigure number automatically, 
unfortunately.

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
___


[NTG-context] Wiki New Extension: ConTeXtXML

2020-08-20 Thread Taco Hoekwater
Hi,

As announced last week, I have been working on a wiki extension to control the 
editing of /Command pages. That extension is now installed on the main wiki.

In short, we will switch to XML as the page model for newly created /Command 
pages. This makes editing a bit harder, but it allows much better quality 
control and (fairly) easy export and import.

The goal is to eventually be able to easily export all of the reference 
documentation in the wiki to a separate system (for instance, Paul Mazaitis 
plans to create a full-blown reference manual). In the current situation, this 
is nearly impossible because there is so much variation in the content and 
quality of the wiki /Command pages (not to mention that many are missing). We 
also want it to be possible to merge improvements to the interface xml 
definitions by Wolfgang without loosing any existing documentation work.

The documentation pages are here:

   https://wiki.contextgarden.net/Command
   https://wiki.contextgarden.net/Help:Command
   https://wiki.contextgarden.net/Extension:ConTeXtXML

After reading those, have a look at the three ‘work pages’:

   https://wiki.contextgarden.net/Document_level_commands_work_page
   https://wiki.contextgarden.net/Style_level_commands_work_page
   https://wiki.contextgarden.net/System_level_commands_work_page 

All the bright red links are currently undocumented commands. Clicking on one 
should bring you to the edit screen automatically, with a blob of XML 
preloaded, ready for you to start writing.

All the dark red links are existing /Command pages. All of those are 
traditional wiki text pages. Following those links will bring you to a normal 
/Command page just like on the main wiki. If you want to see how one of those 
pages would look like in the new system, you’ll have to rename the existing 
page first (as explained in 
https://wiki.contextgarden.net/Command#Pre-existing_pages ) 

If you do some work, please update those work pages!


Comments, suggestions and bug reports are more than welcome. 

Please direct those to me personally or (better) to the wiki mailing list:

https://lists.contextgarden.net/mailman/listinfo/wiki

Have fun!

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
___


Re: [NTG-context] removing word in filtered XML

2020-08-20 Thread Taco Hoekwater


> On 19 Aug 2020, at 18:10, Pablo Rodriguez  wrote:
> 
> Dear list,
> 
> I have the following sample:
> 
>  \startbuffer[demo]
>  
>
>  
>This is
>  One of the best a paragraph.
>This is another paragraph.
>This is another
>  Two of the best paragraph.
>This is another
>  Three paragraph.
>This is another
>  Four of five paragraph.
>  
>
>  
>  \stopbuffer
> 
>  \startxmlsetups xml:initialize
>\xmlsetsetup{#1}{html}{xml:gen}
>  \stopxmlsetups
> 
>  \xmlregistersetup{xml:initialize}
> 
>  \startxmlsetups xml:gen
> \xmlfilter{#1}{/**/div/command(xml:special)}
>  \stopxmlsetups
> 
>  \startxmlsetups xml:special
>%~ \startitem
>\cldcontext{string.gsub(lxml.flush([[#1]]),
>   " of the ", "")}\stopitem
>  \stopxmlsetups
> 
>  \starttext
>\xmlprocessbuffer{main}{demo}{}
>  \stoptext
> 
> Is there any way to remove " of " and " of the " in the filtered content
> (xml:special)?

There is pretty much always ‘a way’, but I do not know of a ’nice’ way. 
Your problem is that lxml.flush() and friends do not return a value,
they just do a direct context(‘’) call behind the scenes with no
return string for you to modify.

Also, the special (catcode, space handling) rules for setups and \cldcontext
do not help you.

That does not mean it can’t be done. As I don’t know a of a nice way,
here is a low-level ‘ugly' way:

\startluacode
function filter(a)
local div = lxml.getid(a)
process(div)
lxml.flush(div)
end
function process(div)
for c=1,#div.dt do
if type(div.dt[c]) == 'string' then
div.dt[c] = string.gsub(div.dt[c], " of the ", "")
else 
process(div.dt[c]) 
end
end
end
\stopluacode

 \startxmlsetups xml:special
   \ctxlua{filter([[#1]])}
 \stopxmlsetups


process() is recursive because your xml:special gets the whole . Not sure 
if you intended it that way.
And if it can be done nicer, I am sure someone will correct me :)

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
___


Re: [NTG-context] TOC chapter and section numbering

2020-08-18 Thread Taco Hoekwater


> On 18 Aug 2020, at 06:40, Adrian  wrote:
> 
> 
> I would like all the chapters to be prefixed with "Chapter RN." and the 
> sections to keep a single count,
> for example:
> 

\setuplabeltext[chapter=Chapter~]

\definestructureresetset[default][1,1,0][1] % reset part, chapter, but not 
section
\setupheads[sectionresetset=default]

\setuphead[section][sectionsegments=section:*]

Mostly copied from the wiki page about titles:

  https://wiki.contextgarden.net/Titles

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
___


Re: [NTG-context] A dumb question about MetaFun

2020-08-16 Thread Taco Hoekwater


> On 16 Aug 2020, at 21:09, Keith McKay  wrote:
> 
> Jairo
> 
> Try
> 
> draw unitsquare scaled 1cm shifted (xcm, ycm);
> 
> Page 11 of the manual metafun-p.pdf is your friend here. My recent 
> conversation with Taco on this list will be usefull as well.

Also:

\starttext
\startMPpage
% puts the center of the bbox of path p at the point t
primarydef p centered t =
 hide(xshift := xpart t - (xpart urcorner p + xpart llcorner p)/2 ;
  yshift := ypart t - (ypart urcorner p + ypart llcorner p)/2 ; )
 p shifted (xshift,yshift)
enddef;

draw fullsquare scaled 2cm shifted (50,3) centered (100,100);

% just for reference:
drawdot origin withpen pencircle scaled 10 withcolor red;
drawdot (100,100) withpen pencircle scaled 10 withcolor green;
\stopMPpage
\stoptext

(I thought there was a metafun definition for that but I cannot find it).

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
___


Re: [NTG-context] reading a single element from XML

2020-08-16 Thread Taco Hoekwater
\xmlfilter is your friend:

 \startxmlsetups xml:initialize
   \xmlsetsetup{#1}{html}{xml:gen}
 \stopxmlsetups

 \xmlregistersetup{xml:initialize}

\startxmlsetups xml:gen
\xmlfilter{#1}{/**/span[@class='special']/command(xml:special)}
\stopxmlsetups

 \startxmlsetups xml:special
   \bgroup\bfd\ssd\xmlflush{#1}\egroup
 \stopxmlsetups


Best wishes,
Taco

> On 16 Aug 2020, at 11:02, Pablo Rodriguez  wrote:
> 
> Dear list,
> 
> I have the following sample:
> 
>  \startbuffer[demo]
>  
>
>  
>This is Only a paragraph.
>This is another paragraph.
>This is another paragraph.
>This is another paragraph.
>This is another paragraph.
>  
>
>  
>  \stopbuffer
> 
>  \startxmlsetups xml:initialize
>\xmlsetsetup{#1}{*}{-}
> 
>\xmlsetsetup{#1}
>  {html|body|div|p}
>  {xml:flush}
> 
>\xmlsetsetup{#1}
>  {html/**/span[@class='special']}
>  {xml:special}
>  \stopxmlsetups
> 
>  \xmlregistersetup{xml:initialize}
> 
>  \startxmlsetups xml:flush
>\xmlflush{#1}
>  \stopxmlsetups
> 
>  \startxmlsetups xml:special
>\bgroup\bfd\ssd\xmlflush{#1}\egroup
>  \stopxmlsetups
> 
>  \starttext
>\xmlprocessbuffer{main}{demo}{}
>  \stoptext
> 
> How can I select only ? I mean, how can I have
> "Only" and nothing more in the output PDF document?
> 
> I thought that lpath "html/**/span[@class='special']" would work, but I
> don’t know what I’m missing.
> 
> Many thanks for your help,
> 
> Pablo
> --
> http://www.ousia.tk
> ___
> If your question is of interest to others as well, please add an entry to the 
> Wiki!
> 
> maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
> webpage  : http://www.pragma-ade.nl / http://context.aanhet.net
> archive  : https://bitbucket.org/phg/context-mirror/commits/
> wiki : http://contextgarden.net
> ___

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
___


Re: [NTG-context] Missing graphic in MPpage when viewing in Apple MAC Preview or GIMP 2.10 but not Adobe

2020-08-15 Thread Taco Hoekwater
Hi Keith,

It took me a while before I saw it, but I think you wanted to type in

  z0 = (60,60);
  z1 = z0 rotated 120;
  z2 = z0 rotated 240;

instead of 

  z0 = (60,60);
  z1 = z0 rotated 120;
  z2 = z1 rotated 240;

because the latter puts z2 at z0, resulting in a path that is a straight line. 
The fact that AR displays anything at all is probably some form of correction 
like "fill of empty path == single pixel line”.

Best wishes,
Taco

> On 15 Aug 2020, at 17:39, Keith McKay  wrote:
> 
> Dear List
> 
> I have come across a problem which I don't think is due to ConTeXt but I'm 
> hopping the great and the good of this list may be able to explain what is 
> going on.
> 
> The code below produces an MPpage with a shaded background and two graphics 
> along with a line of outlined text. When I view in Adobe (or the output from 
> TeXworks) I see everything as it should be. However, I wanted to convert the 
> MPpage to a jpeg file and when I opened the pdf in either Apple MAC Preview 
> or Gimp 2.10 the two graphics are missing, and I have no idea why.
> 
> Could someone explain a way round this?  Here is the code.
> 
> Thanks
> 
> Keith
> 
> %%
> system  > 
> 
> system  > ConTeXt  ver: 2020.07.29 18:36 LMTX  fmt: 2020.7.29  int: 
> english/english
> system  > 
> 
> %%%
> 
> 
> \setuppapersize [A5, portrait]
> \usecolors[crayola]
> \starttext
> \startMPpage
> StartPage;
> width := PaperWidth ; height := PaperHeight ; unit := cm ;
> definecolor [ name = "MyColor1", r = 0.781, g = 0.5, b = 0.5 ] ;
> definecolor [ name = "MyColor3", r = 1, g = 1, b = 0.7983 ] ;
> draw lmt_shade [
> path = unitsquare xscaled 14.8cm yscaled 21cm,
> direction = "up",
> alternative = "linear",
> colors = { "MyColor1", "MyColor3" },
> ] ;
> z0 = (60,60);
>   z1 = z0 rotated 120;
>   z2 = z1 rotated 240;
>   path carre;
>   carre = z0--z1--z2--cycle;
>   picture pic;
>   pic := image(
>  numeric d; d := 0.0005;
>  for i=1 step -d until d:
>   fill carre scaled i shifted (3.9cm,17cm) withcolor((1 + 
> i)*(\MPcolor{VividTangerine})) ;
>   fill carre rotated (45) scaled i shifted (3.9cm,17cm)  withcolor((1 + 
> i)*(\MPcolor{VividTangerine})) ;
>   fill carre rotated (90) scaled i shifted (3.9cm,17cm)  withcolor((1 + 
> i)*(\MPcolor{VividTangerine})) ;
>   fill carre rotated (135) scaled i shifted (3.9cm,17cm)  withcolor((1 + 
> i)*(\MPcolor{VividTangerine})) ;
>   fill carre rotated (180) scaled i shifted (3.9cm,17cm)  withcolor((1 + 
> i)*(\MPcolor{VividTangerine})) ;
>   fill carre rotated (225) scaled i shifted (3.9cm,17cm)  withcolor((1 + 
> i)*(\MPcolor{VividTangerine})) ;
> endfor;);
> draw pic rotatedaround(center pic, 270);
> draw pic rotatedaround(center pic, 90) shifted (7cm,-13cm) ;
> draw lmt_outline [
> text = "Page 18"
> kind = "draw",
> drawcolor = "VividTangerine",
> ] xsized TextWidth shifted (1cm,7.67cm);
> StopPage;
> \stopMPpage
> \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
> ___
> 

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
___


Re: [NTG-context] Same counter for figures as theorems

2020-08-14 Thread Taco Hoekwater
Hi Tim,

I misunderstood your goal, sorry. Proposed setup below.


But first, what I think is a bug in ConTeXt:

Neither
  \setupcaptions
[counter=object]
nor
  \setupcaption
[figure]
[counter=object]

work. the caption always falls back to the ‘current float counter’; figure or 
table or …

For the singular explicit \setupcaption[figure], I think this is a bug.


The solution I found is to blatantly redefine the ‘figure’ counter, that works!


Second, it seems that \setupenumerations does not modify the counter of an 
explicit defined enumeration, so you need to use the explicit 
\setupenumeration[enumeration] form. This may be intentional, I do not know for 
sure.



Here is what I believe is the required code for your desired effect 
(re-indented for Hans' style):

\setupcaptions
  [way=bysection,
   prefixsegments=chapter:section]

\setupenumerations
  [prefix=yes,
   prefixsegments=chapter:section]

\defineenumeration
  [enumeration]
  [text=Enumeration]

\definecounter
  [object]
  [way=bysection]

\setupenumeration
  [enumeration]
  [counter=object]

\definecounter
  [figure]
  [object]

Best wishes,
Taco


> On 14 Aug 2020, at 09:49, Tim Steenvoorden  wrote:
> 
> Hi Taco,
> 
> Thanks for your example and the pointer to make a MWE.
> 
> Sadly, it doesn’t work for me. It numbers the first enumeration 1.1.1 and the 
> first figure _also_ 1.1.1, which I’d like to be 1.1.2.
> 
> This time, you’ll find the code and the output pdf in the attachment!
> 
> Cheers,
> Tim
> 
> 
> P.S. I’m on Context MacTeX/TeXLive 2020:
> 
> mtx-context | ConTeXt Process Management 1.03
> mtx-context |
> mtx-context | main context file: 
> /usr/local/texlive/2020basic/texmf-dist/tex/context/base/mkiv/context.mkiv
> mtx-context | current version: 2020.03.10 14:44
> mtx-context | main context file: 
> /usr/local/texlive/2020basic/texmf-dist/tex/context/base/mkiv/context.mkxl
> mtx-context     | current version: 2020.03.10 14:44
> On 13 Aug 2020, 13:12 +0200, Taco Hoekwater , wrote:
>> 
>> 
>>> On 13 Aug 2020, at 10:06, Tim Steenvoorden  
>>> wrote:
>>> 
>>> Hi all,
>>> 
>>> Anybody some pointers?
>> 
>> Next time, prepare a minimal (non)working example. Because the attachment 
>> works for me.
>> 
>> 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
> ___

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
___


Re: [NTG-context] weird issue with xtable

2020-08-13 Thread Taco Hoekwater

> On 13 Aug 2020, at 14:15, Pablo Rodriguez  wrote:
> 
>>> My questions are: what is the restricted horizontal mode (as different
>>> from the horizontal mode)?

I forgot to answer this. Simple explanation:

* 'restricted horizontal mode' is inside an \hbox{} or something similar like a 
header/footer, 
  where line breaks are forbidden
* ‘horizontal mode’ is inside a paragraph, where line breaks are possible

But the ‘restricted’ part is not relevant to your problem, \prevdepth is 
forbidden in horizontal mode  regardless of restrictions; it is only allowed in 
vertical mode.


Somehow your table ends up being typeset in a horizontal context, based on the 
error message (at least, if we assume that the error message was triggered by a 
table). 

But why that is? I do not have any other good ideas. And unfortunately lots of 
different things in ConTeXt can trigger an implicit horizontal context. 

For debugging, you could try adding this to the preamble (or grouped around 
each xtable, for slightly less damage to the vertical spacing):

  \let\prevdepth\relax
  \newdimen\prevdepth 

that should at least remove the error report.  The vertical spacing in the pdf 
output will be wrong (!!!), but perhaps the output can provide a clue about 
what triggered the problem.

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
___


Re: [NTG-context] weird issue with xtable

2020-08-13 Thread Taco Hoekwater


> On 13 Aug 2020, at 13:07, Pablo Rodriguez  wrote:
> 
> Dear list,
> 
> in order to avoid a problem already reported
> (https://mailman.ntg.nl/pipermail/dev-context/2020/003694.html), I added
> to an indiviual table \startxtable[split=yes] (being the default in the
> document \setupxtable[split=repeat, header=repeat]).
> 
> But I’m experiencing a weird issue with that approach.
> 
> I get the following error message (that breaks compilation) when I add
> \setupxtable[split=yes]:
> 
>   You can't use '\prevdepth' in restricted horizontal mode
> 
> The single document (actually, an XML file) compiles just fine, but when
> combined together to generate a PDF document over 1000 pages, I get the
> error above.
> 
> My questions are: what is the restricted horizontal mode (as different
> from the horizontal mode)? Why might it be triggered with
> \startxtable[split=yes] in the huge source, but not in the single file?

At a wild guess, as I had a similar problem in my XML: try using 
\startembeddedxtable
instead of \startxtable. In my case, what happened was that a row of the xtable
ended up in the header/footer, generating the same error message you got. 

Not sure if it is actually the same problem, but switching is worth a shot.
The \startxtable does not like to be wrapped into other environments, 
so \startembeddedxtable is much better for that.


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
___


Re: [NTG-context] Same counter for figures as theorems

2020-08-13 Thread Taco Hoekwater


> On 13 Aug 2020, at 10:06, Tim Steenvoorden  wrote:
> 
> Hi all,
> 
> Anybody some pointers?

Next time, prepare a minimal (non)working example. Because the attachment works 
for me.

Best wishes,
Taco


tryme.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] Wiki New Extension Preview

2020-08-12 Thread Taco Hoekwater
Hi,

Some of you already know that I have been working on a wiki extension to 
control the editing of /Command pages.

The goal is to eventually be able to easily export all of the reference 
documentation in the wiki to a separate system (for instance, Paul Mazaitis 
plans to create a full-blown reference manual). In the current situation, this 
is nearly impossible because there is so much variation in the content and 
quality of the wiki /Command pages (not to mention that many are missing). We 
also want it to be possible to merge improvements to the interface xml 
definitions by Wolfgang without loosing any existing documentation work.

After some evenings and weekends of steady discussion with Paul, Wolfgang and 
some others on the wiki mailing list and a fair bit of hacking, this plan is 
now starting to come together. In short, we will switch to XML as the page 
model for newly created /Command pages. This makes editing a bit harder, but it 
allows much better quality control and (fairly) easy export and import.

The new extension is not installed on the normal wiki yet, because it makes 
sense to see if we can get some of the bugs ironed out before we start working 
on actual /Command pages. It is my first ever Wiki extension and even my first 
non-trivial php code, thus I am certain there will be bugs. So, while the 
documentation pages are already on the normal wiki, any testing and/or 
experimenting has to be done on the test wiki.

The documentation pages are here:

  https://wiki.contextgarden.net/Command
  https://wiki.contextgarden.net/Help:Command
  https://wiki.contextgarden.net/Extension:ConTeXtXML

and there is a small todo list here:

  https://wiki.contextgarden.net/User_talk:Taco

For playing around / experimenting / testing, have fun at

  https://wikitest.contextgarden.net/

(but read at least Help:Command first!)

A useful landing page on the test wiki to start playing around is:

  https://wikitest.contextgarden.net/Allcommands

which is a list of all the commands that are included in Wolfgang’s interface 
xml (and thus available to be documented using the new wiki extension). 

All the bright red links are currently undocumented commands. Clicking on one 
should bring you to the edit screen automatically, with a blob of XML 
preloaded, ready for you to start writing.

All the dark red links are existing /Command pages. Almost all of those are 
traditional wiki text pagse. Following those links will bring you to a normal 
/Command page just like on the main wiki. If you want to see how one of those 
pages would look like in the new system, you’ll have to rename the existing 
page first. 

Be assured that nothing on the wikitest is permanent! As long as the browser 
url says “ https://wikitest.contextgarden.net/ ” you cannot destroy anything 
important. But don’t spend hours improving existing pages yet, this preview is 
intended for catching bugs in the extension only.

Comments, Suggestions and Bug reports are more than welcome. 

Please direct those to me personally or (better) to the wiki mailing list:

https://lists.contextgarden.net/mailman/listinfo/wiki

Have fun!

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
___


Re: [NTG-context] How can I use ConTeXt from TeXLive2020 ?

2020-08-10 Thread Taco Hoekwater


> On 10 Aug 2020, at 14:59, Otared Kavian  wrote:
> 
> Hi Alex,
> 
> Thank you and Taco for helping. 
> In order to help solve the problem of running ConTeXt from MacTeX, I 
> installed MacTeX2020 (which is the same as TeXLive2020). Now if in a Terminal 
> window I do
>   which context
> the answer is:
>   /Library/TeX/texbin/context
> And the answer to
>   which pdflatex
> is
>   /Library/TeX/texbin/pdflatex
> Also the answer to:
>   which luatools 
> is
>   /Library/TeX/texbin/luatools
> 
> So the binaries are in /Library/TeX/texbin, which is in fact an alias for
>   /usr/local/texlive/2020/bin/x86_64-darwin
> 
> Now, as you and the « ConTeXt (LuaTeX) » engin suggest, if I do
>   luatools --generate 

Does

  mtxrun —generate

work?



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

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/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 can I use ConTeXt from TeXLive2020 ?

2020-08-10 Thread Taco Hoekwater


> On 10 Aug 2020, at 12:03, Otared Kavian  wrote:
> 
> Hi all,
> 
> I suggested to a friend, who is using plain TeX and LaTeX, to switch to 
> ConTeXt, and since he is using TeXShop on MacOSX with a version of 
> TeXLive2020 (named MacTeX2020), I thought he would just typeset a simple test 
> document with the option « ConTeXt (LuaTeX) » from the menu in TeXShop, where 
> it does appear.
> 
> Unfortunately when doing this all he gets in the log file is:
> 
> /sw/bin/init.csh: No such file or directory.

My guess is that this missing init.csh is supposed to set up the correct PATH 
environment.

But that is as far as my knowledge goes…

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
___


Re: [NTG-context] please explain

2020-08-07 Thread Taco Hoekwater


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


Re: [NTG-context] Header bottom line vanishing after 87 pages

2020-08-06 Thread Taco Hoekwater


> On 6 Aug 2020, at 09:09, Willi Egger  wrote:
> 
> Hello good morning,
> 
> I encounter a strange problem when compiling my project. The book has 252 
> pages, compilation runs without errors. But after 87 pages the bottom frame 
> of the header is turned off. The \setupbackgrounds command is given only once 
> in the preamble. — So I am curious what that can be.
> I tried to reproduce the problem by a simple 255 page loop, but there the 
> issue does not appear.
> 
> There is no difference between MKIV and LMTX, no difference in older version 
> and yesteray evening’s version of ConTeXt.
> 
> My question is whether anybody has an idea how to track down this issue.

1. limit the document to 88 pages ;)

2. try deleting in-between chapters, and see if that helps.


My approach after that would be to turn on logging (\loggingall) on page 86, 
and try to find something related to backgrounds in the log afterward. But I do 
not know how well that would work.

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
___


Re: [NTG-context] lmtx update

2020-07-31 Thread Taco Hoekwater
Hi Hans,

> On 31 Jul 2020, at 10:32, Hans Hagen  wrote:
> 
> Hi,
> 
> Sorry for the long mail ...
> 
> One of the changes in lmtx is that we freeze the properties that determine 
> the paragraph shape as well as breaking into lines in such a way that we have 
> predictable behaviour. As a side effect it can be that existing code (lmtx 
> only) will behave differently (will be fixed when we notice) but also that 
> some low level user tweaking can not work, i.e. they are just ignored, but 
> only when they happen mid paragraph which actually is always debatable anyway.
> 
> Now, if for some reasom you get unexpected results and can't wait for a fix, 
> you can do this:
> 
>  \forgetparagraphfreezing : disables
>  \setparagraphfreezing: enables (default)

Are those global or local or can they be prefixed? For example, can we do this:

  \setparagraphfreezing
  ….
  \placefigure[left]{}{} {Bla bla \forgetparagraphfreezing ..  }

or would that still trigger the built-in freeze ?


> 
> Of course it might have other side effects once in lmtx we everywhere expect 
> freezing to be enabled. You can take a snapshot with:
> 
>  \freezeparagraphproperties  : snapshot relevant parameters
>  \defrostparagraphproperties : resets snapshot
> 
> More efficient is snapshotting a subcategory:
> 
>  \updateparagraphproperties : all
>  \updateparagraphpenalties  : only penalties
>  \updateparagraphdemerits   : other than penalties
>  \updateparagraphshapes : hangindent etc
> 
> Don't use the low level commands that they use because we take plenty of time 
> to experiment at that level and interfaces might evolve, for instance:
> 
> \frozen\hangindent 30pt
> \frozen\hangafter  2
> 
> is valid and will likely stay.
> 
> We're talking of a conceptually rather different approach. Internally the 
> engine is still doing the same things but we can control it a bit 
> differently. Due to the way ConTeXt is set up, we can make such a paradigm 
> shift without too much troubles. I'll wrap up more details in an article 
> later.
> 
> Other work in progress is: better columns in itemize, esp proper footnote 
> support (not that I ever need that but I know users do so ...), experiments 
> work ok, but I need to check spacing. In general, footnotes (will) behave a 
> bit better, especially those used nested in other mechanisms. A side effect 
> of more control is that we can do other tricks too and we're playing with it 
> (kind of fun).
> 
> More work in progress concerns paragraph wrappers and that will result in a 
> rewrite of some existing mechanism (generic subsystems with instances), but 
> that might as well go unnoticed.
> 
> To give an idea of possibilities, here is an example:
> 
> \definedescription[whatever][alternative=right:bottom]
> 
> \startwhatever{just a small\\example}
>\input ward
> \stopwhatever
> 
> No one ever requested it so see it an a quick and dirty example but don't 
> hesitate to ask for more anyway (we like an occasional challenge).
> 
> Anyway, it might take some weeks / iterations before all this settles down 
> and now you can't say that we didn't warn you.
> 
> So far,
> 
> 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
> ___

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
___


Re: [NTG-context] ntg-context Digest, Vol 193, Issue 65

2020-07-30 Thread Taco Hoekwater
Help request will be handled off-list.

Best wishes,
Taco

> On 30 Jul 2020, at 22:01, Jan Hansen  wrote:
> 
> Help
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

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


Re: [NTG-context] About testing rest of space on a page

2020-07-30 Thread Taco Hoekwater


> On 29 Jul 2020, at 23:08, Willi Egger  wrote:
> 
> Good evening!
> 
> I have a bookproject in which sections are ended with a small graphical 
> element. Now as usual this graphic might be moved to a new page which is of 
> course unwanted.
> 
> At this moment I have:
> 
> \startsetups endsection
>  \vfil
>  
> \placefigure[middle,none][]{}{\externalfigure[ornament2][height=2\lineheight]}
>  \stopsection
> \stopsetups
> 
> \def\stopmysection{\setups{endsection}}
> 
> I use then instead of \stopsection the \stopmysection. This works except that 
> the ornament is in some cases placed on the next page. — My question is 
> whether it is possible to do a \testpage and evaluate the result hereof and 
> then using either the placement of the ornament and stop the section or just 
> end the section without ornament?

You can put your setups *inside* the test:

  \definepagechecker
[willi]
[method=1,before=,after=,inbetween={\setups{endsection}}]

  \def\stopmysection
{\checkpage[willi][lines=4]}

The before=/after= pair is used when a page break is forced by the test, 
inbetween= is used if there is no forced break.

(\testpage is a wrapper around \checkpage: 
 https://source.contextgarden.net/page-brk.mkiv?search=testpage#l564 )

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
___


Re: [NTG-context] --silent and so on

2020-07-23 Thread Taco Hoekwater


> On 23 Jul 2020, at 16:21, Hans Hagen  wrote:
> 
> On 7/23/2020 2:39 PM, Taco Hoekwater wrote:
>>> On 22 Jul 2020, at 17:57, thierry horsin  wrote:
>>> 
>>> Hi everybody
>>> 
>>> I am a current context user since now many years and in particular I use it 
>>> on linux with automatic compilation with a bash script detecting any 
>>> modifications of the .tex file. In order for this to work I used with 
>>> previous versions
>>> 
>>> the "--nonstopmode --batchmode --silent --noconsole" compilation options.
>> Somewhat related question: is there a way to get rid of the
>>“This is LuaMetaTeX, Version 2.06.18 “
>> line on the terminal ?
> Ah, you want to completely hide that tex is used, just in case someone who 
> watches a run gets bad feelings (and expectations) due to earlier 
> experiences, like ever being forced to use the backslasg driven language 
> during education ... "Oh no, please, not TeX again!”.

Actually, I am trying to capture my (lua-generated) console output to a 
processing pipe that expects a html page.

Best,

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
___


Re: [NTG-context] --silent and so on

2020-07-23 Thread Taco Hoekwater


> On 22 Jul 2020, at 17:57, thierry horsin  wrote:
> 
> Hi everybody
> 
> I am a current context user since now many years and in particular I use it 
> on linux with automatic compilation with a bash script detecting any 
> modifications of the .tex file. In order for this to work I used with 
> previous versions
> 
> the "--nonstopmode --batchmode --silent --noconsole" compilation options.

Somewhat related question: is there a way to get rid of the 

   “This is LuaMetaTeX, Version 2.06.18 “

line on the terminal ?

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


Re: [NTG-context] Fill an area defined by a subpath (Metafun)

2020-07-23 Thread Taco Hoekwater


> On 23 Jul 2020, at 11:48, Fabrice Couvreur  
> wrote:
> 
> Hello,
> I have a little problem with coloring an area (path b).
> Thanks for your help.
> Fabrice
> 
> \starttext
> \startMPcode
>   
>   path circle, p, q, b;
>   
> circle = fullcircle xscaled 6cm yscaled 3.5cm;
> p = (point 2 of circle .. (-0.15cm,1.5cm) ..(0,0)..(0.15cm,-1.5cm).. point 6 
> of circle);
> q = (subpath(0,2) of circle -- p -- subpath(6,8) of circle --cycle);
> b = (p -- subpath(2,6) of circle -- cycle);

That should be:

  b = (reverse p -- subpath(2,6) of circle -- cycle);

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
___


Re: [NTG-context] error after Linux upgrade

2020-07-11 Thread Taco Hoekwater
Hi,

It is possible that the Mint upgrade changed something in your environment that 
affects ConTeXt.

Check for (new) env settings that start with TEXMF.

Best wishes,
Taco

> On 11 Jul 2020, at 03:07, jbf  wrote:
> 
> Hi,
> 
> After upgrading from Linux Mint 19.3 to 20, when attempting to run the 
> context mydoc.tex command, I get the following messages:
> 
> jel@mycomputer:~/Documents/Context_docs$ context mydoc.tex
> resolvers   | caches | path '/home/jel/.texlive2019/texmf-var' created
> mtxrun  | unknown script 'context.lua' or 'mtx-context.lua'
> 
> Obviously it needed to resolve a path issue and appears to have done so, but 
> why did it choose .texlive2019/texmf-var? If I run 'locate context.lua' I get 
> /home/jel/context/tex/texmf-context/scripts/context/lua/context.lua so how 
> might I get Context to resolve to this latter?
> 
> Julian
> 
> ___
> If your question is of interest to others as well, please add an entry to the 
> Wiki!
> 
> maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/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
___


Re: [NTG-context] Store images and text in the right margin

2020-07-06 Thread Taco Hoekwater
Hi Fabrice,

Like this maybe? It depends on what you want to achieve exactly, I think

\useMPlibrary[dum]

\setuppapersize[A4]

\setuplayout
  [width=12cm,
   rightmargin=5cm]

\defineuserdata [margintext] [alternative=margintext]

\defineuserdataalternative [margintext] [renderingsetup=userdata:margintext]

\startsetups [userdata:margintext]
  \margindata
[inright]
[style={\switchtobodyfont[9pt]},
 width=\rightmarginwidth,
 align={flushleft,broad},
 stack=yes]
{\startframedtext[before=,after=,offset=0pt,width=max,frame=off]
 \getinlineuserdata
 \stopframedtext}
\stopsetups

\showframe
\starttext
\startuserdata[margintext]
 {\bf Remarque — }\input ward
\stopuserdata
\startuserdata[margintext]
 \externalfigure[dummy][width=\rightmarginwidth]
\stopuserdata
\startchapter[title=First chapter]
\dorecurse{2}{\input knuth}
\stopchapter
\stoptext


> On 6 Jul 2020, at 16:18, Fabrice Couvreur  wrote:
> 
> 
> 
> -- Forwarded message -
> De : Fabrice Couvreur 
> Date: lun. 6 juil. 2020 à 12:10
> Subject: Re: [NTG-context] Store images and text in the right margin
> To: Marco 
> 
> 
> Hello,
> What has been proposed by Wolfgang and Marco works correctly but is it 
> possible to define a single environment margintext which would allow to 
> include both text and figures ?
> Thank you
> Fabrice
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/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 source browser website update

2020-07-05 Thread Taco Hoekwater
Hi,

> On 5 Jul 2020, at 21:41, Hans Hagen  wrote:
> 
> On 7/5/2020 9:11 PM, Leah Neukirchen wrote:
>> Taco Hoekwater  writes:
>>> Hi all,
>>> 
>>> I just replaced the software of https://source.contextgarden.net/ by a
>>> Lua implementation that uses Hans Hagen’s SciTE lexers for syntax
>>> highlighting and a Lua-generated search index.
>>> Suggestions for improvements are welcome.
>> The download feature for binary files is broken, at least a leading
>> newline is prefixed to the download. 
Binary downloads fixed.

Thanks for the report,
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
___


Re: [NTG-context] overfull message

2020-07-03 Thread Taco Hoekwater
\hbadness affects reports on stretched/shrunk box glue, but not
overfull boxes. You need \hfuzz for that

\hfuzz = 12pt

Best wishes,
Taco

> On 3 Jul 2020, at 14:53, Hans van der Meer  wrote:
> 
> 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 them
> Setting \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
> 
> 
> ___
> If your question is of interest to others as well, please add an entry to the 
> Wiki!
> 
> maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/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
___


Re: [NTG-context] Typesetting poetry with particular indenting

2020-07-02 Thread Taco Hoekwater

I was having fun with this as well while Hans was writing his generic solution. 

Here is an explicit ‘indent each 2nd and 3rd line’:


\unprotect

\installindentingmethod {three} {\c_spac_indentation_toggle_state\plusthree}
  
\unexpanded\def\spac_indentation_tri_toggle_indeed
  {\glet\checkindentation\spac_indentation_tri_toggle}

\unexpanded\def\spac_indentation_tri_toggle
  {\gdef\checkindentation
  {\spac_indentation_remove
   \gdef\checkindentation{\spac_indentation_tri_toggle_indeed}}}

% this next macro is redefinition of a core macro !
\def\spac_indentation_check_toggle
 {\ifcase\c_spac_indentation_toggle_state
% nothing
  \or
\spac_indentation_no_toggle
  \or
\spac_indentation_do_toggle
  \or
\spac_indentation_tri_toggle
  \fi}
\protect
%%

to be used with:

  \setuplines[indenting=three]


Best wishes,
Taco

> On 2 Jul 2020, at 15:01, Tommaso Gordini  wrote:
> 
> \starttext
> 
> \setupindenting[yes,1em]
> \setuplines[indenting=even]
> 
> \startlines
> Per correr miglior acque alza le vele
> omai la navicella del mio ingegno,
> che lascia dietro a sé mar sì crudele;
> e canterò di quel secondo regno
> dove l'umano spirito si purga
> e di salire al ciel diventa degno.
> \stoplines
> 
> \stoptext

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
___


[NTG-context] Fwd: TeX Annual Meeting 2020 going online

2020-07-02 Thread Taco Hoekwater
Hi all,

See the announcement for the (online) TUG 2020 meeting below.

Best wishes,
Taco

> Begin forwarded message:
> 
> From: Paulo Ney DE SOUZA 
> Subject: TeX Annual Meeting 2020 going online
> Date: 1 July 2020 at 21:32:35 CEST
> 
> ---
> The TeX annual user conference TUG 2020 is going digital on July 24, 25, 26. 
> Register for free!
> 
> As we move TUG 2020 completely online, we look forward to offering you the 
> same vibrant programming, innovative and timely content from presenters, and 
> opportunities to reflect and connect over the emerging topics in TeX and 
> typography with users across the world. The online conference will include 
> our regular offerings and opportunities for engagement, including sessions, 
> workshops, keynotes, and space to connect with users, from across the globe.
> 
> We will have keynote addresses by Steven Matteson, the designer of the NOTO 
> fonts and John MacFarlane the author of Pandoc. We will also feature 
> interviews with Javier Bezos of Babel and Philip Kime  of BibLaTeX.
> 
>  In addition to participating in the live event, all attendees will have 
> access to break-out rooms for networking and social engagement. Moving our 
> face-to-face conference to a fully online format presents us with the unique 
> opportunity to spotlight the best of what the online modality affords – 
> meaningful collaboration and the ability to reflect and connect with 
> colleagues around the world. We hope that you will join us for this 
> reimagined event, and celebrate our collective resilience and dedication to 
> forging connections without boundaries.
> 
> We look forward to welcoming you to the TUG 2020 Online Conference in July, 
> and we are here to help you however we can with questions and requests for 
> support.  Please feel free to reach out to us with requests related to TUG 
> 2020 at
> 
>   tug-conferen...@tug.org <mailto:tug-conferen...@tug.org>
> 
> Registration is required. While access to the meeting will be free to 
> everyone, you will be required to register to view the meeting. Even if you 
> registered to attend the TUG 2020 at RIT, you will need to register again for 
> TUG 2020 Online. Registration for the meeting is open at
> 
>   https://tug.org/tug2020/ <https://tug.org/tug2020/>
> 
> Paulo Ney de Souza
> TUG 2020 Organizers

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
___


[NTG-context] Wiki ConText Installation updated

2020-07-01 Thread Taco Hoekwater
Hi all,

Today I updated the ConText behind wiki.contextgarden.net, 
live.contextgarden.net and source.contextgarden.net to the current latest: 
2020.06.30 17:30.

* The wiki’s  tag now defaults to “lmtx” mode, and you can switch back 
to “mkiv“ using the  “mode” attribute. The “mkii” mode is no longer working.
* The wiki’s  now supports the latest ConText as well, and I added 
support for all the “system-level” commands. Also the colors have changed a 
little and generated commands now have a link back to generating command.

* the live website always run lmtx.

* the source website’s software has been improved a little as well; I have 
updated the documentation page accordingly.

Happy TeXing,
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
___


Re: [NTG-context] Commands with arguments before in ConTeXt

2020-06-29 Thread Taco Hoekwater
Sorry, that was a bit too much oversimplification:

> On 29 Jun 2020, at 12:36, Taco Hoekwater  wrote:
> 
> In math mode, there *is* an expression state maintained, and that is why 
> \over and \atop work.

Actually (still oversimplifying), the found commands are saved in a temporary 
list,
that is then reprocessed once math mode has ended. And at that stage, an 
expression tree is built up.

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
___


Re: [NTG-context] Commands with arguments before in ConTeXt

2020-06-29 Thread Taco Hoekwater
---
> ___
> If your question is of interest to others as well, please add an entry to the 
> Wiki!
> 
> maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/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
___


Re: [NTG-context] Which lua XML library is embedded in LMTX?

2020-06-26 Thread Taco Hoekwater
Hi,

> On 25 Jun 2020, at 12:37, Gerben Wierda  wrote:
> 
> According to the XML manual:
> 
> << 2.1 >> TEX versus LUA
> 
> It will not come as a surprise that we can access xml files from TEX as well 
> as from Lua. In fact there are two methods to deal with xml in Lua. First 
> there are the low level xml functions in the xml namespace. On top of those 
> functions there is a set of functions in the lxml namespace that deals with 
> xml in a more TEXie way.
> 
> << 3.7 >> manipulation
> 
> Having read that, I was loooking for the documentation of the commands that 
> are available in the xml namespace. I want to manipulate a XML tree in LMTX 
> lua. But looking online gives me all kinds of different XML-solutions that 
> are proposed for lua. Which one is embedded in LMTX and available in the xml 
> namespace? But then I get confused because other elements like xml.first, 
> xml.collected are in the xml namespace and mentioned.

None of the prefab solutions are used. The XML parser in ConTeXt is 
hand-written by Hans.

Most (all?) of the TeX macros like \xmlfirst are in fact thin wrappers around 
lua code,
see https://source.contextgarden.net/tex/context/base/mkiv/lxml-ini.lua

However, these are currently not documented. Hans wrote the xml-mkiv manual 
with TeX users
in mind, so there is very little documentation on the Lua side of things. I 
have plans myself
to write that ‘missing chapter’ but there are a lot of other things on my list 
of todos as well.

> What I need (in LMTX lua) to add (sub)nodes to the XML node (that I read with 
> xml.first()) because the data I get is broken and I need to fix it before I 
> can use it (and I cannot get good data) The easiest way is to add the correct 
> data to the XML and then use it in my code. If I cannot do that I need to 
> write parallel code that largely does the same as what I already have (ugh)..

Regardless of whether it is doable in principle, this is not the intended use 
of the 
xml processing in ConTeXT. ConTeXt XML support is for Formatting, not 
Transformation. 
If you need to actually change the XML structure, I strongly advice to find a 
solution 
elsewhere.

ConTeXt not only does formatting, but it tries to do this as efficiently and 
fast
as possible. That means that if you want to modify a parsed tree, you will 
almost
certainly also have to fix up external indices into that tree and you probably
will have to write the lua mutation functions yourself as well.

So, better look at some binding for libxml2 to some language you like, and then 
transform
the XML beforehand into something you can confidently use as source for 
typesetting.

Again: ConTeXt XML support is not meant for XML Transformations.

(my two cents, at least)

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
___


Re: [NTG-context] error running wiki example with labels

2020-06-26 Thread Taco Hoekwater


> On 25 Jun 2020, at 17:54, Jan-Erik Hägglöf  wrote:
> 
> It is difficult to see the differences in this case, but I supply both 
> logfiles
> 
> 

The two PATHs are not the same, so it is possible that one of the two 
uses a different mtxrun, context and/or luatex that is elsewhere in the PATH:

test-by-shell-context.log:ENV > 
PATH=/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/Users/janneman/context-osx-64/bin:/Users/janneman/context-osx-64/tex/texmf-osx-64/bin:/Users/janneman/scripts
test-inside-with-mtxrun.log:ENV > 
PATH=/Users/janneman/context-osx-64/tex/texmf-osx-64/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/Users/janneman/context-osx-64/bin:/Users/janneman/context-osx-64/tex/texmf-osx-64/bin:/Users/janneman/scripts

but other than that, nothing stands out to me in that log. 

An interesting experiment would be to run the macvim-generated commandline (for 
the file with the error) in Terminal, and then that same commandline but with 
the PATH set as in macvim.


> Now I also upgraded lmtx to latest version.

But still having problems?

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
___


Re: [NTG-context] error running wiki example with labels

2020-06-25 Thread Taco Hoekwater
Hi,

> On 24 Jun 2020, at 23:13, Jan-Erik Hägglöf  wrote:
> 
> Is the difference when I’m running mtxrun … inside macvim

I would suspect PATH problems. Try running this bit of code both ways,
and compare the differences:

\starttext
\startluacode
for a,v in pairs(os.env) do
   logs.report('ENV', a .. '=' ..v)
end
\stopluacode
\stoptext


> 
> instead of just context ? in the terminal
> 
>> 24 juni 2020 kl. 21:05 skrev Jan-Erik Hägglöf :
>> 
>> lua error   > lua error on line 70 in file ./labels3.tex:
>> 
>> function call [801]: 
>> ...-64/tex/texmf-context/tex/context/base/mkiv/node-syn.lua:435: attempt to 
>> index a nil value (upvalue 'filehandle')
> 
> ___
> If your question is of interest to others as well, please add an entry to the 
> Wiki!
> 
> maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/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
___


Re: [NTG-context] How to define an array of pens

2020-06-22 Thread Taco Hoekwater


> On 22 Jun 2020, at 09:17, Otared Kavian  wrote:
> 
> Hi Hans,
> 
> After learning from you how to define an array of colors and paths, I would 
> like to know how is it possible to define a variable pen size.
> In the following working example below, I would like to replace 
> 
>   MyPens[j] := pencircle scaled 2pt ;
> 
> by something like
> 
>   MyPens[j] := pencircle scaled (2+j) pt ;

MyPens[j] := pencircle scaled ((2+j)*pt);

“pt” is just a multiplier variable in MetaPost. there is an
implied multiplication operation, but that only works in
bare-number cases. That is why you need 

 (2+j)*pt

The outer parentheses are to prevent MetaPost from interpreting
your line as 

  (pencircle scaled (2+j)) * pt;

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
___


Re: [NTG-context] Variables in \useURL

2020-06-19 Thread Taco Hoekwater


> On 19 Jun 2020, at 13:49, Hans Hagen  wrote:
> 
> On 6/19/2020 1:28 PM, Nigel King wrote:
>> Hi Group,
>> I want to insert a variable hyper reference into a pdf document. The 
>> following method does not work for some reason.
>> \def\hyperref{http://www.website.com/abc/def}
>> show \hyperref
>> Gives the correct answer but
>> \useURL[this_doc][\hyperref][][displayed text]
>> \from[this_doc]
>> Gives
>> hyperef%20 as the url
>> What am I doing wrong?
> the content is not expanded, why not just use
> 
> \useURL[this_doc][http://www.website.com/abc/def][][displayed text]

or 

  \expanded{\useURL[this_doc][\hyperref][][displayed text]}

if that is truly impossible for some reason.

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
___


Re: [NTG-context] (no subject)

2020-06-17 Thread Taco Hoekwater

Like this (an arrangement that uses two physical pages, that is
where the \poparrangedpagesAB and \arrangedpageA / \arrangedpageB 
come from):

\installpagearrangement 1*4*reversed
  {\dosetuparrangement{2}{2}{4}{3}{3}% X,Y,Total,hcutmarks,vcutmarks
   \pusharrangedpageFOURSINGLESIDEDFOLDEDREVERSED\poparrangedpagesAB\relax}

\def\pusharrangedpageFOURSINGLESIDEDFOLDEDREVERSED#1%
 {\advancearrangedpageN
  \reportarrangedpage\arrangedpageN
  \ifcase\arrangedpageN
  \or \handlearrangedpageXandY{#1}010\arrangedpageA %  1 rot,hskip,vskip
  \or \handlearrangedpageXandY{#1}111\arrangedpageA %  2
  \or \handlearrangedpageXandY{#1}101\arrangedpageA %  3
  \or \handlearrangedpageXandY{#1}000\arrangedpageA %  4
  \or \handlearrangedpageXandY{#1}000\arrangedpageB %  5
  \or \handlearrangedpageXandY{#1}010\arrangedpageB %  6
  \or \handlearrangedpageXandY{#1}001\arrangedpageB %  7
  \or \handlearrangedpageXandY{#1}011\arrangedpageB %  8
\poparrangedpages
  \fi}

Best wishes,
Taco



> On 17 Jun 2020, at 13:31, Malte Frank Gerdes  wrote:
> 
> Hi,
> 
> I'm new to context and found this
> 
> ```
> \installpagearrangement 1*4*reversed
>   {\dosetuparrangement{2}{2}{4}{3}{3}% X,Y,Total,hcutmarks,vcutmarks
>
> \pusharrangedpageFOURSINGLESIDEDFOLDEDREVERSED\poparrangedpagesTWO\relax}
> 
> \def\pusharrangedpageFOURSINGLESIDEDFOLDEDREVERSED#1%
>  {\advancearrangedpageN
>   \reportarrangedpage\arrangedpageN
>   \ifcase\arrangedpageN
>   \or \handlearrangedpageXandY{#1}010\arrangedpageA %  1 rot,hskip,vskip
>   \or \handlearrangedpageXandY{#1}111\arrangedpageA %  2
>   \or \handlearrangedpageXandY{#1}101\arrangedpageA %  3
>   \or \handlearrangedpageXandY{#1}000\arrangedpageA %  4
> \poparrangedpages
>   \fi}
> 
> \setuppapersize [A10][A8]
> \setuparranging [1*4*reversed]
> \setuplayout[margin=0pt, width=fit]
> 
> \showframe
> 
> \starttext
> \dorecurse{8}{\vbox to \textheight{\vfill\midaligned{\tfd ABC}\vfill}\page}
> \stoptext
> ```
> 
> imposition scheme in the garden wiki and tried it out. Now i noticed
> that this sets the imposition scheme for *every* page, but i would like
> to have a different scheme on the second page (1*4), how do i set that
> (if this is even possible)? 
> 
> The result should look like 
> 
> ```
> P4 P1
> R3 R2
> 
> P5 P6
> P7 P8
> ```
> 
> where 5-8 should be on the back of 1-4 (double sided).
> 
> Thanks in advacne for any help :)
> 
> Malte
> ___
> If your question is of interest to others as well, please add an entry to the 
> Wiki!
> 
> maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/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
___


Re: [NTG-context] problem with counters (page)

2020-06-10 Thread Taco Hoekwater
Hi Alan,

Sorry, I should have actually tried your MWE. You do *not* want
way=bypage here, as that resets the counter to one at the start
of the next page (it is useful for footnotes that are numbered
per-page, but not for actual page counters).


\definecounter[volpage][type=page]
\starttext
\setcounter[volpage][5]
\dorecurse{3}{\startTEXpage[offset=2pc]
  \input ward
  \blank[medium]
  
\centerline{\red\tfa\rawcounter[volpage]\incrementcounter[volpage]}
  \stopTEXpage}
\stoptext


> On 10 Jun 2020, at 15:05, Alan Bowen  wrote:
> 
> Hi, Taco—
> 
> Thanks for the suggestion. I have tried it with \incrementcounter before and 
> after the TEXpage. Sadly, neither worked.
> 
> This mwe is an attempt to capture the failure of the following in processing 
> a product with numerous components:
> 
> \definecounter[volpage][type=page, way=bypage]
> \setupfootertexts[text]
>   []
>   [{\centerline{\raise\NumberRaise\hbox{\rawcounter[volpage]}}
>   \incrementcounter[volpage]}]
>   [{\centerline{\raise\NumberRaise\hbox{\rawcounter[volpage]}}
>   \incrementcounter[volpage]}]
>   []  
>  
> If your suggestion had worked, I would have had difficulty in applying it.
> 
> Alan
> 
> On Wed, Jun 10, 2020 at 3:14 AM Taco Hoekwater  wrote:
> Hi,
> 
> Incrementing the counter outside of the TEXpage should work.
> 
> Best wishes,
> Taco
> 
> > On 9 Jun 2020, at 23:34, Alan Bowen  wrote:
> > 
> > My efforts to set up a new page counter in the footertexts of a book are 
> > not proving successful. The following code shows the nature of the problem.
> > 
> > \definecounter[volpage][type=page, way=bypage]
> > \starttext
> > \setcounter[volpage][5]
> > \dorecurse{3}{\startTEXpage[offset=2pc]
> >   \input ward
> >   \blank[medium]
> >   
> > \centerline{\red\tfa\rawcounter[volpage]\incrementcounter[volpage]}
> >   \stopTEXpage}
> > \stoptext
> > 
> > As you will see, the counter is not incremented on pages 2 and 3.
> > 
> > I expect that I have missed something important. But what?
> > 
> > Alan
> > ___
> > If your question is of interest to others as well, please add an entry to 
> > the Wiki!
> > 
> > maillist : ntg-context@ntg.nl / 
> > http://www.ntg.nl/mailman/listinfo/ntg-context
> > webpage  : http://www.pragma-ade.nl / http://context.aanhet.net
> > archive  : https://bitbucket.org/phg/context-mirror/commits/
> > wiki : http://contextgarden.net
> > ___
> 
> 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
> ___

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
___


Re: [NTG-context] problem with counters (page)

2020-06-10 Thread Taco Hoekwater
Hi,

Incrementing the counter outside of the TEXpage should work.

Best wishes,
Taco

> On 9 Jun 2020, at 23:34, Alan Bowen  wrote:
> 
> My efforts to set up a new page counter in the footertexts of a book are not 
> proving successful. The following code shows the nature of the problem.
> 
> \definecounter[volpage][type=page, way=bypage]
> \starttext
> \setcounter[volpage][5]
> \dorecurse{3}{\startTEXpage[offset=2pc]
>   \input ward
>   \blank[medium]
>   
> \centerline{\red\tfa\rawcounter[volpage]\incrementcounter[volpage]}
>   \stopTEXpage}
> \stoptext
> 
> As you will see, the counter is not incremented on pages 2 and 3.
> 
> I expect that I have missed something important. But what?
> 
> Alan
> ___
> If your question is of interest to others as well, please add an entry to the 
> Wiki!
> 
> maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
> webpage  : http://www.pragma-ade.nl / http://context.aanhet.net
> archive  : https://bitbucket.org/phg/context-mirror/commits/
> wiki : http://contextgarden.net
> ___

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
___


[NTG-context] ConTeXt source browser website update

2020-06-07 Thread Taco Hoekwater
Hi all,

I just replaced the software of https://source.contextgarden.net/ by a Lua 
implementation that uses Hans Hagen’s SciTE lexers for syntax highlighting and 
a Lua-generated search index.

There is no official documentation yet (because I may want to change some stuff 
still) but here is some relevant information:

* The search field uses a Lua string pattern to match a single word (no 
multi-word search as of yet). 

  See https://www.lua.org/manual/5.3/manual.html#6.4.1 for the syntax of lua 
string patterns.

* The search index only contains 7-bit ASCII ‘words’ that contain at least one 
of 'a-zA-Z’ (writing an LPEG for unicode matching is a tricky and probably 
would be quite slow even if I could make it work). 

  Still, this should be ok-ish because most of the ConTeXt source is ASCII, 
except for the interface files.

* The files context-en.xml, mtxrun{.lua}, and all of the files in the 
tex/context/patterns subtree are skipped in the search index. Also skipped are 
words shorter than 3 bytes, lua keywords, and words having more than (approx) 
1500 hits

* On the plus side, because of the SciTE lexer, “contextversion’ and 
“\contextversion” are separate entries in the search index. And you can search 
for “\@@kldirection”.

* For text file types that have no SciTE lexer there is no syntax highlighting, 
and binary files are ignored altogether.

The rest of the interface should be self-explanatory.

Suggestions for improvements are welcome.


Index statistics:

4085 files processed, 178 skipped, 3744 with matches
120733 words found
119154 words exported to word.idx
37928 comment words found
36880 words exported to comment.idx
26756 documentation words found
26018 words exported to docs.idx

The word.idx is roughly 11 megabytes.

Have fun,

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
___


Re: [NTG-context] Dangerous bend metafont/post code?

2020-05-27 Thread Taco Hoekwater
Sure, it is a character in manfnt.mf (and there is a pfb version of that as 
well)

Taco

> On 27 May 2020, at 21:20, Gerben Wierda  wrote:
> 
> To honour Donald Knuth, I’ve use his ‘dangerous bend’ (with attribution of 
> course) in one of my publications. But I only had a low res image. Is the 
> code of this symbol available somewhere so I can do it proper justice in a 
> next edition?
> 
> G
> ___
> If your question is of interest to others as well, please add an entry to the 
> Wiki!
> 
> maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/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] Wiki - Proposal to update the Welcome page

2020-05-25 Thread Taco Hoekwater
Hi,

I like the new page layout. It is a big improvement structurally, and great 
work!

Best wishes,
Taco

> On 24 May 2020, at 10:53, Henning Hraban Ramm  wrote:
> 
> 
> 
>> Am 24.05.2020 um 04:06 schrieb Aditya Mahajan :
>> 
>> I am okay with changing the main page as well. But since this is the main 
>> page, let's wait for the other mods to chime in as well.
> 
> Am I a mod? Just a frequent contributor, I guess...
> 
> I like the new main page, it looks very friendly. Myself I never look a lot 
> at the main page but use the search or type the URL directly, since I usually 
> know what I’m looking for...
> 
> Thanks for the efforts though!
> 
> 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
> ___

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
___


Re: [NTG-context] --silent and so on

2020-05-04 Thread Taco Hoekwater


> On 4 May 2020, at 13:35, Thierry Horsin  wrote:
> 
> Hi everybody
> 
> I am a current context user since now many years and in particular I use it 
> with automatic compilation with a bash script detecting any modifications of 
> the .tex file. In order for this to work I used with previous versions
> 
> the --nonstopmode --batchmode --silent --noconsole options
> 
> Now  with the last version appears a single page pdf file with ERROR written 
> on it. Is there a way to have something similar as before ?

I am also eager to find a way to get rid of that ERROR page.

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
___


Re: [NTG-context] Basic font question (Optima, but no bold, no italics). Standalone ConTeXt does not work. TeX Live 2019 works

2020-04-24 Thread Taco Hoekwater
See this link:

https://wiki.contextgarden.net/Mac_Installation


In particular, you need this set of shell commands from that page:

mkdir $HOME/context
cd $HOME/context
rsync -av rsync://contextgarden.net/minimals/setup/first-setup.sh .
sh ./first-setup.sh --modules=all --engine=luatex

but we are currently investigating whether the problem may be binary-related,
because my mkiv started getting issues as well, so that may or may not work.

Also, it is possible that fonts work even though

  mtxrun --script fonts --list --all —pattern

does not list them.

And no, we are not sure why yet.

Taco

> On 24 Apr 2020, at 14:24, Gerben Wierda  wrote:
> 
> 
> 
>> On 24 Apr 2020, at 11:56, Taco Hoekwater  wrote:
>> 
>> Hi,
>> 
>> FYI, my "context mkiv” standalone seems to be fine (latest download). 
>> “lmtx” standalone (also latest download) not so much (same problems).
> 
> Thx. How do I get/install a ‘context mkiv’ standalone? The standalone on 
> http://www.pragma-ade.com/install.htm is only LMTX.
> 
> G
> 
>> 
>> Looks like something is broken in ltmx’ TTC parser.
>> 
>> OS X Catalina 10.15.4
>> 
>> 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
> ___

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
___


Re: [NTG-context] Basic font question (Optima, but no bold, no italics). Standalone ConTeXt does not work. TeX Live 2019 works

2020-04-24 Thread Taco Hoekwater


> On 24 Apr 2020, at 12:14, Benjamin Buchmuller  
> wrote:
> 
> Hi Hraban,
> 
> This might confirm Taco‘s notion that there is some bug lmtx. 

We have moved this off-list for a while. For now, if you have problems with 
lmtx, just
switch back to the regular mkiv standalone.

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
___


Re: [NTG-context] Basic font question (Optima, but no bold, no italics). Standalone ConTeXt does not work. TeX Live 2019 works

2020-04-24 Thread Taco Hoekwater
Hi,

FYI, my "context mkiv” standalone seems to be fine (latest download). 
“lmtx” standalone (also latest download) not so much (same problems).

Looks like something is broken in ltmx’ TTC parser.

OS X Catalina 10.15.4

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
___


Re: [NTG-context] METAPOST: How do I get this 'max' cutafter to work?

2020-04-22 Thread Taco Hoekwater
Hi,

> On 21 Apr 2020, at 17:52, Gerben Wierda  wrote:
> 
>> pair a ; a := arrowHead intersection_point connection ;

Hans’ example also works with “intersectionpoint”: the differences between 
intersectionpoint
and intersection_point are minimal except if there is no intersection at all.

The trick is that Hans does not use cutafter. cutafter is designed to cut off 
as little as 
possible, it is a cutbefore on both paths reversed. So, uses the last 
intersection point of 
the paths, and in this case it will therefore use the top of the arrowhead. 

In contrast, intersectionpoint finds the first intersection on the non-reversed 
paths, which 
is the base of the arrowhead.

Alternatively (in this case), you could move the arrowhead up a tiny amount, so 
that there is 
only one intersection between the connection and arrowHead.

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
___


Re: [NTG-context] Best way to create a large number of documents from database

2020-04-16 Thread Taco Hoekwater


> On 16 Apr 2020, at 11:12, Mojca Miklavec  
> wrote:
> 
> Hi,
> 
> I have been asked to create a few thousand PDF documents from a CSV
> "database" today (which I can easily transform into any other form,
> like XML or a lua table or TeX definitions or whatever).
> 
> Generating a few thousand pages would be straightforward, but I'm sure
> there are some clever ways to handle this scenario as well, I'm just
> not aware of them :)

In CPU cycles, the fastest way is to do a single context —once
run generating all the pages as a single document, then using
mutool merge to split it into separate documents using a (shell)
loop.

Starting up mutool is much faster than starting context, even with lmtx.


> One option is that I quickly draft a python script that creates a few
> thousand TeX documents and compiles them individually, but it might be
> easier if there was a way to just create a single template document
> and then run something like
>context --some-params --N=42 --output=document-0042.pdf template.tex
> or something along those lines.

If you want to go this route (and you may have to if not each record
fits exactly within a single page), browse back a day or so in the mailing
list archive for Gerben’s question about 

  “Using command line values in a TeX document; writing a script?"

The replies offer various options using either lua or tex code
to get at user-supplied arguments from the commandline.

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
___


Re: [NTG-context] Using command line values in a TeX document; writing a script?

2020-04-14 Thread Taco Hoekwater


> On 14 Apr 2020, at 11:25, Gerben Wierda  wrote:
> 
> This helps for adding information to my processing. 
> 
> What I was also looking for is that I don’t have a test.tex anymore, just the 
> XML file I am parsing and a command line action.
> 
> So, I use mtxrun, give it the name of an XML. lua code (using a ’script’ 
> somewhere?) reads the XML, extracts a name (e.g. ‘foo’) from it, creates a 
> .tex file (e.g. ‘foo.tex’), produces a .pdf file from that .tex file (e.g. 
> ‘foo.pdf').

When processing XML, I normally use 
  
   context —environment=whatever.tex file.xml

with whatever.tex being a mix of tex and lua to setup and process the XML 
directly,
perhaps including other XML files as needed.

But when you need to extract stuff and rename files, a Makefile or shell script
comes more naturally (at least for me).

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
___


Re: [NTG-context] Using command line values in a TeX document; writing a script?

2020-04-14 Thread Taco Hoekwater
Hi Gerben,

What you want is quite easy to do since you are using lua already. Try this:

  % context --whatever=green test

with test.tex:

  \starttext
  \startluacode
  table.print(environment.arguments)
  \stopluacode
  \stoptext

everything from the command line ends up in environment.arguments.

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
___


Re: [NTG-context] Why does this example from the MetaFun manual not work?

2020-04-09 Thread Taco Hoekwater
Hi,

Using multiple (text ) arguments in macros doesn’t work, you would 
need to convert all but the last argument into (expr ) somehow.

That means that you probably cannot do a call like the one below at all.
(I, at least, do not see how you could convert one of those transparent 
colours into an expr  argument)

> 
> SampleText ("Much Of This", transparent(1, .5, red  ) , transparent(1, .5, 
> green  )) ;

The situation may get even trickier because withtransparency() and
transparent() both use a  (text ) argument internally as well,
and I am not quite sure why.

At this point, I think you may need Hans for advice, sorry.

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
___


Re: [NTG-context] Why does this example from the MetaFun manual not work?

2020-04-09 Thread Taco Hoekwater
Hi Gerben,

Changing the macro header to this will work:

   vardef SampleText (expr t)(text c) =

or you can use the answer from stackexchange, same approach.

BTW Hans would like people to use “withtransparency” instead as that is a 
newer, more flexible approach (but that would also need the above change,
or a split into multiple parameters).

Taco


> On 9 Apr 2020, at 09:04, Gerben Wierda  wrote:
> 
> Nobody?
> 
>> On 8 Apr 2020, at 12:20, Gerben Wierda  wrote:
>> 
>> I would like to use the result of transparent() straight in my macros, so I 
>> can pass the colors with transparency using a single parameter. That should 
>> be possible if I understand the MetaFun manual (where I’ve copy-pasted this 
>> example from):
>> 
>> \starttext
>> \startMPpage[instance=doublefun]
>> 
>> vardef SampleText (expr t, c) =
>>   save p ; picture p ;
>>   p := image (draw t infont "\truefontname{Regular}") ;
>>   draw (p shifted (- xpart center p,0)) scaled 5 withcolor c;
>> enddef ;
>> SampleText ("Much Of This"   , transparent(1, .5, red  )) ;
>> SampleText ("Functionality"  , transparent(1, .5, green)) ;
>> SampleText ("Was Written", transparent(1, .5, blue )) ;
>> SampleText ("While Listening", transparent(1, .5, cmyk(1,0,0,0))) ;
>> SampleText ("To the CD's Of" , transparent(1, .5, cmyk(0,1,0,0))) ;
>> SampleText ("Tori Amos"  , transparent(1, .5, cmyk(0,0,1,0))) ;
>> 
>> \stopMPpage
>> \stoptext
>> 
>> But it results in:
>> 
>> system  > files > jobname 'testcolor', input './testcolor', result 
>> 'testcolor'
>> fonts   > latin modern fonts are not preloaded
>> languages   > language 'en' is active
>> open source > level 2, order 3, name './testcolor.tex'
>> fonts   > preloading latin modern fonts (second stage)
>> fonts   > 'fallback modern-designsize rm 12pt' is loaded
>> metapost> initializing instance 'doublefun:1' using format 'metafun' 
>> and method 'double'
>> metapost> loading 'metafun' as 
>> '/usr/local/context-osx-64/tex/texmf-context/metapost/context/base/mpiv/metafun.mpxl'
>>  using method 'double'
>> metapost> initializing number mode 'double'
>> metapost log> 
>> metapost log> loading metafun, including plain.mp version 1.004 for 
>> metafun iv and xl
>> metapost log> 
>> metapost log> ! Missing ')' has been inserted.
>> metapost log>  
>> metapost log>withprescript
>> metapost log> transparent->(1)withprescript
>> metapost log>  
>> "tr_alternative="_alternat...
>> metapost log> <*> ... ("Much Of This" , transparent(1, .5, red )
>> metapost log>   ) ; 
>> SampleText ("Functiona...
>> metapost log> 
>> backend > xmp > using file 
>> '/usr/local/context-osx-64/tex/texmf-context/tex/context/base/mkiv/lpdf-pdx.xml'
>> pages   > flushing realpage 1, userpage 1, subpage 1
>> close source> level 2, order 3, name './testcolor.tex'
>> close source> level 1, order 3, name 'cont-yes.mkiv'
>> 
>> For me, it is not about passing colour on to ConTeXt to typeset text, these 
>> are colors that normally would be drawn with “withcolor ca withtransparency 
>> (method,factor)” but that requires the passing of many more parameters and a 
>> lot more work in coding.
>> 
>> Does transparent() maybe produce a string that looks like “ca 
>> withtransparency (method,factor)” so something only usable in draw/fill/etc 
>> statements? But in that case how does that work without scantokens to parse 
>> the string?
>> 
>> Is there a way I can do this without having twice the parameters (and I have 
>> to pass multiple colours)  in my macros everywhere?
>> 
>> Thanks,
>> 
>> G
>> ___
>> If your question is of interest to others as well, please add an entry to 
>> the Wiki!
>> 
>> maillist : ntg-context@ntg.nl / 
>> http://www.ntg.nl/mailman/listinfo/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] startMPpage..stopMPpage written to a separate PDF?

2020-04-06 Thread Taco Hoekwater


> On 5 Apr 2020, at 12:27, Gerben Wierda  wrote:
> 
> Alternatively, I could have a step before this to turn the input XML into 
> many separate XMLs and have many ConTeXt runs. Probably that is the best way 
> to do it. Each generated XML would have all of the original XML except it 
> would only have one ‘view’ in it and the rest removed.

Or you could write out a shell script while processing the run. 

function moduledata.archimate(filename)
  local root = xml.load(filename)
  warnIfVerbose( "Processing %s", filename)
  local shfile = io.open(tex.jobname.. ".sh", "w")
  local i = 1
  for view in xml.collected(root,"diagrams/view") do
local viewName = xml.text(view,"/name")
shfile:write(string.format('mutool merge -o "%s.pdf" %s "%s.pdf" ', 
viewName, i, tex.jobname))
i = i + 1
….
  end
  shfile:close()

and process that shell script at the end of the run.


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

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/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] Issue with rendering arrows in lmtx

2020-03-17 Thread Taco Hoekwater


> On 17 Mar 2020, at 15:51, Jan-Erik Hägglöf  wrote:
> 
> Hi All!
> 
> When I invoke this command
> 
> \startMPcode 
> picture p ; p := lmt_svg [ filename ="pil.svg" ];
> draw p;
> \stopMPcode
> 
> I get weird results, the arrowhead points in wrong direction


That one is because lmt_svg does not properly consider the 

> orient=“auto"

in the marker definition. I played with setting it to actual angles,
and then the output is ok.

> and is very tiny compared to the size it was meant to have.

The path in the marker has its own transform, and that seems to be
ignored by lmt_svg. (I do not see how a scale of (-1.1,-1.1) would
make it that much bigger, but I know that manually altering the values 
does nothing, so I guess that must be it).

No solution, but I hope this helps Hans somewhat...

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
___


Re: [NTG-context] METAPOST vardef returning multiple and non-numeric types as a single answer?

2020-03-16 Thread Taco Hoekwater


> On 16 Mar 2020, at 10:10, Taco Hoekwater  wrote:
> 
> 
> 
>> On 16 Mar 2020, at 09:53, Gerben Wierda  wrote:
>> 
>> Hola! So, the arguments passed to macros are by reference and not by value? 
>> I could have known of course, they are simple expansions, but I’d like to be 
>> sure. IfI assign to a variable inside a vardef macro and that variable is 
>> not ’save’d I’m changing the original?
> 
> Yes. (A simple test would have confirmed that)

Oops, sorry, no! I was wrong on that… it must be too early for me.

  vardef Foo(text y) = 
scantokens(y&":=5”);
  enddef;
  Foo("x");

This would work, but that is weird. This also works, and that is why
I had the erroneous memory that it would work always:

  vardef Foo(expr a)(text y) = 
y[a] := 5;
  enddef;
  numeric foo[]; 
  foo[1] = 6;
  Foo(1,foo);

or you could use global variables, of course.

Main point: Metapost is not an easy language to grasp. If you want to
really understand how it works, you should study the Metafont book by DEK.
As you can clearly see, even experienced users are likely to make mistakes.


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
___


Re: [NTG-context] METAPOST vardef returning multiple and non-numeric types as a single answer?

2020-03-16 Thread Taco Hoekwater


> On 16 Mar 2020, at 09:53, Gerben Wierda  wrote:
> 
> Hola! So, the arguments passed to macros are by reference and not by value? I 
> could have known of course, they are simple expansions, but I’d like to be 
> sure. IfI assign to a variable inside a vardef macro and that variable is not 
> ’save’d I’m changing the original?

Yes. (A simple test would have confirmed that)

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
___


Re: [NTG-context] Why do I see the outline of the green box in this METAPOST code?

2020-03-16 Thread Taco Hoekwater
Move the fills to within the image(), and build it up in
stacking order. 


> On 14 Mar 2020, at 16:29, Gerben Wierda  wrote:
> 
> Code:
> 
> vardef Foo(expr w, h, lh) =
>save pth; path pth;
>save pthtwo; path pthtwo;
>save pththree; path pththree;
>save pic; picture pic;
>pth = fullsquare xysized (w, h);
>pthtwo = fullsquare xysized (2*lh, lh) shifted (-w/2, 2.5*lh);
>pththree = fullsquare xysized (2*lh, lh) shifted (-w/2, lh);
>fill pth withcolor green;
>fill pthtwo withcolor yellow;
>fill pththree withcolor yellow;
>pic := image (
>draw pth;
>draw pthtwo;
>draw pththree;
>);
>% setbounds pic to pth;
>pic
> enddef ;
> 
> 
> Call:
> 
> \startMPpage
> 
> picture s ; s := Foo(8cm, 2cm, 0.25cm);
> 
> draw s;
> 
> drawdot center leftboundary  s withpen pencircle scaled 2 withcolor green;
> drawdot center rightboundary s withpen pencircle scaled 2 withcolor blue;
> drawdot point .25 along topboundary s withpen pencircle scaled 2 withcolor 
> yellow;
> drawdot .25[llcorner s, lrcorner s] withpen pencircle scaled 2 withcolor 
> magenta;
> drawdot origin  withpen pencircle scaled 4 withcolor red;
> 
> \stopMPpage
> 
> 
> Output:
> 
> 
> 
> Why is the outline of the green box visible in the yellow boxes? And how can 
> I prevent this from happening?
> ___
> If your question is of interest to others as well, please add an entry to the 
> Wiki!
> 
> maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/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
___


Re: [NTG-context] METAPOST vardef returning multiple and non-numeric types as a single answer?

2020-03-16 Thread Taco Hoekwater


> On 15 Mar 2020, at 11:22, Gerben Wierda  wrote:
> 
> I would like a vardef macro to return the pair of a picture and a bounding 
> box. I don't want to use the setbound operator, because as soon as I do that, 
> I cannot access the components of the picture anymore with pathpart.
> 
> I found metapost vardef returning multiple values on StackExchange but that 
> is about returning multiple values of the same numeric type. Is it possible 
> to have vardef return a set of (picture, path) or (picture, picture) in some 
> way? If not, I need to make two vardef macros for each result type.

Sure, using that same endgroup,begingroup trick. But since there is no 
multi-assignment in metapost that doesn’t you help much.
Either two separate vardefs or passing the to-be-assigned variable(s) as an 
extra argument(s) are generally more practical.

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
___


Re: [NTG-context] Can I share METAPOST vardefs over multiple pages?

2020-03-13 Thread Taco Hoekwater
Hi,



> On 13 Mar 2020, at 12:53, Gerben Wierda  wrote:
> 
> Suppose I have this code:
> 
> 
> Can I reuse that varied across follow-up MPPages?

Sure, put the vardef inside \startMPinclusions:

\startMPinclusions
vardef MyShape(expr w, h) =
   ...
enddef ;
\stopMPinclusions
\startMPpage
picture s ; s := MyShape(4cm, 2cm);

draw s;
 . . .
\stopMPpage

\startMPpage
picture s ; s := MyShape(8cm, 4cm);

draw s;
 . . .
\stopMPpage


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
___


Re: [NTG-context] SOLVED Re: \bTABLE bug, please help !

2020-03-10 Thread Taco Hoekwater


> On 10 Mar 2020, at 16:20, Hans Hagen  wrote:
> 
> On 3/10/2020 3:07 PM, Taco Hoekwater wrote:
>> Hi,
>> Never mind, I got it (starting at \loggingall output for a while). This
>> patch to my input fixes it:
>>   \unprotect
>>   \setupfootertexts[{\tabl_ntb_next_level \getbuffer[mytable] 
>> \tabl_ntb_prev_level}]
>>   \protect
> 
> you beat me on this ... (still puzzled because nesting shoudl kind of work)

Well, they are not _really_ nested, which is the problem, of course.

> I'll add this:
> 
> %D This is for the special cases where for instance a table is in a header or 
> footer
> %D line and we have a split table in progress. (See mail to list from Taco.)
> 
> \unexpanded\def\bTABLEnested{\tabl_ntb_next_level\bTABLE}
> \unexpanded\def\eTABLEnested{\eTABLE\tabl_ntb_next_level}

That last macro should be \tabl_ntb_prev_level ;)

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
___


[NTG-context] SOLVED Re: \bTABLE bug, please help !

2020-03-10 Thread Taco Hoekwater
Hi,

Never mind, I got it (starting at \loggingall output for a while). This
patch to my input fixes it:

  \unprotect
  \setupfootertexts[{\tabl_ntb_next_level \getbuffer[mytable] 
\tabl_ntb_prev_level}]
  \protect

Best wishes,
Taco

> On 10 Mar 2020, at 14:47, Taco Hoekwater  wrote:
> 
> Hi,
> 
> Please see the attached example. The \bTABLE in the footer of the page 
> ‘inherits' the
> first line of the split \bTABLE in the running text. I have no idea how to 
> fix this
> or why this even happens. Help!
> 
> I’ll need a way to work around this problem in my current ConTeXt 
> installation for
> this project. That is now nearly 4 years old, but the same bug is still 
> happens with
> a new beta of mkiv.
> 
> I cannot switch to \startxtable because I would need \startembeddedxtable, 
> and that
> has way too many limitations to be useful in this project.
> 
> 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
> ___

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
___


[NTG-context] \bTABLE bug, please help !

2020-03-10 Thread Taco Hoekwater
Hi,

Please see the attached example. The \bTABLE in the footer of the page 
‘inherits' the
first line of the split \bTABLE in the running text. I have no idea how to fix 
this
or why this even happens. Help!

I’ll need a way to work around this problem in my current ConTeXt installation 
for
this project. That is now nearly 4 years old, but the same bug is still happens 
with
a new beta of mkiv.

I cannot switch to \startxtable because I would need \startembeddedxtable, and 
that
has way too many limitations to be useful in this project.

Best wishes,
Taco




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
___


Re: [NTG-context] mtxrun

2020-02-10 Thread Taco Hoekwater
Hi,

> On 10 Feb 2020, at 11:54, Rudolf Bahr  wrote:
> 
> Please, what is to be done?

This usually happens when the mtxrun script you call is not in its ’normal'
tree location. It uses its own location to find the rest of its files.

For example, one of my context trees has mtxrun in:

  ~/elvenkind/tex_2014/tex/texmf-osx-64/bin/mtxrun

and then it works fine. But If I were to move it to e.g. 

  ~/bin/mtxrun

it would (likely) fail to find any files.

Best wishes,
Taco

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
___


Re: [NTG-context] checking whether file is landscape or portrait

2020-01-28 Thread Taco Hoekwater
Hi Pablo,

I have had lots of problems with getting the correct figure dimensions
for external images. In the end, I now use the code below. It is just
as low-level and much more inefficient than your code, but it has not 
failed me yet.

  \newdimen\MYfigurewidth
  \newdimen\MYfigureheight
  \unexpanded\def\MYgetfiguredimensions
{\dodoubleempty\MYdogetfiguredimensions}
  
  \def\MYdogetfiguredimensions[#1][#2]%
{\setbox0=\hbox{\externalfigure[#1][#2]}%
 \MYfigurewidth=\wd0
 \MYfigureheight=\ht0 } 

And used like:

   \MYgetfiguredimensions[cow.pdf][page=1]
   \ifdim\MYfigurewidth>\MYfigureheight
   …
   \fi

and I only use Hans’ \getfiguredimensions when I need to know a pdf page count.

It is not that Hans’ macro is bad, but external figures (especially PDF, 
but also PNGs) can be very misbehaved.

Actually forcing the inclusion into a box is crude but at least it will 
always return results identical to any actual desired inclusion.

Best wishes,
Taco

> On 28 Jan 2020, at 16:51, Pablo Rodriguez  wrote:
> 
> Dear list,
> 
> I have to check whether an external PDF document is portrait or
> landscape (in order to manipulate it in different ways).
> 
> From what I understand of grph-inc.mkiv, I came with the following sample:
> 
>\unprotect
>\def\figureXSize{\clf_figurestatus{width}{}}
>\def\figureYSize{\clf_figurestatus{height}{}}
>\protect
> 
>\setupexternalfigures[location=default]
>\starttext
>\getfiguredimensions[cow.pdf]
>\figuresize\\
>\figurelabel\\
>\figureXSize\\
>\figureYSize\\
>\ifnum\figureXSize<\figureYSize portrait\else landscape\fi
>\stoptext
> 
> I feel bad of abusing the ConTeXt source in such a miserable way. But
> I’m afraid this is the best I can.
> 
> Is there no standard way to check portrait or landscape on a given
> figure? A conditional for that would be useful.
> 
> At least, I would like to know how to get image dimension numbers
> suitable to be deployed with \ifnum.
> 
> 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
> ___

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
___


Re: [NTG-context] characterspacing not always working in LMTX

2020-01-15 Thread Taco Hoekwater


> On 15 Jan 2020, at 10:15, Hans Hagen  wrote:
> 
>> By the way, thin spaces are not specific to French typography, historically 
>> speaking, since they seem to have been used everywhere in Europe for 
>> centuries — at least in England, Belgium, Germany and Italy (probably in the 
>> Netherlands too, I will check). In France and sometimes in England, thin 
>> spaces were often used before commas as well. I wonder why most countries 
>> stopped using them. Out of laziness ? :-)
> never seen them in dutch ... i think not so much lazyness but side effect of 
> going digital ... i bet that these spaces were also (ab)used to justify lines 
> (cheat a bit) i.e. manual injection of some lead blob

Dutch typesetting had some rules for thin spaces in a transition period from 
full spaces (early) to no spaces (modern).

Much of this change happened in the (late) 19th century, so I guess it had more 
to do with linotype/monotype than with modern digitisation.

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
___


Re: [NTG-context] developer not verified error

2019-11-19 Thread Taco Hoekwater


> On 18 Nov 2019, at 22:25, Alan Bowen  wrote:
> 
> This seems to be a problem peculiar to Catalina (macOS 10.15.1). There is a 
> fix, as Otared and Glen have indicated.
> 
> go to Apple menu -> Preferences -> Security & Privacy
>   on the Security & Privacy, login, choose the tab General
>   there choose, towards the bottom of that pane, under « Allow apps 
> downloaded from: » 
>choose the radio button App Store and identified developers
>click the button «allow anyway»

There is a easier / safer way: open de folder with ‘mtxrun’ in it using Finder. 
Then select 
‘Open’ from the popup menu on the mtxrun executable. That will give you dialog 
with that 
’This app was downloaded …’ error, but now with an extra ‘Open’ button on it. 
Click that,
and it will start mtxrun once. Running mtxrun itself this ways is pointless, 
but it makes
Apple start to remember that *you* trust this mtxrun binary, and from now on it 
can be
used normally.

On packaged distributed Apps you download from the web, you can also hold down 
CTRL while 
opening the App so you don’t have to do the Finder step, but I am not certain 
that works with
command-line binaries (and cannot test any more since I already did the ‘fix’ 
above).

It is a bit tedious, but sort of I see Apple’s point. Making it harder to run 
downloaded
unsigned executables is probably a good thing.


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
___


Re: [NTG-context] Cross references to column numbers

2019-11-15 Thread Taco Hoekwater


> On 15 Nov 2019, at 16:31, Taco Hoekwater  wrote:
> 
> But that outer \numexpr rounds instead of truncates. so anything that
> is past halfway   of the column is rounded too far up. This fixes it
 ^ horizontally

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
___


Re: [NTG-context] Cross references to column numbers

2019-11-15 Thread Taco Hoekwater
>>>> can't see how I can get this information.
>>>>>> 
>>>>>> For an example, see the question posted by me at stackexchange:
>>>>>> https://tex.stackexchange.com/questions/502944/context-cross-references-to-column-numbers
>>>>>>  
>>>>>> 
>>>>>> Besides, I am wondering, regarding the generally very regular and 
>>>>>> consistent naming of commands in ConTeXt, why this is not so in the case 
>>>>>> of references. For example, to refer to a page, I need \pagereference 
>>>>>> (for the target) and \at (for the reference); to refer to a line, I need 
>>>>>> \someline (for the target) and \inline (for the reference), but only if 
>>>>>> I want it to automatically add the word "line" or something else before 
>>>>>> the number, otherwise I have to use \inlinerange. It took me some time 
>>>>>> to find that out. Wouldn't it be easier to have just one command for the 
>>>>>> target and another one for the reference, and everything else, as 
>>>>>> counters and headers to be returned, text to be added etc. to be 
>>>>>> configured by options?
>>> Because all these \in \at \about ... give back different things (a title, a 
>>> number, a range, a ...) and packaging all that in one macro doens't make it 
>>> cleaner so soon users will then wrap complex calls in a macro of their own 
>>> (which then can clash with some existing name).
>>> 
>>> Also, the ref mechanism evolved over decades and we're not going to drop 
>>> compatibility.
>>> 
>>> 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
>>> ___
>>>  
>> 
> -- 
> Dr. Oliver von Criegern
> Referat für IT und Digital Humanities
> Bayerische Akademie der Wissenschaften
> Alfons-Goppel-Str. 11
> 80539 München
> Tel.: 089-23031-1310
> 
> ___
> If your question is of interest to others as well, please add an entry to the 
> Wiki!
> 
> maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/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
___


Re: [NTG-context] Math symbol for inexact differential

2019-11-13 Thread Taco Hoekwater
Like this?

\def\dbar{\mathop{\text{\it đ}}}

I do not know whether you want it to be \mathop or \mathord

> On 13 Nov 2019, at 10:35, w n  wrote:
> 
> Can you give an example on how to use đ  (U+00111) in  \def\dbar{ ... }

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
___


  1   2   3   4   5   6   7   8   9   10   >