[NTG-context] Re: How can I use a variable for a MetaPost coordinate ?

2023-10-05 Thread peter.hopcroft--- via ntg-context
> StopPage in your MPcode, then you can knock yourself out by using variables > such as PaperHeight or TextHeight and do all sorts of calculations. > > All best > > Thomas > > On 10/5/23 05:54, peter.hopcroft--- via ntg-context wrote: >> Hello list, I want to dr

[NTG-context] Re: How can I use a variable for a MetaPost coordinate ?

2023-10-05 Thread Thomas A. Schmitz
Have a look at chapter 6.4 of the metafun manual. You need StartPage ... StopPage in your MPcode, then you can knock yourself out by using variables such as PaperHeight or TextHeight and do all sorts of calculations. All best Thomas On 10/5/23 05:54, peter.hopcroft--- via ntg-context wrote

[NTG-context] Re: MPcode inserts page

2023-07-06 Thread Henning Hraban Ramm
Am 06.07.23 um 12:02 schrieb Alan Braslau: On 06/07/23 06/07/23, 11:23, Henning Hraban Ramm wrote: Hi, if I use \startMPcode to declare variables etc. that I need in several MP graphics, it always inserts an empty page. How can I avoid that? (Actually, I load an external mp file, and for

[NTG-context] Re: MPcode inserts page

2023-07-06 Thread Alan Braslau via ntg-context
On 06/07/23 06/07/23, 11:23, Henning Hraban Ramm wrote: Hi, if I use \startMPcode to declare variables etc. that I need in several MP graphics, it always inserts an empty page. How can I avoid that? (Actually, I load an external mp file, and for random value reasons I must load it only once.

[NTG-context] MPcode inserts page

2023-07-06 Thread Henning Hraban Ramm
Hi, if I use \startMPcode to declare variables etc. that I need in several MP graphics, it always inserts an empty page. How can I avoid that? (Actually, I load an external mp file, and for random value reasons I must load it only once. But the MWE already shows the problem.) """ \startMPcode

Re: [NTG-context] Mathematical MetaFun Mania

2022-12-15 Thread Otared Kavian via ntg-context
t it to pass mine. Is >> there some intermediate step? Your example has a key=value pair in >> \connectboxanchors and which is accessed in the MetaPost code. The pair, and >> MetaPost code are: >> rulethickness=1pt >> mpvard “rulethickness" >> However,

Re: [NTG-context] Mathematical MetaFun Mania

2022-12-15 Thread Hans Hagen via ntg-context
it to pass mine. Is there some intermediate step? Your example has a key=value pair in \connectboxanchors and which is accessed in the MetaPost code. The pair, and MetaPost code are: rulethickness=1pt mpvard “rulethickness" However, if I change the pair and MPcode to (see attached ex

Re: [NTG-context] Mathematical MetaFun Mania

2022-12-15 Thread Gavin via ntg-context
Is there some intermediate step? Your example has a key=value pair in \connectboxanchors and which is accessed in the MetaPost code. The pair, and MetaPost code are: rulethickness=1pt mpvard “rulethickness" However, if I change the pair and MPcode to (see attached example for full code

Re: [NTG-context] changes of color

2021-09-21 Thread fv leung via ntg-context
\starttext It seems that the problem comes up when the same color as the surrounding text is used in MPcode.\par { \red text red\par \startMPcode drawoptions(withcolor blue); label("text blue in MPcode", origin); \stopMPcode \par text still red\par But\par te

Re: [NTG-context] Height of parentheses in a matrix with lmtx

2020-07-28 Thread Hans Hagen
On 7/28/2020 11:35 AM, Fabrice Couvreur wrote: \definemathmatrix [pmatrix][matrix:parentheses][simplecommand=MATRIX] \starttext \math{\MATRIX{\MPcode{draw (0,0) -- (1cm,0);}  ;\MPcode{draw (0,0) -- (1cm,0);} }} \stoptext found it ... (typo in var name after i made the mem footprint

[NTG-context] Height of parentheses in a matrix with lmtx

2020-07-28 Thread Fabrice Couvreur
Hi Hans, With the upgraded version of lmtx, the parentheses of the matrix are no longer adjusted to the content. Thank you. Fabrice \definemathmatrix [pmatrix][matrix:parentheses][simplecommand=MATRIX] \starttext \math{\MATRIX{\MPcode{draw (0,0) -- (1cm,0);} ;\MPcode{draw (0,0) -- (1cm,0

Re: [NTG-context] MetaPost with Multiple Variable Sections

2019-09-18 Thread Jeong Dal
Dear Jeroen, If you change “pair a;” to “numeric a;” in the second MPcode, it draws a circle without error. Best regards, Dalyoung > > \placefloatright{}{ > \startMPcode > pair a; numeric a; > a := 2cm; > draw fullcircle scaled (2*a); > \stopM

Re: [NTG-context] MetaPost with Multiple Variable Sections

2019-09-18 Thread Aditya Mahajan
circle scaled (2*a); ; I'm sorry, but I don't know how to make such things equal. (See the two expressions just above the error message.) You can fix that by saying numeric a; a := 2cm; One needs to keep in mind that all the code in multiple MPcode environments are run in the same scope. I occas

Re: [NTG-context] Construct a matrix with Metafun

2018-10-14 Thread Wolfgang Schuster
It works for me when I add a space after each \MPcode{…} block. \math{\MATRIX{\MPcode{...} ;\MPcode{...} }} Wolfgang Fabrice Couvreur schrieb am 14.10.18 um 12:18: Hi Wolfgang, Thank you for your solution.The space came from copy-paste because if I do this, it does not work

[NTG-context] Saving Metafun Graphic for use outside ConTeXt

2018-04-05 Thread Keith McKay
a graphic as an svg file. /outputformat := "svg"; / /outputtemplate := "test.svg";/ // I have tried adding this to some MPcode in a ConteXt document but these lines seem to be ignored since no svg file is produced apart from the usual ConTeXt files. Is this expected behavio

Re: [NTG-context] Bug: \textext inside \*MPinclusions causes error

2017-01-22 Thread Hans Hagen
side (yes); A circle with "3" inside again (no, instead it produces circle with "2" inside); A rhombus with "2" inside (no, instead it produces a rhombus with "1") and so on. (tested on http://live.contextga

Re: [NTG-context] Bug: \textext inside \*MPinclusions causes error

2017-01-22 Thread Sergey Slyusarev
>> >> >> First, it shows why *MPinitializations can't replace *MPinclusions for >> me (it affects all instances), >> >> and second, it silently produces produces some really unexpected results: >> >> It looks like it should produce (by line) >> >

Re: [NTG-context] Bug: \textext inside \*MPinclusions causes error

2017-01-17 Thread Hans Hagen
h "1" inside (yes); A circle with "3" inside again (no, instead it produces circle with "2" inside); A rhombus with "2" inside (no, instead it produces a rhombus with "1") and so on. (tested on http://live.contextgarden.net/) In fact, I failed to de

Re: [NTG-context] Bug: \textext inside \*MPinclusions causes error

2017-01-16 Thread Sergey Slyusarev
h "3" inside again (no, instead it produces circle with "2" inside); A rhombus with "2" inside (no, instead it produces a rhombus with "1") and so on. (tested on http://live.contextgarden.net/) In fact, I failed to declare picture variable inside with text insi

Re: [NTG-context] Bug: \textext inside \*MPinclusions causes error

2017-01-12 Thread Hans Hagen
On 1/11/2017 11:08 PM, Sergey Slyusarev wrote: Hi, i found the following bug (likely) some time ago: When \textext (or any other text generating thing like btex etex etc.) is present inside \*MPinclusions and \*MPinclusions are followed by \*MPcode ConTeXt returns error: Equation cannot

[NTG-context] Bug: \textext inside \*MPinclusions causes error

2017-01-11 Thread Sergey Slyusarev
Hi, i found the following bug (likely) some time ago: When \textext (or any other text generating thing like btex etex etc.) is present inside \*MPinclusions and \*MPinclusions are followed by \*MPcode ConTeXt returns error: Equation cannot be performed (color=vacuous). Minimal example would

Re: [NTG-context] Using MPgraphics as externalfigures?

2012-08-03 Thread Aditya Mahajan
[here] [fig: 5 loop departed setup] {The start position for a 5-loop braid with departed loops} {\framed{\getbuffer[setup 5-loop basic]}} Come to think of it, is there another way of framing the incoming graphic? I don't want to include the frames in the MPcode as I may

[NTG-context] Using MPgraphics as externalfigures?

2012-08-01 Thread Mari Voipio
] {The start position for a 5-loop braid with departed loops} {\framed{\getbuffer[setup 5-loop basic]}} Come to think of it, is there another way of framing the incoming graphic? I don't want to include the frames in the MPcode as I may not always want them, but that \framed

[NTG-context] MPpage-MPcode

2011-12-01 Thread Hans van der Meer
Can someone give me a short explanation of the difference between the various metapost enclosures in MetaFun? such as \startMPpage-\stopMPpage, \startMPcode-\stopMPcode? I am on the lookout for a setup in which textext can be used and where the figure comes out clipped, i.e. not contained in a

Re: [NTG-context] Metfun macro for triangle

2011-03-24 Thread Stefan Müller
the MPdefinitions section and put the complete vardef before your normal mp code in the MPcode section. That should work, I think. May I ask one more question? In the macro you wrote Triangle((0cm,0cm), (5cm,0cm), 8cm, 6cm) one has to specify the double of the length of each side

Re: [NTG-context] Metfun macro for triangle

2011-03-24 Thread Otared Kavian
vardef before your normal mp code in the MPcode section. That should work, I think. May I ask one more question? In the macro you wrote Triangle((0cm,0cm), (5cm,0cm), 8cm, 6cm) one has to specify the double of the length of each side (because a unit circle in MetaPost

Re: [NTG-context] Metfun macro for triangle

2011-03-24 Thread Aditya Mahajan
Is there a solution with mkii? Then just drop the MPdefinitions section and put the complete vardef before your normal mp code in the MPcode section. That should work, I think. Or you can use \startMPinclusions[+] \stopMPinclusions [+] appends to the existing content of MPinclusion, so you

Re: [NTG-context] metapost and lua

2010-08-06 Thread Hans Hagen
Hi, I've added \MPdrawing and \MPcode so that less calls are needed for i=1,100,5 do context.MPdrawing(draw fullsquare scaled ..i .. mm withcolor white;) end Hans - Hans Hagen

Re: [NTG-context] metapost and lua

2010-08-06 Thread Philipp Gesang
On 2010-08-06 13:44:14, Hans Hagen wrote: Hi, I've added \MPdrawing and \MPcode so that less calls are needed Great! Many thanks for this. Philipp pgp7YJZdtu02k.pgp Description: PGP signature ___ If your

Re: [NTG-context] \sometxt inside functions

2009-08-22 Thread Mojca Miklavec
); \stopMPcode that only transfers image, but no text. But when thinking about it, there might be a good reason that text is not transferred from MPinclusions to MPcode. If I would change font between MPinclusions and MPcode ... Anyway ... no time to lose extra time on that issue now. This is LuaTeX

Re: [NTG-context] metapost code fails to work in mkiv

2008-12-03 Thread Hans Hagen
); but for that i first need to implement multiple instances associated with MPcode cum suis; not that hard but it can wait for a while Hans - Hans Hagen | PRAGMA ADE

Re: [NTG-context] printing tab in lua: print('a\tb') fails

2008-11-27 Thread Hans Hagen
Mojca Miklavec wrote: I thought that \startluacode should be behaving the same way as verbatim environments where commands inside verbatim have no influence, but apparently I was wrong. no, more like MPcode where one can mix things if the luacode would not expand macros, then we'd need

[NTG-context] \loadfontfileoncetrue?

2003-12-15 Thread David Arnold
[pdftex] \starttext \section{Including the MPcode in the placefigure mechanism} \placefigure [here] [] {the label} {\startMPcode label.top(btex Some label 1 etex, (1cm,1cm)) ; \stopMPcode} \section{startMPgraphic -- placeMPgraphic} \startMPgraphic label.top(btex

Re: [NTG-context] MetaPost with etex/btex

2003-12-14 Thread Willi Egger
in no label output: \starttext \startMPcode label.top(btex Some label etex, (1cm,1cm)) ; \stopMPcode \stoptext I'm using ConTeXt 2003.12.12. By the way, why don't \startMPgraphic and \stopMPgraphic do anything? \setupoutput[pdftex] \starttext \section{Including the MPcode in the placefigure