Re: [NTG-context] How to add margin around standalone MetaPost?
On Sat, 2022-05-21 at 07:39 +0530, śrīrāma wrote: > On 5/20/22 10:26 PM Vincent Hennebert via ntg-context wrote: > > Take the following MetaPost file: > > > > beginfig(0) > > ahlength := 20; > > linejoin := mitered; > > drawarrow origin--(40,0) withpen pencircle scaled 5; > > endfig; > > > > Render it into PDF with ConTeXt. Witness the cut out ends of the > > arrow. > > How to fix that? > > > > Being able to add some margin would be a solution, which may be > > desirable anyway in some cases. Is that possible? > > Enlarge the bounds of your picture – > > beginfig(0); > ahlength := 20; > linejoin := mitered; > drawarrow origin--(40,0) withpen pencircle scaled 5; > > setbounds currentpicture to boundingbox currentpicture enlarged > 5mm; > endfig; Exactly what I was looking for. Thanks! (I did find out about \startMPpage[offset=3pt], but that requires me to include my MetaPost file into an additional, somewhat superfluous TeX file. And for better editor support I prefer to edit the MetaPost in a .mp file, rather than embedded in a .tex.) Vincent ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context webpage : http://www.pragma-ade.nl / http://context.aanhet.net archive : https://bitbucket.org/phg/context-mirror/commits/ wiki : http://contextgarden.net ___
[NTG-context] How to add margin around standalone MetaPost?
Take the following MetaPost file: beginfig(0) ahlength := 20; linejoin := mitered; drawarrow origin--(40,0) withpen pencircle scaled 5; endfig; Render it into PDF with ConTeXt. Witness the cut out ends of the arrow. How to fix that? Being able to add some margin would be a solution, which may be desirable anyway in some cases. Is that possible? Thanks, Vincent ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/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] Rendering Standalone MetaPost Graphics with ConTeXt
On Thu, 2022-05-19 at 14:23 +0530, śrīrāma wrote: > On 5/19/22 1:53 PM Vincent Hennebert via ntg-context wrote: > > Looking at the wiki, it seems that \startMPinclusions is not meant > > to > > actually render any content, just to include MetaPost code like > > function definitions. I guess I would have expected \startMPpage > > instead. > > > > Am I doing something wrong, or is that an error in ConTeXt? > > The MP statements should be inside a beginfig() .. endfig. Oh, I see. Not super fan of enclosing each and every of my graphics in a beginfig...endfig statement, but it does the job indeed. Although in my case I must give a number parameter to beginfig, otherwise I get an error. Thanks Sreeram! Vincent ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/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] Rendering Standalone MetaPost Graphics with ConTeXt
I’d like to use MetaPost to generate all sorts of standalone graphics (ultimately converted to SVG). For various reasons (among others, MetaFun and advanced text processing) I want to use MetaPost as embedded in ConTeXt rather than a standalone installation. metapost.mp fill fullcircle scaled 10cm; Whether I run context metapost.mp or mtxrun --script metapost metapost.mp I get a PDF document that contains no page. The mtxrun version generates the following temp file: mptopdf-temp.tex \starttext \startMPinclusions fill fullcircle scaled 10cm; \stopMPinclusions \stoptext Looking at the wiki, it seems that \startMPinclusions is not meant to actually render any content, just to include MetaPost code like function definitions. I guess I would have expected \startMPpage instead. Am I doing something wrong, or is that an error in ConTeXt? Thanks, Vincent ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/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] Reset environment between MetaPost graphics?
On Thu, 2022-01-20 at 15:47 +0100, Hans Hagen via ntg-context wrote: > On 1/20/2022 3:26 PM, Aditya Mahajan via ntg-context wrote: > > > AFAIK, there is no in-built support for this. > > FYEO: > > \starttext > > \startMPcode > u = 123; > \stopMPcode > > \ctxlua{metapost.reset("metafun:1")} > > \startMPcode > u = 123; > \stopMPcode > > \stoptext > > (the instance is reported on the console) Thanks Aditya and Hans! Glad to hear I wasn’t missing anything obvious. Vincent ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/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] Reset environment between MetaPost graphics?
Hi, Say I’m writing a document containing many independent MetaPost figures. I don’t want to bother with enclosing each and every graphics in a ‘begingroup...endgroup’ with the appropriate ‘save’ statement. But I don’t want variables from previous graphics to leak into following ones either. Like this: % SOF \starttext Text about some topic. \startMPcode u=1cm; draw (-u, u)--origin--(u ,u); \stopMPcode Now on to another topic. \startMPcode u=2cm; % Triggers an error: Inconsistent equation (off by 28.34645) draw (-u, u)..origin..(u ,u); \stopMPcode \stoptext % EOF Is that achievable? Thanks, Vincent ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/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] Emojis showing up in black instead of colours
On Fri, 2021-11-12 at 23:00 +0100, Pablo Rodriguez via ntg-context wrote: > On 11/12/21 7:08 PM, Vincent Hennebert via ntg-context wrote: > > Hi there, > > > > freshly upgraded LMTX installation. TwemojiMozilla.ttf downloaded > > from > > GitHub [1]. > > [...] > > gives me pages of emojis, all black. According to what is described > > on > > Stackexchange, I should be getting colours. Am I doing something > > wrong? > > Hi Vincent, > > if you are using Evince, try Okular to check color display. > > I experienced something similar in the past. > > Just in case it helps, Thanks Pablo (and Hans). I am using Evince indeed and I would never have thought of checking with another PDF viewer. All is well on the ConTeXt side, my document displays fine in Firefox. Thanks again, Vincent ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/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] Emojis showing up in black instead of colours
Hi there, freshly upgraded LMTX installation. TwemojiMozilla.ttf downloaded from GitHub [1]. The following: \usemodule[fonts-emoji] \definefontfeature [overlay] [default] [ccmp=yes, colr=yes, dist=yes] \starttext {\definedfont[name:twemojimozilla*overlay] \ShowEmoji} \stoptext gives me pages of emojis, all black. According to what is described on Stackexchange, I should be getting colours. Am I doing something wrong? Thanks, Vincent [1] https://github.com/mozilla/twemoji- colr/releases/download/v0.6.0/TwemojiMozilla.ttf [2] https://tex.stackexchange.com/questions/466442/context-using-emoji- fonts-without-color ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/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] Create an enumeration style
On Wed, 2021-08-11 at 10:23 +0200, Hans Hagen via ntg-context wrote: > On 8/11/2021 10:09 AM, Otared Kavian via ntg-context wrote: > > > > > > > On 9 Aug 2021, at 18:10, Wolfgang Schuster via ntg-context > > cont...@ntg.nl> wrote: > > > (…) > > > core-con.lua (line 1155): > > > > > > local ordinals = { > > > [...] > > > french = function(n) > > > if n == 1 then > > > return "er" > > > + else > > > + return "e" > > > end > > > end, > > > } > > > > Hi Wolfgang, > > > > Thanks for the example and the fix, but I would rather think that the > > « french » part of ordinals should be > > > > french = function(n) > > if n == 1 then > > return « er" > > else > > return « ème" > > end > > end, > > > > Now if this were not accepted as a fix in core-con.lua, is there a > > way for a user to change the default to the above choice in his > > document ? > > it is no problem to fix if you all can agree on what/how to fix ... The purpose of abbreviations is, well, to abbreviate. Even though ‘ème’ is seen a lot, it’s wrong because it’s too long. Source (pretty official): https://www.academie-francaise.fr/abreviations-des-adjectifs-numeraux So for numbers starting from 3 the proper abbreviation is ‘e’. For 1 and 2 it’s more complicated, however, as it depends on the gender. For 1: * masculine: 1er * feminine: 1re In addition for 2, and when the enumeration contains only 2 elements, there is the option to use the older word ‘second(e)’: * masculine: 2d * feminine: 2de For 3 elements and above, we always use the newer word ‘deuxième’, which is abbreviated in the form of the generic ‘e’. While that rule is optional, people who use tools like ConTeXt are likely to pay attention to that kind of details and will probably want to use it. Finally, we have to add an ‘s’ to all the abbreviations if the plural is needed (the 1st (1ers) elements, the 2nd (2ds or 2es) elements, etc., vs the 1st (1er) element, 2nd (2d or 2e) element…). Now, can all those subtleties be coded in a function? :) Vincent > 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 ___