Re: [NTG-context] \pagewidth undefined?

2020-05-19 Thread Gerben Wierda
the page width and page height dimens for use in my macros. G > On 19 May 2020, at 11:58, Gerben Wierda wrote: > > Why doesn't > > \starttext > \externalfigure[foo.pdf][width=\pagewidth] > \stoptext > > work? Without

[NTG-context] Can someone explain the \startuseMPgraphic interface to me?

2020-05-19 Thread Gerben Wierda
In details.pdf, I encounter \startuseMPgraphic{mpos:par:columnset:shade} numeric h ; for i=1 upto nofmultipars : h := bbheight(p) ; if multikind[i] = "single" : fill multipars[i] topenlarged -.5h When I encounter that, I wonder: - where do nofmultipars, p,

[NTG-context] Looking for a way to use lua to output console/debug messages from MetaPost instead of 'show'

2020-05-18 Thread Gerben Wierda
I often need some debugging info to find out what is going on in my METAPOST code (as I often do not have exact knowledge of what some things do). MetaPost’s ‘show’ command has limited formatting functionality (e.g. I would like to add a number as a string to a show message instead of putting

[NTG-context] What is required to make \setuplayout work?

2020-05-17 Thread Gerben Wierda
I’ve been trying to define a layout that just has a 5mm no-printing edge around the paper and has all the rest for \textwidth and \textheight. No header, footer, pagenumber, etc. Just as much space as I can get out of a standard A4. But the following (following the manual and ConTeXtgarden):

[NTG-context] Building a page based on exact location of graphical elements (PDF)

2020-05-17 Thread Gerben Wierda
What is the simplest way to build a page based on positioning of external images? Some of these images are page-sized (so take up an entire page, though I might want to overlay some other text boxes and MP graphics). I’ve been trying to find a good explanation/introduction into layers (which I

[NTG-context] \goto not working from within \textext()

2020-05-16 Thread Gerben Wierda
This does give me ythe look of a link, but not a working link. Outside of textext() it works. Is there a way to get a working link in a MetaFun picture? Thx, G \setupinteraction [state=start, color=blue, style=bold] \starttext

Re: [NTG-context] Using transparency in METAPOST within textext()

2020-05-14 Thread Gerben Wierda
Thank you. That works. > On 14 May 2020, at 17:13, Wolfgang Schuster > wrote: > > Gerben Wierda schrieb am 14.05.2020 um 11:47: >> Is it possible to get a transparent background in a textext()? The following >> minimal example doesn’t work. >> \starttext >>

[NTG-context] Using transparency in METAPOST within textext()

2020-05-14 Thread Gerben Wierda
Is it possible to get a transparent background in a textext()? The following minimal example doesn’t work. \starttext \setupMPpage [background=color, backgroundcolor=gray] \startMPpage draw

[NTG-context] Is it possible to make xml.load a bit more 'verbose' when it encounters errors?

2020-05-13 Thread Gerben Wierda
I am loading an xml.file. I sometimes make mistakes editing that file and then xml.load creates a string that contains invalid xml file - parsed text At that point I check my file and sometimes (like now) I cannot find the error. Is there a way to make xml.load somewhat more verbose about

[NTG-context] \goto works but links don't when passed via textext() in METAPOST

2020-05-10 Thread Gerben Wierda
I am trying to get an URL link in a textext() via METAPOST. I’ve got this before \starttext (or after, tried both): \setupinteraction [state=start, color=blue, style=bold] The intended link shows up in blue and bold, but it is not clickable. I’ve turned ConTeXt tracing on and see

[NTG-context] Would it be possible in LMTX to do something like variable font/lineheight to fit a fixed frame?

2020-05-10 Thread Gerben Wierda
Suppose I have a fixed sized frame, say 3 y 4 cm. And I have a variable-length text. Would it be possible to write a macro that scaled the font and line height such that the text will fit in the frame? What I have now is very basic: Fixed width Typeset (METAPOST textext())

Re: [NTG-context] METAPOST subpath rounding issue

2020-05-10 Thread Gerben Wierda
> On 10 May 2020, at 00:01, Bruce Horrocks wrote: > >> You can save extracting the xparts and yparts by using direct subtraction of >> pairs and comparing with (0,0) like this: > > Aaaargh, no, ignore that, it's nonsense. It's amazing how you can stare at > something for minutes but only see

Re: [NTG-context] METAPOST subpath rounding issue

2020-05-08 Thread Gerben Wierda
> On 8 May 2020, at 00:46, n...@scorecrow.com wrote: > > > >> On 7 May 2020, at 20:28, Gerben Wierda wrote: >> >> I have a METAPOST algorithm that splits a path at a certain time in two, >> does something with both ends (not the ends where they w

[NTG-context] METAPOST subpath rounding issue

2020-05-07 Thread Gerben Wierda
I have a METAPOST algorithm that splits a path at a certain time in two, does something with both ends (not the ends where they were split) and then rejoins them. In very rare cases this crashes, because the subpath doesn’t work as expected. firstPart := subpath (0,halfWayTime) of

Re: [NTG-context] How do I add cyrillic to my typescript/document?

2020-05-04 Thread Gerben Wierda
On 4 May 2020, at 12:13, Pablo Rodriguez wrote: > > On 5/4/20 12:36 AM, Gerben Wierda wrote: >> [...] >> It could help if I would understand ConTeXt better. The link gives me a >> grammar for a command, but doesn’t tell me what to put in. >> >> I tried many,

Re: [NTG-context] lmt_followtext crashes while standard followtext itself works

2020-05-04 Thread Gerben Wierda
> we can patch this > >if ad <> origin : rotated(angle(ad)) fi > > in mp-blob.mpiv but I expect you to test if all still works then Applied and tested, it works fine. And it also provided me with an insight about if:else:fi that was slow in coming but now that I see it, I

Re: [NTG-context] How do I add cyrillic to my typescript/document?

2020-05-03 Thread Gerben Wierda
On 3 May 2020, at 15:55, Pablo Rodriguez wrote: > > On 5/3/20 2:56 PM, Gerben Wierda wrote: >> ConTeXtgarden had theanswer when I searched again: >> >> \setupbodyfont[dejavu] >> \mainlanguage[russian] > > Hi Gerben, > > I’m afraid they may be differ

[NTG-context] lmt_followtext crashes while standard followtext itself works

2020-05-03 Thread Gerben Wierda
The following example has been extracted from my automatically generated MP code. \starttext \startMPpage string texstring; texstring := "{\colored [r=0.00, g=0.00, b=0.00]{\definebodyfont [9.0pt][rm][default=Regular at 9.0pt]\switchtobodyfont [9.0pt]\setupinterlinespace [9.9pt]\tf E.g.

Re: [NTG-context] followtext, lmt_followtext and an offset of the glyphs typeset along the path (suggestion works)

2020-05-03 Thread Gerben Wierda
> On 3 May 2020, at 15:01, Gerben Wierda wrote: > >>>>> Am 01.05.2020 um 10:26 schrieb Gerben Wierda >>>> <mailto:gerben.wie...@rna.nl>>: >>>>> >>>>> I have been looking at lmt_followtext and followtext to get typesett

Re: [NTG-context] followtext, lmt_followtext and an offset of the glyphs typeset along the path

2020-05-03 Thread Gerben Wierda
>>>> Am 01.05.2020 um 10:26 schrieb Gerben Wierda : >>>> >>>> I have been looking at lmt_followtext and followtext to get typesetting >>>> done along a path. That works fine, except that in my case, I need the >>>> text to not be

[NTG-context] How do I add cyrillic to my typescript/document?

2020-05-03 Thread Gerben Wierda
I am looking for a way to amend a typescript for the additional use of cyrillic characters. I currently use: \starttypescript [sans] [optima] \setups[font:fallback:sans] \definefontsynonym [Sans] [file:Optima.ttc(Optima Regular)] [features=default] \definefontsynonym

Re: [NTG-context] How do I add cyrillic to my typescript/document?

2020-05-03 Thread Gerben Wierda
ConTeXtgarden had theanswer when I searched again: \setupbodyfont[dejavu] \mainlanguage[russian] G > On 3 May 2020, at 13:34, Gerben Wierda wrote: > > I am looking for a way to amend a typescript for the additional use of > cyrillic characters. > > I currently use: >

Re: [NTG-context] module article-basic interferes with \definebodyfont?

2020-05-01 Thread Gerben Wierda
> use pagella math with optima, not modern > Zo? \definetypeface [optima] [mm] [math] [pagella] [default] Ik gok, want documentatie die dat helder maakt heb ik niet. Er is geen uitleg in de manuals die bij de standalone context komen en op ContextGarden vond ik vooral mkii zaken die niet meer

Re: [NTG-context] module article-basic interferes with \definebodyfont?

2020-05-01 Thread Gerben Wierda
On 1 May 2020, at 16:02, Wolfgang Schuster wrote: > > Gerben Wierda schrieb am 01.05.2020 um 13:58: >> \definetypeface [optima] [ss] [sans] [optima] [default] >> \definetypeface [optima] [rm] [serif] [optima] [default] >> \definetypeface [optima] [tt]

Re: [NTG-context] followtext, lmt_followtext and an offset of the glyphs typeset along the path

2020-05-01 Thread Gerben Wierda
> On 1 May 2020, at 17:10, Henning Hraban Ramm wrote: > > > >> Am 01.05.2020 um 10:26 schrieb Gerben Wierda : >> >> I have been looking at lmt_followtext and followtext to get typesetting done >> along a path. That works fine, except that in my case, I

Re: [NTG-context] Reverse traversing of xml.collected()?

2020-05-01 Thread Gerben Wierda
> On 1 May 2020, at 13:30, Hans Hagen wrote: > > On 5/1/2020 11:31 AM, Gerben Wierda wrote: >> I’d like to travese the contents of an xml.collected() in a reverse order. I >> have >> for connectionFromXML in xml.collected(viewFromXML,"/connection&

Re: [NTG-context] module article-basic interferes with \definebodyfont?

2020-05-01 Thread Gerben Wierda
> On 1 May 2020, at 13:22, Wolfgang Schuster > wrote: > > Gerben Wierda schrieb am 01.05.2020 um 13:15: >> The following code: >> \enabletrackers[context.trace] >> %\usemodule[article-basic] >> \starttypescript [sans] [optima] >>\setups[font:fal

Re: [NTG-context] How do I get an empty line in a \framed[align=flushleft]{} item?

2020-05-01 Thread Gerben Wierda
> On 1 May 2020, at 13:28, Hans Hagen wrote: > > On 5/1/2020 10:21 AM, Gerben Wierda wrote: >> code it back to a \ ? E.g. something like >>{ ‘\U{XXX}', '\' }, > \utfchar{100} > \Uchar 100 Yes, but the question was: how do I code this in the XML and get it t

[NTG-context] module article-basic interferes with \definebodyfont?

2020-05-01 Thread Gerben Wierda
The following code: \enabletrackers[context.trace] %\usemodule[article-basic] \starttypescript [sans] [optima] \setups[font:fallback:sans] \definefontsynonym [Sans] [file:Optima.ttc(Optima Regular)] [features=default] \definefontsynonym [SansBold]

Re: [NTG-context] How do I get an empty line in a \framed[align=flushleft]{} item?

2020-05-01 Thread Gerben Wierda
> On 1 May 2020, at 09:38, Hans Hagen wrote: > > On 5/1/2020 1:44 AM, Gerben Wierda wrote: >>{ ‘\n', ‘\\strut' }, > often a \zwj or \zwno also works ok (has zero dimensions, contraty to strut; > you could also try \crlf I tried \crlf{} and that worked too (

[NTG-context] Reverse traversing of xml.collected()?

2020-05-01 Thread Gerben Wierda
I’d like to travese the contents of an xml.collected() in a reverse order. I have for connectionFromXML in xml.collected(viewFromXML,"/connection") do parseXMLConnection( rootFromXML, connectionFromXML, viewFromXML, rootFromOverrideXML) end I tried: local relationTable =

[NTG-context] followtext, lmt_followtext and an offset of the glyphs typeset along the path

2020-05-01 Thread Gerben Wierda
I have been looking at lmt_followtext and followtext to get typesetting done along a path. That works fine, except that in my case, I need the text to not be exactly on that path, I need it to hover slightly above tor below he path. Given that the path may have an unpredictable form, that means

Re: [NTG-context] How do I get an empty line in a \framed[align=flushleft]{} item?

2020-04-30 Thread Gerben Wierda
> On 30 Apr 2020, at 22:54, Wolfgang Schuster > wrote: > > Gerben Wierda schrieb am 30.04.2020 um 22:47: >> In normal TeX, when I type >> AapAap >> I get something like >> Aap >> Aap >> But inside a \framed[align=]{} the empty line disappea

Re: [NTG-context] How do I get an empty line in a \framed[align=flushleft]{} item?

2020-04-30 Thread Gerben Wierda
> On 30 Apr 2020, at 22:51, Henning Hraban Ramm wrote: > > > >> Am 30.04.2020 um 22:47 schrieb Gerben Wierda : >> >> In normal TeX, when I type >> >> AapAap >> >> I get something like >> >> Aap >> >> Aap

Re: [NTG-context] How do I get an empty line in a \framed[align=flushleft]{} item?

2020-04-30 Thread Gerben Wierda
Brilliant! Thank you! > On 30 Apr 2020, at 22:54, Wolfgang Schuster > wrote: > > Gerben Wierda schrieb am 30.04.2020 um 22:47: >> In normal TeX, when I type >> AapAap >> I get something like >> Aap >> Aap >> But inside a \framed[align=]{} the

[NTG-context] How do I get an empty line in a \framed[align=flushleft]{} item?

2020-04-30 Thread Gerben Wierda
In normal TeX, when I type AapAap I get something like Aap Aap But inside a \framed[align=]{} the empty line disappears. How do I get it back? Minimal example: \starttext TestingTesting \page \framed[align=flushleft]{TestingTesting}

[NTG-context] Is this a MetaFun bug or intended behaviour?

2020-04-30 Thread Gerben Wierda
I wanted to use the macro simplified to remove duplicate points from a path, but it removes more than that: metapost log> (127,-107)..controls (117,-107) and (107,-107) metapost log> ..(97,-107)..controls (97,-130.34) and (97,-153.66) metapost log>

[NTG-context] Using \startuseMPgraphic inside a textext() in METAPOST?

2020-04-27 Thread Gerben Wierda
I am in METAPOST which is inside TeX and I’d like (in METAPOST, not in TeX) to let a string follow a path. Adapting from the MetaFun manual around page 250, I tried this: \starttext \startMPpage[instance=doublefun] pic p; p := textext("\startuseMPgraphic[instance=doublefun]{followtokens}path

[NTG-context] \framed[align=] with a 'maxwidth' instead of a width? Or get the size of a \frame returned to lua without typesetting it in a document?

2020-04-26 Thread Gerben Wierda
Setup: TeX file Contains ctxlua{} call lua function reads XML file and calls context() statements, it puts out a \startMPpage METAPOST statements Of which some are textext(\framed[align, so

Re: [NTG-context] Solution: METAPOST textext() eats my \pars. Was: Setting vertical spacing of lines inside a \framed[align=]

2020-04-25 Thread Gerben Wierda
}\par}"); draw (textext("\framed[align=flushright,frame=on,offset=none,width=106.400bp]{\colored[r=0.000, g=0.000, b=0.000]{\switchtobodyfont[11.0pt]\setupinterlinespace[11.5pt] \rm [My]\\Application\\(Component)\\}}") shifted (200,0)); \stopMPpage \stoptext G > On 25 Apr 2020,

[NTG-context] METAPOST textext() eats my \pars. Was: Setting vertical spacing of lines inside a \framed[align=]

2020-04-24 Thread Gerben Wierda
> On 24 Apr 2020, at 18:40, Thomas A. Schmitz <mailto:thomas.schm...@uni-bonn.de>> wrote: > > > >> On 24. Apr 2020, at 18:19, Gerben Wierda > <mailto:gerben.wie...@rna.nl>> wrote: >> >> \starttext >> >> \framed[align=flushrigh

[NTG-context] METAPOST textext() eats my \pars. Was: Setting vertical spacing of lines inside a \framed[align=]

2020-04-24 Thread Gerben Wierda
> On 24 Apr 2020, at 18:40, Thomas A. Schmitz <mailto:thomas.schm...@uni-bonn.de>> wrote: > > > >> On 24. Apr 2020, at 18:19, Gerben Wierda > <mailto:gerben.wie...@rna.nl>> wrote: >> >> \starttext >> >> \framed[align=flushrigh

Re: [NTG-context] Setting vertical spacing of lines inside a \framed[align=]

2020-04-24 Thread Gerben Wierda
Not possible in my case, unless I redefine them for each use (my code is generated from data with unpredictable colors), hut thanks anyway Gerben Wierda Chess and the Art of Enterprise Architecture Mastering ArchiMate Architecture for Real Enterprises at InfoWorld On Slippery Ice at EAPJ

Re: [NTG-context] Setting vertical spacing of lines inside a \framed[align=]

2020-04-24 Thread Gerben Wierda
of those, so I need a solution that works in the above setting. Gerben Wierda Chess and the Art of Enterprise Architecture <https://ea.rna.nl/the-book/> Mastering ArchiMate <https://ea.rna.nl/the-book-edition-iii/> Architecture for Real Enterprises <https://www.infoworld.com/bl

[NTG-context] Setting vertical spacing of lines inside a \framed[align=]

2020-04-24 Thread Gerben Wierda
question like this. I must be doing something wrong and looking in the wrong place) Gerben Wierda Chess and the Art of Enterprise Architecture <https://ea.rna.nl/the-book/> Mastering ArchiMate <https://ea.rna.nl/the-book-edition-iii/> Architecture for Real Enterprises <https://www.inf

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 Gerben Wierda
> 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

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

2020-04-24 Thread Gerben Wierda
recall I installed that because Hans patched something, but I am uncertain. Hans? G > On 24 Apr 2020, at 08:54, Henning Hraban Ramm wrote: > > > >> Am 24.04.2020 um 08:48 schrieb Gerben Wierda : >> >> Then I thought, let’s test some other things. I logged in as anoth

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 Gerben Wierda
> On 24 Apr 2020, at 08:53, Wolfgang Schuster > wrote: > > Can you try this: > > \definefontfamily [mainface] [rm] [Optima] > [it=optimaitalic, >bf=optimabold, >bi=optimabolditalic] I altready did that earlier as per the Wiki information (did not report it) and just tried again.

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 Gerben Wierda
With Arial: \definefontfamily[mainface][rm][Arial] \setupbodyfont[mainface,10pt] with Optima: \definefontfamily[mainface][rm][Optima] \setupbodyfont[mainface,10pt] It doesn’t matter if the font statements are before or after \starttext Then I thought, let’s test some other things. I logged

Re: [NTG-context] Basic font question (Optima, but no bold, no italics)

2020-04-23 Thread Gerben Wierda
> On 23 Apr 2020, at 19:18, Henning Hraban Ramm wrote: > >> >> Am 23.04.2020 um 16:42 schrieb Gerben Wierda : >> >>> >>> On 23 Apr 2020, at 16:34, Henning Hraban Ramm wrote: >>> >>>> >>>> Am 23.04.2020 um 16:

Re: [NTG-context] Is there a 'sized' command equivalent to \colored?

2020-04-23 Thread Gerben Wierda
Answering my own question: \switchtobodyfont > On 23 Apr 2020, at 16:45, Gerben Wierda wrote: > > I can directly colour a text in rgb by doing > \colored[r=0.8,b=0.6,c=0.4]{Text}. Suppose I want to hard code a piece of > text as 12.8pt, is there a simple way to do tha

[NTG-context] Is there a 'sized' command equivalent to \colored?

2020-04-23 Thread Gerben Wierda
I can directly colour a text in rgb by doing \colored[r=0.8,b=0.6,c=0.4]{Text}. Suppose I want to hard code a piece of text as 12.8pt, is there a simple way to do that directly like with \colored for colour? G ___

Re: [NTG-context] Basic font question

2020-04-23 Thread Gerben Wierda
> On 23 Apr 2020, at 16:34, Henning Hraban Ramm wrote: > >> >> Am 23.04.2020 um 16:22 schrieb Gerben Wierda : >> >> >> >>> On 23 Apr 2020, at 16:16, Vladimir Lomov wrote: >>> >>> Hello, >>> ** Gerb

Re: [NTG-context] Basic font question

2020-04-23 Thread Gerben Wierda
> On 23 Apr 2020, at 16:16, Vladimir Lomov wrote: > > Hello, > ** Gerben Wierda [2020-04-23 16:00:34 +0200]: > >> On my Mac, I am trying: > >> \definefontfamily[mainface][rm][Optima] >> \setupbodyfont[mainface,10pt] > >> {\bf Bold} and {\

[NTG-context] Basic font question

2020-04-23 Thread Gerben Wierda
On my Mac, I am trying: \definefontfamily[mainface][rm][Optima] \setupbodyfont[mainface,10pt] {\bf Bold} and {\it Italic} and {\rm Regular} text. What do I need to do to get actual bold and italics in my output? Thx,

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

2020-04-22 Thread Gerben Wierda
> On 22 Apr 2020, at 09:30, Taco Hoekwater wrote: > > 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 d

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

2020-04-21 Thread Gerben Wierda
> On 21 Apr 2020, at 14:41, Hans Hagen wrote: > > On 4/21/2020 1:29 PM, Gerben Wierda wrote: [snip] > > \startMPpage[instance=doublefun] > > path arrowHead; > arrowHead := >(542,-77.000186920166016)..controls > (545.37,-77.000186920166016

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

2020-04-21 Thread Gerben Wierda
I have these two paths, but cutting doesn’t work because the path to be cut takes the wrong intersection regardless of how I direct the path to be cut after (reverse or not). The path to cut after is a triangle with the base horizontal and the path to cut is a vertical line. The top of the

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

2020-04-15 Thread Gerben Wierda
> On 15 Apr 2020, at 13:54, Wolfgang Schuster > wrote: > > Gerben Wierda schrieb am 15.04.2020 um 12:19: >>> On 14 Apr 2020, at 11:52, Taco Hoekwater wrote: >>>> On 14 Apr 2020, at 11:25, Gerben Wierda wrote: >>>> >>>> This helps f

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

2020-04-15 Thread Gerben Wierda
> On 14 Apr 2020, at 11:52, Taco Hoekwater wrote: > > > >> 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

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

2020-04-14 Thread Gerben Wierda
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

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

2020-04-13 Thread Gerben Wierda
Currently, I process a file like this: mtxrun --autogenerate --script context test12.tex and in the file test12.tex one sees something like this: \input archimate-mp \ctxlua{moduledata.archimate(“myarchimatefile.xml")} The latter parses the xml file and produces a PDF using generated MP code.

Re: [NTG-context] METAPOST/MetaFun withtransparency doesn't accept my pair primary argument, what am I doing wrong?

2020-04-10 Thread Gerben Wierda
e pic; pic := Foo( 150, 50, (0.686,1.000,1.000), 0.5); draw pic; \stopMPpage \stoptext > On 9 Apr 2020, at 18:06, Hans Hagen wrote: > > On 4/9/2020 4:58 PM, Gerben Wierda wrote: >> \starttext >> \startMPpage[instance=doublefun] >> vardef Foo( expr w, h, fillColor, fillT

[NTG-context] METAPOST/MetaFun withtransparency doesn't accept my pair primary argument, what am I doing wrong?

2020-04-09 Thread Gerben Wierda
I have refactored my code to use withtransparency and separate parameters for colors, sizes, transparency, etc. But I’m running into a problem. The fillTransparency parameter is a pair primary (as can be seen from the show command) Here is a pretty minimum example (in reality there are

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

2020-04-09 Thread Gerben Wierda
(r,g,b,t) as one parameter. G > > 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

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

2020-04-09 Thread Gerben Wierda
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

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

2020-04-08 Thread Gerben Wierda
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

Re: [NTG-context] Trying to understand this ctxlua error

2020-04-06 Thread Gerben Wierda
On 6 Apr 2020, at 02:54, Wolfgang Schuster wrote: > > Gerben Wierda schrieb am 06.04.2020 um 00:41: >> I got this error after I had changed some lua code: >> tex error > tex error on line 272 in file archimate-lua.new: ! >> Undefined control sequence >>

[NTG-context] Trying to understand this ctxlua error

2020-04-05 Thread Gerben Wierda
I got this error after I had changed some lua code: tex error > tex error on line 272 in file archimate-lua.new: ! Undefined control sequence warnIfVerbose( "Breaking off the processing of node %s\nNo l...eak

Re: [NTG-context] Bounding box of picture returned by textext() in METAPOST

2020-04-05 Thread Gerben Wierda
Nobody? > On 4 Apr 2020, at 22:58, Gerben Wierda wrote: > > I have this METAPOST macro: > > vardef makeTeXLabel( expr w, h, name) = > if debugProgram or debugLabels: show "NAME makeTeXLabel:", name, tostring > 0.8w, tostring 0.8h; fi > s

[NTG-context] Is there a robust way to find the first (or last intersection) of path p with path q?

2020-04-05 Thread Gerben Wierda
Intersecting path p and q will give you more or less randomly (actually, there is an algorithm, but not a very useful one for METAPOST) an intersection (time on p, time on q) I am trying to find out if anybody as already created a macro that gives you the intersection with the smallest (or

Re: [NTG-context] What was that 'rounding paths' metafun(?) function again?

2020-04-05 Thread Gerben Wierda
civilised. I had looked at 2.5 and 2.6 but this was not required (nor of any use). G > > Keith > > On 05/04/2020 11:31, Gerben Wierda wrote: >> I think I saw a function in MetaFun somehwre that you could give a ‘hard’ >> path, i.e. (0,0) -- (0,1) — (1,1) and it woul

Re: [NTG-context] What was that 'rounding paths' metafun(?) function again?

2020-04-05 Thread Gerben Wierda
:= direction (arctime (rounding) of subTwo) of subTwo; softPath := softPath -- pointOne{dirOne} .. {dirTwo}pointTwo; fi endfor; softPath enddef; Fixed rounding of 5bp, but that is easy to change. > On 5 Apr 2020, at 12:37, Wolfgang Schuster > wrote: > > Gerben Wierda schrieb am 0

[NTG-context] What was that 'rounding paths' metafun(?) function again?

2020-04-05 Thread Gerben Wierda
I think I saw a function in MetaFun somehwre that you could give a ‘hard’ path, i.e. (0,0) -- (0,1) — (1,1) and it would become a path with nicely rounded (part of a circle) corners (still straight lines), but I can’t find it anymore. I wrote my own, but it is giving me headaches so I’d like to

Re: [NTG-context] startMPpage..stopMPpage written to a separate PDF?

2020-04-05 Thread Gerben Wierda
> On 5 Apr 2020, at 11:34, Hans Hagen wrote: > > On 4/5/2020 12:29 AM, Gerben Wierda wrote: >> I have a series of startMPpage—stopMPpage pairs (with MP code inbetween). >> These now become separate pages in a single PDF. But I need them to become >> separate PDF’s

[NTG-context] startMPpage..stopMPpage written to a separate PDF?

2020-04-04 Thread Gerben Wierda
I have a series of startMPpage—stopMPpage pairs (with MP code inbetween). These now become separate pages in a single PDF. But I need them to become separate PDF’s each during my ConTeXt run, with a name of my own choosing. Is this possible? I guess this will be problematic, but one can hope

[NTG-context] Bounding box of picture returned by textext() in METAPOST

2020-04-04 Thread Gerben Wierda
I have this METAPOST macro: vardef makeTeXLabel( expr w, h, name) = if debugProgram or debugLabels: show "NAME makeTeXLabel:", name, tostring 0.8w, tostring 0.8h; fi save p; picture p; p := textext( "\startframedtext[middle]" & "[align=middle,frame=on" & ",width=" & tostring 0.8w &

[NTG-context] Solved: Minimum example of problem getting curly braces printed in METAPOST

2020-04-03 Thread Gerben Wierda
[12] = { '"', "\"&\"" }, } return lpeg.replacer(rep):match(str) end And the string becomes something that can safely be given toi METAPOST and safely handled by TeX when called from METAPOST via textext() G > On 2 Apr 2020, at 14:05, Gerben Wierda wrote: > > Her

[NTG-context] Minimum example of problem getting curly braces printed in METAPOST

2020-04-02 Thread Gerben Wierda
Here is a minimum example of a problem that I have in getting curly braces printed in METAPOST in code that is generated by lua.Any help is welcome.\usemodule[scite]\setupxml [entities=yes]\startluacodefunction warn( ... )  texio.write_nl("-> " .. string.format(...))endlocal function

Re: [NTG-context] Lua/TeX/METAPOST/textext string issue/puzzle

2020-04-02 Thread Gerben Wierda
Actually, the backslashes disappear before the call to textext() G > On 1 Apr 2020, at 23:44, Aditya Mahajan wrote: > > On Wed, 1 Apr 2020, Gerben Wierda wrote: >> >> My route is probably to complex anyway, but what can I do for the curly >> braces to be actu

[NTG-context] Lua/TeX/METAPOST/textext string issue/puzzle

2020-04-01 Thread Gerben Wierda
I have lua code that generates this for METAPOST: ApplicationComponentLogo( w, h, "withcolor (0.686,1.000,1.000) withtransparency (1,0.200)", "withcolor (0.000,0.000,0.000) withtransparency (1,1.000) withpen pencircle scaled 1.000", "\{Hello\}, "&"(a)"&" [World]!") shifted (x, -y); draw pic;

Re: [NTG-context] Puzzle (for me)

2020-04-01 Thread Gerben Wierda
> On 1 Apr 2020, at 01:53, Henri Menke wrote: > > On 01/04/20, 01:20, Gerben Wierda wrote: >> I have a string with double quotes that needs to become a text in a box in >> METAPOST. METAPOST is used to create an image consisting of boxes and >> connections. >

[NTG-context] Puzzle (for me)

2020-03-31 Thread Gerben Wierda
I have a string with double quotes that needs to become a text in a box in METAPOST. METAPOST is used to create an image consisting of boxes and connections. Basically, the approach is now something like this: TeX: calls Lua code with \ctxlua{filename} Lua: context.startMPpage Lua: read XML.

[NTG-context] Fwd: Is de string interpretatie van het lua context() commando separaat benaderbaar?

2020-03-31 Thread Gerben Wierda
The lua context() command has a string interpretation, e.g. function moduledata.test( astring) local testone = "{Hello}, \"(a)\" [World]!" context( "%!tex!", testone) end Two questions: - Have all the lua commands been documented somewhere e.g. in a reference manual? Especially the basic

Re: [NTG-context] macOS

2020-03-31 Thread Gerben Wierda
; > > Med Vänlig Hälsning > > Jan-Erik Hägglöf > > > ---- Originalmeddelande > Från: Gerben Wierda > Datum: 2020-03-30 23:52 (GMT+01:00) > Till: mailing list for ConTeXt users > Ämne: [NTG-context] macOS > > Spotlight on macOS can help

[NTG-context] macOS: Spotlight indexing of manuals?

2020-03-30 Thread Gerben Wierda
Spotlight on macOS can help me to find the right documentation. When I copy the contents of the folder (the manuals for ConTeXt) from its original location /usr/local/context-osx-64/tex/texmf-context/doc/context/documents/general/manuals to ~/Downloads/TestFolder they are indexed and found by

[NTG-context] Box of certain width (and height?) containing a paragraph of text?

2020-03-30 Thread Gerben Wierda
Does ConTeXt have a command to create a (non framed) box from a line of text, where the text is typeset as a paragraph inside a box of certain size? G ___ If your question is of interest to others as well, please add

Re: [NTG-context] How do I handle strings with " characters in it in METAPOST?

2020-03-29 Thread Gerben Wierda
will be pretty complex. If I drop the use of \type{} inside the btex-etex I have to ‘escape' everything that TeX doesn’t see as normal text catcode. That, again might play havoc with breaking words across lines later. G > On 29 Mar 2020, at 15:09, Wolfgang Schuster > wrote: > > Ger

[NTG-context] What alternative for scantokens( "btex " & texcommands & " etex")?

2020-03-29 Thread Gerben Wierda
I’m trying in METAPOST to build a command to pass on to ConTeXt using btex/etex. picture p; p := scantokens( "btex " & texcommands & " etex”); with texcommands a variable that holds a string of TeX commands doesn’t work. The METAPOST parser complains about not finding etex. I’m using MetaFun

Re: [NTG-context] How do I handle strings with " characters in it in METAPOST?

2020-03-29 Thread Gerben Wierda
> On 29 Mar 2020, at 14:35, Wolfgang Schuster > wrote: > > Gerben Wierda schrieb am 29.03.2020 um 14:30: >>> On 29 Mar 2020, at 12:58, Wolfgang Schuster >>> wrote: >>> >>> Gerben Wierda schrieb am 29.03.2020 um 12:52: >>>> I

Re: [NTG-context] How do I handle strings with " characters in it in METAPOST?

2020-03-29 Thread Gerben Wierda
> On 29 Mar 2020, at 12:58, Wolfgang Schuster > wrote: > > Gerben Wierda schrieb am 29.03.2020 um 12:52: >> I am using MetaFun (Lua code) to create METAPOST commands from an XML file. >> One of the issues I am running into that in METAPOST I have to handle >

[NTG-context] How do I handle strings with " characters in it in METAPOST?

2020-03-29 Thread Gerben Wierda
I am using MetaFun (Lua code) to create METAPOST commands from an XML file. One of the issues I am running into that in METAPOST I have to handle strings with " characters in them and METAPOST doesn’t like those. The argument using the string Foo "Bar” Foo turns into someCall( "Foo “Bar”

Re: [NTG-context] I could use some ideas for a strategy to get these kind of labels in a METAPOST picture

2020-03-29 Thread Gerben Wierda
I tried this and it worked. Next issue: if the string has a “ character in it, METAPOST cannot handle it. New question for the list... G > On 29 Mar 2020, at 10:47, Gerben Wierda wrote: > > > >> On 28 Mar 2020, at 19:04, Wolfgang Schuster >> wrote: >>

Re: [NTG-context] I could use some ideas for a strategy to get these kind of labels in a METAPOST picture

2020-03-29 Thread Gerben Wierda
> On 28 Mar 2020, at 19:04, Wolfgang Schuster > wrote: > > Gerben Wierda schrieb am 28.03.2020 um 18:58: >> Actually, I would already be helped with a way to convert this string: >> My “Büsiness" sérvice >> into something that can be typeset by

Re: [NTG-context] I could use some ideas for a strategy to get these kind of labels in a METAPOST picture

2020-03-28 Thread Gerben Wierda
Actually, I would already be helped with a way to convert this string: My “Büsiness" sérvice into something that can be typeset by ConTeXt. Using embedded lua is fine. G > On 28 Mar 2020, at 02:01, Gerben Wierda wrote: > > I have strings I get from an XML that

[NTG-context] I could use some ideas for a strategy to get these kind of labels in a METAPOST picture

2020-03-27 Thread Gerben Wierda
I have strings I get from an XML that I want to turn into labels for objects in a METAPOST picture (using MetaFun). These strings can have arbitrary characters (like accents) and some characters are coded. Examples of how these are coded: My "Application” Fünction [My]

[NTG-context] mtx-context | fatal error: return code: 11

2020-03-19 Thread Gerben Wierda
What does mtx-context | fatal error: return code: 11 mean? G___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl /

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

2020-03-16 Thread Gerben Wierda
ditya Mahajan wrote: >> On Fri, 13 Mar 2020, Taco Hoekwater wrote: >>> Hi, >>> >>> >>> >>>> On 13 Mar 2020, at 12:53, Gerben Wierda wrote: >>>> >>>> Suppose I have this code: >>>> >>>> &

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

2020-03-16 Thread Gerben Wierda
Maybe a nice little explanation (educational with good examples) of ‘how to use pass by reference’ and ‘building and using complex data structures’ would be useful for people. Say, some ‘patterns’. G > On 16 Mar 2020, at 10:38, Hans Hagen wrote: > > that said, after muy share of mp

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

2020-03-16 Thread Gerben Wierda
> On 16 Mar 2020, at 10:23, Taco Hoekwater wrote: > > > >> 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 b

<    1   2   3   4   5   6   >