Re: [NTG-context] t-vim module: no highlighting for custom filetypes
On 5/21/2021 9:37 PM, Nicola wrote: On 2021-05-21, Aditya Mahajan wrote: nvim was 8-10% faster than vim in my tests: https://adityam.github.io/context-blog/post/vim-vs-neovim/ Interesting, thanks for sharing. I actually want t-vim (or rather t-filter) to support more editors/syntax highlighters. At some stage I had added rudimentary support for other syntax highlighters most of them required scaffolding to wrap around the latex output: https://adityam.github.io/context-blog/post/clean-tex-output/ I think I have said that already, but it is worth repeating: t-vim is a genius idea! Vim is universally available and it supports almost any imaginable syntax. t-vim makes creating code-oriented documents absolutely painless (ConTeXt helps, of course). And it makes me scream when I have to do that in LaTeX. So, kudos for that. Personally, I do not think that supporting other highlighters would add much value to what is already there. But if it is possible to make the module more general without overcomplicating it, it might be a good idea. I have only a minor annoyance: I have just noticed that -- is typeset as an en-dash in LMTX (but not in MKIV, as documented). Could you look into that? best is that the module uses: \the\everyinitializeverbatim because there we disable all kind of non verbatim stuff 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 ___
Re: [NTG-context] mathfun (Hans Hagen)
On 5/21/2021 11:55 PM, Jeong Dal wrote: Dear Hans, Thank you for your new module for math. If possible, I prefer to use $ \sqrt(x) = \compute\sqrt[.3N] {2} $ $ \pi = \mathexpr[.40N]{pi} $ It is more direct to use and good to write a text in which we need some math calculation. It is another good news for me. I hope it covers at least all the functions in metafun and in lua. we have several math libs: math (lua one) xmath(c one, more functions) xcomplex (c one + cerf) xdecimal (same as mp) (as experiment, m-mathfun only maps a few but we can map more) - 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 ___
Re: [NTG-context] mathfun
On 5/21/2021 11:01 PM, Henning Hraban Ramm wrote: Am 21.05.2021 um 15:15 schrieb Hans Hagen : I uploaded an lmtx update (only m-mathfun added). Attached a short description of this (windy stormy friday afternoon) math experiment. The question is, what similar features using this trickery come to mind. Thank you! I can probably simplify my invoices with such directly calculated output, even if I don’t need a lot of math, just some addition and tax percents. But I got no time to look into that ATM. I also didn’t look into formatters yet. Is there a possibility for l10n, e.g. replacing decimal points by commas? (At the moment I’m converting via string and replace.) e.g. can I "format" from 12.00 (1.5) to "12,00 €" ("1,50 €") or even "12,-- €" (still "1,50 €")? (I finally bought Ierusalimschy’s Lua book and hope to find some time for it in the upcoming holiday week with my children.) \luaexpr[.M]{1234.56} \luaexpr[.m]{1234.56} you can use the formatters that context already has - 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 ___
Re: [NTG-context] mathfun (Hans Hagen)
Dear Hans, Thank you for your new module for math. If possible, I prefer to use $ \sqrt(x) = \compute\sqrt[.3N] {2} $ $ \pi = \mathexpr[.40N]{pi}$ It is more direct to use and good to write a text in which we need some math calculation. It is another good news for me. I hope it covers at least all the functions in metafun and in lua. Best regards, Dalyoung___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/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] mathfun
> Am 21.05.2021 um 15:15 schrieb Hans Hagen : > > I uploaded an lmtx update (only m-mathfun added). > > Attached a short description of this (windy stormy friday afternoon) math > experiment. The question is, what similar features using this trickery come > to mind. Thank you! I can probably simplify my invoices with such directly calculated output, even if I don’t need a lot of math, just some addition and tax percents. But I got no time to look into that ATM. I also didn’t look into formatters yet. Is there a possibility for l10n, e.g. replacing decimal points by commas? (At the moment I’m converting via string and replace.) e.g. can I "format" from 12.00 (1.5) to "12,00 €" ("1,50 €") or even "12,-- €" (still "1,50 €")? (I finally bought Ierusalimschy’s Lua book and hope to find some time for it in the upcoming holiday week with my children.) 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 ___
Re: [NTG-context] mathfun
On Fri, 21 May 2021, Otared Kavian wrote: > By the way, what does > > \complexexpr{123 + new(456,789)} > > mean? Haven't look at the code yet, but I'd guess `new(a,b) = a + bi`. Aditya ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context webpage : http://www.pragma-ade.nl / http://context.aanhet.net archive : https://bitbucket.org/phg/context-mirror/commits/ wiki : http://contextgarden.net ___
Re: [NTG-context] Trouble constructing a drawer rail with MP
Hi, It was in fact not really "working", but it just happened that it looked more or less correct in one case, but not in the other. For example: The path Pkt[1]--dir(194)*10mm for example is not given by the two points Pkt[1] and "Pkt[1] shifted 10mm in direction 194 degrees", but Pkt[1] and the point which is 10mm from the origin, rotated 194 degrees. /Mikael On Fri, May 21, 2021 at 9:27 PM Willi Egger wrote: > > Hi Jairo! > > thank you so much, this is precisely what I need. > > Still I am wondering why this is not working starting at the Pkt[2] but > working when starting from Pkt[1]. > > Kind regards > > Willi > > > On 21 May 2021, at 13:15, Jairo A. del Rio wrote: > > > > Hi! > > > > Do > > > > p[102] := (origin--dir(194)*10mm) shifted Pkt[1]; > > > > and > > > > p[103] := (origin--dir(166)*10mm) shifted Pkt[2]; > > > > do what you need? > > > > Jairo > > > > El vie, 21 de may. de 2021 a la(s) 05:57, Willi Egger (cont...@boede.nl) > > escribió: > > Hello MP Gurus! > > > > I wanted to make a technical drawing. However the enclosed mwe does not > > give me the required results. > > > > While the vector from point 1 is directing in the desired direction of 194 > > degrees, the second vector from point 2 does not as defined point in the > > direction of 166 degrees. > > > > What am I doing wrong here? > > > > > > Thanks for pointing me into the right direction :-) > > > > Willi > > > > > > ___ > > If your question is of interest to others as well, please add an entry to > > the Wiki! > > > > maillist : ntg-context@ntg.nl / > > http://www.ntg.nl/mailman/listinfo/ntg-context > > webpage : http://www.pragma-ade.nl / http://context.aanhet.net > > archive : https://bitbucket.org/phg/context-mirror/commits/ > > wiki : http://contextgarden.net > > ___ > > ___ > > If your question is of interest to others as well, please add an entry to > > the Wiki! > > > > maillist : ntg-context@ntg.nl / > > http://www.ntg.nl/mailman/listinfo/ntg-context > > webpage : http://www.pragma-ade.nl / http://context.aanhet.net > > archive : https://bitbucket.org/phg/context-mirror/commits/ > > wiki : http://contextgarden.net > > ___ > > ___ > If your question is of interest to others as well, please add an entry to the > Wiki! > > maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context > webpage : http://www.pragma-ade.nl / http://context.aanhet.net > archive : https://bitbucket.org/phg/context-mirror/commits/ > wiki : http://contextgarden.net > ___ ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/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] Hand Style Sketching in Metapost
I have updated LMTX and indeed seems to be working now Thanks Op do 20 mei 2021 om 21:05 schreef Aditya Mahajan : > On Thu, 20 May 2021, Jeroen wrote: > > > I have the following working example with hatching. This works fine, but > > when I uncomment the sketching commands, no figure is rendered. Is the > > mp-sketch macro still working? > > Seems to be working here with LMTX ver. 2021.04.29. See attached. > > > Aditya___ > If your question is of interest to others as well, please add an entry to > the Wiki! > > maillist : ntg-context@ntg.nl / > http://www.ntg.nl/mailman/listinfo/ntg-context > webpage : http://www.pragma-ade.nl / http://context.aanhet.net > archive : https://bitbucket.org/phg/context-mirror/commits/ > wiki : http://contextgarden.net > > ___ > ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context webpage : http://www.pragma-ade.nl / http://context.aanhet.net archive : https://bitbucket.org/phg/context-mirror/commits/ wiki : http://contextgarden.net ___
Re: [NTG-context] t-vim module: no highlighting for custom filetypes
On 2021-05-21, Aditya Mahajan wrote: > nvim was 8-10% faster than vim in my tests: > > https://adityam.github.io/context-blog/post/vim-vs-neovim/ Interesting, thanks for sharing. > I actually want t-vim (or rather t-filter) to support more > editors/syntax highlighters. At some stage I had added rudimentary > support for other syntax highlighters most of them required > scaffolding to wrap around the latex output: > > https://adityam.github.io/context-blog/post/clean-tex-output/ I think I have said that already, but it is worth repeating: t-vim is a genius idea! Vim is universally available and it supports almost any imaginable syntax. t-vim makes creating code-oriented documents absolutely painless (ConTeXt helps, of course). And it makes me scream when I have to do that in LaTeX. So, kudos for that. Personally, I do not think that supporting other highlighters would add much value to what is already there. But if it is possible to make the module more general without overcomplicating it, it might be a good idea. I have only a minor annoyance: I have just noticed that -- is typeset as an en-dash in LMTX (but not in MKIV, as documented). Could you look into that? Nicola ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/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] Trouble constructing a drawer rail with MP
Hi Jairo! thank you so much, this is precisely what I need. Still I am wondering why this is not working starting at the Pkt[2] but working when starting from Pkt[1]. Kind regards Willi > On 21 May 2021, at 13:15, Jairo A. del Rio wrote: > > Hi! > > Do > > p[102] := (origin--dir(194)*10mm) shifted Pkt[1]; > > and > > p[103] := (origin--dir(166)*10mm) shifted Pkt[2]; > > do what you need? > > Jairo > > El vie, 21 de may. de 2021 a la(s) 05:57, Willi Egger (cont...@boede.nl) > escribió: > Hello MP Gurus! > > I wanted to make a technical drawing. However the enclosed mwe does not give > me the required results. > > While the vector from point 1 is directing in the desired direction of 194 > degrees, the second vector from point 2 does not as defined point in the > direction of 166 degrees. > > What am I doing wrong here? > > > Thanks for pointing me into the right direction :-) > > Willi > > > ___ > If your question is of interest to others as well, please add an entry to the > Wiki! > > maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context > webpage : http://www.pragma-ade.nl / http://context.aanhet.net > archive : https://bitbucket.org/phg/context-mirror/commits/ > wiki : http://contextgarden.net > ___ > ___ > If your question is of interest to others as well, please add an entry to the > Wiki! > > maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context > webpage : http://www.pragma-ade.nl / http://context.aanhet.net > archive : https://bitbucket.org/phg/context-mirror/commits/ > wiki : http://contextgarden.net > ___ ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context webpage : http://www.pragma-ade.nl / http://context.aanhet.net archive : https://bitbucket.org/phg/context-mirror/commits/ wiki : http://contextgarden.net ___
Re: [NTG-context] mathfun
On 5/21/2021 5:24 PM, Otared Kavian wrote: Hi Hans, Thanks for the new features you have introduced in the module mathfun. Actually I have been using commands such as the one mentioned by Aditya, \ctxlua{myfunction(args)} but for the formatting of the output, that is when one wants only 3 or four decimal digits, that approach is not very handy. So I will use the new feature and I’ll put it on the wiki once I have a few interesting examples. By the way, what does \complexexpr{123 + new(456,789)} complex numbers, so (re=123,im=0) + (re=456,im=789) this uses the xcomplex library that is in lmtx, while ecimal uses the xdecimal library for decimal precision(as in metapost decimal mode) 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 ___
Re: [NTG-context] mathfun
Hi Hans, Thanks for the new features you have introduced in the module mathfun. Actually I have been using commands such as the one mentioned by Aditya, \ctxlua{myfunction(args)} but for the formatting of the output, that is when one wants only 3 or four decimal digits, that approach is not very handy. So I will use the new feature and I’ll put it on the wiki once I have a few interesting examples. By the way, what does \complexexpr{123 + new(456,789)} mean? Best regards: Otared > On 21 May 2021, at 17:06, Hans Hagen wrote: > > On 5/21/2021 4:37 PM, Aditya Mahajan wrote: >> On Fri, 21 May 2021, Hans Hagen wrote: >>> I uploaded an lmtx update (only m-mathfun added). >>> >>> Attached a short description of this (windy stormy friday afternoon) math >>> experiment. The question is, what similar features using this trickery come >>> to >>> mind. >> Personally, I can see occasionally making use of this instead of >> \ctxlua{myfunction(args)}. There is a similar library called pgfmath which >> is part of the tikz package, which is used quite heavily by the pgfplots >> package but also appears to be popular for other purposes: >> https://tex.stackexchange.com/questions/tagged/pgfmath?tab=Votes > I guessed right that you would be the first to to react! Anyway, I suppose > that you come up with additional demands like: > >\permanent\protected\def\randomized{\thewithproperty\plustwo} > > so that we can do: > >$ \sin(x) = \randomized\sin{2pi} $ > > which i'm sure you can figure out by looking at the source. > > 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] mathfun
On 5/21/2021 4:37 PM, Aditya Mahajan wrote: On Fri, 21 May 2021, Hans Hagen wrote: I uploaded an lmtx update (only m-mathfun added). Attached a short description of this (windy stormy friday afternoon) math experiment. The question is, what similar features using this trickery come to mind. Personally, I can see occasionally making use of this instead of \ctxlua{myfunction(args)}. There is a similar library called pgfmath which is part of the tikz package, which is used quite heavily by the pgfplots package but also appears to be popular for other purposes: https://tex.stackexchange.com/questions/tagged/pgfmath?tab=Votes I guessed right that you would be the first to to react! Anyway, I suppose that you come up with additional demands like: \permanent\protected\def\randomized{\thewithproperty\plustwo} so that we can do: $ \sin(x) = \randomized\sin{2pi} $ which i'm sure you can figure out by looking at the source. 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 ___
Re: [NTG-context] mathfun
On Fri, 21 May 2021, Hans Hagen wrote: > I uploaded an lmtx update (only m-mathfun added). > > Attached a short description of this (windy stormy friday afternoon) math > experiment. The question is, what similar features using this trickery come to > mind. Personally, I can see occasionally making use of this instead of \ctxlua{myfunction(args)}. There is a similar library called pgfmath which is part of the tikz package, which is used quite heavily by the pgfplots package but also appears to be popular for other purposes: https://tex.stackexchange.com/questions/tagged/pgfmath?tab=Votes Aditya ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context webpage : http://www.pragma-ade.nl / http://context.aanhet.net archive : https://bitbucket.org/phg/context-mirror/commits/ wiki : http://contextgarden.net ___
Re: [NTG-context] t-vim module: no highlighting for custom filetypes
On Fri, 21 May 2021, Nicola wrote: > On 2021-05-21, Nicola wrote: > > For some reason, the vim module has stopped highlighting code associated > > to custom filetypes (it still works for built-in filetypes). > > I think I have found the culprit. In t-vim.tex, lines 63-88, Vim is > called with --clean. That option appears *after* -u, effectively > overriding it. Moving --clean as the first option (or, better, removing > it) solves my issue. > > Some remarks. The module has this comment: > >--clean % dont load scada [sic] file (nvim) > > If the purpose of the option is to avoid loading a shada file, `-i NONE` > (which is already there) should be enough. Thanks for finding the bug. > In Vim, --clean is not strictly necessary, because it is effectively > a shorthard for `-N -i NONE --noplugin`. > In Neovim, the meaning might be > slightly different. Which brings me to the next paragraph. Indeed, the vim manpage says: --clean Do not use any personal configuration (vimrc, plugins, etc.). Useful to see if a problem reproduces with a clean Vim setup. while nvim manpage says: --clean Skip loading plugins and shada (viminfo) file. So, in vim, the --clean option also skips vimrc while in nvim it does not. Looking at my git log, I see that I added --clean option for nvim: commit b907543d9f6b2185185f3674035987f47bf91381 Author: Aditya Mahajan Date: Wed Apr 29 17:48:24 2020 -0400 Add --clean option to not load viminfo files in `nvim`. Somehow `nvim` does not honor ``` -i NONE ``` option. Looking at the man page of nvim I see -i shadaUse shada instead of the default ~/.local/share/nvim/shada/main.shada. If shada is NONE, do not read or write a ShaDa file. :help shada So, -i NONE should have worked. I'll test this again, and if -i NONE now works in nvim, I'll simply remove that line. > My recommendation would be not to care about Neovim. It is *not* > a drop-in replacement for Vim and not meant to be compatible with Vim > (it has already diverged from Vim in significant ways). Supporting both > is likely going to become more and more difficult as time goes by. nvim was 8-10% faster than vim in my tests: https://adityam.github.io/context-blog/post/vim-vs-neovim/ > Anyway, if you do want to support both, I'd suggest at least to > segregate the two commands, even if currently they may be (almost) > identical. That's a good suggestion. For now, I'll play around with the order of options to seei if that fixes the problem. I agree that at some stage it might be better to simply split off the module into a `t-nvim.tex` which configures the settings for nvim separately. I actually want t-vim (or rather t-filter) to support more editors/syntax highlighters. At some stage I had added rudimentary support for other syntax highlighters most of them required scaffolding to wrap around the latex output: https://adityam.github.io/context-blog/post/clean-tex-output/ Aditya ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context webpage : http://www.pragma-ade.nl / http://context.aanhet.net archive : https://bitbucket.org/phg/context-mirror/commits/ wiki : http://contextgarden.net ___
Re: [NTG-context] definelabel and TEXpage
On 5/21/2021 00:16, Wolfgang Schuster wrote: Rik Kabel schrieb am 21.05.2021 um 04:31: In the following example: \definelabel[BB][alternative=inright,headcolor=red,text=] \startTEXpage Where is the label?\BB \stopTEXpage The label is not displayed if a TEXpage is used, but if the start/stop is changed to starttext/stoptext, all is well. Is this expected? Yes this is normal because a TEXPage has no margin areas. \showframe \starttext \blackrule[width=\hsize,height=\vsize,color=green] \startTEXpage[width=\paperwidth,height=\paperheight] \blackrule[width=\hsize,height=\vsize,color=orange] \stopTEXpage \stoptext Wolfgang Indeed, and I would have seen this if I had not used the inright alternative. Sorry for the noise. -- Rik ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context webpage : http://www.pragma-ade.nl / http://context.aanhet.net archive : https://bitbucket.org/phg/context-mirror/commits/ wiki : http://contextgarden.net ___
Re: [NTG-context] Color problem
On 5/21/2021 00:26, Wolfgang Schuster wrote: Aditya Mahajan schrieb am 21.05.2021 um 04:47: On Thu, 20 May 2021, Rik Kabel wrote: Consider the following example: \define \HighlightColor {red} Why not just use: \definecolor[HighlightColor][red] and then use color=HighlightColor, etc. This is the better way to create unique color names but the problem in the example was the use of \define instead of \defineexpandable. \defineexpandable\HighlightColor{red} Wolfgang Wolfgang and Aditya, Thank you both for the lesson. Is the difference between MkIV (--luatex) and LMTX due to stricter application of expandability in LMTX? -- Rik ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context webpage : http://www.pragma-ade.nl / http://context.aanhet.net archive : https://bitbucket.org/phg/context-mirror/commits/ wiki : http://contextgarden.net ___
[NTG-context] mathfun
Hi, I uploaded an lmtx update (only m-mathfun added). Attached a short description of this (windy stormy friday afternoon) math experiment. The question is, what similar features using this trickery come to mind. 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 - math-fun.pdf Description: Adobe PDF document ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context webpage : http://www.pragma-ade.nl / http://context.aanhet.net archive : https://bitbucket.org/phg/context-mirror/commits/ wiki : http://contextgarden.net ___
Re: [NTG-context] t-vim module: no highlighting for custom filetypes
On 2021-05-21, Nicola wrote: > For some reason, the vim module has stopped highlighting code associated > to custom filetypes (it still works for built-in filetypes). I think I have found the culprit. In t-vim.tex, lines 63-88, Vim is called with --clean. That option appears *after* -u, effectively overriding it. Moving --clean as the first option (or, better, removing it) solves my issue. Some remarks. The module has this comment: --clean % dont load scada [sic] file (nvim) If the purpose of the option is to avoid loading a shada file, `-i NONE` (which is already there) should be enough. In Vim, --clean is not strictly necessary, because it is effectively a shorthard for `-N -i NONE --noplugin`. In Neovim, the meaning might be slightly different. Which brings me to the next paragraph. My recommendation would be not to care about Neovim. It is *not* a drop-in replacement for Vim and not meant to be compatible with Vim (it has already diverged from Vim in significant ways). Supporting both is likely going to become more and more difficult as time goes by. Anyway, if you do want to support both, I'd suggest at least to segregate the two commands, even if currently they may be (almost) identical. Hope this helps! Nicola ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/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] [metafun example does not compile]
On 21/05/2021 14:14, Taco Hoekwater wrote: It looks like textext.dflt is undefined in the latest lmtx because it is now renamed to textext.dlft :) As we say in dutch: een kniesoor die daar op let ;-) ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/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] [metafun example does not compile]
the line preventing the output from showing uo seems to be be: draw textext.dflt("DFLT-" & MonTexte) shifted PB; If I remove that, I'll get output. ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/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] [metafun example does not compile]
Hi, It looks like textext.dflt is undefined in the latest lmtx because it is now renamed to textext.dlft :) > On 21 May 2021, at 14:03, Floris van Manen wrote: > > Using the example from the wiki > https://wiki.contextgarden.net/textext_positioning > > then using the latest version of lmtx > > $ context --version > mtx-context | ConTeXt Process Management 1.04 > mtx-context | > mtx-context | main context file: > /home/vm/context/tex/texmf-context/tex/context/base/mkiv/context.mkiv > mtx-context | current version: 2021.05.20 16:06 > mtx-context | main context file: > /home/vm/context/tex/texmf-context/tex/context/base/mkxl/context.mkxl > mtx-context | current version: 2021.05.20 16:06 > > > it will produce an error (and an empty page) > > > metapost> initializing instance 'metafun:1' using format 'metafun' > and method 'default' > metapost> loading 'metafun' as 'metafun.mpxl' using method 'default' > metapost> initializing number mode 'scaled' > metafun > log > > metafun > log > error: Unknown relation will be considered false > metafun > log > > metapost> log > > metapost> log > > metapost> log >) > metapost> log > > thetextext->...FIX2)(rawtextext(ddecimal(EXPR3)),(EXPR4))else:if.anchortextexts>0:image(draw(EXPR3)withprescript"tx_anchor="&ddecimal(EXPR4))else:(EXPR3)fi.if(mfun_labtype(SUFFIX2)>=10) > metapost> log > :shifted(0,y... > metapost> log > > thetextext->begingroup.if.string(EXPR3):thetextext(SUFFIX2)(rawtextext((EXPR3)),(EXPR4)) > metapost> log > > elseif.numeric(EXPR3):thetextext(SUFFIX2)(rawtextext(decimal(EXPR3)),(EXPR4))elseif.pair(EXPR3):thetextext(SU... > metapost> log > > textext->begingroup.thetextext(SUFFIX2)((EXPR3),origin) > metapost> log > endgroup > metapost> log > <*> ...A; draw PA withpen pencircle scaled 1.5mm > withcolor red; pair PB ; PB := PA shifted decal ; draw textext.drt ("DRT-" & > MonTexte) shifted PB; draw textext.dflt("DFLT-" & MonTexte) > metafun > log > > metafun > log > Oh dear. I can't decide if the expression above is > positive, negative, or zero. > So this comparison test won't be 'true'. > > > > > As in most of the cases with software, there is (probably) a reason to it ;-) > > > .F > ___ > If your question is of interest to others as well, please add an entry to the > Wiki! > > maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/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 E: t...@bittext.nl genderfluid (all pronouns) ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/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] [metafun example does not compile]
Using the example from the wiki https://wiki.contextgarden.net/textext_positioning then using the latest version of lmtx $ context --version mtx-context | ConTeXt Process Management 1.04 mtx-context | mtx-context | main context file: /home/vm/context/tex/texmf-context/tex/context/base/mkiv/context.mkiv mtx-context | current version: 2021.05.20 16:06 mtx-context | main context file: /home/vm/context/tex/texmf-context/tex/context/base/mkxl/context.mkxl mtx-context | current version: 2021.05.20 16:06 it will produce an error (and an empty page) metapost> initializing instance 'metafun:1' using format 'metafun' and method 'default' metapost> loading 'metafun' as 'metafun.mpxl' using method 'default' metapost> initializing number mode 'scaled' metafun > log > metafun > log > error: Unknown relation will be considered false metafun > log > metapost> log > metapost> log > metapost> log >) metapost> log > thetextext->...FIX2)(rawtextext(ddecimal(EXPR3)),(EXPR4))else:if.anchortextexts>0:image(draw(EXPR3)withprescript"tx_anchor="&ddecimal(EXPR4))else:(EXPR3)fi.if(mfun_labtype(SUFFIX2)>=10) metapost> log > :shifted(0,y... metapost> log > thetextext->begingroup.if.string(EXPR3):thetextext(SUFFIX2)(rawtextext((EXPR3)),(EXPR4)) metapost> log > elseif.numeric(EXPR3):thetextext(SUFFIX2)(rawtextext(decimal(EXPR3)),(EXPR4))elseif.pair(EXPR3):thetextext(SU... metapost> log > textext->begingroup.thetextext(SUFFIX2)((EXPR3),origin) metapost> log > endgroup metapost> log > <*> ...A; draw PA withpen pencircle scaled 1.5mm withcolor red; pair PB ; PB := PA shifted decal ; draw textext.drt ("DRT-" & MonTexte) shifted PB; draw textext.dflt("DFLT-" & MonTexte) metafun > log > metafun > log > Oh dear. I can't decide if the expression above is positive, negative, or zero. So this comparison test won't be 'true'. As in most of the cases with software, there is (probably) a reason to it ;-) .F ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/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] Trouble constructing a drawer rail with MP
Hi! Do p[102] := (origin--dir(194)*10mm) shifted Pkt[1]; and p[103] := (origin--dir(166)*10mm) shifted Pkt[2]; do what you need? Jairo El vie, 21 de may. de 2021 a la(s) 05:57, Willi Egger (cont...@boede.nl) escribió: > Hello MP Gurus! > > I wanted to make a technical drawing. However the enclosed mwe does not > give me the required results. > > While the vector from point 1 is directing in the desired direction of 194 > degrees, the second vector from point 2 does not as defined point in the > direction of 166 degrees. > > What am I doing wrong here? > > > Thanks for pointing me into the right direction :-) > > Willi > > > > ___ > If your question is of interest to others as well, please add an entry to > the Wiki! > > maillist : ntg-context@ntg.nl / > http://www.ntg.nl/mailman/listinfo/ntg-context > webpage : http://www.pragma-ade.nl / http://context.aanhet.net > archive : https://bitbucket.org/phg/context-mirror/commits/ > wiki : http://contextgarden.net > > ___ > ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context webpage : http://www.pragma-ade.nl / http://context.aanhet.net archive : https://bitbucket.org/phg/context-mirror/commits/ wiki : http://contextgarden.net ___
[NTG-context] Trouble constructing a drawer rail with MP
Hello MP Gurus!I wanted to make a technical drawing. However the enclosed mwe does not give me the required results.While the vector from point 1 is directing in the desired direction of 194 degrees, the second vector from point 2 does not as defined point in the direction of 166 degrees.What am I doing wrong here?Thanks for pointing me into the right direction :-)Willi test-rail.pdf Description: Adobe PDF document test-rail.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] t-vim module: no highlighting for custom filetypes
For some reason, the vim module has stopped highlighting code associated to custom filetypes (it still works for built-in filetypes). For instance, typeset this: \usemodule[vim] \startvimrc[name=foo] set nocompatible set runtimepath+=~/foo/ \stopvimrc \definevimtyping[foo][ style={\switchtobodyfont[16pt,tt]}, directory=code/, syntax=foo, alternative=pscolor, vimrc=foo, ] \starttext \startfoo let while endwhile \stopfoo \stoptext The ~/foo/ directory contains ftdetect/foo.vim: au BufRead,BufNewFile *.foo setfiletype foo and syntax/foo.vim: if exists("b:current_syntax") finish endif syn case match syn iskeyword @,48-57,192-255,_ syn keyword fooKeyword let while endwhile hi def link fooKeyword Keyword let b:current_syntax = "foo" If I change `syntax=foo` to, say, `syntax=vim` in \definevimtyping then the code is highlighted. So, I suspect that I am not configuring the runtimepath correctly. Any idea how to fix this? I am using the latest LMTX to which I have added modules as explained here: https://wiki.contextgarden.net/Modules#ConTeXt_LMTX t-vim VERSION reads 2021.03.01. Nicola ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/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] Synctex broken in LMTX ?
On 2021-05-21, Hans Hagen wrote: > On 5/21/2021 10:50 AM, Nicola wrote: >> On 2021-05-20, Hans Hagen wrote: >> One thing he asked is what I was asking you: it would be useful if there were a way to sync in the other direction as well. >>> You mean sort of trying to deduce from the synctex file where to go in >>> the pdf? >> >> Yes. You provide a .tex file and a line number, and maybe also an >> optional column number, and mtxrun outputs a .pdf file, a page number >> and a coordinate pair or bounding box (I don't know what the best output >> is). > > define 'tex file' ... is that the master file? in that case we're > talking about the 'foo.synctex file' because how does a tex file knows > what pdf is related? Good point. I don't know how/if searching from source to PDF works in TeXShop when the source is split into several files. Nicola ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/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] Synctex broken in LMTX ?
On 5/21/2021 10:50 AM, Nicola wrote: On 2021-05-20, Hans Hagen wrote: One thing he asked is what I was asking you: it would be useful if there were a way to sync in the other direction as well. You mean sort of trying to deduce from the synctex file where to go in the pdf? Yes. You provide a .tex file and a line number, and maybe also an optional column number, and mtxrun outputs a .pdf file, a page number and a coordinate pair or bounding box (I don't know what the best output is). define 'tex file' ... is that the master file? in that case we're talking about the 'foo.synctex file' because how does a tex file knows what pdf is related? When the 'call external program' approach is used I can have an alternative (lua) output that is easier and might do that (less work). Lets first go one direction. Dick prefers to tackle both directions at once: maybe you can coordinate with each other. I only have a very old macbook and an old imac i once got so no real equipment to test anythign modern. I'd be happy to help, and I am sure other users are interested, too. Nicola ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context webpage : http://www.pragma-ade.nl / http://context.aanhet.net archive : https://bitbucket.org/phg/context-mirror/commits/ wiki : http://contextgarden.net ___ -- - 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 ___
Re: [NTG-context] Synctex broken in LMTX ?
On 2021-05-20, Hans Hagen wrote: >> One thing he asked is what I was asking you: it >> would be useful if there were a way to sync in the other direction as >> well. > You mean sort of trying to deduce from the synctex file where to go in > the pdf? Yes. You provide a .tex file and a line number, and maybe also an optional column number, and mtxrun outputs a .pdf file, a page number and a coordinate pair or bounding box (I don't know what the best output is). > When the 'call external program' approach is used I can have an > alternative (lua) output that is easier and might do that (less work). > Lets first go one direction. Dick prefers to tackle both directions at once: maybe you can coordinate with each other. > I only have a very old macbook and an old imac i once got so no real > equipment to test anythign modern. I'd be happy to help, and I am sure other users are interested, too. Nicola ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context webpage : http://www.pragma-ade.nl / http://context.aanhet.net archive : https://bitbucket.org/phg/context-mirror/commits/ wiki : http://contextgarden.net ___