[NTG-context] Footer
Hi, I have to write a book : on the even pages at the bottom and on the left : the page number, a vertical line and the number of the chapter preceded by the text "Chapter" ; on the odd pages at the bottom and on the right : the title of the chapter, a line vertical and page number. Thanks for your help. Fabrice \setupfootertexts [{\getmarking[chapter]}] [{\pagenumber}] [{\pagenumber}] [Chapter\space\pagenumber] \starttext \startchapter [title=First chapter] \dorecurse{10}{\input knuth} \stopchapter \startchapter [title=Second chapter] \dorecurse{10}{\input knuth} \stopchapter \stoptext [image: pied_2.png] [image: pied_1.png] ___ 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] upload / some new math stuff
Hi Hans, I am not a font specialist and I use pagella and modern. I'm curious so I installed this new font in /home/viserion/LMTX/tex/texmf/fonts/opentype/public/newcomputermodern I tested your file and I get the following message Thank you Fabrice Running `lmtx' on `hans-33' with ``/home/viserion/LMTX/tex/texmf-linux-64/bin/mtxrun --autogenerate --script context --autopdf --purgeall hans-33'' resolvers | formats | executing runner 'run luametatex format': /home/viserion/LMTX/tex/texmf-linux-64/bin/luametatex --jobname="hans-33" --fmt=/home/viserion/LMTX/tex/texmf-cache/luatex-cache/context/5fe67e0bfe781ce0dde776fb1556f32e/formats/luametatex/cont-en.fmt --lua=/home/viserion/LMTX/tex/texmf-cache/luatex-cache/context/5fe67e0bfe781ce0dde776fb1556f32e/formats/luametatex/cont-en.lui --c:autopdf --c:currentrun=1 --c:fulljobname="./hans-33" --c:input="./hans-33" --c:kindofrun=1 --c:maxnofruns=9 --c:purgeall --c:texmfbinpath="/home/viserion/LMTX/tex/texmf-linux-64/bin" fonts > beware: no fonts are loaded yet, using 'lm mono' in box system > system > ConTeXt ver: 2021.06.10 23:13 LMTX fmt: 2021.6.11 int: english/english system > system > 'cont-new.mkxl' loaded open source > level 1, order 1, name '/home/viserion/LMTX/tex/texmf-context/tex/context/base/mkxl/cont-new.mkxl' system > beware: some patches loaded from cont-new.mkiv close source> level 1, order 1, name '/home/viserion/LMTX/tex/texmf-context/tex/context/base/mkxl/cont-new.mkxl' system > files > jobname 'hans-33', input './hans-33', result 'hans-33' fonts > latin modern fonts are not preloaded languages > language 'en' is active open source > level 1, order 2, name './hans-33.tex' open source > level 2, order 3, name '/home/viserion/LMTX/tex/texmf-context/tex/context/fonts/mkiv/type-imp-newcomputermodern.mkiv' close source> level 2, order 3, name '/home/viserion/LMTX/tex/texmf-context/tex/context/fonts/mkiv/type-imp-newcomputermodern.mkiv' fonts > defining > forced type 'otf' of 'newcm10-regular' not found fonts > defining > unable to define 'newcm10-regular.otf' as 'newcomputermodern-12pt-rm-tf-0--0' fonts > defining > font with asked name 'newcmmath-regular' is not found using lookup 'file' fonts > defining > unable to define 'newcmmath-regular' as 'newcomputermodern-12pt-mm-mr--3' fonts > defining > unable to define 'newcmmath-regular' as 'newcomputermodern-12pt-mm-mr--2' fonts > defining > unable to define 'newcmmath-regular' as 'newcomputermodern-12pt-mm-mr--1' fonts > defining > unable to define 'newcmmath-regular' as 'newcomputermodern-12pt-mm-mb--3' fonts > defining > unable to define 'newcmmath-regular' as 'newcomputermodern-12pt-mm-mb--2' fonts > defining > unable to define 'newcmmath-regular' as 'newcomputermodern-12pt-mm-mb--1' tex error > tex error on line 12 in file ./hans-33.tex: Math error: parameter 'quad' in style 0 is not set \p_distance \endgroup \stopimath \p_distance \stopforceddisplaymath \egroup \d_strc_math_number_width \wd \b_strc_formulas_number \ifcase \mathnumberstatus \setfalse \c_strc_math_has_number \or \ifzeropt \d_strc_math_number_width \setfalse \c_strc_math_has_number \else \settrue \c_strc_math_has \p_distance \endgroup \ifcase \c_strc_formulas_mode \Ucheckedstopdisplaymath \or \normalUstopmath \egroup \strc_formulas_flush_content_and_number \else \expandafter \stopinnermath \fi \afterdisplayspace \egroup \p_distance \strc_formulas_place_number \strc_formulas_flush_number \dostarttagged \t!formulacontent \empty \dotagregisterformula \c_strc_formulas_n \csname \e!stop \formulaparameter \c!alternative \v!formula \endcsname \dostoptagged \dostoptagged \nonoindentati \stopformula 2 % \setupbodyfont[cambria] 3 4 \starttext 5 6 \startformula 7 x = \integral^1_2 \mathinner{\vrule height 10mm depth 10mm width 5mm} = 8 x = \integral^1_2 \mathinner{\vrule height 20mm depth 20mm width 5mm} = 9 x = \integral^1_2 \mathinner{\vrule height 30mm depth 30mm width 5mm} = 10 x = \integral^1_2 \mathinner{x} = 11 x = \integral^1_2 x 12 >> \stopformula 13 14 \startformula 15 x = \int\Umathadaptsize^1_2 \mathinner{\vrule height 10mm depth 16 10mm width 5mm} = 17 x = \int\Umathadaptsize^1_2 \mathinner{\vrule height 20mm depth 18 20mm width 5mm} = 19 x = \int\Umathadaptsize^1_2 \mathinner{\vrule height 30mm depth 20 30mm width 5mm} = 21 x = \int\Umathadaptsize^1_2 \mathinner{x} = 22 x = \int\Umathadaptsize^1_2 x Sorry, but I can't typeset math unless various parameters have been set. This is normally done by loading special math fonts into the math family slots. Your font set is lacking at least the parameter mentioned earlier. mtx-context | fatal error: return code: 256 Le ven. 11 juin
[NTG-context] mathscript in math mode
Hi, Is it possible to run the macro in math mode ? Thank you Fabrice \usebodyfont [stix] \setupbodyfont[modern] \setupmathematics[stylealternative=calligraphic] \unexpanded\def\CScript#1#2{\start\switchtobodyfont[stixtwo] \m{{\mathscript{#1}}_{#2}}\stop} \unexpanded\def\cscript#1{\start\switchtobodyfont[stixtwo]\m{{\mathscript{#1}}}\stop} \starttext \cscript{P} \startformula \cscript{P} \stopformula \stoptext ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context webpage : http://www.pragma-ade.nl / http://context.aanhet.net archive : https://bitbucket.org/phg/context-mirror/commits/ wiki : http://contextgarden.net ___
Re: [NTG-context] Macro to write a letter with \ mathscript{}
Hi Hans and Wolfgang, I have tried your suggestions and it seems to work. Thank you so much. Fabrice Le sam. 17 avr. 2021 à 19:04, Wolfgang Schuster < wolfgang.schuster.li...@gmail.com> a écrit : > Fabrice Couvreur schrieb am 17.04.2021 um 16:30: > > Hi, > This is going to be difficult to explain because the code below works but > in a project with many components does not. Actually the macro does not > work in the definition environment in my project but in the same > environment of this simple code yes. Thank you for your possible help. > > > Without more information or a better example there is nothing which can be > done. > > It's possible you have multiple definitions for the command in your style > file, > you can also try if adding \usebodyfont[stixtwo] (or > \definebodyfont[...pt] when > you use a unconventional font size) to your setups. > > Wolfgang > > > ___ > 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] Macro to write a letter with \ mathscript{}
Hi, This is going to be difficult to explain because the code below works but in a project with many components does not. Actually the macro does not work in the definition environment in my project but in the same environment of this simple code yes. Thank you for your possible help. Fabrice \setupbodyfont[modern] \setupenumerations [before={}, after={\blank}, alternative=serried, number=no, title=yes, titleleft={(}, titleright={)}, prefix=yes, prefixsegments=chapter, way=bychapter, titlestyle=bold, width=broad] \defineenumeration [definition] [text=Définition, number=no, headcommand=\groupedcommand{}{}, style=slanted] \setupmathematics[stylealternative=calligraphic] \unexpanded\def\CScript#1#2{\start\switchtobodyfont[stixtwo]\m{{\mathscript{#1}}_{#2}}\stop} \unexpanded\def\cscript#1{\start\switchtobodyfont[stixtwo]\m{{\mathscript{#1}}}\stop} \starttext \startdefinition \placefigure[right]{}{ \startMPcode path rectangle; rectangle=unitsquare xscaled 6cm yscaled 4cm; draw rectangle withcolor green; label.bot("\cscript{C}", center rectangle); \stopMPcode} Soit \m{f} une fonction continue et positive sur un intervalle \m{[a\,;b]} et \cscript{C} sa courbe représentative dans un repère orthogonal. L'aire du domaine délimité par la courbe \cscript{C}, l'axe des abscisses et les droites d'équations \m{x=a} et \m{x=b}, exprimée en unité d'aire, est appelée {\bi intégrale de \m{a} à \m{b} de la fonction \m{f}}. \stopdefinition \stoptext ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context webpage : http://www.pragma-ade.nl / http://context.aanhet.net archive : https://bitbucket.org/phg/context-mirror/commits/ wiki : http://contextgarden.net ___
[NTG-context] Alignment with an enumeration
Hi, Is it possible that the first item is on the baseline of the definition environment title ? Thank you. Fabrice \define\ItemCommand {\hskip\zeropoint\relax\autoinsertnextspace} \setupitemgroup [itemize] [color=darkred, style=bold, distance=\spaceamount] \setupitemgroup [itemize:1] [option={n,packed,fit,intext}, command=\ItemCommand] \setupitemgroup [itemize:2] [lefttext=, righttext=, option={a,text}] \setupenumerations [before={}, after={\blank}, alternative=serried, number=no, title=yes, titleleft={(}, titleright={)}, prefix=yes, prefixsegments=chapter, way=bychapter, titlestyle=bold, width=broad] \defineenumeration [definition] [text=Définition, number=no, headcommand=\groupedcommand{}{}, style=normal] \starttext \startdefinition \input knuth \stopdefinition \startdefinition \startitemize[n] \startitem First item \stopitem \startitem Second item \stopitem \stopitemize \stopdefinition \stoptext ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context webpage : http://www.pragma-ade.nl / http://context.aanhet.net archive : https://bitbucket.org/phg/context-mirror/commits/ wiki : http://contextgarden.net ___
[NTG-context] Center a text (Metafun)
Hi Hans, Some time ago, you offered this code to respond to a specific request from me. I used this code again and wanted to know if it was possible for the title "Algorithm" to be automatically centered based on the content. Thank you Fabrice \definecolor[MyBlue][c=0.2 , m=0.03, y=0.00, k=0.00] \definecolor[maincolor] [b=.5] \defineframedtext [MyFrame] [frame=off, background=MyFrame, width=fit, height=fit, style=small] \startuseMPgraphic{MyFrame} path b; picture p; p := textext.rt("\tfx\bf\white\framedtextparameter{Title}"); p := p shifted (2BodyFontSize,OverlayHeight-ypart center p+.25ExHeight); b := boundingbox p leftenlarged .5EmWidth rightenlarged .5EmWidth topenlarged .5EmWidth bottomenlarged .5EmWidth ; fill OverlayBox withcolor "MyBlue" ; fill b withcolor \MPcolor{maincolor} ; draw p ; setbounds currentpicture to boundingbox currentpicture enlarged 2mm ; \stopuseMPgraphic \defineoverlay [MyFrame] [\useMPgraphic{MyFrame}] \starttext \MyFrame[Title=Algorithme]{% \m{a\gets 2x-1} \m{b\gets a²-1} \m{c\gets b\div 4} \m{d\gets c-a+x} } \stoptext ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context webpage : http://www.pragma-ade.nl / http://context.aanhet.net archive : https://bitbucket.org/phg/context-mirror/commits/ wiki : http://contextgarden.net ___
Re: [NTG-context] Lua code and table
Hi Hans The xx.tex file works for me Thanks Fabrice Le ven. 19 févr. 2021 à 14:28, Hans Hagen a écrit : > On 2/19/2021 2:12 PM, Jano Kula wrote: > > Hi, > > > > On Fri, 19 Feb 2021 at 13:06, Hans Hagen > <mailto:j.ha...@xs4all.nl>> wrote: > > > > On 2/19/2021 12:42 PM, Fabrice Couvreur wrote: > > > Hi Hans,Thanks again for the ideas to improve my code. However, I > > am new > > > to Lua and my level is far from sufficient to understand > > everything. Why > > > in no table do the crosses appear in the cells; which was my > > original > > > idea.Thank you.Fabrice > > I get a cross (see attached). > > > > > > I've got no crosses with ConTeXt ver: 2021.02.05 17:45 LMTX. > > Fresh install of ConTeXt ver: 2021.02.19 13:15 LMTX gives me no > > crosses, too. > > No missing fonts in both cases. > > Log and tuc attached. > And with the previously attached xx.tex file? maybe the mailer messes up > something? > > 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] Lua code and table
Hi Hans, Thanks again for the ideas to improve my code. However, I am new to Lua and my level is far from sufficient to understand everything. Why in no table do the crosses appear in the cells; which was my original idea. Thank you. Fabrice Le jeu. 18 févr. 2021 à 16:28, Fabrice Couvreur a écrit : > Hello Jano, > Thanks. > Fabrice > > Le jeu. 18 févr. 2021 à 16:27, Jano Kula a écrit : > >> Hello Fabrice, >> >> >> >> On Thu, 18 Feb 2021 at 16:19, Fabrice Couvreur < >> fabrice1.couvr...@gmail.com> wrote: >> >>> Hi all, Thanks to you, I'm not at your level with Lua, but I'm learning >>> thanks to you >>> Hans, I compiled your code and I get an error message : >>> >>> lua error > lua error on line 50 in file ./table_1.tex: >>> >>> token call, syntax: [ctxlua]:11: unexpected symbol near '=' >>> >>> 13 \startluacode >>> 14 function document.MyTable(specification) >>> 15 >>> 16 local pattern= specification.pattern >>> 17 local action = specification.action >>> 18 local conversion = specification.conversion or >>> "Characters" >>> 19 >>> 20 local n = #pattern >>> 21 >>> 22 -- context.startxtable { align = "middle,lohi", width = >>> "0.8cm", >>> 23 >> offset = "0.8ex", bodyfont = "9pt", framecolor = "cyan" } >>> >> >> Just comment out line 23, too, or join 22 + 23 to one line. >> >> Jano >> >> >> >> ___ >> 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] Lua code and table
Hello Jano, Thanks. Fabrice Le jeu. 18 févr. 2021 à 16:27, Jano Kula a écrit : > Hello Fabrice, > > > > On Thu, 18 Feb 2021 at 16:19, Fabrice Couvreur < > fabrice1.couvr...@gmail.com> wrote: > >> Hi all, Thanks to you, I'm not at your level with Lua, but I'm learning >> thanks to you >> Hans, I compiled your code and I get an error message : >> >> lua error > lua error on line 50 in file ./table_1.tex: >> >> token call, syntax: [ctxlua]:11: unexpected symbol near '=' >> >> 13 \startluacode >> 14 function document.MyTable(specification) >> 15 >> 16 local pattern= specification.pattern >> 17 local action = specification.action >> 18 local conversion = specification.conversion or >> "Characters" >> 19 >> 20 local n = #pattern >> 21 >> 22 -- context.startxtable { align = "middle,lohi", width = >> "0.8cm", >> 23 >> offset = "0.8ex", bodyfont = "9pt", framecolor = "cyan" } >> > > Just comment out line 23, too, or join 22 + 23 to one line. > > Jano > > > > ___ > 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] Lua code and table
Hi all, Thanks to you, I'm not at your level with Lua, but I'm learning thanks to you Hans, I compiled your code and I get an error message : lua error > lua error on line 50 in file ./table_1.tex: token call, syntax: [ctxlua]:11: unexpected symbol near '=' 13 \startluacode 14 function document.MyTable(specification) 15 16 local pattern= specification.pattern 17 local action = specification.action 18 local conversion = specification.conversion or "Characters" 19 20 local n = #pattern 21 22 -- context.startxtable { align = "middle,lohi", width = "0.8cm", 23 >> offset = "0.8ex", bodyfont = "9pt", framecolor = "cyan" } 24 context.startxtable { "MyTable" } 25 context.startxrow() 26 context.startxcell { frame = "off" } 27 context() 28 context.stopxcell() 29 for i=1,n do 30 context.startxcell() 31 context.convertnumber(conversion,i) 32 context.stopxcell() 33 end mtx-context | fatal error: return code: 256 TeX Output exited abnormally with code 1 at Thu Feb 18 16:13:29 Thank you very much Fabrice Le jeu. 18 févr. 2021 à 10:06, Hans Hagen a écrit : > On 2/18/2021 12:22 AM, Bruce Horrocks wrote: > > >> On 17 Feb 2021, at 17:40, Fabrice Couvreur > wrote: > >> > >> Hi, The code works, but is it possible to make it shorter ? > OK, here is my take, based on earlier posts, bringing together some > 'technologies': > > (1) make a document function which isolatees the code > (2) then call it where needed > (3) use the built in conversion code > (4) use so called unique mp graphics (smaller files, faster run) > (5) use symbols to get the baseline right > (6) use a little abstraction in the table setup > > watch how we can pass a table instead of a string, so > > context.startxtable { align = "middle,lohi", width = "0.8cm", offset = > "0.8ex", bodyfont = "9pt", framecolor = "cyan" } > > is ok, but anm abstraction is even better. Now, who will wikify it ... > > %%% code %%% > > \setupbodyfont[pagella] > > \starttext > > \definextable >[MyTable] >[align={middle,lohi}, > width=0.8cm, > offset=0.8ex, > bodyfont=9pt, > framecolor=cyan] > > \startluacode > function document.MyTable(specification) > > local pattern= specification.pattern > local action = specification.action > local conversion = specification.conversion or "Characters" > > local n = #pattern > > -- context.startxtable { align = "middle,lohi", width = "0.8cm", > offset = "0.8ex", bodyfont = "9pt", framecolor = "cyan" } > context.startxtable { "MyTable" } > context.startxrow() > context.startxcell { frame = "off" } > context() > context.stopxcell() > for i=1,n do > context.startxcell() > context.convertnumber(conversion,i) > context.stopxcell() > end > context.stopxrow() > for i=1,n do > context.startxrow() > context.startxcell() > context.convertnumber(conversion,i) > context.stopxcell() > for j=1,n do > context.startxcell { align = "middle" } > action(string.sub(pattern[i],j,j)) > context.stopxcell() > end > context.stopxrow() > end > context.stopxtable() > > end > \stopluacode > > \startuniqueMPgraphic{cross}{width,height,depth,color,line} > draw image ( > draw (\MPvar{depth},\MPvar{height}) -- (\MPvar{width},0) ; > draw (\MPvar{depth},0) -- (\MPvar{width},\MPvar{height}) ; > ) > withpen pencircle scaled \MPvar{line} > withcolor \MPvar{color} ; > \stopuniqueMPgraphic > > \definesymbol >[MyRedCross] > > > [\uniqueMPgraphic{cross}{width=1em,height=1ex,depth=.5ex,color=red,line=.2ex}] > > \definesymbol >[MyGreenCross] > > > [\uniqueMPgraphic{cross}{width=1em,height=1ex,depth=.5ex,color=green,line=.2ex}] > > \startluacode > document.MyTab
[NTG-context] Lua code and table
Hi, The code works, but is it possible to make it shorter ? Thank you Fabrice \startuseMPgraphic{DiagonalRule} rulethickness := \frameddimension{rulethickness}; drawoptions( withpen pencircle scaled rulethickness withcolor \MPcolor{\framedparameter{framecolor}}); pair leftcorner, rightcorner, Leftcorner, Rightcorner; leftcorner := (rulethickness, \overlayheight-rulethickness); rightcorner := (\overlaywidth-rulethickness, rulethickness); Leftcorner := ( rulethickness, rulethickness); Rightcorner := (\overlaywidth-rulethickness,\overlayheight-rulethickness); draw leftcorner -- rightcorner; draw Leftcorner -- Rightcorner; \stopuseMPgraphic \defineoverlay [DiagonalRule] [\useMPgraphic{DiagonalRule}] \define[2]\DiagonalLabel{% \setuptabulate [after={\blank[\frameddimension{offset}]}] \starttabulate [|p|r|] \NC\NC \bf #2 \NC\NR \NC \bf #1 \NC\NC\NR \stoptabulate } \starttext \startluacode local background_one = { align = "middle", style = "type", background = "DiagonalRule", } local letters_1 = { "A", "B", "C", "D", "E", "F", "G", "H" } context.startxtable({"align={middle,lohi}, width=0.8cm,offset=0.8ex,bodyfont=9pt,framecolor=cyan"}) context.startxrow() context.startxcell({"frame=off"}) context() context.stopxcell() for _, letter in ipairs(letters_1) do context.startxcell() context(letter) context.stopxcell() end context.stopxrow() for _, letter in ipairs(letters_1) do context.startxrow() context.startxcell() context(letter) context.stopxcell() for j = 0, 7 do context.startxcell( j == 0 and letter == "B" and background_one or j == 0 and letter == "C" and background_one or j == 0 and letter == "D" and background_one or j == 0 and letter == "G" and background_one or j == 0 and letter == "H" and background_one or j == 1 and letter == "A" and background_one or j == 1 and letter == "E" and background_one or j == 1 and letter == "F" and background_one or j == 1 and letter == "G" and background_one or j == 2 and letter == "A" and background_one or j == 2 and letter == "D" and background_one or j == 2 and letter == "F" and background_one or j == 2 and letter == "G" and background_one or j == 2 and letter == "H" and background_one or j == 3 and letter == "A" and background_one or j == 3 and letter == "C" and background_one or j == 3 and letter == "E" and background_one or j == 3 and letter == "H" and background_one or j == 4 and letter == "B" and background_one or j == 4 and letter == "D" and background_one or j == 4 and letter == "F" and background_one or j == 4 and letter == "G" and background_one or j == 5 and letter == "B" and background_one or j == 5 and letter == "C" and background_one or j == 5 and letter == "E" and background_one or j == 6 and letter == "A" and background_one or j == 6 and letter == "B" and background_one or j == 6 and letter == "C" and background_one or j == 6 and letter == "E" and background_one or j == 7 and letter == "A" and background_one or j == 7 and letter == "C" and background_one or j == 7 and letter == "D" and background_one ) context() context.stopxcell() end context.stopxrow() end context.stopxtable() \stopluacode \stoptext ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context webpage : http://www.pragma-ade.nl / http://context.aanhet.net archive : https://bitbucket.org/phg/context-mirror/commits/ wiki : http://contextgarden.net ___
[NTG-context] Hatch a cell : meta:hash:left
Hi, I seem to have seen a method for hatching the cell of a table, but maybe it's my imagination. The following code does not work. Thanks for your help. Fabrice ## hatching.tex # \setupcolors[state=start] \usemodule[xwi] \starttext \startxtable [align={lohi,middle}, width=1.5cm,framecolor=purple] \startxrow \startxcell[background=color,backgroundcolor=paleturquoise] i \stopxcell \startxcell [background=meta:hash:left, meta:hash:linecolor=green] \stopxcell \startxcell 0 \stopxcell \startxcell 1 \stopxcell \startxcell 2 \stopxcell \stopxrow \stopxtable \stoptext ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context webpage : http://www.pragma-ade.nl / http://context.aanhet.net archive : https://bitbucket.org/phg/context-mirror/commits/ wiki : http://contextgarden.net ___
[NTG-context] Problem with \dfrac{}{} with lmtx updated
Hi, I just updated lmtx and I don't understand the error that occurs with the \dfrac{}{}. Thank you. Fabrice # \starttext \m{f(x)=\dfrac{a + b\ln(x)}{x}} \stoptext # tex error > tex error on line 2 in file ./hans_21.tex: Math error: parameter 'fractionnumup' in style 2 is not set \math_m_nop #1->\relax \ifmmode #1\else \normalstartimath #1\normalstopimath \fi \m{f(x)=\dfrac{a + b\ln(x)}{x}} 1 \starttext 2 >> \m{f(x)=\dfrac{a + b\ln(x)}{x}} 3 \stoptext Sorry, but I can't typeset math unless various parameters have been set. This is normally done by loading special math fonts into the math family slots. Your font set is lacking at least the parameter mentioned earlier. mtx-context | fatal error: return code: 256 TeX Output exited abnormally with code 1 at Thu Dec 24 16:30:13 ___ 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] Several lines under a limit
Hi Wolfgang, I knew the \substack command exists with latex but not with context, thanks a lot. Fabrice Le sam. 28 nov. 2020 à 16:29, Wolfgang Schuster < wolfgang.schuster.li...@gmail.com> a écrit : > Fabrice Couvreur schrieb am 28.11.2020 um 15:57: > > Hi, > > Is there a command that allows to write multiple lines under the command > > \lim ? > > I tried but ... > > Cordially > > Fabrice > > > > \starttext > > \startformula > >\lim_{ > > \vbox{\startalign > >\NC x \to 2 \NR > >\NC x > 2 \NR > > \stopalign}}=+\infty > > \stopformula > > \stoptext > > \starttext > > \startformula >\lim_{% > \startsubstack >x \to 2 \NR >x > 2 \NR > \stopsubstack >} = +\infty > \stopformula > > \stoptext > > Wolfgang > > ___ > 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] Several lines under a limit
Hi, Is there a command that allows to write multiple lines under the command \lim ? I tried but ... Cordially Fabrice \starttext \startformula \lim_{ \vbox{\startalign \NC x \to 2 \NR \NC x > 2 \NR \stopalign}}=+\infty \stopformula \stoptext ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context webpage : http://www.pragma-ade.nl / http://context.aanhet.net archive : https://bitbucket.org/phg/context-mirror/commits/ wiki : http://contextgarden.net ___
Re: [NTG-context] Import a metapost extension
Hello, That's okay, I'll compile the files with mpost and do an image insert. Thanks for your help. Fabrice Le mar. 1 sept. 2020 à 19:32, Wolfgang Schuster < wolfgang.schuster.li...@gmail.com> a écrit : > Taco Hoekwater schrieb am 01.09.2020 um 19:12: > > Hi, > > > On 1 Sep 2020, at 16:46, Hans Hagen > wrote: > > On 9/1/2020 3:04 PM, Fabrice Couvreur wrote: > > Hi Taco, > Thank you for your help. I specify that this extension works perfectly by > compiling the following file. > > A logfile of a failed run would have been more helpful in trying to track > down the problem. But I did notice that there is a LaTeX file loaded in your > succesful run. So perhaps the extension depends on LaTeX > > > I looked for the file online [1] and it uses LaTeX commands (even > begin/end blocks) for all text boxes. > > [1] https://melusine.eu.org/syracuse/poulecl/mp-scratch/ > > Wolfgang > > > ___ > If your question is of interest to others as well, please add an entry to > the Wiki! > > maillist : ntg-context@ntg.nl / > http://www.ntg.nl/mailman/listinfo/ntg-context > webpage : http://www.pragma-ade.nl / http://context.aanhet.net > archive : https://bitbucket.org/phg/context-mirror/commits/ > wiki : http://contextgarden.net > > ___ > ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context webpage : http://www.pragma-ade.nl / http://context.aanhet.net archive : https://bitbucket.org/phg/context-mirror/commits/ wiki : http://contextgarden.net ___
Re: [NTG-context] Import a metapost extension
Hi Taco, Thank you for your help. I specify that this extension works perfectly by compiling the following file. input mp-scratch; Scratchversion:=3; beginfig(1); draw Drapeau; draw Repeter("4"); draw Avancer("100"); draw Tournerd("90"); draw FinBlocRepeter; endfig; end But what you are proposing unfortunately does not work. Fabrice Le mar. 1 sept. 2020 à 14:25, Taco Hoekwater a écrit : > Hi, > > I think you need this: > > \startMPinclusions > input mp-scratch; > \stopMPinclusions > > \startMPcode > Scratchversion:=3; > …. > > If that also doesn’t work, perhaps attach the log file / terminal output > to a new message. > > Best wishes, > Taco > > > On 1 Sep 2020, at 13:07, Fabrice Couvreur > wrote: > > > > Hello > > Is it possible to import a metapost extension into a file compiled with > the lmtx engine ? > > I tried unsuccessfully with this example : > > > > begin test.tex > > > > \starttext > > \startMPcode > > input mp-scratch; > > > > Scratchversion:=3; > > > > draw Drapeau; > > draw Repeter("4"); > > draw Avancer("50"); > > draw Tournerd("90"); > > draw FinBlocRepeter; > > > > \stopMPcode > > \stoptext > > > > end test.tex > > > > Thanks > > Fabrice > > > ___ > > If your question is of interest to others as well, please add an entry > to the Wiki! > > > > maillist : ntg-context@ntg.nl / > http://www.ntg.nl/mailman/listinfo/ntg-context > > webpage : http://www.pragma-ade.nl / http://context.aanhet.net > > archive : https://bitbucket.org/phg/context-mirror/commits/ > > wiki : http://contextgarden.net > > > ___ > > Taco Hoekwater > Elvenkind BV > > > > > > ___ > If your question is of interest to others as well, please add an entry to > the Wiki! > > maillist : ntg-context@ntg.nl / > http://www.ntg.nl/mailman/listinfo/ntg-context > webpage : http://www.pragma-ade.nl / http://context.aanhet.net > archive : https://bitbucket.org/phg/context-mirror/commits/ > wiki : http://contextgarden.net > > ___ > This is MetaPost, version 2.00 (TeX Live 2020) (kpathsea version 6.3.2) 1 SEP 2020 15:01 **scratch-1.mp (/home/viserion/texlive/2020/texmf-dist/metapost/base/mpost.mp (/home/viserion/texlive/2020/texmf-dist/metapost/base/plain.mp Preloading the plain mem file, version 1.005) ) (./scratch-1.mp (/home/viserion/texmf/metapost/mp-scratch.mp (/home/viserion/texmf/metapost/LATEXScratch.mp) (/home/viserion/texmf/metapost/Mouvement.mp) (/home/viserion/texmf/metapost/Apparence.mp) (/home/viserion/texmf/metapost/Sons.mp) (/home/viserion/texmf/metapost/Stylo.mp ) (/home/viserion/texmf/metapost/Controle.mp) (/home/viserion/texmf/metapost/Evenements.mp) (/home/viserion/texmf/metapost/Bloc.mp) (/home/viserion/texmf/metapost/Divers.mp) (/home/viserion/texmf/metapost/Capteurs.mp) (/home/viserion/texmf/metapost/Variable.mp)) (./mptextmp.mp) (./mptextmp.mp) >> 34.55159 >> 55.29037 (./mptextmp.mp) (./mptextmp.mp) >> 105.50436 (./mptextmp.mp) (./mptextmp.mp) (./mptextmp.mp) (./mptextmp.mp) (./mptextmp.mp) (./mptextmp.mp) >> 39.74248 >> 63.32898 (./mptextmp.mp) (./mptextmp.mp) >> 84.05197 (./mptextmp.mp) (./mptextmp.mp) (./mptextmp.mp) (./mptextmp.mp) (./mptextmp.mp) (./mptextmp.mp) >> 56.92798 >> 92.35968 (./mptextmp.mp) (./mptextmp.mp) >> 112.43477 (./mptextmp.mp) (./mptextmp.mp) (./mptextmp.mp) (./mptextmp.mp) (./mptextmp.mp) (./mptextmp.mp) >> 97.13678 >> 127.64769 (./mptextmp.mp) (./mptextmp.mp) >> 171.08908 (./mptextmp.mp) [1{psfonts.map}{crlt_csjzgd.enc}] ) 1 output file written: scratch-1.1 ___ 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] Import a metapost extension
Hello Is it possible to import a metapost extension into a file compiled with the lmtx engine ? I tried unsuccessfully with this example : begin test.tex \starttext \startMPcode input mp-scratch; Scratchversion:=3; draw Drapeau; draw Repeter("4"); draw Avancer("50"); draw Tournerd("90"); draw FinBlocRepeter; \stopMPcode \stoptext end test.tex Thanks Fabrice ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context webpage : http://www.pragma-ade.nl / http://context.aanhet.net archive : https://bitbucket.org/phg/context-mirror/commits/ wiki : http://contextgarden.net ___
Re: [NTG-context] Mathematical symbol of non-inclusion
Hi Hans, Thank you for the clarification Fabrice Le dim. 30 août 2020 à 17:56, Hans Åberg a écrit : > > > On 30 Aug 2020, at 11:40, Fabrice Couvreur > wrote: > > > > @Hans My ignorance is total : how to write symbols from the keyboard ? > > I use text substitutions on MacOS: a sequence of characters can be > automatically translated into another. So for example, ".subset" might > translate into "⊂" as you type along. To find the ⊂ the first time, there > is a Unicode symbol table. Other platforms and editors have similar > features. There are other ways, but I have found this easiest and fastest > both to create and use. > > > > ___ > 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] Mathematical symbol of non-inclusion
Hello, Thank you for your answers. @Hans My ignorance is total : how to write symbols from the keyboard ? Fabrice Le sam. 29 août 2020 à 20:41, Hans Åberg a écrit : > > > On 29 Aug 2020, at 19:58, Wolfgang Schuster < > wolfgang.schuster.li...@gmail.com> wrote: > > > > Fabrice Couvreur schrieb am 29.08.2020 um 19:27: > >> Hello, > >> The result is not what you expected. > >> How can I correct this problem? > > > > 1. Wait for a fix. > > > > 2. Use \nsubset. > > > > \starttext > > \m{A \nsubset B} > > \stoptext > > One can also use Unicode directly, choosing the style: > > \starttext > \m{A ⊄ B ⊈ C ⊊ D} > \stoptext > > > ___ > If your question is of interest to others as well, please add an entry to > the Wiki! > > maillist : ntg-context@ntg.nl / > http://www.ntg.nl/mailman/listinfo/ntg-context > webpage : http://www.pragma-ade.nl / http://context.aanhet.net > archive : https://bitbucket.org/phg/context-mirror/commits/ > wiki : http://contextgarden.net > > ___ > ___ 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] Mathematical symbol of non-inclusion
Hello, The result is not what you expected. How can I correct this problem? Thank you Fabrice \starttext \m{A \not\subset B} \stoptext ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context webpage : http://www.pragma-ade.nl / http://context.aanhet.net archive : https://bitbucket.org/phg/context-mirror/commits/ wiki : http://contextgarden.net ___
Re: [NTG-context] Label to delete in the table of contents
Thanks !! Le lun. 24 août 2020 à 15:41, Wolfgang Schuster < wolfgang.schuster.li...@gmail.com> a écrit : > Fabrice Couvreur schrieb am 24.08.2020 um 15:32: > > Hi Wolfgang, > Thank you for your reply. Probably my fault but now I get the number 0 on > the word "Summary". > Fabrice > [image: contents.png] > > > \setuphead > [title] > [command=, >numbercommand=] > > Wolfgang > > > ___ > 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] Label to delete in the table of contents
Hi Wolfgang, Thank you for your reply. Probably my fault but now I get the number 0 on the word "Summary". Fabrice [image: contents.png] Le lun. 24 août 2020 à 15:12, Wolfgang Schuster < wolfgang.schuster.li...@gmail.com> a écrit : > Fabrice Couvreur schrieb am 23.08.2020 um 16:02: > > Hello, > For the title of the chapters I use the following command. > > \unexpanded\def\HeadTitle#1#2% >{\framed > [frame=off, >width=fit, >align=flushleft] >{\color[darkgray]{\tfxx\cap\bf\labeltext{chapter}} > \blank#1\blank#2} > > When I compile my project, I have the label "Chapitre" above the word > "Sommaire" in the table of contents : how to delete it ? > > > 1. Don't apply the command to \title > > \setuphead[title][command=] > > > 2. Make the command local to bodypart of your document, this works only > when you use section blocks (e.g. \startbodymatter) > > \startsectionblockenvironment[bodypart] > \setuphead[chapter][command=\HeadTitle] > \stopsectionblockenvironment > > > Wolfgang > > > ___ > 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] Color specific cells in a table
Hello, This table will be used to illustrate Pascal's triangle. I manage to color the cell (2,0) but I would also like to color the cells (2,1) and (3,1). Is it possible ? Thank you Fabrice \usecolors[X11] \starttext \startluacode local background_one = { align = "middle", style = "type", background = "color", backgroundcolor = "thistle2", foregroundcolor = "white", } local background_two = { align = "middle", style = "type", background = "color", backgroundcolor = "peachpuff", foregroundcolor = "white", } context.startxtable({"align={middle,lohi}, width=1cm,offset=0.8ex,bodyfont=9pt,framecolor=cyan"}) context.startxrow() context.startxcell({"background=color,backgroundcolor=thistle2"}) context("") context.stopxcell() for j = 0, 7 do context.startxcell({"foregroundstyle=bold,background=color,backgroundcolor=thistle2"}) context(j) context.stopxcell() end context.startxcell({"foregroundstyle=bold,background=color,backgroundcolor=thistle2"}) context("\\dots") context.stopxcell() context.stopxrow() for i = 0, 7 do context.startxrow() context.startxcell({"foregroundstyle=bold,background=color,backgroundcolor=thistle2"}) context(i) context.stopxcell() for j = 0, 8 do context.startxcell(j>i and background_one or i == 2 and j == 0 and background_two) context("") context.stopxcell() end context.stopxrow() end context.startxrow() context.startxcell({"background=color,backgroundcolor=thistle2"}) context("\\dots") context.stopxcell() for i = 0, 8 do context.startxcell() context("") context.stopxcell() end context.stopxrow() context.stopxtable() \stopluacode \stoptext ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context webpage : http://www.pragma-ade.nl / http://context.aanhet.net archive : https://bitbucket.org/phg/context-mirror/commits/ wiki : http://contextgarden.net ___
[NTG-context] Label to delete in the table of contents
Hello, For the title of the chapters I use the following command. \unexpanded\def\HeadTitle#1#2% {\framed [frame=off, width=fit, align=flushleft] {\color[darkgray]{\tfxx\cap\bf\labeltext{chapter}} \blank#1\blank#2} When I compile my project, I have the label "Chapitre" above the word "Sommaire" in the table of contents : how to delete it ? Thanks for your help Fabrice ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context webpage : http://www.pragma-ade.nl / http://context.aanhet.net archive : https://bitbucket.org/phg/context-mirror/commits/ wiki : http://contextgarden.net ___
[NTG-context] Chapter number with Luametafun
Hello, How to get the number of the current chapter ? How to get the label "Chapitre" ? Thanks for your help. Fabrice %%% Begin example \mainlanguage[fr] \setcharacterspacing [frenchpunctuation] \setuplabeltext[fr][chapter=Chapitre~] \startuseMPgraphic{fun} definecolor[name="Mycolor", s = 0.85 ] draw lmt_outline [ text = "1", kind = "fillup", fillcolor = "Mycolor", rulethickness = 1, ] xsized 1cm; \stopuseMPgraphic \unexpanded\def\MyNumber#1{\useMPgraphic{fun}#1} \unexpanded\def\Title#1#2{\framed[frame=off,width=fit,align=flushleft] {#1\blank#2}} \setuphead[chapter] [style=\bfd, align={flushleft,broad}, command=\Title, textcommand=\MyNumber, numbercommand=\groupedcommand{}{\MyNumber}, number=no] \starttext \startchapter [title={First chapter}] \input knuth.tex \stopchapter \startchapter [title={Second chapter}] \input knuth.tex \stopchapter \stoptext %%% end example ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context webpage : http://www.pragma-ade.nl / http://context.aanhet.net archive : https://bitbucket.org/phg/context-mirror/commits/ wiki : http://contextgarden.net ___
Re: [NTG-context] About the numbering of theorems
Hi Wolfgang, Thank you Fabrice Le ven. 7 août 2020 à 19:45, Wolfgang Schuster < wolfgang.schuster.li...@gmail.com> a écrit : > Fabrice Couvreur schrieb am 07.08.2020 um 16:30: > > Hello, > > I have a little problem with the numbering of theorems when there is no > > subsection. I would like to know : > > > > Theorem 1.1 > > Theorem 1.2 > > > > Theorem 2.3 > > Theorem 2.4 > > > > Thank you > > Fabrice > > Use a conversion set to set the number conversion for you sections and > remove the conversion setting (\setuphead[...][conversion=...]) from the > setups. > > \defineconversionset [fabrice] [n,n,R,n] [n] > > \setupheads >[sectionconversionset=fabrice] > > Wolfgang > > ___ > 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] About the numbering of theorems
Hello, I have a little problem with the numbering of theorems when there is no subsection. I would like to know : Theorem 1.1 Theorem 1.2 Theorem 2.3 Theorem 2.4 Thank you Fabrice begin example \setuplabeltext[chapter=Chapitre~] \unexpanded\def\Title#1#2{\framed[frame=off,width=fit,align=flushleft]{#1\blank#2}} \startbuffer[mybuffer] \starttheorem \input ward \stoptheorem \stopbuffer \setuphead [chapter] [style=\bfd, align={flushleft,broad}, command=\Title] \setuphead [section] [style=\bfc, distance=\zeropoint, sectionsegments=section, conversion={R}, align={flushleft,broad}, commandbefore={\space\endash\space}] \setuphead [subsection] [sectionsegments=subsection, conversion={n}, style=\bfb, align={flushleft,broad}] \setupenumerations [before={\blank}, after={\blank}, alternative=serried, title=yes, prefix=yes, prefixsegments=chapter, titlestyle=bold, width=broad] \defineenumeration [theorem] [text=Théorème, number=yes, style=italic] \starttext \startchapter [title={First chapter}] \startsection [title={First section}] \startsubsection [title={First subsection}] \dorecurse{2}{\getbuffer[mybuffer]} \stopsubsection \stopsection \stopchapter \startchapter [title={Second chapter}] \startsection [title={Second section}] \dorecurse{2}{\getbuffer[mybuffer]} \stopsection \stoptheorem \stopchapter \stoptext end example ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context webpage : http://www.pragma-ade.nl / http://context.aanhet.net archive : https://bitbucket.org/phg/context-mirror/commits/ wiki : http://contextgarden.net ___
Re: [NTG-context] Bug with \wordright in LMTX version 2020-08-03 14:25
Hello, I also use a square to complete a demonstration. I tried this without success Thank you Fabrice \definesymbol[Fin][\mathematics{\square}] \def\qed{\strut\wordright{\symbol[Fin]}} \defineenumeration [proof] [text=Démonstration, alternative=serried, distance=\zeropoint, number=no, headstyle=boldslanted, width=broad, closesymbol={\symbol[\qed]}] \starttext \startproof \startformula a^2 + b^2 = c^2 \stopformula \stopproof \stoptext Le mar. 4 août 2020 à 14:02, Otared Kavian a écrit : > Hi Hans, > > Thanks for the hint which consists in adding an \ifmmode to the definition > of \qed. > However, as you suggest, one needs some other mechanism in math mode, > since with your new definition of \qed the alignment of the formula changes > when one adds this close symbol: > > begin-example-qed.tex > \definesymbol[Fin][\mathematics{\square}] > \def\qed{\ifmmode\quad\symbol[Fin]\else\strut\wordright{\symbol[Fin]}\fi} > \starttext > \startformula > a^2 + b^2 = c^2. > \stopformula > \startformula > a^2 + b^2 = c^2. \qed > \stopformula > One sees that\type{\qed} in the formula changes the alignment of the > formula. \qed > \stoptext > end-example-qed.tex > > Thanks a lot for everything: Otared > > > On 4 Aug 2020, at 13:24, Hans Hagen wrote: > > > > On 8/4/2020 11:17 AM, Otared Kavian wrote: > >> Thanks Hans for your explanations. > >> The problem I encountered is that, the command \qed is used dozens of > time in my text without any issue because it was preceded by something on > th eline, but the only place where it was alone after a formula resulted in > the error and it was not easy for me to isolate the issue… > >> By the way, in mkii it was possible to add \qed on the last line of a > math formula, but that does not work anymore: > >> \definesymbol[Fin][\mathematics{\square}] > >> \def\qed{\strut\wordright{\symbol[Fin]}} > >> \starttext > >> \startformula > >> a^2 + b^2 = c^2. \qed > >> \stopformula > >> The above formula does not show the close symbol.\qed > >> \stoptext > >> Is there a way to have something like \qed work in math formulas? > > because that's now hwpo wordright works ... > > > > \def\qed{\ifmmode\quad\symbol[Fin]\else\strut\wordright{\symbol[Fin]}\fi} > > > > but we probably need something different, something that hooks into > display math > > > > 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 ___
[NTG-context] Notation of the first derivative in mathematical mode (lmtx)
Hello, I replaced the context engine with the lmtx engine but I find that the derivative symbol is too high regardless of the font used. I mainly use modern and pagella because I type many texts using mathematics: can we correct this problem, Thanks for your help. Fabrice \starttext \startitemize[n] \startitem \math{f'(x)=x²+4x+4} \stopitem \startitem \math{f''(x)=2x+4} \stopitem \stopitemize \stoptext ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context webpage : http://www.pragma-ade.nl / http://context.aanhet.net archive : https://bitbucket.org/phg/context-mirror/commits/ wiki : http://contextgarden.net ___
[NTG-context] Height of parentheses in a matrix with lmtx
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);} }} \stoptext ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context webpage : http://www.pragma-ade.nl / http://context.aanhet.net archive : https://bitbucket.org/phg/context-mirror/commits/ wiki : http://contextgarden.net ___
Re: [NTG-context] upload
Hi Hans, I updated the version of lmtx and wanted to test the following code \useMPlibrary[dum] \starttext \placefigure[right]{}{\externalfigure[dummy]} \input ward\par \placefigure[right]{}{\externalfigure[dummy]} {\bf \input ward} \par \stoptext This returns the error message runtime error : input file 'ward}.tex' is not found, quitting mtx-context | fatal error: return code: 256 TeX Output exited abnormally with code 1 at Tue Jul 28 10:57:55 Thank you Fabrice Le lun. 27 juil. 2020 à 16:42, Hans Hagen a écrit : > Hi, > > Normally we don't report on successive loe level improvements in the > engine or the core of context (we do so in articles and wrapups), and > much goes unnoticed anyway (which is good). But ... the last couple of > weeks we have been playing with some adapted functionality in lmtx and > some of the experimental low level code has now made it in core. > Normally users will not notice this but who knows. > > There are already features in lmtx that are not (and are unlikely to be) > in mkiv (most significant in the metapost related part). When possible > new macros and additions to mechanism will be in both mkiv and lmtx, but > lmtx users will be better off in the end. We're mostly talking of the > more tricky mechanisms here, those that currently have limitations due > to all kind of possible interferences. To summarize: > > mkii : frozen (seldom patches) > lmtx : cutting edge > mkiv : when possible following lmtx, otherwise frozen > > Because we develop lmtx and luametatex alongside it is no problem if we > have experimental (and even temporary imperfect) code in the engine: > context knows about it and especially with experiments, we try to make > sure it doesn't hit users (who we don't expect to use those, often > undocumented, new tricks anyway). It's sometimes the only way to go > forward (stepwise testing). > > So, here is an example of where lmtx can do better than mkiv: > > \placefigure[left]{}{} \input ward \par > \placefigure[left]{}{} {\bf \input ward} \par > > Another area is in using footnotes. As a first step to more robust > handling of deeply nested notes, lmtx now defaults to (the more than a > decade optional in mkiv) \automigrateinserts, but with less overhead > (for performance reasons, it was never enabled in mkiv, apart from > occasional side effects). It is features like these that will stepwise > be improved, at least that is what we hope for. > > So, the current upload has some new stuff, hopefully without too many > side effects, but if so, we'll deal with it as usual. As a result, the > latest lmtx could be a little slower, but I wonder if someone will > notice it in practice. > > 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] Fill an area defined by a subpath (Metafun)
Hello Taco Thank you so much ; I did not know the reverse operator. Fabrice Le jeu. 23 juil. 2020 à 11:56, Taco Hoekwater a écrit : > > > > On 23 Jul 2020, at 11:48, Fabrice Couvreur > wrote: > > > > Hello, > > I have a little problem with coloring an area (path b). > > Thanks for your help. > > Fabrice > > > > \starttext > > \startMPcode > > > > path circle, p, q, b; > > > > circle = fullcircle xscaled 6cm yscaled 3.5cm; > > p = (point 2 of circle .. (-0.15cm,1.5cm) ..(0,0)..(0.15cm,-1.5cm).. > point 6 of circle); > > q = (subpath(0,2) of circle -- p -- subpath(6,8) of circle --cycle); > > b = (p -- subpath(2,6) of circle -- cycle); > > That should be: > > b = (reverse p -- subpath(2,6) of circle -- cycle); > > Best wishes, > Taco > > ___ > If your question is of interest to others as well, please add an entry to > the Wiki! > > maillist : ntg-context@ntg.nl / > http://www.ntg.nl/mailman/listinfo/ntg-context > webpage : http://www.pragma-ade.nl / http://context.aanhet.net > archive : https://bitbucket.org/phg/context-mirror/commits/ > wiki : http://contextgarden.net > > ___ > ___ 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] Fill an area defined by a subpath (Metafun)
Hello, I have a little problem with coloring an area (path b). Thanks for your help. Fabrice \starttext \startMPcode path circle, p, q, b; circle = fullcircle xscaled 6cm yscaled 3.5cm; p = (point 2 of circle .. (-0.15cm,1.5cm) ..(0,0)..(0.15cm,-1.5cm).. point 6 of circle); q = (subpath(0,2) of circle -- p -- subpath(6,8) of circle --cycle); b = (p -- subpath(2,6) of circle -- cycle); definecolor [ name = "mp:red", r = 1 ]; definecolor [ name = "mp:blue", r = 0.54, g = 0.17, b = 0.89 ]; fill q withcolor "mp:red" withtransparency(1,0.5) ; fill b withcolor "mp:blue" withtransparency(1,0.5) ; draw circle; draw p; label("$\overline{\text{A}}$",( 1.5cm,0)) withcolor "mp:red"; label("$\text{A}$",(-1.5cm,0)) withcolor "mp:blue"; label.top("E",(0,1.85cm)); \stopMPcode \stoptext ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context webpage : http://www.pragma-ade.nl / http://context.aanhet.net archive : https://bitbucket.org/phg/context-mirror/commits/ wiki : http://contextgarden.net ___
[NTG-context] Bug with lmtx and color in table
Hello, With the latest version of lmtx, the background color of cells does not work. Thank you. Fabrice \starttext \startxtable [align={middle,lohi}, offset=0.8ex,background=color, backgroundcolor=red,frame=off] \startxrow \startxcell \m{\displaystyle\binom{n-1}{k-1}} \stopxcell \startxcell[width=fit] \m{+} \stopxcell \startxcell \m{\displaystyle\binom{n-1}{k}} \stopxcell \stopxrow \startxrow \startxcell \stopxcell \startxcell[width=fit] \m{=} \stopxcell \startxcell \m{\displaystyle\binom{n}{k}} \stopxcell \stopxrow \stopxtable \stoptext ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context webpage : http://www.pragma-ade.nl / http://context.aanhet.net archive : https://bitbucket.org/phg/context-mirror/commits/ wiki : http://contextgarden.net ___
Re: [NTG-context] Code lua in a table
Hello, I am making progress and I almost get what I want to achieve but I still have two problems : how to color cells not containing numbers with the same color as the others ? how to color in salmon, for example, cells 1 2 ? 3 Thank you Fabrice \usecolors[X11] \startuseMPgraphic{DiagonalRule} rulethickness := \frameddimension{rulethickness}; drawoptions( withpen pencircle scaled rulethickness withcolor \MPcolor{\framedparameter{framecolor}}); pair leftcorner, rightcorner; leftcorner := (rulethickness, \overlayheight-rulethickness); rightcorner := (\overlaywidth-rulethickness, rulethickness); draw leftcorner -- rightcorner; \stopuseMPgraphic \defineoverlay [DiagonalRule] [\useMPgraphic{DiagonalRule}] \define[2]\DiagonalLabel{% \setuptabulate [after={\blank[\frameddimension{offset}]}] \starttabulate [|p|r|] \NC\NC #2 \NC\NR \NC #1 \NC\NC\NR \stoptabulate } \starttext \startluacode function Binom(n,k) if k > n then return "" elseif (n == 0 or k == 0) then return 1 else return math.round((n*Binom(n-1,k-1))/k) end end context.startxtable({"align={middle,lohi}, width=1cm,offset=0.8ex,bodyfont=9pt,framecolor=cyan"}) context.startxrow() context.startxcell({"background=DiagonalRule,background=color,backgroundcolor=thistle2"}) context("\\DiagonalLabel{\\m{n}}{\\m{k}}") context.stopxcell() for j = 0, 7 do context.startxcell({"background=color,backgroundcolor=thistle2"}) context(j) context.stopxcell() end context.startxcell({"background=color,backgroundcolor=thistle2"}) context("\\dots") context.stopxcell() context.stopxrow() for i = 0, 7 do context.startxrow() context.startxcell({"background=color,backgroundcolor=thistle2"}) context(i) context.stopxcell() for j = 0, 8 do context.startxcell() context(Binom(i,j)) context.stopxcell() end context.stopxrow() end context.startxrow() context.startxcell({"background=color,backgroundcolor=thistle2"}) context("\\dots") context.stopxcell() for i = 0, 8 do context.startxcell({"background=color,backgroundcolor=thistle2"}) context("") context.stopxcell() end context.stopxrow() context.stopxtable() \stopluacode \stoptext Le lun. 20 juil. 2020 à 14:55, Hans Hagen a écrit : > On 7/20/2020 2:40 PM, Jeong Dal wrote: > > > I also wonder where is the boundary of ConTeXt. > The boundaries are set and shift by users (the mailing list) and > curiosity (personal). > > 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] Code lua in a table
Hi all, Thank you for your contributions, it allows me to progress. @Hans and Deal The code is impressive but does not correspond to the shape of the triangle that I have to make (by convention). Fabrice Le lun. 20 juil. 2020 à 10:36, Hans Hagen a écrit : > On 7/20/2020 7:56 AM, Jeong Dal wrote: > > Dear Fabrice, > > > > You may split Binom(n,k) function into two functions as following: > > > > see original mail > > > > Dalyoung > Best stay in a protected namespace ... > > \startluacode > > local function fact (n) > if n <= 0 then > return 1 > else > return n * fact(n-1) > end > end > > local function ncr(n,r) > return fact(n)/(fact(r)*fact(n-r)) > end > > userdata.P = { > fact = fact, > ncr = ncr, > } > > function MP.pascal_ncr(n, r) > mp.print(ncr(n,r)) > end > > \stopluacode > > Watch the last definition. This permits > >% tt := lua("mp.print(userdata.P.ncr(" & decimal n & "," & > decimal r & " ))"); > > replaced by > > tt := lua.MP.pascal_ncr(n,r); > > which looks nicer. > > \startbuffer[pt1] > numeric n, r, s, u, dx, dy, tt; > path p, q; > pair A, B, start, now; > u := 1.8cm; > A := dir(210)*u; > B := dir(-30)*u; > dy := sind(30)*u; > dx := 2*cosd(30)*u; > for n=0 upto 4: > start := n*dir(210)*u; > for r=0 upto n: > s := n-r; >% tt := lua("mp.print(userdata.P.ncr(" & decimal n & "," & > decimal r & " ))"); >tt := lua.MP.pascal_ncr(n,r); > now := start+r*right*dx; > dotlabel.top(textext("$\displaystyle {" & decimal n & > "\choose" & decimal r & "} = "& decimal tt & "$"),now); > draw (now+A) -- now -- (now+B); > endfor; > endfor; > \stopbuffer > > Now, in context lmtx we can have a different kind of abstraction. We can > do this: > > function MP.pascal_ncr_x() > mp.print(ncr(mp.scan.pair())) > end > > and then use: > > tt := runscript("MP.pascal_ncr_x()") (n,r) ; > > Of course one can decide to pick to two numerics instead, like > > tt := runscript("MP.pascal_ncr_x()") n r ; > > but i leave that as exercise. > >% tt := runscript mp_pascal_ncr (n,r) ; > tt := pascal_ncr (n,r) ; > > However, we still have the rather verbose runscript here, so we go > further, we register pascal as script: > > \startluacode > metapost.registerscript("pascal_ncr",MP.pascal_ncr_x) > \stopluacode > > And then define an alias at the metafun end: > > \startMPextensions > newinternal mp_pascal_ncr ; mp_pascal_ncr := scriptindex "pascal_ncr" > ; > > def pascal_ncr = > runscript mp_pascal_ncr > enddef ; > \stopMPextensions > > The internal permits this: > > tt := runscript mp_pascal_ncr (n,r) ; > > while the additional def permits > > tt := pascal_ncr (n,r) ; > > Now watch out, because we define pascal_ncr here, something > lua.MP.pascal_ncr(n,r) won't work because the last part gets expanded > because that is what mp does (i'll probably cook something for that some > day). > > Now, to come back to > > "I couldn’t wikify it at that time because I don’t know > how to. I’ll do it soon." > > looks like you suddenly have an additional challenge, > > 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] Code lua in a table
Small correction : \starttext \startluacode function Binom(n,k) if k > n then return 0 elseif (n == 0 or k == 0) then return 1 else return (n*Binom(n-1,k-1))/k end end context.startxtable({"align={middle,lohi}, width=1cm,offset=0.8ex,bodyfont=9pt"}) for i = 0, 9 do context.startxrow({"background=color,backgroundcolor=cyan"}) for j = 0, i do context.startxcell() context(Binom(i,j)) context.stopxcell() end context.stopxrow() end context.stopxtable() \stopluacode \stoptext Le sam. 18 juil. 2020 à 22:25, Fabrice Couvreur a écrit : > Hi Wolfgang, > > It works but why did you ask this question since I finally use context ? > >> Are you sure you want to use context(...) here? >> > How not to display the .0 ? > Fabrice > > Le sam. 18 juil. 2020 à 22:22, Wolfgang Schuster < > wolfgang.schuster.li...@gmail.com> a écrit : > >> Fabrice Couvreur schrieb am 18.07.2020 um 22:09: >> > Hi, >> > I improved the code to be able to display the grid but I cannot display >> > the coefficients. >> > Thank you >> > Fabrice >> > >> > \starttext >> > >> > \startluacode >> > function Binom(n,k) >> > if k > n then >> > return 0 >> > elseif (n == 0 or k == 0) then >> > return 1 >> > else >> > return (n*Binom(n-1,k-1))/k >> > end >> > >> > end >> > >> > context.startxtable({"align={middle,lohi}, >> > width=1.2cm,offset=0.8ex,bodyfont=9pt"}) >> > for i = 1, 10 do >> >context.startxrow({"background=color,backgroundcolor=cyan"}) >> > for j = 1, i do >> >context.startxcell() >> > \ctxlua{context(Binom(i,j))} >> >> Remove \ctxlua: >> >> context(Binom(i,j)) >> >> Wolfgang >> >> ___ >> 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] Code lua in a table
Hi Wolfgang, It works but why did you ask this question since I finally use context ? > Are you sure you want to use context(...) here? > How not to display the .0 ? Fabrice Le sam. 18 juil. 2020 à 22:22, Wolfgang Schuster < wolfgang.schuster.li...@gmail.com> a écrit : > Fabrice Couvreur schrieb am 18.07.2020 um 22:09: > > Hi, > > I improved the code to be able to display the grid but I cannot display > > the coefficients. > > Thank you > > Fabrice > > > > \starttext > > > > \startluacode > > function Binom(n,k) > > if k > n then > > return 0 > > elseif (n == 0 or k == 0) then > > return 1 > > else > > return (n*Binom(n-1,k-1))/k > > end > > > > end > > > > context.startxtable({"align={middle,lohi}, > > width=1.2cm,offset=0.8ex,bodyfont=9pt"}) > > for i = 1, 10 do > >context.startxrow({"background=color,backgroundcolor=cyan"}) > > for j = 1, i do > >context.startxcell() > > \ctxlua{context(Binom(i,j))} > > Remove \ctxlua: > > context(Binom(i,j)) > > Wolfgang > > ___ > 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] Code lua in a table
Hi, I improved the code to be able to display the grid but I cannot display the coefficients. Thank you Fabrice \starttext \startluacode function Binom(n,k) if k > n then return 0 elseif (n == 0 or k == 0) then return 1 else return (n*Binom(n-1,k-1))/k end end context.startxtable({"align={middle,lohi}, width=1.2cm,offset=0.8ex,bodyfont=9pt"}) for i = 1, 10 do context.startxrow({"background=color,backgroundcolor=cyan"}) for j = 1, i do context.startxcell() \ctxlua{context(Binom(i,j))} context.stopxcell() end context.stopxrow() end context.stopxtable() \stopluacode \stoptext Le sam. 18 juil. 2020 à 20:32, Wolfgang Schuster < wolfgang.schuster.li...@gmail.com> a écrit : > Fabrice Couvreur schrieb am 18.07.2020 um 20:05: > > Hello, > I want to display the values of Pascal's triangle in a table. > Unfortunately my knowledge of Lua is not sufficient to run this code. > Thank you. > Fabrice > > \starttext > > \startluacode > function Binom(n,k) >if k > n then > return 0 >elseif (n == 0 or k == 0) then > return 1 >else > return (n*Binom(n-1,k-1))/k > end > context(Binom(n,k)) > > Are you sure you want to use context(...) here? > > end > > context.startxtable({"align={middle,lohi}, > width=1.2cm,offset=0.8ex,bodyfont=9pt"}) > context.startxrow({"background=color,backgroundcolor=green"}) > for i = 0, 10 do > for j = 0, i do > context.startxcell() > context(Binom(i,j)) > context.stopxcell() > end > end > context.stopxrow() > > context.stopxtable() > > Wolfgang > > > ___ > 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] Code lua in a table
Hello, I want to display the values of Pascal's triangle in a table. Unfortunately my knowledge of Lua is not sufficient to run this code. Thank you. Fabrice \starttext \startluacode function Binom(n,k) if k > n then return 0 elseif (n == 0 or k == 0) then return 1 else return (n*Binom(n-1,k-1))/k end context(Binom(n,k)) end context.startxtable({"align={middle,lohi}, width=1.2cm,offset=0.8ex,bodyfont=9pt"}) context.startxrow({"background=color,backgroundcolor=green"}) for i = 0, 10 do for j = 0, i do context.startxcell() context(Binom(i,j)) context.stopxcell() end end context.stopxrow() \stopluacode \stoptext ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context webpage : http://www.pragma-ade.nl / http://context.aanhet.net archive : https://bitbucket.org/phg/context-mirror/commits/ wiki : http://contextgarden.net ___
Re: [NTG-context] Text around a figure
Hi Otared and Wolfgang, It's great, the following code does the job! Thank you so much. Fabrice \useMPlibrary[dum] \definecolor[fondpaille][c=0,m=0,y=0.2,k=0] \setupfloats[freeregion=no] \definetextbackground[fondpaille] [background=color, backgroundcolor=fondpaille, frame=off, location=always, ] \showframe \starttext \starttextbackground[fondpaille] \startplacefigure[number=no,location=right] \externalfigure[dummy] \stopplacefigure \startitemize[n] \dorecurse{3}{\startitem \input ward \stopitem} \stopitemize \stoptextbackground \stoptext Le jeu. 16 juil. 2020 à 14:59, Wolfgang Schuster < wolfgang.schuster.li...@gmail.com> a écrit : > Otared Kavian schrieb am 16.07.2020 um 11:58: > > Hi Fabrice, > > > > Maybe you can play with different settings of your textbackground, as in > > > > \definetextbackground[fondpaille] > > [background=color, > > backgroundcolor=fondpaille, > > frame=off, > > location=paragraph, % or: text, always, paragraph > > backgroundoffset=4pt] % change the value here > > It's a float feature which can be disabled. > > \setupfloats[freeregion=no] > > Wolfgang > > ___ > 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] Text around a figure
Hi Otared and Wolfgang, Thanks for your help ; the result is almost what I want (the space between the text and the figure is not colored) but it is likely that we could not do better. Fabrice Le mer. 15 juil. 2020 à 22:25, Otared Kavian a écrit : > Hi Fabrice, > > I think what Wolfgang suggests is something like the following: > > \useMPlibrary[dum] > \definecolor[fondpaille][c=0,m=0,y=0.2,k=0] > \definetextbackground[fondpaille] > [background=color, > backgroundcolor=fondpaille, > frame=off, > location=always] > > \starttext > > \starttextbackground[fondpaille] > \startplacefigure[number=no,location=right] > \externalfigure[dummy] > \stopplacefigure > \startitemize[n] > \dorecurse{3}{\startitem \input ward \stopitem} > \stopitemize > \stoptextbackground > > \stoptext > > Best regards: Otared K. > > > On 15 Jul 2020, at 22:13, Wolfgang Schuster < > wolfgang.schuster.li...@gmail.com> wrote: > > > > Fabrice Couvreur schrieb am 15.07.2020 um 19:54: > >> Hello, > >> I always encounter difficulties with the placement of figures in such a > way that the text envelops the figure. > >> Thank you. > >> Fabrice > >> \useMPlibrary[dum] > >> \definecolor[fondpaille][c=0,m=0,y=0.2,k=0] > >> \starttext > >> \startframedtext[width=max,background=color,backgroundcolor=fondpaille] > >> \placefloat[][right,none]{} > >>{\externalfigure[dummy]} > >> \startitemize[n] > >>\dorecurse{3}{\startitem \input ward \stopitem} > >> \stopitemize > >>\stopframedtext > >>\stoptext > > > > > > Side floats don't work in frames, use the textbackground environment to > add a colored box behind the text. > > > > Wolfgang > > > ___ > > 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 ___
[NTG-context] Text around a figure
Hello, I always encounter difficulties with the placement of figures in such a way that the text envelops the figure. Thank you. Fabrice \useMPlibrary[dum] \definecolor[fondpaille][c=0,m=0,y=0.2,k=0] \starttext \startframedtext[width=max,background=color,backgroundcolor=fondpaille] \placefloat[][right,none]{} {\externalfigure[dummy]} \startitemize[n] \dorecurse{3}{\startitem \input ward \stopitem} \stopitemize \stopframedtext \stoptext ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context webpage : http://www.pragma-ade.nl / http://context.aanhet.net archive : https://bitbucket.org/phg/context-mirror/commits/ wiki : http://contextgarden.net ___
Re: [NTG-context] Incorrect placement of a table with LMTX
Hi Otared, Thanks, it works perfectly. Best regards. fabrice Le mar. 14 juil. 2020 à 12:23, Otared Kavian a écrit : > Hi Fabrice, > > You should enclose the table into \startplacetable... \stopplacetable as > in: > > \startplacetable[number=no] > % here put your xtable > \stopplacetable > > Best regards: Otared > > > On 14 Jul 2020, at 11:28, Fabrice Couvreur > wrote: > > Hello, > In my lessons, I often have to include tables, figures, ... in > definitions, theorems ... > With the context engine it works fine but not with lmtx. > Thanks for your help. > Fabrice > > \setupenumerations > [before={\blank}, >after={\blank}, >alternative=serried, >title=yes, >titleleft=, >titleright=, >prefix=yes, >prefixsegments=chapter, >way=bychapter, >titlestyle=bold, >width=broad] > > \defineenumeration >[definition] >[text=Définition, > number=yes, > headcommand=\groupedcommand{}{.}, > style=italic] > > \starttext > > \startdefinition > \blank > \startxtable[align={lohi,middle},width=2cm,offset=0.8ex] > \startxrow > \startxcell > 1 > \stopxcell > \startxcell > 2 > \stopxcell > \stopxrow > \startxrow > \startxcell > 3 > \stopxcell > \startxcell > 4 > \stopxcell > \stopxrow > \stopxtable > \stopdefinition > > \stoptext > > ___ > If your question is of interest to others as well, please add an entry to > the Wiki! > > maillist : ntg-context@ntg.nl / > http://www.ntg.nl/mailman/listinfo/ntg-context > webpage : http://www.pragma-ade.nl / http://context.aanhet.net > archive : https://bitbucket.org/phg/context-mirror/commits/ > wiki : http://contextgarden.net > > ___ > > > > ___ > 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] Incorrect placement of a table with LMTX
Hello, In my lessons, I often have to include tables, figures, ... in definitions, theorems ... With the context engine it works fine but not with lmtx. Thanks for your help. Fabrice \setupenumerations [before={\blank}, after={\blank}, alternative=serried, title=yes, titleleft=, titleright=, prefix=yes, prefixsegments=chapter, way=bychapter, titlestyle=bold, width=broad] \defineenumeration [definition] [text=Définition, number=yes, headcommand=\groupedcommand{}{.}, style=italic] \starttext \startdefinition \blank \startxtable[align={lohi,middle},width=2cm,offset=0.8ex] \startxrow \startxcell 1 \stopxcell \startxcell 2 \stopxcell \stopxrow \startxrow \startxcell 3 \stopxcell \startxcell 4 \stopxcell \stopxrow \stopxtable \stopdefinition \stoptext ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context webpage : http://www.pragma-ade.nl / http://context.aanhet.net archive : https://bitbucket.org/phg/context-mirror/commits/ wiki : http://contextgarden.net ___
Re: [NTG-context] Symbol ' of the derived function + pagella + lmtx
Hello, I found an intermediate solution but I find that the ' is too high. \m{f^{\prime}(x)=2x} Fabrice Le sam. 11 juil. 2020 à 12:46, Fabrice Couvreur a écrit : > Hello, > I am now using the lmtx engine and I have found that using the Pagella > font the writing of derived functions is not very nice with the symbol '. > Thank you. > Fabrice > > \setupbodyfont [pagella,11pt] > \starttext > \startitemize[n] > \startitem > \math{f'(x)=x²+4x+4} > \stopitem > \startitem > \math{f''(x)=2x+4} > \stopitem > \stopitemize > \stoptext > ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context webpage : http://www.pragma-ade.nl / http://context.aanhet.net archive : https://bitbucket.org/phg/context-mirror/commits/ wiki : http://contextgarden.net ___
[NTG-context] About the table of contents
Hello, I would like to reduce the space between the numbering and the title of the chapters, sections and subsections. I would also like to have this: 1 My first chapter 1.1 My first section 1.1.1 My first subsection \setuplist [chapter] [style=bold,width=10mm] \starttext \placelist [chapter,section,subsection] [criterium=all, interaction=all, alternative=c] \startchapter [title=My first chapter] \dorecurse{2}{\input knuth} \startsection [title=My first section] \dorecurse{2}{\input knuth} \startsubsection [title=My first subsection] \dorecurse{2}{\input knuth} \stopsubsection \stopsection \stopchapter \stoptext ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context webpage : http://www.pragma-ade.nl / http://context.aanhet.net archive : https://bitbucket.org/phg/context-mirror/commits/ wiki : http://contextgarden.net ___
[NTG-context] Symbol ' of the derived function + pagella + lmtx
Hello, I am now using the lmtx engine and I have found that using the Pagella font the writing of derived functions is not very nice with the symbol '. Thank you. Fabrice \setupbodyfont [pagella,11pt] \starttext \startitemize[n] \startitem \math{f'(x)=x²+4x+4} \stopitem \startitem \math{f''(x)=2x+4} \stopitem \stopitemize \stoptext ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context webpage : http://www.pragma-ade.nl / http://context.aanhet.net archive : https://bitbucket.org/phg/context-mirror/commits/ wiki : http://contextgarden.net ___
Re: [NTG-context] Vertical space between label and title
Hello, I know it works but ConteXt has so many commands with many keys that I thought there was a "cleaner" way. Fabrice Le mar. 7 juil. 2020 à 20:36, Henning Hraban Ramm a écrit : > > > > Am 07.07.2020 um 19:27 schrieb Fabrice Couvreur < > fabrice1.couvr...@gmail.com>: > > > > Hello, > > I want a vertical space between the label and the chapter title: is this > the right way to proceed ? > > Why not? It seems to work. What’s your problem? > > BTW I’d set \mainlanguage[fr] > > 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 > > ___ > ___ 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] Vertical space between label and title
Hello, I want a vertical space between the label and the chapter title: is this the right way to proceed ? Thank you. Fabrice \setuplabeltext[chapter=Chapitre~] \unexpanded\def\Title#1#2{\framed[frame=off,width=fit,align=flushleft]{#1\blank#2}} \setuphead [chapter] [style=\bfc, command=\Title] \setupenumerations [before={\blank}, after={\blank}, alternative=serried, title=yes, prefix=yes, prefixsegments=chapter, way=bychapter, titlestyle=bold, width=broad] \defineenumeration [definition] [text=Définition, number=yes, headcommand=\groupedcommand{}{.}, style=italic] \starttext \startchapter [title=Nombres complexes : point de vue algébrique] \startdefinition \input zapf \stopdefinition \startdefinition \input zapf \stopdefinition \stopchapter \stoptext ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context webpage : http://www.pragma-ade.nl / http://context.aanhet.net archive : https://bitbucket.org/phg/context-mirror/commits/ wiki : http://contextgarden.net ___
Re: [NTG-context] Store images and text in the right margin
Hi Taco, Thank you for your help. What I want to do is write a course for my students, and the definitions, theorems ... will be illustrated by graphs, examples, remarks ... placed in the right margin. The idea is to consider that a text or a graphic is an element to place in the right margin without worrying about the nature and that a single command does the job. What you are proposing goes in the right direction. However, I noticed a little problem with the hyphenation. Fabrice Le lun. 6 juil. 2020 à 16:35, Taco Hoekwater a écrit : > Hi Fabrice, > > Like this maybe? It depends on what you want to achieve exactly, I think > > \useMPlibrary[dum] > > \setuppapersize[A4] > > \setuplayout > [width=12cm, >rightmargin=5cm] > > \defineuserdata [margintext] [alternative=margintext] > > \defineuserdataalternative [margintext] > [renderingsetup=userdata:margintext] > > \startsetups [userdata:margintext] > \margindata > [inright] > [style={\switchtobodyfont[9pt]}, > width=\rightmarginwidth, > align={flushleft,broad}, > stack=yes] > {\startframedtext[before=,after=,offset=0pt,width=max,frame=off] > \getinlineuserdata > \stopframedtext} > \stopsetups > > \showframe > \starttext > \startuserdata[margintext] > {\bf Remarque — }\input ward > \stopuserdata > \startuserdata[margintext] > \externalfigure[dummy][width=\rightmarginwidth] > \stopuserdata > \startchapter[title=First chapter] > \dorecurse{2}{\input knuth} > \stopchapter > \stoptext > > > > On 6 Jul 2020, at 16:18, Fabrice Couvreur > wrote: > > > > > > > > -- Forwarded message - > > De : Fabrice Couvreur > > Date: lun. 6 juil. 2020 à 12:10 > > Subject: Re: [NTG-context] Store images and text in the right margin > > To: Marco > > > > > > Hello, > > What has been proposed by Wolfgang and Marco works correctly but is it > possible to define a single environment margintext which would allow to > include both text and figures ? > > Thank you > > Fabrice > > ___ > If your question is of interest to others as well, please add an entry to > the Wiki! > > maillist : ntg-context@ntg.nl / > http://www.ntg.nl/mailman/listinfo/ntg-context > webpage : http://www.pragma-ade.nl / http://context.aanhet.net > archive : https://bitbucket.org/phg/context-mirror/commits/ > wiki : http://contextgarden.net > > ___ > ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context webpage : http://www.pragma-ade.nl / http://context.aanhet.net archive : https://bitbucket.org/phg/context-mirror/commits/ wiki : http://contextgarden.net ___
[NTG-context] Fwd: Store images and text in the right margin
-- Forwarded message - De : Fabrice Couvreur Date: lun. 6 juil. 2020 à 12:10 Subject: Re: [NTG-context] Store images and text in the right margin To: Marco Hello, What has been proposed by Wolfgang and Marco works correctly but is it possible to define a single environment margintext which would allow to include both text and figures ? Thank you Fabrice Le sam. 4 juil. 2020 à 11:36, Fabrice Couvreur a écrit : > Hi Marco, > Without being a specialist, I knew the \blank command, but I too thought > that there must be another solution. > Thank you for your help. > Fabrice > > Le ven. 3 juil. 2020 à 11:04, Marco a écrit : > >> On Fri, 3 Jul 2020 10:39:41 +0200 >> Fabrice Couvreur wrote: >> >> > I think there should be a space between comments and figures. >> >> Maybe you can add manual \blank[…] in the margindata setups, e.g. >> >> ... >> {\blank{\bf Remarque — }\getinlineuserdata\blank} >> >> Otherwise I'm sure there's a more elegant solution using dedicated >> keys, but as I haven't used that mechanism for a while I can't tell >> which works. Maybe manual blanks already do the job. >> >> Marco >> > ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context webpage : http://www.pragma-ade.nl / http://context.aanhet.net archive : https://bitbucket.org/phg/context-mirror/commits/ wiki : http://contextgarden.net ___
Re: [NTG-context] Store images and text in the right margin
Hi Marco, Thanks, it works but only for a comment and a picture. Indeed, if I add a comment and an image, the first image is placed on the second comment. Fabrice \starttext \startuserdata[margintext] \input ward \stopuserdata \marginfigure{\externalfigure[dummy][width=\rightmarginwidth,location=high]} \startuserdata[margintext] \input ward \stopuserdata \marginfigure{\externalfigure[dummy][width=\rightmarginwidth,location=high]} \startchapter[title=First chapter] \dorecurse{2}{\input knuth} \stopchapter \stoptext Le jeu. 2 juil. 2020 à 19:04, Marco Patzer a écrit : > On Thu, 2 Jul 2020 17:20:07 +0200 > Fabrice Couvreur wrote: > > Try: > > > \useMPlibrary[dum] > > > > \setuppapersize[A4] > > > > \setuplayout > > [width=12cm, > >rightmargin=5cm] > > > > \definemargindata[marginfigure][inright] > > \setupmargindata [marginfigure][command=\vbox,align=middle] > > \setupmargindata [marginfigure][command=\vbox,align=middle,stack=yes] > > > \startsetups [userdata:margintext] > > \margindata > > [inright] > > [%style=\smallbodyfont, > > style={\switchtobodyfont[9pt]}, > > width=\rightmarginwidth, > > stack=yes, > > > align={flushleft,broad}] > > {{\bf Remarque — }\getinlineuserdata} > > \stopsetups > > > \marginfigure{\externalfigure[dummy][width=\rightmarginwidth]} > > > \marginfigure{\externalfigure[dummy][width=\rightmarginwidth,location=high]} > > Marco > > ___ > 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] Store images and text in the right margin
Hello everyone and in particular to Wolfgang who has already provided me with the solution below. I will have to write a Mathematics book for my students and the remarks and graphics should be in the right margin. I got the code written by Wolfgang and tried to include the graphics in it. The result is not as expected because the graphic overflows on the text. The course will be written in A4 format with an 11 pts font. Thanks for your help. Fabrice \useMPlibrary[dum] \setuppapersize[A4] \setuplayout [width=12cm, rightmargin=5cm] \definemargindata[marginfigure][inright] \setupmargindata [marginfigure][command=\vbox,align=middle] \defineuserdata [margintext] [alternative=margintext] \defineuserdataalternative [margintext] [renderingsetup=userdata:margintext] \startsetups [userdata:margintext] \margindata [inright] [%style=\smallbodyfont, style={\switchtobodyfont[9pt]}, width=\rightmarginwidth, align={flushleft,broad}] {{\bf Remarque — }\getinlineuserdata} \stopsetups \showframe \starttext \startuserdata[margintext] \input ward \stopuserdata \marginfigure{\externalfigure[dummy][width=\rightmarginwidth]} \startchapter[title=First chapter] \dorecurse{2}{\input knuth} \stopchapter \stoptext ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context webpage : http://www.pragma-ade.nl / http://context.aanhet.net archive : https://bitbucket.org/phg/context-mirror/commits/ wiki : http://contextgarden.net ___
Re: [NTG-context] Compile only one new component in a project
Hi Aditya, It does not work ; the compilation encounters errors with each command that I created. I guess it comes from the components. Fabrice ##chapter-4-seconde.tex## \startcomponent chapter-4-seconde \startchapter[title=] ... \stopchapter \stopcomponent Le jeu. 7 mai 2020 à 16:01, Aditya Mahajan a écrit : > On Thu, 7 May 2020, Fabrice Couvreur wrote: > > > Hi, > > Here is part of a project that is starting to be heavy ; when i add a > > chapter i do context seconde.tex > > How do I compile only the chapter I just added ? > > Thank you. > > Fabrice > > > > \startproduct Seconde > > > > \environment modules > > \environment specialite-style > > \environment specialite-macros > > > > \startfrontmatter > > \component specialite-titlepage > > \component specialite-contents > > \stopfrontmatter > > > > \startbodymatter > >\component chapter-1-seconde > >\component chapter-2-seconde > >\component chapter-3-seconde > >\component chapter-4-seconde > > \stopbodymatter > > \stopproduct > > context chapter-4-seconde > > There is a MyWay which shows how you can share cross-refs etc. > > 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 ___
[NTG-context] Compile only one new component in a project
Hi, Here is part of a project that is starting to be heavy ; when i add a chapter i do context seconde.tex How do I compile only the chapter I just added ? Thank you. Fabrice \startproduct Seconde \environment modules \environment specialite-style \environment specialite-macros \startfrontmatter \component specialite-titlepage \component specialite-contents \stopfrontmatter \startbodymatter \component chapter-1-seconde \component chapter-2-seconde \component chapter-3-seconde \component chapter-4-seconde \stopbodymatter \stopproduct ___ 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] Changing the font size in an environment changes the behavior of a macro
Hi Aditya, Thank you for your help ; this also works with pgfplots but the body of the text must be with the same font. I always use the pagella font but it doesn't allow you to use \mathscript{} that's why I use this macro. Are there other free fonts that allow you to do this ? Fabrice \usemodule[pgfplots] \pgfplotsset{compat=newest} \usebodyfont[xitsbidi] \define[1]\cscript{\start\m{{\mathscript{#1}}}\stop} \startmidaligned \define[1]\cscript{\start\m{{\mathscript{#1}}}\stop} \starttikzpicture \startaxis \addplot {x}; \node[above left] at (2,2) {\cscript{C}}; \stopaxis \stoptikzpicture \stopmidaligned \blank \startmidaligned \switchtobodyfont[9pt] \starttikzpicture \startaxis \addplot {x}; \node[above left] at (2,2) {\cscript{C}}; \stopaxis \stoptikzpicture \stopmidaligned \stoptext Le lun. 4 mai 2020 à 19:18, Aditya Mahajan a écrit : > On Mon, 4 May 2020, Fabrice Couvreur wrote: > > > Hi, > > Sorry to insist but I cannot fix this problem. > > Thanks for any help. > > I don't know the answer, but here is a simpler example without pgfplot > which fails (different calligraphic C's): > > > > \define[1]\cscript{\start\switchtobodyfont[xitsbidi]\m{{\mathscript{#1}}}\stop} > > \starttext > \startTEXpage[offset=2mm] > \cscript{C} > \start >\switchtobodyfont[9pt] >\cscript{C} > \stop > \stopTEXpage > \stoptext > > And here is a version with a minor change that works (same calligraphic > C's)! > > \usebodyfont[xitsbidi] > > \define[1]\cscript{\start\m{{\mathscript{#1}}}\stop} > > \starttext > \startTEXpage[offset=2mm] > \cscript{C} > \start >\switchtobodyfont[9pt] >\cscript{C} > \stop > \stopTEXpage > \stoptext > > 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] Changing the font size in an environment changes the behavior of a macro
Hi, Sorry to insist but I cannot fix this problem. Thanks for any help. Fabrice Le sam. 25 avr. 2020 à 00:13, Fabrice Couvreur a écrit : > Hi, > This macro was written by Otared and it works well unless I change the > size of the font (see the second graph). > How to correct this problem ? > Thanks for your help. > Fabrice > > begin example > > \usemodule[pgfplots] > \pgfplotsset{compat=newest} > > \define[2]\cscript{\start\switchtobodyfont[xitsbidi]\m{{\mathscript{#1}}_{#2}}\stop} > > \starttext > > \startmidaligned > \starttikzpicture > \startaxis >\addplot {x}; >\node[above left] at (2,2) {\cscript{C}{f}}; >\stopaxis > \stoptikzpicture > \stopmidaligned > \blank > \startmidaligned > \switchtobodyfont[9pt] > \starttikzpicture > \startaxis >\addplot {x}; >\node[above left] at (2,2) {\cscript{C}{f}}; >\stopaxis > \stoptikzpicture > \stopmidaligned > > \stoptext > > end example > ___ 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] \setupinteraction [ ...] do not work
Hi, It seemed to me that it was necessary to proceed in this way to create a link in a pdf file; it does not work. Thank you. Fabrice \setupinteraction[state=start,color=darkred] \starttext \goto{vecteur directeur}[https://www.youtube.com/watch?v=6VdSz-0QT4Y] \stoptext ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context webpage : http://www.pragma-ade.nl / http://context.aanhet.net archive : https://bitbucket.org/phg/context-mirror/commits/ wiki : http://contextgarden.net ___
[NTG-context] Changing the font size in an environment changes the behavior of a macro
Hi, This macro was written by Otared and it works well unless I change the size of the font (see the second graph). How to correct this problem ? Thanks for your help. Fabrice begin example \usemodule[pgfplots] \pgfplotsset{compat=newest} \define[2]\cscript{\start\switchtobodyfont[xitsbidi]\m{{\mathscript{#1}}_{#2}}\stop} \starttext \startmidaligned \starttikzpicture \startaxis \addplot {x}; \node[above left] at (2,2) {\cscript{C}{f}}; \stopaxis \stoptikzpicture \stopmidaligned \blank \startmidaligned \switchtobodyfont[9pt] \starttikzpicture \startaxis \addplot {x}; \node[above left] at (2,2) {\cscript{C}{f}}; \stopaxis \stoptikzpicture \stopmidaligned \stoptext end example ___ 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] Text size with lmt_text [ ]
Hi, As an extension of this discussion https://mail.google.com/mail/u/0/#inbox/QgrcJHsNlRfcqCPHBTrnSFbJKjGPwjbJnLL?compose=CllgCJZWxJlpNNfzrPpFwWRqsFfdXqmnxkCwWVjvXKQJBwQmBfZGvchjMbsJDKXLtKldJtpWVqq (thanks to Wolfgang), I used the MetaFun interface with lmt_text [] ; I managed to pass the text and color parameters while I did not succeed using textext (). My problem is the size of the letters which is too small. Thank you. Fabrice \usecolors[xwi] \definecolor [prune] [r=1.29,g=.20,b=.83] \starttext \startMPcode vardef card(expr s, c) = image( draw fullsquare xyscaled (2cm,4cm); draw fullsquare xyscaled (1.8cm,3.8cm) withcolor \MPcolor{violet}; draw lmt_text[ text = s, color = c, style = "bold", ] ) enddef; draw card("A",red) rotatedaround((1cm,2cm),5); draw card("L",green) rotatedaround((1cm,2cm),-5) shifted(3.5cm,0); draw card("E",blue) rotatedaround((1cm,2cm),5) shifted(6cm,0); draw card("A","prune") rotatedaround((1cm,2cm),-5) shifted(9cm,0); \stopMPcode \stoptext ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context webpage : http://www.pragma-ade.nl / http://context.aanhet.net archive : https://bitbucket.org/phg/context-mirror/commits/ wiki : http://contextgarden.net ___
Re: [NTG-context] Passing the parameters of a frame in an environment \startMPcode ... \stopMPcode
Hi Wolfgang, Thank you very much ; as usual your explanations are always clear and your approach to the problem intelligent and original. I would however like to know the way in which we can use the command \frameletter except for the rounded corners with outlinetext. For example, this doesn't work. \startMPcode draw outlinetext.f ("\frameletter{A}") (withcolor darkred withpen pencircle scaled 1/10) rotated 5 xsized 2cm ; \stopMPcode Fabrice Le lun. 20 avr. 2020 à 10:36, Wolfgang Schuster < wolfgang.schuster.li...@gmail.com> a écrit : > Rudolf Bahr schrieb am 20.04.2020 um 10:23: > > On Mon, Apr 20, 2020 at 09:21:41AM +0200, Wolfgang Schuster wrote: > >> Fabrice Couvreur schrieb am 19.04.2020 um 22:55: > >>> Hi, > >>> I try to reproduce the figure as faithfully as possible. I tried for > the > >>> rounded corners to put the key corner = round, but it does not work. > >> > >> 1. To create a new framed-instance you need \defineframe, \setupframed > isn't > >> enough to set the values. > >> > >> I guess you assumed this works similar to xtables but this > mechanism sets > >> a few values to assure \setupxtable is enough in certain cases but even > here > >> you need \definextable in certain cases. > >> > >> When you create a new instance you have to use the name of the new > >> instance as command name, e.g. \frameletter or use the \placeframed > command > >> which takes the name as argument, e.g. \placeframed[frameletter]. > >> > >> 2. You can't pass the name of a framed-instance to \framed (backwards > >> compatibility, performance ...), this is only possible with > \startframed. > >> > >> 3. ConTeXt uses different mechanism to draw rectangular (unless you > draw a > >> closed frame) and rounded frame and the mechanism for rounded frames > doesn't > >> work with outlinetext. > >> > >> 4. To achieve the desired result you can now a) use MetaPost to draw the > >> complete card (letter plus frame) or b) use only TeX to put the letter > in a > >> frame and rotate it. > >> > >> begin tex example > >> \usecolors[svg] > >> > >> \defineframed > >>[frameletter] > >>[width=1.25em, > >> height=1.75em, > >> foregroundstyle=\ssbfc, > >> corner=round, > >> radius=0.1\bodyfontsize, > >> rulethickness=1pt] > >> > >> \starttext > >> > >> \startTEXpage[offset=\linewidth] > >> \dontleavehmode > >> \rotate [rotation=5] {\color[darkred] {\frameletter{A}}} > >> \rotate [rotation=-5]{\color[green] {\frameletter{L}}} > >> \rotate [rotation=5] {\color[mediumblue]{\frameletter{E}}} > >> \rotate [rotation=-5]{\color[darkviolet]{\frameletter{A}}} > >> \stopTEXpage > >> > >> \stoptext > >> end tex example > >> > >> Wolfgang > > > > Nice Example and good explanation, Wolfgang. But why did you use the > command > > "dontleavehmode"? It doesn't seem to be necessary in this example. > > I wrote the example without TeXpage where I needed \doneleavehmode to > keep all cards on the same line. At the end I just added TeXpage to > create a cropped image with with a small border and forgot to remove it. > > Wolfgang > > > ___ > 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] Passing the parameters of a frame in an environment \startMPcode ... \stopMPcode
Hi, I try to reproduce the figure as faithfully as possible. I tried for the rounded corners to put the key corner = round, but it does not work. Thanks for your help. Fabrice \usecolors[xwi] \definecolor [prune] [r=1.29,g=.20,b=.83] \starttext \setupframed[frameletter][corner=round,align=normal] \startMPcode draw outlinetext.f ("\framed[frameletter]{A}") (withcolor darkred withpen pencircle scaled 1/10) rotated 5 xsized 2cm ; draw outlinetext.f ("\framed[frameletter]{L}") (withcolor green withpen pencircle scaled 1/10) rotated -5 xsized 2cm shifted (2cm,0); draw outlinetext.f ("\framed[frameletter]{E}") (withcolor \MPcolor{blueviolet} withpen pencircle scaled 1/10) rotated 5 xsized 2cm shifted (4.5cm,0); draw outlinetext.f ("\framed[frameletter]{A}") (withcolor \MPcolor{prune} withpen pencircle scaled 1/10) rotated -5 xsized 2cm shifted (6.5cm,0); \stopMPcode \stoptext ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context webpage : http://www.pragma-ade.nl / http://context.aanhet.net archive : https://bitbucket.org/phg/context-mirror/commits/ wiki : http://contextgarden.net ___
Re: [NTG-context] Text around an image
Hi, I found a way to solve it using the command \flushsidefloats Is this the best solution ? Thank you. Fabrice \startitem Programmer une fonction \m{A(x)} qui renvoie l'aire totale du terrain en fonction de la longueur \m{x}. \stopitem \flushsidefloats Le jeu. 16 avr. 2020 à 12:33, Fabrice Couvreur a écrit : > Hi, > I know that this question has been raised several times (especially by me > !), but the solutions provided sometimes work and sometimes not, especially > in this example. > Thanks for your help. > Fabrice > > \useMPlibrary [dum] > >\define\ItemCommand >{\hskip\zeropoint\relax\autoinsertnextspace} > > \setupitemgroup > [itemize] > [color=black, > style=bold, > distance=\zeropoint] > > \setupitemgroup > [itemize:1] > [option={n,packed,fit,intext}, > command=\ItemCommand] > > \setupitemgroup > [itemize:2] > [lefttext=, > righttext=, > option={a,text}] > > \starttext > > \startitemize > \startitem > Justifier que \m{x>4} et \m{y>2}. > \stopitem > \placefigure[right,none]{}{\externalfigure [dummy]} > \startitem > Pour calculer la valeur de \m{y} en fonction de \m{x}, l'urbaniste > a écrit la fonction en Python. > > \startitemize > \startitem > Son algorithme est-il correct ? > \stopitem\par > \startitem > Programmer une fonction \m{A(x)} qui renvoie l'aire totale du > terrain en fonction de la longueur \m{x}. > \stopitem > \stopitemize > \stopitem > \startitem > On considère la fonction suivante. > > \startitemize > \startitem > Qu'affiche l'instruction ? > \stopitem\par > \startitem > Interpréter les résultats renvoyés. > \stopitem > \stopitemize > \stopitem > \stopitemize > \stoptext > ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context webpage : http://www.pragma-ade.nl / http://context.aanhet.net archive : https://bitbucket.org/phg/context-mirror/commits/ wiki : http://contextgarden.net ___
[NTG-context] Text around an image
Hi, I know that this question has been raised several times (especially by me !), but the solutions provided sometimes work and sometimes not, especially in this example. Thanks for your help. Fabrice \useMPlibrary [dum] \define\ItemCommand {\hskip\zeropoint\relax\autoinsertnextspace} \setupitemgroup [itemize] [color=black, style=bold, distance=\zeropoint] \setupitemgroup [itemize:1] [option={n,packed,fit,intext}, command=\ItemCommand] \setupitemgroup [itemize:2] [lefttext=, righttext=, option={a,text}] \starttext \startitemize \startitem Justifier que \m{x>4} et \m{y>2}. \stopitem \placefigure[right,none]{}{\externalfigure [dummy]} \startitem Pour calculer la valeur de \m{y} en fonction de \m{x}, l'urbaniste a écrit la fonction en Python. \startitemize \startitem Son algorithme est-il correct ? \stopitem\par \startitem Programmer une fonction \m{A(x)} qui renvoie l'aire totale du terrain en fonction de la longueur \m{x}. \stopitem \stopitemize \stopitem \startitem On considère la fonction suivante. \startitemize \startitem Qu'affiche l'instruction ? \stopitem\par \startitem Interpréter les résultats renvoyés. \stopitem \stopitemize \stopitem \stopitemize \stoptext ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context webpage : http://www.pragma-ade.nl / http://context.aanhet.net archive : https://bitbucket.org/phg/context-mirror/commits/ wiki : http://contextgarden.net ___
Re: [NTG-context] Lmtx + pgfplots compilation error
Hi Aditya, Your solution seems to work even with the most complex files, it's a great idea! The only small disadvantage is that you have to place this file in each directory containing files using these modules. Thank you very much even if this solution is temporary. Fabrice Le lun. 13 avr. 2020 à 12:13, Aditya Mahajan a écrit : > On Mon, 13 Apr 2020, Fabrice Couvreur wrote: > > > Hi, > > Sorry to restart the discussion, but I have updated my entire system and > > the problem remains. I used the example of Aditya. > > Thank you. > > Fabrice > > > > \usemodule[pgfplots] > > \starttext > > \starttikzpicture > > \startaxis > > \addplot {x}; > > \stopaxis > > \stoptikzpicture > > \stoptext > > > > tex error > tex error on line 5 in file > pgfplotsbinary.data.code.tex: > > ! Undefined control sequence > > > > l.5 ...ode`\^0=11\expandafter\xdef\csname pgfp@bin@\the\counter > > \endcsname{^0 > > > >}\advance\counter by1 > > lua error: > > I have no clue what pgfplotsbinary.data.code.tex does, but simply > bypassing that works for the simple example above. > > Simply create an empty file with the name pgfplotsbinary.data.code.tex in > your current directory and compile your example. > > Note that if your code uses any of the features which are provided by this > file (and I am not sure what they are), then it will fail. But at least > this "fix" works for the simple example above. > > 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] Lmtx + pgfplots compilation error
Hi, Sorry to restart the discussion, but I have updated my entire system and the problem remains. I used the example of Aditya. Thank you. Fabrice \usemodule[pgfplots] \starttext \starttikzpicture \startaxis \addplot {x}; \stopaxis \stoptikzpicture \stoptext tex error > tex error on line 5 in file pgfplotsbinary.data.code.tex: ! Undefined control sequence l.5 ...ode`\^0=11\expandafter\xdef\csname pgfp@bin@\the\counter \endcsname{^0 }\advance\counter by1 lua error: ? Le jeu. 9 avr. 2020 à 00:07, Aditya Mahajan a écrit : > On Wed, 8 Apr 2020, Aditya Mahajan wrote: > > > Simpler example: > > Sorry, pasted the wrong thing: > > \usemodule[pgfplots] > > \starttext > \starttikzpicture >\startaxis > \addplot {x}; >\stopaxis > \stoptikzpicture > \stoptext > > > Works with LMTX 2019.12.31 but fails with the most recent LMTX (same > error as > > below) using the same pgfplots module. > > > > Aditya > > > > On Wed, 8 Apr 2020, Fabrice Couvreur wrote: > > > >> Hi Henri, > >> Sorry ! > >> > >> \usemodule[pgfplots] > >> \pgfplotsset{compat=newest} > >> \starttext > >> \starttikzpicture > >> \startaxis > >>[ > >> xlabel=$x$, > >> ylabel={$f(x) = x^2 - x +4$} > >>] > >>\addplot {x^2 - x +4}; > >> \stopaxis > >> \stoptikzpicture > >> \stoptext > >> > >> > >> tex error > tex error on line 5 in file > pgfplotsbinary.data.code.tex: > >> ! Undefined control sequence > >> > >> l.5 ...ode`\^0=11 \expandafter\xdef\csname pgfp@bin@\the\counter > >> \endcsname{^0 > >> > >>}\advance\counter by1 > >> lua error: > >> > >> ? > >> > >> > >> Le mer. 8 avr. 2020 à 12:40, Henri Menke a > écrit : > >> > >>> MINIMAL working example... > >>> > >>> Cheers, Henri > >>> > >>> On 08/04/20, 11:52, Fabrice Couvreur wrote: > >>>> Hi Henri, > >>>> This file works well with context but does not work with lmtx. > >>>> > >>>> \usemodule[pgfplots] > >>>> \usemodule[pgfpltstable] > >>>> \pgfplotsset{compat=newest} > >>>> \starttext > >>>> \starttikzpicture > >>>> \startaxis[ > >>>> title={\bf Relevé de notes chronologique}, > >>>> ymajorgrids=true, > >>>> grid style={cyan!30}, > >>>> ymin=0, > >>>> ymax=22, > >>>> xmin=0, > >>>> xmax=14, > >>>> x=1cm, > >>>> y=0.3cm, > >>>> axis x line =bottom, > >>>> axis y line =left, > >>>> axis on top=true, > >>>> axis line style =very thick, > >>>> tick align=outside, > >>>> tickwidth=0.12cm, > >>>> tick style=very thick, > >>>> xtick={\empty}, > >>>> ytick={0,2,...,18,20}, > >>>> extra x ticks={2,5,7,9,11,13}, > >>>> extra x tick labels={octobre,novembre,janvier,mars,avril, juin}, > >>>> extra x tick style={tick label style={rotate=45}}, > >>>> extra tick style={tick style={draw=none}}, > >>>> xlabel={Date},ylabel={Note}, > >>>> xlabel={Date},ylabel={Effectif}, > >>>> every axis x label/.style={ > >>>> at={(ticklabel* cs:1.01)}, > >>>> anchor=west, > >>>> }, > >>>> every axis y label/.style={ > >>>> at={(ticklabel* cs:1.01)}, > >>>> anchor=south, > >>>> }, > >>>> samples=1000, > >>>> >=stealth, > >>>> ] > >>>> \addplot [color=green,only marks] coordinates { > >>>> (1,5) > >>>> (2,7) > >>>> (3,5) > >>>> (4,10) > >>>> (5,5) > >>>> (6,8) > >>>> (7,10) > >>>> (8,8) > >>>> (9,10) > >>>> (10,14) > >>>> (11,18) > >>>> (12,14) > >>>> (13,11) > >>>> }; > >>>> \stopaxis > >>>> \stoptikzpicture > >>>> \stoptext > >>>> > >>>> > >>>> open source > level 7, order 88, name > 'pgfplotsbinary.
Re: [NTG-context] Lmtx + pgfplots compilation error
Hi Henri, Sorry ! \usemodule[pgfplots] \pgfplotsset{compat=newest} \starttext \starttikzpicture \startaxis [ xlabel=$x$, ylabel={$f(x) = x^2 - x +4$} ] \addplot {x^2 - x +4}; \stopaxis \stoptikzpicture \stoptext tex error > tex error on line 5 in file pgfplotsbinary.data.code.tex: ! Undefined control sequence l.5 ...ode`\^0=11\expandafter\xdef\csname pgfp@bin@\the\counter \endcsname{^0 }\advance\counter by1 lua error: ? Le mer. 8 avr. 2020 à 12:40, Henri Menke a écrit : > MINIMAL working example... > > Cheers, Henri > > On 08/04/20, 11:52, Fabrice Couvreur wrote: > > Hi Henri, > > This file works well with context but does not work with lmtx. > > > > \usemodule[pgfplots] > > \usemodule[pgfpltstable] > > \pgfplotsset{compat=newest} > > \starttext > > \starttikzpicture > > \startaxis[ > > title={\bf Relevé de notes chronologique}, > > ymajorgrids=true, > > grid style={cyan!30}, > > ymin=0, > > ymax=22, > > xmin=0, > > xmax=14, > > x=1cm, > > y=0.3cm, > > axis x line =bottom, > > axis y line =left, > > axis on top=true, > > axis line style =very thick, > > tick align=outside, > > tickwidth=0.12cm, > > tick style=very thick, > > xtick={\empty}, > > ytick={0,2,...,18,20}, > > extra x ticks={2,5,7,9,11,13}, > > extra x tick labels={octobre,novembre,janvier,mars,avril, juin}, > > extra x tick style={tick label style={rotate=45}}, > > extra tick style={tick style={draw=none}}, > > xlabel={Date},ylabel={Note}, > > xlabel={Date},ylabel={Effectif}, > > every axis x label/.style={ > > at={(ticklabel* cs:1.01)}, > > anchor=west, > > }, > > every axis y label/.style={ > > at={(ticklabel* cs:1.01)}, > > anchor=south, > > }, > > samples=1000, > > >=stealth, > > ] > > \addplot [color=green,only marks] coordinates { > > (1,5) > > (2,7) > > (3,5) > > (4,10) > > (5,5) > > (6,8) > > (7,10) > > (8,8) > > (9,10) > > (10,14) > > (11,18) > > (12,14) > > (13,11) > > }; > > \stopaxis > > \stoptikzpicture > > \stoptext > > > > > > open source > level 7, order 88, name 'pgfplotsbinary.data.code.tex' > > > > tex error > tex error on line 5 in file > pgfplotsbinary.data.code.tex: > > ! Undefined control sequence > > > > l.5 ...ode`\^0=11\expandafter\xdef\csname pgfp@bin@\the\counter > > \endcsname{^0 > > > > }\advance\counter by1 > > lua error: > > > > ? > > > > > > > > > > > > > > The control sequence at the end of the top line of your error message was > > never > > \def'ed. You can just continue as I'll forget about whatever was > undefined. > > > > > > mtx-context | fatal error: return code: 256 > > > > TeX Output exited abnormally with code 1 at Wed Apr 8 11:49:56 > > > > > > Le mer. 8 avr. 2020 à 11:21, Henri Menke a écrit > : > > > > > Hi Fabrice, > > > > > > Could you provide a MWE, or maybe even open an issue on the bugtracker? > > > https://github.com/pgf-tikz/pgfplots/issues > > > > > > Cheers, Henri > > > > > > On 07/04/20, 14:22, Fabrice Couvreur wrote: > > > > Hi Henri, > > > > Thank you for answering me. We're entering an area that I don't > really > > > know. I > > > > replaced all ^^ by ^ but I'm not sure I understood. I now have the > > > > following message : > > > > Thank you > > > > Fabrice > > > > > > > > tex error > tex error on line 5 in file > > > pgfplotsbinary.data.code.tex: > > > > ! Undefined control sequence > > > > > > > > l.5 \catcode`\^00=11 \expandafter\xdef\csname pgfp@bin@\the\counter > > > > \endcsname{^0 > > > > > > > >0}\advance\counter by1 > > > > lua error: > > > > > > > > ? > > > > > > > > > > > > > > > > > > > > > > > > > > > > The control sequence at the end of the top line of your error > message was > > > > never > > > > \def'ed. You can just continue as I'll forget about whatever was > > > undefined. > > > > > > > > > > > > mtx-conte
Re: [NTG-context] Lmtx + pgfplots compilation error
Hi Henri, This file works well with context but does not work with lmtx. \usemodule[pgfplots] \usemodule[pgfpltstable] \pgfplotsset{compat=newest} \starttext \starttikzpicture \startaxis[ title={\bf Relevé de notes chronologique}, ymajorgrids=true, grid style={cyan!30}, ymin=0, ymax=22, xmin=0, xmax=14, x=1cm, y=0.3cm, axis x line =bottom, axis y line =left, axis on top=true, axis line style =very thick, tick align=outside, tickwidth=0.12cm, tick style=very thick, xtick={\empty}, ytick={0,2,...,18,20}, extra x ticks={2,5,7,9,11,13}, extra x tick labels={octobre,novembre,janvier,mars,avril, juin}, extra x tick style={tick label style={rotate=45}}, extra tick style={tick style={draw=none}}, xlabel={Date},ylabel={Note}, xlabel={Date},ylabel={Effectif}, every axis x label/.style={ at={(ticklabel* cs:1.01)}, anchor=west, }, every axis y label/.style={ at={(ticklabel* cs:1.01)}, anchor=south, }, samples=1000, >=stealth, ] \addplot [color=green,only marks] coordinates { (1,5) (2,7) (3,5) (4,10) (5,5) (6,8) (7,10) (8,8) (9,10) (10,14) (11,18) (12,14) (13,11) }; \stopaxis \stoptikzpicture \stoptext open source > level 7, order 88, name 'pgfplotsbinary.data.code.tex' tex error > tex error on line 5 in file pgfplotsbinary.data.code.tex: ! Undefined control sequence l.5 ...ode`\^0=11\expandafter\xdef\csname pgfp@bin@\the\counter \endcsname{^0 }\advance\counter by1 lua error: ? The control sequence at the end of the top line of your error message was never \def'ed. You can just continue as I'll forget about whatever was undefined. mtx-context | fatal error: return code: 256 TeX Output exited abnormally with code 1 at Wed Apr 8 11:49:56 Le mer. 8 avr. 2020 à 11:21, Henri Menke a écrit : > Hi Fabrice, > > Could you provide a MWE, or maybe even open an issue on the bugtracker? > https://github.com/pgf-tikz/pgfplots/issues > > Cheers, Henri > > On 07/04/20, 14:22, Fabrice Couvreur wrote: > > Hi Henri, > > Thank you for answering me. We're entering an area that I don't really > know. I > > replaced all ^^ by ^ but I'm not sure I understood. I now have the > > following message : > > Thank you > > Fabrice > > > > tex error > tex error on line 5 in file > pgfplotsbinary.data.code.tex: > > ! Undefined control sequence > > > > l.5 \catcode`\^00=11 \expandafter\xdef\csname pgfp@bin@\the\counter > > \endcsname{^0 > > > >0}\advance\counter by1 > > lua error: > > > > ? > > > > > > > > > > > > > > The control sequence at the end of the top line of your error message was > > never > > \def'ed. You can just continue as I'll forget about whatever was > undefined. > > > > > > mtx-context | fatal error: return code: 256 > > > > TeX Output exited abnormally with code 1 at Tue Apr 7 14:15:58 > > > > Le mar. 7 avr. 2020 à 04:21, Henri Menke a écrit > : > > > > > The problem is that pgfplots uses the ^^ syntax to access characters > but > > > this relies on ^ having catcode 7 which is not the case by default in > > > ConTeXt. I had a similar issue in PGF before and that was fixed by > just > > > replacing the ^^ syntax with the ascii code constants from > > > syst-ini.mkxl. > > > > > > Cheers, Henri > > > > > > On 06/04/20, 22:23, Fabrice Couvreur wrote: > > > > Hi, > > > > Still with the idea of using lmtx, I get a compilation error when I > use > > > > pgfplots. > > > > Thank you. > > > > Fabrice > > > > > > > > open source > level 9, order 92, name > 'pgfplotsbinary.data.code.tex' > > > > > > > > tex error > tex error on line 42 in file > > > > pgfplotsbinary.data.code.tex: ! Undefined control sequence > > > > > > > > l.42 \catcode`\ =11^^I\expandafter\xdef\csname pgfp@bin@ > > > > > > > > \the\counter^^I\endcsname{^^20}\endgroup\advance\counter by1 > > > > lua error: > > > > > > > > ? > > > > > > > > > > > > > > > > > > > > > > > > > > > > The control sequence at the end of the top line of your error > message was > > > > never > > > > \def'ed. You can just continue as I'll forget about whateve
Re: [NTG-context] Background color of a framedtext that covers floats
Hi Pablo, Here a sample. Fabrice \useMPlibrary[dum] \definecolor[fondpaille][c=0,m=0,y=0.2,k=0] \starttext \startframedtext[width=max,background=color,backgroundcolor=fondpaille] \starthanging[location=right] {\startMPcode draw unitsquare scaled 2cm ; \stopMPcode} \input tufte \stophanging \stopframedtext \stoptext Le mer. 8 avr. 2020 à 10:45, Pablo Rodriguez a écrit : > On 4/8/20 10:19 AM, Fabrice Couvreur wrote: > > Hi, > > Is there a more elegant way to have a white background for the table? > > Hi Fabrice, > > I think not including the table in the framed text is the easiest way to > avoid the colored background. > > Or why do you need the table inside the framed text, which only adds the > background color (and disables the frame)? > > > In fact, my question is more general: if we insert an image, the > > background color envelops this image: how to solve this problem? > > Unless you provide a sample that shows the issue you are facing, not > including the image in the frame may be your best option. > > Just in case it helps, > > Pablo > -- > http://www.ousia.tk > > ___ > If your question is of interest to others as well, please add an entry to > the Wiki! > > maillist : ntg-context@ntg.nl / > http://www.ntg.nl/mailman/listinfo/ntg-context > webpage : http://www.pragma-ade.nl / http://context.aanhet.net > archive : https://bitbucket.org/phg/context-mirror/commits/ > wiki : http://contextgarden.net > > ___ > ___ 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] Background color of a framedtext that covers floats
Hi, Is there a more elegant way to have a white background for the table ? In fact, my question is more general : if we insert an image, the background color envelops this image : how to solve this problem ? Thank you. Fabrice \definecolor[fondpaille][c=0,m=0,y=0.2,k=0] \starttext \startframedtext [frame=off,width=\textwidth, background=color,backgroundcolor=fondpaille] \input tufte \startlinecorrection[blank] \startmidaligned \startxtable [align={lohi,middle}, option={stretch},framecolor=cyan, offset=0.8ex,background=color,backgroundcolor=white] \startxrow \startxcell \bf Profondeur \m{x} (en mètre) \stopxcell \startxcell \bf Pression \m{P} (en bar) \stopxcell \startxcell \bf Volume \m{V} (en \m{\text{dm}^{3}}) \stopxcell \stopxrow \startxrow \startxcell 0 (niveau de la mer) \stopxcell \startxcell 1 \stopxcell \startxcell 1 \stopxcell \stopxrow \startxrow \startxcell 10 \stopxcell \startxcell 2 \stopxcell \startxcell 0,5 \stopxcell \stopxrow \stopxtable \stopmidaligned \stoplinecorrection \stopframedtext \stoptext ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context webpage : http://www.pragma-ade.nl / http://context.aanhet.net archive : https://bitbucket.org/phg/context-mirror/commits/ wiki : http://contextgarden.net ___
Re: [NTG-context] Lmtx + pgfplots compilation error
Hi Henri, Thank you for answering me. We're entering an area that I don't really know. I replaced all ^^ by ^ but I'm not sure I understood. I now have the following message : Thank you Fabrice tex error > tex error on line 5 in file pgfplotsbinary.data.code.tex: ! Undefined control sequence l.5 \catcode`\^00=11 \expandafter\xdef\csname pgfp@bin@\the\counter \endcsname{^0 0}\advance\counter by1 lua error: ? The control sequence at the end of the top line of your error message was never \def'ed. You can just continue as I'll forget about whatever was undefined. mtx-context | fatal error: return code: 256 TeX Output exited abnormally with code 1 at Tue Apr 7 14:15:58 Le mar. 7 avr. 2020 à 04:21, Henri Menke a écrit : > The problem is that pgfplots uses the ^^ syntax to access characters but > this relies on ^ having catcode 7 which is not the case by default in > ConTeXt. I had a similar issue in PGF before and that was fixed by just > replacing the ^^ syntax with the ascii code constants from > syst-ini.mkxl. > > Cheers, Henri > > On 06/04/20, 22:23, Fabrice Couvreur wrote: > > Hi, > > Still with the idea of using lmtx, I get a compilation error when I use > > pgfplots. > > Thank you. > > Fabrice > > > > open source > level 9, order 92, name 'pgfplotsbinary.data.code.tex' > > > > tex error > tex error on line 42 in file > > pgfplotsbinary.data.code.tex: ! Undefined control sequence > > > > l.42 \catcode`\ =11^^I\expandafter\xdef\csname pgfp@bin@ > > > > \the\counter^^I\endcsname{^^20}\endgroup\advance\counter by1 > > lua error: > > > > ? > > > > > > > > > > > > > > The control sequence at the end of the top line of your error message was > > never > > \def'ed. You can just continue as I'll forget about whatever was > undefined. > > > > > > mtx-context | fatal error: return code: 256 > > > > TeX Output exited abnormally with code 1 at Mon Apr 6 22:19:01 > > > > ___ > > 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 ___
[NTG-context] Lmtx + pgfplots compilation error
Hi, Still with the idea of using lmtx, I get a compilation error when I use pgfplots. Thank you. Fabrice open source > level 9, order 92, name 'pgfplotsbinary.data.code.tex' tex error > tex error on line 42 in file pgfplotsbinary.data.code.tex: ! Undefined control sequence l.42 \catcode`\ =11^^I\expandafter\xdef\csname pgfp@bin@ \the\counter^^I\endcsname{^^20}\endgroup\advance\counter by1 lua error: ? The control sequence at the end of the top line of your error message was never \def'ed. You can just continue as I'll forget about whatever was undefined. mtx-context | fatal error: return code: 256 TeX Output exited abnormally with code 1 at Mon Apr 6 22:19:01 ___ 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] Compile a file embedding modules with the lmtx engine
Hi Pablo, It seems to be working, thanks for your help. Fabrice Le ven. 3 avr. 2020 à 22:22, Pablo Rodriguez a écrit : > On 4/3/20 7:21 PM, Fabrice Couvreur wrote: > > > > I reinstalled context and lmtx, followed your instructions because I got > > the same error message but now I get another error message; my editor is > > Emacs. > > > > Running `LmtX' on `ESSAI' with > > ``/home/viserion/LMTX/tex/texmf-linux-64/bin/mtxrun --autogenerate > > --script context --autopdf ESSAI'' > > mtxrun | unknown script 'context.lua' or 'mtx-context.lua' > > Hi Fabrice, > > from the shell, run "~/LMTX/tex/texmf-linux-64/bin/mtxrun --generate" > before. > > After that, it should compile your document fine. > > Pablo > -- > http://www.ousia.tk > > ___ > If your question is of interest to others as well, please add an entry to > the Wiki! > > maillist : ntg-context@ntg.nl / > http://www.ntg.nl/mailman/listinfo/ntg-context > webpage : http://www.pragma-ade.nl / http://context.aanhet.net > archive : https://bitbucket.org/phg/context-mirror/commits/ > wiki : http://contextgarden.net > > ___ > ___ 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] Compile a file embedding modules with the lmtx engine
I reinstalled context and lmtx, followed your instructions because I got the same error message but now I get another error message; my editor is Emacs. Thank you. Fabrice Running `LmtX' on `ESSAI' with ``/home/viserion/LMTX/tex/texmf-linux-64/bin/mtxrun --autogenerate --script context --autopdf ESSAI'' mtxrun | unknown script 'context.lua' or 'mtx-context.lua' TeX Output exited abnormally with code 1 at Fri Apr 3 19:15:18 Le ven. 3 avr. 2020 à 15:07, Pablo Rodriguez a écrit : > On 4/3/20 2:18 PM, Fabrice Couvreur wrote: > > Hi, > > > > I did the installation then I copied the files and finally I did mtxrun > > --generate > > The file does not compile and I get a file where it says ERROR. > > > > viserion@archlinux ~]$ cd /home/viserion/data/context/tex/texmf-modules/ > > [viserion@archlinux texmf-modules]$ ls > > doc fonts ls-R metapost scripts source tex VERSION > > Hi Fabrice, > > I have just installed both LMTX and the ConTeXt Suite brand new. I moved > the tex/texmf-modules contents form the Suite to LMTX tex/temxf-modules. > > Your file was compiled perfectly fine. I removed the contents of > tex/texmf-modules and I got these errors: > > system > jobfiles > unknown tex file > > '/home/ousia/64ctx/tex/texmf-modules/tex/context/pgf/frontendlayer/t-tikz.tex' > modules > 'tikz' is loaded > > tex error > tex error on line 2 in file ./a.tex: ! Undefined > control sequence > > \syst_helpers_triple_empty_two_nop \usetikzlibrary > > l.2 \usetikzlibrary > [calc] > > If you get a similar error, I would do the following: > > 1. Remove tex/texmf-cache/luatex-cache. > 2. Run "mtxrun --generate". > 3. Compile the document. > > I hope this helps, > > Pablo > -- > http://www.ousia.tk > > ___ > If your question is of interest to others as well, please add an entry to > the Wiki! > > maillist : ntg-context@ntg.nl / > http://www.ntg.nl/mailman/listinfo/ntg-context > webpage : http://www.pragma-ade.nl / http://context.aanhet.net > archive : https://bitbucket.org/phg/context-mirror/commits/ > wiki : http://contextgarden.net > > ___ > ___ 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] Compile a file embedding modules with the lmtx engine
Hi, I did the installation then I copied the files and finally I did mtxrun --generate The file does not compile and I get a file where it says ERROR. viserion@archlinux ~]$ cd /home/viserion/data/context/tex/texmf-modules/ [viserion@archlinux texmf-modules]$ ls doc fonts ls-R metapost scripts source tex VERSION [viserion@archlinux texmf-modules]$ Fabrice Le ven. 3 avr. 2020 à 13:10, Pablo Rodriguez a écrit : > On 4/3/20 12:38 PM, Fabrice Couvreur wrote: > > Hi, > > I'm sorry but I didn't necessarily follow all the threads. I use to make > > my graphics Metapost or Metafun, but I also sometimes use TiKz. This > > file compiles with context but not with lmtx because the modules are not > > recognized. I am willing to use only lmtx which seems to be the future > > of ConteXt, but how do I do that? > > Hi Fabrice, > > do you have any modules installed in your LMTX distribution? > > As far as I know (sorry if I’ missing something), the user should > install the modules manually for LMTX. > > Your sample compiles for me, but I copied the tex/texmf-modules > directory from the ConTeXt Suite to the LMTX distribution. > > I hope this helps, > > Pablo > -- > http://www.ousia.tk > > ___ > If your question is of interest to others as well, please add an entry to > the Wiki! > > maillist : ntg-context@ntg.nl / > http://www.ntg.nl/mailman/listinfo/ntg-context > webpage : http://www.pragma-ade.nl / http://context.aanhet.net > archive : https://bitbucket.org/phg/context-mirror/commits/ > wiki : http://contextgarden.net > > ___ > ___ 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] Compile a file embedding modules with the lmtx engine
Hi, I'm sorry but I didn't necessarily follow all the threads. I use to make my graphics Metapost or Metafun, but I also sometimes use TiKz. This file compiles with context but not with lmtx because the modules are not recognized. I am willing to use only lmtx which seems to be the future of ConteXt, but how do I do that ? Thank you. Fabrice \usemodule[tikz] \usetikzlibrary[calc] \starttext \startlinecorrection[blank] \startmidaligned \starttikzpicture \draw[fill=orange!30e,draw=orange] (0,0) rectangle (5,5); \stoptikzpicture \stopmidaligned \stoplinecorrection \stoptext ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context webpage : http://www.pragma-ade.nl / http://context.aanhet.net archive : https://bitbucket.org/phg/context-mirror/commits/ wiki : http://contextgarden.net ___
Re: [NTG-context] Bug (Lua) ?
Hi mf, Thanks ! Fabrice Le jeu. 19 mars 2020 à 11:46, mf a écrit : > Il 19/03/20 11:20, Fabrice Couvreur ha scritto: > > Hi, > > this file did not pose any problems but today yes. > > Thank you. > > Fabrice > > > > \starttext > > \startluacode > > local letters_1 = { "A", "B", "C", "D", "E", "F", "G", "H", "I", "J" } > > local letters_2 = { "1", "Année", "1998", "1999", "2000", "2001", "2002", > > "2003", "2004", "2005","2006" } > > context.startxtable({"align={middle,lohi}, > > width=1.2cm,offset=0.8ex,bodyfont=9pt"}) > > > > context.startxtable( { align = "middle,lohi", width = "1.2cm", offset = > "0.8ex", bodyfont = "9pt" } ) > > The argument is a lua table. Values are usually strings. > > > context.startxrow({"background=color,backgroundcolor=green"}) > > context.startxrow( { background = "color", backgroundcolor = "green" } ) > > ... and so on. > > Best wishes, > Massi > > ___ > 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] Bug (Lua) ?
Hi, this file did not pose any problems but today yes. Thank you. Fabrice \starttext \startluacode local letters_1 = { "A", "B", "C", "D", "E", "F", "G", "H", "I", "J" } local letters_2 = { "1", "Année", "1998", "1999", "2000", "2001", "2002", "2003", "2004", "2005","2006" } context.startxtable({"align={middle,lohi}, width=1.2cm,offset=0.8ex,bodyfont=9pt"}) context.startxrow({"background=color,backgroundcolor=green"}) context.startxcell({"background=color,backgroundcolor=white,frame=off"}) context("") context.stopxcell() for _, letter in ipairs(letters_1) do context.startxcell() context(letter) context.stopxcell() end context.stopxrow() context.startxrow() for _, letter in ipairs(letters_2) do context.startxcell() context(letter) context.stopxcell() end context.stopxrow() context.startxrow() context.startxcell() context("2") context.stopxcell() context.startxcell({"width=2cm"}) context("Prix (kg)") context.stopxcell() for i=0,8 do context.startxcell() context("%0.5g",1.031^i) context.stopxcell() end context.stopxrow() context.stopxtable() \stopluacode \stoptext lua error > lua error on line 34 in file /home/viserion/Table.tex: [ctxlua]:5: unfinished string near '"align={middle,lohi},' 1 \starttext 2 \startluacode 3 local letters_1 = { "A", "B", "C", "D", "E", "F", "G", "H", "I", "J" } 4 local letters_2 = { "1", "Année", "1998", "1999", "2000", "2001", "2002", 5 "2003", "2004", "2005","2006" } 6 >> context.startxtable({"align={middle,lohi}, 7 width=1.2cm,offset=0.8ex,bodyfont=9pt"}) 8 9 context.startxrow({"background=color,backgroundcolor=green"}) 10 context.startxcell({"background=color,backgroundcolor=white,frame=off"}) 11 context("") 12 context.stopxcell() 13 for _, letter in ipairs(letters_1) do 14 context.startxcell() 15 context(letter) context.stopxcell() 16 end mtx-context | fatal error: return code: 256 TeX Output exited abnormally with code 1 at Thu Mar 19 11:15:49 ___ 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] Exercise file with statements and correction
Hi Otared, https://mailman.ntg.nl/pipermail/ntg-context/2016/087487.html Thanks Fabrice Le mar. 17 mars 2020 à 22:56, Fabrice Couvreur a écrit : > Hi Wolfgang, > Is it possible to adapt your code with the environment that you proposed > to me ? > Thank you. > Fabrice > > https://mailman.ntg.nl/pipermail/ntg-context/2016/087487.html > > \defineframed > [EXFRAME] > [frame=off, > offset=0pt, > location=low, > width=\struttotal, > background=color, > backgroundcolor=black, > foregroundcolor=white, > forgroundstyle=bold] > > \defineprocessor[ACPROCESSOR][command=\EXFRAME] > \defineconversionset[ACCONVERSION][][ACPROCESSOR->n] > > \defineenumeration >[ex] >[text=, > width=fit, >numberconversionset=ACCONVERSION, >alternative=serried, >number=yes] > > Le mar. 17 mars 2020 à 22:14, Fabrice Couvreur < > fabrice1.couvr...@gmail.com> a écrit : > >> Hi Pablo, >> Thank you very much, it's a great base to start with. >> Fabrice >> >> Le mar. 17 mars 2020 à 22:09, Pablo Rodriguez a écrit : >> >>> On 3/17/20 9:14 PM, Fabrice Couvreur wrote: >>> > Hello, >>> > I would like to make files with statements of exercises and correction >>> > where it would be enough to click on "correction" to access the >>> > correction at the end of the file. I'm running out of time, does anyone >>> > have a model to share ? >>> >>> Hi Fabrice, >>> >>> I don’t have a model, but the following sample could give you a hint: >>> >>> \setupinteraction[state=start, focus=standard] >>> \starttext >>> \startbodymatter >>> \chapter[lesson-1]{Lesson 1} >>> \section[exercises-1]{Exercises 1} >>> These are the exercises. >>> >>> Here you have their key (\about[key-1]). >>> \stopbodymatter >>> \startappendices >>> \section[key-1]{Key to Lesson 1} >>> This is the key >>> >>> Back to exercises (\about[exercises-1]) >>> \stopappendices >>> \stoptext >>> >>> I hope it helps, >>> >>> Pablo >>> -- >>> http://www.ousia.tk >>> >>> ___ >>> If your question is of interest to others as well, please add an entry >>> to the Wiki! >>> >>> maillist : ntg-context@ntg.nl / >>> http://www.ntg.nl/mailman/listinfo/ntg-context >>> webpage : http://www.pragma-ade.nl / http://context.aanhet.net >>> archive : https://bitbucket.org/phg/context-mirror/commits/ >>> wiki : http://contextgarden.net >>> >>> ___ >>> >> ___ 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] Exercise file with statements and correction
Hi Kavian, Thank you so much. I don't even have time to offer examples ! Fabrice Le mar. 17 mars 2020 à 22:56, Fabrice Couvreur a écrit : > Hi Wolfgang, > Is it possible to adapt your code with the environment that you proposed > to me ? > Thank you. > Fabrice > > https://mailman.ntg.nl/pipermail/ntg-context/2016/087487.html > > \defineframed > [EXFRAME] > [frame=off, > offset=0pt, > location=low, > width=\struttotal, > background=color, > backgroundcolor=black, > foregroundcolor=white, > forgroundstyle=bold] > > \defineprocessor[ACPROCESSOR][command=\EXFRAME] > \defineconversionset[ACCONVERSION][][ACPROCESSOR->n] > > \defineenumeration >[ex] >[text=, > width=fit, >numberconversionset=ACCONVERSION, >alternative=serried, >number=yes] > > Le mar. 17 mars 2020 à 22:14, Fabrice Couvreur < > fabrice1.couvr...@gmail.com> a écrit : > >> Hi Pablo, >> Thank you very much, it's a great base to start with. >> Fabrice >> >> Le mar. 17 mars 2020 à 22:09, Pablo Rodriguez a écrit : >> >>> On 3/17/20 9:14 PM, Fabrice Couvreur wrote: >>> > Hello, >>> > I would like to make files with statements of exercises and correction >>> > where it would be enough to click on "correction" to access the >>> > correction at the end of the file. I'm running out of time, does anyone >>> > have a model to share ? >>> >>> Hi Fabrice, >>> >>> I don’t have a model, but the following sample could give you a hint: >>> >>> \setupinteraction[state=start, focus=standard] >>> \starttext >>> \startbodymatter >>> \chapter[lesson-1]{Lesson 1} >>> \section[exercises-1]{Exercises 1} >>> These are the exercises. >>> >>> Here you have their key (\about[key-1]). >>> \stopbodymatter >>> \startappendices >>> \section[key-1]{Key to Lesson 1} >>> This is the key >>> >>> Back to exercises (\about[exercises-1]) >>> \stopappendices >>> \stoptext >>> >>> I hope it helps, >>> >>> Pablo >>> -- >>> http://www.ousia.tk >>> >>> ___ >>> If your question is of interest to others as well, please add an entry >>> to the Wiki! >>> >>> maillist : ntg-context@ntg.nl / >>> http://www.ntg.nl/mailman/listinfo/ntg-context >>> webpage : http://www.pragma-ade.nl / http://context.aanhet.net >>> archive : https://bitbucket.org/phg/context-mirror/commits/ >>> wiki : http://contextgarden.net >>> >>> ___ >>> >> ___ 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] Exercise file with statements and correction
Hi Wolfgang, Is it possible to adapt your code with the environment that you proposed to me ? Thank you. Fabrice https://mailman.ntg.nl/pipermail/ntg-context/2016/087487.html \defineframed [EXFRAME] [frame=off, offset=0pt, location=low, width=\struttotal, background=color, backgroundcolor=black, foregroundcolor=white, forgroundstyle=bold] \defineprocessor[ACPROCESSOR][command=\EXFRAME] \defineconversionset[ACCONVERSION][][ACPROCESSOR->n] \defineenumeration [ex] [text=, width=fit, numberconversionset=ACCONVERSION, alternative=serried, number=yes] Le mar. 17 mars 2020 à 22:14, Fabrice Couvreur a écrit : > Hi Pablo, > Thank you very much, it's a great base to start with. > Fabrice > > Le mar. 17 mars 2020 à 22:09, Pablo Rodriguez a écrit : > >> On 3/17/20 9:14 PM, Fabrice Couvreur wrote: >> > Hello, >> > I would like to make files with statements of exercises and correction >> > where it would be enough to click on "correction" to access the >> > correction at the end of the file. I'm running out of time, does anyone >> > have a model to share ? >> >> Hi Fabrice, >> >> I don’t have a model, but the following sample could give you a hint: >> >> \setupinteraction[state=start, focus=standard] >> \starttext >> \startbodymatter >> \chapter[lesson-1]{Lesson 1} >> \section[exercises-1]{Exercises 1} >> These are the exercises. >> >> Here you have their key (\about[key-1]). >> \stopbodymatter >> \startappendices >> \section[key-1]{Key to Lesson 1} >> This is the key >> >> Back to exercises (\about[exercises-1]) >> \stopappendices >> \stoptext >> >> I hope it helps, >> >> Pablo >> -- >> http://www.ousia.tk >> >> ___ >> If your question is of interest to others as well, please add an entry to >> the Wiki! >> >> maillist : ntg-context@ntg.nl / >> http://www.ntg.nl/mailman/listinfo/ntg-context >> webpage : http://www.pragma-ade.nl / http://context.aanhet.net >> archive : https://bitbucket.org/phg/context-mirror/commits/ >> wiki : http://contextgarden.net >> >> ___ >> > ___ 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] Exercise file with statements and correction
Hi Pablo, Thank you very much, it's a great base to start with. Fabrice Le mar. 17 mars 2020 à 22:09, Pablo Rodriguez a écrit : > On 3/17/20 9:14 PM, Fabrice Couvreur wrote: > > Hello, > > I would like to make files with statements of exercises and correction > > where it would be enough to click on "correction" to access the > > correction at the end of the file. I'm running out of time, does anyone > > have a model to share ? > > Hi Fabrice, > > I don’t have a model, but the following sample could give you a hint: > > \setupinteraction[state=start, focus=standard] > \starttext > \startbodymatter > \chapter[lesson-1]{Lesson 1} > \section[exercises-1]{Exercises 1} > These are the exercises. > > Here you have their key (\about[key-1]). > \stopbodymatter > \startappendices > \section[key-1]{Key to Lesson 1} > This is the key > > Back to exercises (\about[exercises-1]) > \stopappendices > \stoptext > > I hope it helps, > > Pablo > -- > http://www.ousia.tk > > ___ > If your question is of interest to others as well, please add an entry to > the Wiki! > > maillist : ntg-context@ntg.nl / > http://www.ntg.nl/mailman/listinfo/ntg-context > webpage : http://www.pragma-ade.nl / http://context.aanhet.net > archive : https://bitbucket.org/phg/context-mirror/commits/ > wiki : http://contextgarden.net > > ___ > ___ 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] Exercise file with statements and correction
Hello, I would like to make files with statements of exercises and correction where it would be enough to click on "correction" to access the correction at the end of the file. I'm running out of time, does anyone have a model to share ? Thank you so much. Fabrice ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context webpage : http://www.pragma-ade.nl / http://context.aanhet.net archive : https://bitbucket.org/phg/context-mirror/commits/ wiki : http://contextgarden.net ___
Re: [NTG-context] Quizz
Hi Hans, Thank you, I will try to use your file. Fabrice Le lun. 16 mars 2020 à 11:32, luigi scarso a écrit : > > > On Mon, Mar 16, 2020 at 11:14 AM Hans Hagen wrote: > >> On 3/15/2020 10:34 AM, Fabrice Couvreur wrote: >> > Hi, >> > With the Coronavirus pandemic, my school will close like all the >> others. >> > We chose to work with Microsoft Teams. I know how to file Math >> exercises >> > written with ConteXt and export to pdf format. Is it possible with >> > ConteXt to create interactive Quizz? >> it should be doable (in the past we've made those with choice, fill in >> etc questions) but one problem with pdf is that there has been >> introduced some restrictions, for instance one cannot save in the reader >> so one then need to run a server that picks up the filled in stuff and >> regenerates a pdf file ... no big deal but i must admit that i don't >> have that code (if at all) around in loadable module form >> > > In google chrome this seems to work, apart the choice fields (the choice > selected has the red frame but it has no mark inside): > https://martin-thoma.com/images/2012/02/pdf-form.pdf > > -- > luigi > > ___ > 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] Quizz
Hi, With the Coronavirus pandemic, my school will close like all the others. We chose to work with Microsoft Teams. I know how to file Math exercises written with ConteXt and export to pdf format. Is it possible with ConteXt to create interactive Quizz? Thank you Fabrice ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context webpage : http://www.pragma-ade.nl / http://context.aanhet.net archive : https://bitbucket.org/phg/context-mirror/commits/ wiki : http://contextgarden.net ___
[NTG-context] Hatch color in a table cell
Hi, I would like to hatch the cell green. Thank you. Fabrice \usecolors[xwi] \startuniqueMPgraphic{meta:hash}{linewidth,linecolor,angle,gap} if unknown context_back : input mp-back ; fi ; some_hash ( OverlayWidth, OverlayHeight , \MPvar{linewidth}, \MPvar{linecolor} , \MPvar{angle}, \MPvar{gap} ) ; \stopuniqueMPgraphic \setupMPvariables [meta:hash] [gap=.25\bodyfontsize, angle=45, linewidth=\overlaylinewidth, linecolor=\overlaylinecolor] \def\metahashoverlay#1{\uniqueMPgraphic{meta:hash}{angle=#1}} \defineoverlay[meta:hash:right] [\metahashoverlay{ +45}] \defineoverlay[meta:hash:left] [\metahashoverlay{ -45}] \defineoverlay[meta:hash:horizontal][\metahashoverlay{+180}] \defineoverlay[meta:hash:vertical] [\metahashoverlay{ -90}] \starttext \startmidaligned \startxtable [align={lohi,middle}, width=1.5cm, background=color, backgroundcolor=white, framecolor=purple, meta:hash:linecolor=green] \startxrow \startxcell[background=color,backgroundcolor=paleturquoise] i \stopxcell \startxcell[background=meta:hash:right,frame=off] \stopxcell \startxcell 0 \stopxcell \startxcell 1 \stopxcell \startxcell 2 \stopxcell \stopxrow \startxrow \startxcell[background=color,backgroundcolor=paleturquoise] S \stopxcell \startxcell 0 \stopxcell \startxcell \stopxcell \startxcell \stopxcell \startxcell \stopxcell \stopxrow \startxrow \startxcell[background=color,backgroundcolor=paleturquoise] a \stopxcell \startxcell 3 \stopxcell \startxcell \stopxcell \startxcell \stopxcell \startxcell \stopxcell \stopxrow \stopxtable \stopmidaligned \stoptext ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context webpage : http://www.pragma-ade.nl / http://context.aanhet.net archive : https://bitbucket.org/phg/context-mirror/commits/ wiki : http://contextgarden.net ___
Re: [NTG-context] Problem with shading when using rotation (Metapost)
Hi, No idea ? Thanks Fabrice Le sam. 29 févr. 2020 à 11:01, Fabrice Couvreur a écrit : > Hi, > Sorry to come back with my match problem. In fact, I do not understand > why a rotation of 90 influences the degraded color of the ends of the > matches. > Thank you. > Fabrice > > \starttext > \startMPcode > > def match (expr alpha, pos) = > numeric l; > l = 4.6cm; > picture pic; > pic = image ( > fill unitsquare xscaled 4cm yscaled 0.2cm withcolor yellow ; > fill origin -- (4cm,0) -- (4.1cm,-0.05cm) -- (0.1cm,-0.05cm) -- > cycle withcolor(.6yellow + black); > draw origin -- (0,0.2cm) -- (4cm,0.2cm) -- (4cm,0) -- (4.1cm,-0.05cm) > -- (0.1cm,-0.05cm) -- cycle ; > fill fullcircle xyscaled (0.5cm,0.44cm) shifted (4.125cm,0.1cm) shaded > withshademethod "circular" > withshadefactor 0.75 > withshadecolors (white,red);); > draw (fullcircle xyscaled (0.5cm,0.44cm) shifted (4.125cm,0.1cm)); > draw pic rotated alpha shifted pos; > enddef; > > picture house ; > house = image ( > match(90,(0,0)); > match(0,(0,0)); > match(90,(l,0)); > match(120,(l,l)); > match(60,(0,l));); > > draw house; > > \stopMPcode > ___ 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] Problem with shading when using rotation (Metapost)
Hi, Sorry to come back with my match problem. In fact, I do not understand why a rotation of 90 influences the degraded color of the ends of the matches. Thank you. Fabrice \starttext \startMPcode def match (expr alpha, pos) = numeric l; l = 4.6cm; picture pic; pic = image ( fill unitsquare xscaled 4cm yscaled 0.2cm withcolor yellow ; fill origin -- (4cm,0) -- (4.1cm,-0.05cm) -- (0.1cm,-0.05cm) -- cycle withcolor(.6yellow + black); draw origin -- (0,0.2cm) -- (4cm,0.2cm) -- (4cm,0) -- (4.1cm,-0.05cm) -- (0.1cm,-0.05cm) -- cycle ; fill fullcircle xyscaled (0.5cm,0.44cm) shifted (4.125cm,0.1cm) shaded withshademethod "circular" withshadefactor 0.75 withshadecolors (white,red);); draw (fullcircle xyscaled (0.5cm,0.44cm) shifted (4.125cm,0.1cm)); draw pic rotated alpha shifted pos; enddef; picture house ; house = image ( match(90,(0,0)); match(0,(0,0)); match(90,(l,0)); match(120,(l,l)); match(60,(0,l));); draw house; \stopMPcode ___ 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] Shading
Hi Wolfgang, I would like the same result as the code with TikZ. Thank you. Fabrice \usemodule[tikz] \starttext \startMPcode fill fullcircle xscaled 1cm yscaled 0.88cm shaded withshademethod "circular" withshadefactor 0.75 withshadecolors (white,red); \stopMPcode \starttikzpicture \shade[ball color=red] (0,0) ellipse (0.5cm and 0.44cm); \stoptikzpicture \stoptext Le mar. 25 févr. 2020 à 17:18, Wolfgang Schuster < wolfgang.schuster.li...@gmail.com> a écrit : > On Tue, 25 Feb 2020 12:34:00 +0100 > Fabrice Couvreur wrote: > > > Hi, > > In the Metafun documentation on page 410, there is a shaded bullet "fill > > fullcircle shaded cshade". > > I tried to reproduce the same effect, but it is not exactly the same > result. > > It's different because your code isn't the same as the example in the > manual. > > \starttext > > \startMPcode > fill fullcircle scaled 4cm shaded withshademethod "circular" ; > \stopMPcode > > \stoptext > > > \starttext > > \startMPcode > > fill fullcircle scaled 4cm shaded withshademethod "circular" > >withshadevector (1,0) > >withshadecolors (red, white) ; > > \stopMPcode > > \stoptext > > Not sure what you're trying to achieve but this is closer the example > above. > > \starttext > > \startMPcode > fill fullcircle scaled 4cm shaded > withshademethod "circular" > withshadefactor 0.75 > withshadecolors (white,red) > ; > \stopMPcode > > \stoptext > > Wolfgang > > ___ > 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] Shading
Hi, In the Metafun documentation on page 410, there is a shaded bullet "fill fullcircle shaded cshade". I tried to reproduce the same effect, but it is not exactly the same result. Thank you. Fabrice \starttext \startMPcode fill fullcircle scaled 4cm shaded withshademethod "circular" withshadevector (1,0) withshadecolors (red, white) ; \stopMPcode \stoptext ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context webpage : http://www.pragma-ade.nl / http://context.aanhet.net archive : https://bitbucket.org/phg/context-mirror/commits/ wiki : http://contextgarden.net ___
Re: [NTG-context] Metapost and TikZ color code equivalent
Hi Henri, Why does the blue path not rotate 90 with the draw command but rotate with the fill command ? \startMPcode def match (expr alpha, pos) = fill unitsquare xscaled 4cm yscaled 0.2cm rotated alpha shifted pos withcolor yellow ; fill origin -- (4cm,0) -- (4.1cm,-0.05cm) -- (0.1cm,-0.05cm) -- cycle rotated alpha withcolor(.6yellow + black); draw origin -- (0,0.2cm) -- (4cm,0.2cm) -- (4cm,0) -- (4.1cm,-0.05cm) -- (0.1cm,-0.05cm) -- cycle rotated alpha withcolor blue; draw origin -- (0,0.2cm) -- (4cm,0.2cm) -- (4cm,0) -- (4.1cm,-0.05cm) -- (0.1cm,-0.05cm) -- cycle rotated alpha withcolor blue; draw fullcircle xscaled 0.50cm yscaled 0.44cm shifted (4.125cm,0.1cm) rotated alpha; draw fullcircle xscaled 0.50cm yscaled 0.44cm shifted (4.125cm,0.1cm) rotated alpha withshademethod "circular 1" withshadevector (0,1) withshadecolors (red,white); enddef; match(0,(0,0)); match(90,(4.2cm,0)); match(90,(0,0)); match(0,(0,4.2cm)); \stopMPcode Le sam. 15 févr. 2020 à 00:01, Fabrice Couvreur a écrit : > Hi, > Hi, > I have corrected for the dimensions of the ellipse but I cannot achieve > the same effect for the red color. > Thank you. > Fabrice > \startMPcode > def match (expr pos) = > fill unitsquare xscaled 4cm yscaled 0.2cm shifted pos withcolor > yellow; > fill origin -- (4cm,0) -- (4.1cm,-0.05cm) -- (0.1cm,-0.05cm) -- cycle > withcolor(.6yellow + black); > draw origin -- (0,0.2cm) -- (4cm,0.2cm) -- (4cm,0) -- (4.1cm,-0.05cm) > -- (0.1cm,-0.05cm) -- cycle; > fill fullcircle xscaled 0.50cm yscaled 0.44cm shifted (4.125cm,0.1cm) > withcolor red; > draw fullcircle xscaled 0.50cm yscaled 0.44cm shifted (4.125cm,0.1cm); > draw fullcircle xscaled 0.50cm yscaled 0.44cm shifted (4.125cm,0.1cm) > withshademethod "circular" > withshadevector (0,1) > withshadecolors (red,white) > enddef; > match((0,0)); > > \stopMPcode > > > > Le ven. 14 févr. 2020 à 16:43, Fabrice L a > écrit : > >> Hi, >> >> Le 13 févr. 2020 à 16:45, Fabrice Couvreur >> a écrit : >> >> >> How to have the color defined by {yellow!60!black} with Metapost ? >> >> >> color MyColor ; MyColor := .6[yellow,black] ; >> >> See metafun manual, section 1.13. >> >> Thank you. >> Fabrice >> >> >> Fabrice (another one !). >> >> >> ___ >> 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] Metapost and TikZ color code equivalent
Hi, Hi, I have corrected for the dimensions of the ellipse but I cannot achieve the same effect for the red color. Thank you. Fabrice \startMPcode def match (expr pos) = fill unitsquare xscaled 4cm yscaled 0.2cm shifted pos withcolor yellow; fill origin -- (4cm,0) -- (4.1cm,-0.05cm) -- (0.1cm,-0.05cm) -- cycle withcolor(.6yellow + black); draw origin -- (0,0.2cm) -- (4cm,0.2cm) -- (4cm,0) -- (4.1cm,-0.05cm) -- (0.1cm,-0.05cm) -- cycle; fill fullcircle xscaled 0.50cm yscaled 0.44cm shifted (4.125cm,0.1cm) withcolor red; draw fullcircle xscaled 0.50cm yscaled 0.44cm shifted (4.125cm,0.1cm); draw fullcircle xscaled 0.50cm yscaled 0.44cm shifted (4.125cm,0.1cm) withshademethod "circular" withshadevector (0,1) withshadecolors (red,white) enddef; match((0,0)); \stopMPcode Le ven. 14 févr. 2020 à 16:43, Fabrice L a écrit : > Hi, > > Le 13 févr. 2020 à 16:45, Fabrice Couvreur > a écrit : > > > How to have the color defined by {yellow!60!black} with Metapost ? > > > color MyColor ; MyColor := .6[yellow,black] ; > > See metafun manual, section 1.13. > > Thank you. > Fabrice > > > Fabrice (another one !). > > > ___ > 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] Metapost and TikZ color code equivalent
i Henri, Thank you for your answer. The idea is to make the graph as an attachment. I converted to Metapost but the road is still long! The code is from percusse on StackExchange. As you can see, there is a problem with the ellipse. How do I fix this ? Thank you Fabrice \usemodule[tikz] \starttext \startMPcode def match (expr pos) = fill unitsquare xscaled 4cm yscaled 0.2cm shifted pos withcolor yellow; fill origin -- (4cm,0) -- (4.1cm,-0.05cm) -- (0.1cm,-0.05cm) -- cycle withcolor(.6yellow + black); draw origin -- (0,0.2cm) -- (4cm,0.2cm) -- (4cm,0) -- (4.1cm,-0.05cm) -- (0.1cm,-0.05cm) -- cycle; fill fullcircle xscaled 0.25cm yscaled 0.22cm shifted (4.125cm,0.1cm) withcolor red; draw fullcircle xscaled 0.25cm yscaled 0.22cm shifted (4.125cm,0.1cm) withshademethod "circular" withshadevector (0,1) withshadecolors (red,white) enddef; match((0,0)); \stopMPcode \starttikzpicture \define[2]\allumette{ \fill [yellow] (#1,#2) rectangle (#1+4,#2+0.2); \fill [yellow!60!black] (#1,#2) -- ++(4,0)-- ++(0.1,-0.05) -- ++(-4,0) -- ++(-0.1,0.05); \draw (#1,#2) -- ++(0,0.2) -- ++(4,0) -- ++(0,-0.2) -- ++(0.1,-0.05) -- ++(-4,0) -- ++(-0.1,0.05); \shade[ball color=red] (#1+4,#2+0.1) ellipse (0.25cm and 0.22cm); \draw (#1+4,#2+0.1) ellipse (0.25cm and 0.22cm); } \allumette{0.1}{0.2} \filldraw[orange,scale=0.5,shift={(8.2,1.2)}] (0,0) .. controls (-1.5,1.25) and (.5,2) .. (-.2,4) .. controls (1,2.5) and (1,.5) .. (0,0); \stoptikzpicture \stoptext Le ven. 14 févr. 2020 à 02:49, Henri Menke a écrit : > On 2/14/20 10:45 AM, Fabrice Couvreur wrote: > > Hi, > > How to have the color defined by {yellow!60!black} with Metapost ? > > \usemodule[tikz] > \starttext > \startMPcode > fill fullsquare scaled 1cm withcolor (.6yellow + black) ; > \stopMPcode > > \starttikzpicture > \fill[yellow!60!black] (0,0) rectangle (1,1); > \stoptikzpicture > \stoptext > > > > Thank you. > > Fabrice > > > > > > > ___ > > If your question is of interest to others as well, please add an entry > to the Wiki! > > > > maillist : ntg-context@ntg.nl / > http://www.ntg.nl/mailman/listinfo/ntg-context > > webpage : http://www.pragma-ade.nl / http://context.aanhet.net > > archive : https://bitbucket.org/phg/context-mirror/commits/ > > wiki : http://contextgarden.net > > > ___ > > > > ___ > 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] Metapost and TikZ color code equivalent
Hi, How to have the color defined by {yellow!60!black} with Metapost ? Thank you. Fabrice ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context webpage : http://www.pragma-ade.nl / http://context.aanhet.net archive : https://bitbucket.org/phg/context-mirror/commits/ wiki : http://contextgarden.net ___
Re: [NTG-context] macro that does not work (Metapost)
Hi Mikael, Thanks. Fabrice Le mar. 11 févr. 2020 à 14:01, Mikael P. Sundqvist a écrit : > On Tue, Feb 11, 2020 at 1:22 PM Fabrice Couvreur < > fabrice1.couvr...@gmail.com> wrote: > >> Hi Hans, >> I tried this but without success : >> >> \startMPcode >> suite{1,0}; >> suite{2,1}; >> \stopMPcode >> >> Fabrice >> >> Le mar. 11 févr. 2020 à 13:08, Hans Hagen a écrit : >> >>> On 2/11/2020 11:50 AM, Fabrice Couvreur wrote: >>> > Hi, >>> > I have some problems with the following macro : >>> > >>> > tex error > mp error on line 23 in file /home/viserion/macro.tex: >>> > >>> > ! Missing argument to suite. >>> > >>> > { >>> > <*> suite{ >>> > 1,0}; suite(2,1); ; >>> > That macro has more parameters than you thought. >>> > I'll continue by pretending that each missing argument >>> > is either zero or null. >>> > >>> > ! Missing argument to suite. >>> > >>> > { >>> > <*> suite{ >>> > 1,0}; suite(2,1); ; >>> > That macro has more parameters than you thought. >>> > I'll continue by pretending that each missing argument >>> > is either zero or null. >>> >>> >>> {} instead of () >>> >>> > ! Extra tokens will be flushed. >>> > >>> > { >>> > <*> suite{ >>> > 1,0}; suite(2,1); ; >>> > I've just read as much of that statement as I could fathom, >>> > so a semicolon should have been next. It's very puzzling... >>> > but I'll try to get myself back together, by ignoring >>> > everything up to the next `;'. Please insert a semicolon >>> > now in front of anything that you don't want me to delete. >>> > (See Chapter 27 of The METAFONTbook for an example.) >>> > >>> > [1] >>> > >>> > 13 enddef; >>> > 14 \stopMPcode >>> > 15 \starttext >>> > 16 On présente ci-dessous deux suites de dessins. >>> > 17 \startlinecorrection[blank] >>> > 18 \startmidaligned >>> > 19 \startcombination[2*1] >>> > 20 {\startMPcode >>> > 21 suite{1,0}; >>> > 22 suite(2,1); >>> > 23 >> \stopMPcode}{\tfxx \bf Suite 2} >>> > 24 \stopcombination >>> > 25 \stopmidaligned >>> > 26 \stoplinecorrection >>> > 27 \stoptext >>> > >>> > mtx-context | fatal error: return code: 256 >>> > >>> > TeX Output exited abnormally with code 1 at Tue Feb 11 11:45:53 >>> > >>> > ## >>> > macro.tex >>> > ## >>> > >>> > \startMPcode >>> >def suite (expr n, t) = >>> >begingroup >>> > numeric u; >>> > u := 5mm; >>> > pickup pencircle scaled 4pt; >>> > for i=0 upto n: >>> > for j=0 upto n: >>> > drawdot (i*u,j*u) shifted(t*u,0) withcolor darkred; >>> > endfor >>> > endfor >>> >endgroup >>> >enddef; >>> > \stopMPcode >>> > \starttext >>> > On présente ci-dessous deux suites de dessins. >>> >\startlinecorrection[blank] >>> > \startmidaligned >>> >\startcombination[2*1] >>> > {\startMPcode >>> >suite{1,0}; >>> >suite(2,1); >>> > \stopMPcode}{\tfxx \bf Suite 2} >>> >\stopcombination >>> > \stopmidaligned >>> >\stoplinecorrection >>> > \stoptext >>> > >>> > >>> > Thank you. >>> > Fabrice >>> > >>> > >>> ___ >>> > If your question is of interest to others as well, please add an entry >>> to the Wiki! >>> > >>> > maillist : ntg-context@ntg.nl / >>> http://www.ntg.nl/mailman/listinfo/ntg-context >>> > webpage : http://www.pragma-ade.nl / h
Re: [NTG-context] macro that does not work (Metapost)
Hi Hans, I tried this but without success : \startMPcode suite{1,0}; suite{2,1}; \stopMPcode Fabrice Le mar. 11 févr. 2020 à 13:08, Hans Hagen a écrit : > On 2/11/2020 11:50 AM, Fabrice Couvreur wrote: > > Hi, > > I have some problems with the following macro : > > > > tex error > mp error on line 23 in file /home/viserion/macro.tex: > > > > ! Missing argument to suite. > > > > { > > <*> suite{ > > 1,0}; suite(2,1); ; > > That macro has more parameters than you thought. > > I'll continue by pretending that each missing argument > > is either zero or null. > > > > ! Missing argument to suite. > > > > { > > <*> suite{ > > 1,0}; suite(2,1); ; > > That macro has more parameters than you thought. > > I'll continue by pretending that each missing argument > > is either zero or null. > > > {} instead of () > > > ! Extra tokens will be flushed. > > > > { > > <*> suite{ > > 1,0}; suite(2,1); ; > > I've just read as much of that statement as I could fathom, > > so a semicolon should have been next. It's very puzzling... > > but I'll try to get myself back together, by ignoring > > everything up to the next `;'. Please insert a semicolon > > now in front of anything that you don't want me to delete. > > (See Chapter 27 of The METAFONTbook for an example.) > > > > [1] > > > > 13 enddef; > > 14 \stopMPcode > > 15 \starttext > > 16 On présente ci-dessous deux suites de dessins. > > 17 \startlinecorrection[blank] > > 18 \startmidaligned > > 19 \startcombination[2*1] > > 20 {\startMPcode > > 21 suite{1,0}; > > 22 suite(2,1); > > 23 >> \stopMPcode}{\tfxx \bf Suite 2} > > 24 \stopcombination > > 25 \stopmidaligned > > 26 \stoplinecorrection > > 27 \stoptext > > > > mtx-context | fatal error: return code: 256 > > > > TeX Output exited abnormally with code 1 at Tue Feb 11 11:45:53 > > > > ## > > macro.tex > > ## > > > > \startMPcode > >def suite (expr n, t) = > >begingroup > > numeric u; > > u := 5mm; > > pickup pencircle scaled 4pt; > > for i=0 upto n: > > for j=0 upto n: > > drawdot (i*u,j*u) shifted(t*u,0) withcolor darkred; > > endfor > > endfor > >endgroup > >enddef; > > \stopMPcode > > \starttext > > On présente ci-dessous deux suites de dessins. > >\startlinecorrection[blank] > > \startmidaligned > >\startcombination[2*1] > > {\startMPcode > >suite{1,0}; > >suite(2,1); > > \stopMPcode}{\tfxx \bf Suite 2} > >\stopcombination > > \stopmidaligned > >\stoplinecorrection > > \stoptext > > > > > > Thank you. > > Fabrice > > > > > ___ > > If your question is of interest to others as well, please add an entry > to the Wiki! > > > > maillist : ntg-context@ntg.nl / > http://www.ntg.nl/mailman/listinfo/ntg-context > > webpage : http://www.pragma-ade.nl / http://context.aanhet.net > > archive : https://bitbucket.org/phg/context-mirror/commits/ > > wiki : http://contextgarden.net > > > ___ > > > > > -- > > - >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 ___
[NTG-context] macro that does not work (Metapost)
Hi, I have some problems with the following macro : tex error > mp error on line 23 in file /home/viserion/macro.tex: ! Missing argument to suite. { <*> suite{ 1,0}; suite(2,1); ; That macro has more parameters than you thought. I'll continue by pretending that each missing argument is either zero or null. ! Missing argument to suite. { <*> suite{ 1,0}; suite(2,1); ; That macro has more parameters than you thought. I'll continue by pretending that each missing argument is either zero or null. ! Extra tokens will be flushed. { <*> suite{ 1,0}; suite(2,1); ; I've just read as much of that statement as I could fathom, so a semicolon should have been next. It's very puzzling... but I'll try to get myself back together, by ignoring everything up to the next `;'. Please insert a semicolon now in front of anything that you don't want me to delete. (See Chapter 27 of The METAFONTbook for an example.) [1] 13 enddef; 14 \stopMPcode 15 \starttext 16 On présente ci-dessous deux suites de dessins. 17 \startlinecorrection[blank] 18 \startmidaligned 19 \startcombination[2*1] 20 {\startMPcode 21 suite{1,0}; 22 suite(2,1); 23 >> \stopMPcode}{\tfxx \bf Suite 2} 24 \stopcombination 25 \stopmidaligned 26 \stoplinecorrection 27 \stoptext mtx-context | fatal error: return code: 256 TeX Output exited abnormally with code 1 at Tue Feb 11 11:45:53 ## macro.tex ## \startMPcode def suite (expr n, t) = begingroup numeric u; u := 5mm; pickup pencircle scaled 4pt; for i=0 upto n: for j=0 upto n: drawdot (i*u,j*u) shifted(t*u,0) withcolor darkred; endfor endfor endgroup enddef; \stopMPcode \starttext On présente ci-dessous deux suites de dessins. \startlinecorrection[blank] \startmidaligned \startcombination[2*1] {\startMPcode suite{1,0}; suite(2,1); \stopMPcode}{\tfxx \bf Suite 2} \stopcombination \stopmidaligned \stoplinecorrection \stoptext Thank you. Fabrice ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context webpage : http://www.pragma-ade.nl / http://context.aanhet.net archive : https://bitbucket.org/phg/context-mirror/commits/ wiki : http://contextgarden.net ___