Re: [NTG-context] Alphabet & color
I got it. Thanks. Marcus Vinicius On Thu, Jul 16, 2020, 13:57 Hans Hagen wrote: > On 7/16/2020 6:41 PM, Marcus Vinicius Mesquita wrote > > > I tried your code and it works fine. But where do the color schemes > > default and whatever come from? How can they be changed? > defauls is defined in the example .. colorshemes have numbers: > > \definecolor[colorscheme:1:1][s=.75] > \definecolor[colorscheme:1:2][r=.75] > \definecolor[colorscheme:1:3][g=.75] > \definecolor[colorscheme:1:4][b=.75] > \definecolor[colorscheme:1:5][c=.75] > \definecolor[colorscheme:1:6][m=.75] > \definecolor[colorscheme:1:7][y=.75] > > Hans > > > - >Hans Hagen | PRAGMA ADE >Ridderstraat 27 | 8061 GH Hasselt | The Netherlands > tel: 038 477 53 69 | www.pragma-ade.nl | www.pragma-pod.nl > - > ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context webpage : http://www.pragma-ade.nl / http://context.aanhet.net archive : https://bitbucket.org/phg/context-mirror/commits/ wiki : http://contextgarden.net ___
Re: [NTG-context] Alphabet & color
On 7/16/2020 6:41 PM, Marcus Vinicius Mesquita wrote I tried your code and it works fine. But where do the color schemes default and whatever come from? How can they be changed? defauls is defined in the example .. colorshemes have numbers: \definecolor[colorscheme:1:1][s=.75] \definecolor[colorscheme:1:2][r=.75] \definecolor[colorscheme:1:3][g=.75] \definecolor[colorscheme:1:4][b=.75] \definecolor[colorscheme:1:5][c=.75] \definecolor[colorscheme:1:6][m=.75] \definecolor[colorscheme:1:7][y=.75] Hans - Hans Hagen | PRAGMA ADE Ridderstraat 27 | 8061 GH Hasselt | The Netherlands tel: 038 477 53 69 | www.pragma-ade.nl | www.pragma-pod.nl - ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context webpage : http://www.pragma-ade.nl / http://context.aanhet.net archive : https://bitbucket.org/phg/context-mirror/commits/ wiki : http://contextgarden.net ___
Re: [NTG-context] Alphabet & color
Thank you, Hans for your answer. I tried your code and it works fine. But where do the color schemes default and whatever come from? How can they be changed? Best regards Marcus Vinicius On Thu, Jul 16, 2020, 04:19 Hans Hagen wrote: > On 7/16/2020 7:32 AM, Marcus Vinicius Mesquita wrote: > > Dear list > > > > I need to typeset a book for kids wich contains texts where each letter > > is assigned a fixed color, for example: > > > > A - - > red; > > B - - > blue; > > ... > > Z - - > green. > > > > What would be the best way to do this? TIA. > There's more ways to do this but here is one: > > (1) make a file: colorfont.lfg: > > return { > name = "coloralphabet", > colorschemes = { > default = { > [1] = { "a", "e" }, > [2] = { "i", "o", "u" }, > }, > whatever = { > [1] = { "65:90" }, > [2] = { }, > [3] = { }, > [4] = { "97:122" }, > } > } > } > > There is some more possible but this wil do ... > > (2) You define a font with these goodies attached: > > \setupbodyfont[plex,10pt] > > \definefontfeature >[MyFeaturesA] [default] >[goodies={colorfont},colorscheme=default,liga=no] > > \definefontfeature >[MyFeaturesB] [default] >[goodies={colorfont},colorscheme=whatever,liga=no] > > \definefont[MyFontA][Serif*MyFeaturesA] > \definefont[MyFontB][Serif*MyFeaturesB] > > (3) and use it this way: > > \starttext > > \setfontcolorscheme[1] {\MyFontA \samplefile{tufte}}\par > \setfontcolorscheme[2] {\MyFontA \samplefile{tufte}}\par > \setfontcolorscheme[3] {\MyFontA \samplefile{tufte}}\par > > \page > > \setfontcolorscheme[1] {\MyFontB \samplefile{tufte}}\par > \setfontcolorscheme[2] {\MyFontB \samplefile{tufte}}\par > \setfontcolorscheme[3] {\MyFontB \samplefile{tufte}}\par > > \stoptext > > Now, this is pretty (more than a decade) old functionality from early > days of mkiv/luatex when it was used for some tracing (by Idris) and it > still works (surprise). > > Today I would definitely use more recent trickery. If there is real > demand for this I can have a look at it, after all it's "kind of fun" > (as is most of font stuff). > > Hans > > - >Hans Hagen | PRAGMA ADE >Ridderstraat 27 | 8061 GH Hasselt | The Netherlands > tel: 038 477 53 69 | www.pragma-ade.nl | www.pragma-pod.nl > - > ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context webpage : http://www.pragma-ade.nl / http://context.aanhet.net archive : https://bitbucket.org/phg/context-mirror/commits/ wiki : http://contextgarden.net ___
Re: [NTG-context] 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
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 ___
Re: [NTG-context] Text around a figure
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 Best regards: Otared > On 16 Jul 2020, at 11:10, Fabrice Couvreur > wrote: > > 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 > > 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 > ___ ___ 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 ___
Re: [NTG-context] embolden font in LMTX
On 7/15/2020 5:03 PM, Pablo Rodriguez wrote: Dear list, I have the following sample: \definefontfamily [mainface] [rm] [TeX Gyre Pagella] [it={style:regular, features:{default, slanted}}, bi={style:regular, features:{default, boldened, slanted}}, bf={style:regular, features:{default, boldened}}] \setupbodyfont[mainface] \starttext \input{zapf}\\ {\it \input{zapf}}\\ {\bf \input{zapf}}\\ {\bi \input{zapf}}\\ \stoptext I’m afraid that LMTX (current latest 2020.07.13 23:53) cannot deal with the boldened feature. MkIV (from 2020.01.30 14:13) works just fine. Am I missing something or have I hit a bug? I have a fix. This kind of trickery is complicated by the fact that mkiv and lmtx follow a bit different route and that there is still mkiv code around that does the lmtx backend stuff (mkiv also had a lua pdf backend but it was dropped at some point because it made no sense to keep it). Features like these effects often are the result of playing around (as i always want something weirdly new to present at e.g. a BT or CTX meeting or just because it rains outside and I have a stack of new cd's to listen to). For sure they can be made better if there is demand. The same is true for variables fonts, emoji etc ... all these were supported as soon as the fonts showed up providing them, but it's hard to predict if any of that is actually used or useful. Anyway, you seem to use most trickery so ... fix in next upload (but I really do need to strip away old code some day). Hans - Hans Hagen | PRAGMA ADE Ridderstraat 27 | 8061 GH Hasselt | The Netherlands tel: 038 477 53 69 | www.pragma-ade.nl | www.pragma-pod.nl - ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context webpage : http://www.pragma-ade.nl / http://context.aanhet.net archive : https://bitbucket.org/phg/context-mirror/commits/ wiki : http://contextgarden.net ___
Re: [NTG-context] Alphabet & color
On 7/16/2020 7:32 AM, Marcus Vinicius Mesquita wrote: Dear list I need to typeset a book for kids wich contains texts where each letter is assigned a fixed color, for example: A - - > red; B - - > blue; ... Z - - > green. What would be the best way to do this? TIA. There's more ways to do this but here is one: (1) make a file: colorfont.lfg: return { name = "coloralphabet", colorschemes = { default = { [1] = { "a", "e" }, [2] = { "i", "o", "u" }, }, whatever = { [1] = { "65:90" }, [2] = { }, [3] = { }, [4] = { "97:122" }, } } } There is some more possible but this wil do ... (2) You define a font with these goodies attached: \setupbodyfont[plex,10pt] \definefontfeature [MyFeaturesA] [default] [goodies={colorfont},colorscheme=default,liga=no] \definefontfeature [MyFeaturesB] [default] [goodies={colorfont},colorscheme=whatever,liga=no] \definefont[MyFontA][Serif*MyFeaturesA] \definefont[MyFontB][Serif*MyFeaturesB] (3) and use it this way: \starttext \setfontcolorscheme[1] {\MyFontA \samplefile{tufte}}\par \setfontcolorscheme[2] {\MyFontA \samplefile{tufte}}\par \setfontcolorscheme[3] {\MyFontA \samplefile{tufte}}\par \page \setfontcolorscheme[1] {\MyFontB \samplefile{tufte}}\par \setfontcolorscheme[2] {\MyFontB \samplefile{tufte}}\par \setfontcolorscheme[3] {\MyFontB \samplefile{tufte}}\par \stoptext Now, this is pretty (more than a decade) old functionality from early days of mkiv/luatex when it was used for some tracing (by Idris) and it still works (surprise). Today I would definitely use more recent trickery. If there is real demand for this I can have a look at it, after all it's "kind of fun" (as is most of font stuff). Hans - Hans Hagen | PRAGMA ADE Ridderstraat 27 | 8061 GH Hasselt | The Netherlands tel: 038 477 53 69 | www.pragma-ade.nl | www.pragma-pod.nl - ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context webpage : http://www.pragma-ade.nl / http://context.aanhet.net archive : https://bitbucket.org/phg/context-mirror/commits/ wiki : http://contextgarden.net ___