[NTG-context] Re: Scale content to height of the font, measure font height
Also you can use this: assuming that you have a fixed size figure such as a pdf page: \definesymbol[Bsymbol][{\scale[width=1.6ex]{\externalfigure[myfile.pdf][page=1]}}] \define\mysym{\kern 0.2em \symbol[Bsymbol] \kern 0.3em} \starttext this is a sample\mysym text. \tfa{this is a sample\mysym text.} \stoptext On Mon, Jun 10, 2024 at 7:18 AM Gerion Entrup wrote: > Hi, > > I'd like to scale something (actually a symbol drawn in TikZ) to the exact > high of the char 'M'. I found the scale environment for it but struggle to > measure the correct font height. I found the > "definemeasure/measure/measured" > commands but they define a dimension and are not for doing measurements on > rendered text. Is there a simple way to get the height a char as a > dimension? > > MWE: > ``` > \starttext > % Is it possible to replace 1cm with a common expression? > This is the letter M. \scale[height=1cm]{a} should have the exact same > size as > M. > > This should also be true {\tfc with a bigger M. \scale[height=1cm]{a}}. > \stoptext > ``` > > Best > Gerion > > > ___ > If your question is of interest to others as well, please add an entry to > the Wiki! > > maillist : ntg-context@ntg.nl / > https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl > webpage : https://www.pragma-ade.nl / https://context.aanhet.net (mirror) > archive : https://github.com/contextgarden/context > wiki : https://wiki.contextgarden.net > > ___ > test.pdf Description: Adobe PDF document ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl webpage : https://www.pragma-ade.nl / https://context.aanhet.net (mirror) archive : https://github.com/contextgarden/context wiki : https://wiki.contextgarden.net ___
[NTG-context] Re: Square right aligned
Pablo Rodriguez via ntg-context schrieb am 09.02.2024 um 20:07: On 2/8/24 22:37, Otared Kavian wrote: Hi Ursula, I think you mean the so-called end of the proof sign, or QED (Quod Erat Demonstrandum). You can use this: \definesymbol[QED][\mathematics{\square}] \def\qed{\wordright{\symbol[QED]}} \starttext This is the end of our proof. \qed \stoptext In principle it is included in ConTeXt, but it seems that in the latest version I have (2024.01.23), the command \qed is broken. Hi Otared, \qed seems to have been disabled (line 988 in strc-con.mklx). The \qed command works only in a description or enumeration environment. \definedescription [qedtest] [closesymbol=\symbol{qed}] \starttext \startqedtest \samplefile{lorem}\qed \stopqedtest \stoptext Wolfgang ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl webpage : https://www.pragma-ade.nl / https://context.aanhet.net (mirror) archive : https://github.com/contextgarden/context wiki : https://wiki.contextgarden.net ___
[NTG-context] Re: Square right aligned
On 2/8/24 22:37, Otared Kavian wrote: > Hi Ursula, > > I think you mean the so-called end of the proof sign, or QED (Quod Erat > Demonstrandum). You can use this: > > \definesymbol[QED][\mathematics{\square}] > \def\qed{\wordright{\symbol[QED]}} > \starttext > This is the end of our proof. \qed > \stoptext > > In principle it is included in ConTeXt, but it seems that in the latest > version I have (2024.01.23), the command \qed is broken. Hi Otared, \qed seems to have been disabled (line 988 in strc-con.mklx). Functionality seems to have been enabled in \QED (line 45 in math-mis.mkxl). Just in case it might help, Pablo ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl webpage : https://www.pragma-ade.nl / https://context.aanhet.net (mirror) archive : https://github.com/contextgarden/context wiki : https://wiki.contextgarden.net ___
[NTG-context] Re: Square right aligned
Dear Otared and Dear Hraban, So this is my little example: works perfect, after our correspondence. \starttext \startalignment[normal] \margintext {1.1.1} {\bf Beispiel 3.2.17 (Vertauschung von All- und Existenzquantor).} \par {\it Sei M die Menge aller Männer und F die Menge aller Frauen. Die Aus-\par sage h(m, f) sei ”m ist verliebt in f“. Unter diesen Voraussetzungen machen \par Sie sich die Bedeutung der beiden Aussagen klar.}\wordright{\square} \stopalignment \stoptext Many thanks Uschi Von: Ursula Hermann Gesendet: Freitag, 9. Februar 2024 08:39:10 An: mailing list for ConTeXt users Betreff: [NTG-context] Re: Square right aligned Dear Hraban, Dear Otared! Many Thanks, Hraban: Because of \wordright: I took a look at wordright at the wiki, works perfect. Otared, many thanks too. It also works perfect with your example Uschi Von: Otared Kavian Gesendet: Donnerstag, 8. Februar 2024 22:37:08 An: mailing list for ConTeXt users Betreff: [NTG-context] Re: Square right aligned Hi Ursula, I think you mean the so-called end of the proof sign, or QED (Quod Erat Demonstrandum). You can use this: \definesymbol[QED][\mathematics{\square}] \def\qed{\wordright{\symbol[QED]}} \starttext This is the end of our proof. \qed \stoptext In principle it is included in ConTeXt, but it seems that in the latest version I have (2024.01.23), the command \qed is broken. Best regards: Otared On 8 Feb 2024, at 12:23, Ursula Hermann mailto:ursula.herm...@univie.ac.at>> wrote: Dear List, I am at Home and have the following example.: \starttext \margintext {1.1.1} {\bf Beispiel 3.2.17 (Vertauschung von All- und Existenzquantor).} \par {\it Sei M die Menge aller Männer und F die Menge aller Frauen. Die Aus-\par sage h(m, f) sei ”m ist verliebt in f“. Unter diesen Voraussetzungen machen Sie sich die Bedeutung der beiden Aussagen klar.\startalignment[right]\square\stopalignment}\stoptext} There should be a sign like this □ at the end of the proof. Uschi ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl<mailto:ntg-context@ntg.nl> / https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl webpage : https://www.pragma-ade.nl<https://www.pragma-ade.nl/> / https://context.aanhet.net<https://context.aanhet.net/> (mirror) archive : https://github.com/contextgarden/context wiki : https://wiki.contextgarden.net<https://wiki.contextgarden.net/> ___ Otared Kavian e-mail: ota...@gmail.com<mailto:ota...@gmail.com> Phone: +33 6 88 26 70 95 ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl webpage : https://www.pragma-ade.nl / https://context.aanhet.net (mirror) archive : https://github.com/contextgarden/context wiki : https://wiki.contextgarden.net ___
[NTG-context] Re: Square right aligned
Dear Hraban, Dear Otared! Many Thanks, Hraban: Because of \wordright: I took a look at wordright at the wiki, works perfect. Otared, many thanks too. It also works perfect with your example Uschi Von: Otared Kavian Gesendet: Donnerstag, 8. Februar 2024 22:37:08 An: mailing list for ConTeXt users Betreff: [NTG-context] Re: Square right aligned Hi Ursula, I think you mean the so-called end of the proof sign, or QED (Quod Erat Demonstrandum). You can use this: \definesymbol[QED][\mathematics{\square}] \def\qed{\wordright{\symbol[QED]}} \starttext This is the end of our proof. \qed \stoptext In principle it is included in ConTeXt, but it seems that in the latest version I have (2024.01.23), the command \qed is broken. Best regards: Otared On 8 Feb 2024, at 12:23, Ursula Hermann mailto:ursula.herm...@univie.ac.at>> wrote: Dear List, I am at Home and have the following example.: \starttext \margintext {1.1.1} {\bf Beispiel 3.2.17 (Vertauschung von All- und Existenzquantor).} \par {\it Sei M die Menge aller Männer und F die Menge aller Frauen. Die Aus-\par sage h(m, f) sei ”m ist verliebt in f“. Unter diesen Voraussetzungen machen Sie sich die Bedeutung der beiden Aussagen klar.\startalignment[right]\square\stopalignment}\stoptext} There should be a sign like this □ at the end of the proof. Uschi ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl<mailto:ntg-context@ntg.nl> / https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl webpage : https://www.pragma-ade.nl<https://www.pragma-ade.nl/> / https://context.aanhet.net<https://context.aanhet.net/> (mirror) archive : https://github.com/contextgarden/context wiki : https://wiki.contextgarden.net<https://wiki.contextgarden.net/> ___ Otared Kavian e-mail: ota...@gmail.com<mailto:ota...@gmail.com> Phone: +33 6 88 26 70 95 ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl webpage : https://www.pragma-ade.nl / https://context.aanhet.net (mirror) archive : https://github.com/contextgarden/context wiki : https://wiki.contextgarden.net ___
[NTG-context] Re: Square right aligned
Hi Ursula, I think you mean the so-called end of the proof sign, or QED (Quod Erat Demonstrandum). You can use this: \definesymbol[QED][\mathematics{\square}] \def\qed{\wordright{\symbol[QED]}} \starttext This is the end of our proof. \qed \stoptext In principle it is included in ConTeXt, but it seems that in the latest version I have (2024.01.23), the command \qed is broken. Best regards: Otared > On 8 Feb 2024, at 12:23, Ursula Hermann wrote: > > Dear List, > > I am at Home and have the following example.: > > \starttext > \margintext {1.1.1} > {\bf Beispiel 3.2.17 (Vertauschung von All- und Existenzquantor).} > \par > {\it Sei M die Menge aller Männer und F die Menge aller Frauen. Die > Aus-\par > sage h(m, f) sei ”m ist verliebt in f“. Unter diesen Voraussetzungen > machen Sie sich die Bedeutung der beiden Aussagen > klar.\startalignment[right]\square\stopalignment}\stoptext} > > There should be a sign like this □ at the end of the proof. > > Uschi > ___ > If your question is of interest to others as well, please add an entry to the > Wiki! > > maillist : ntg-context@ntg.nl <mailto:ntg-context@ntg.nl> / > https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl > <https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl> > webpage : https://www.pragma-ade.nl <https://www.pragma-ade.nl/> / > https://context.aanhet.net <https://context.aanhet.net/> (mirror) > archive : https://github.com/contextgarden/context > <https://github.com/contextgarden/context> > wiki : https://wiki.contextgarden.net <https://wiki.contextgarden.net/> > ___ Otared Kavian e-mail: ota...@gmail.com Phone: +33 6 88 26 70 95 ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl webpage : https://www.pragma-ade.nl / https://context.aanhet.net (mirror) archive : https://github.com/contextgarden/context wiki : https://wiki.contextgarden.net ___
[NTG-context] Re: Scaling characters without font switching in CLD
On Aug 12, 2023, 3:49 PM -0600, Hans Hagen , wrote: > you'll figure it out, right? I hope so and I'm working on it -- with your help -) > the demo shows both: x/.y scaling and 90/180/270 rotation Yes, here is what I have so far: == % % Hans' original template % \startsetups glyph:iTee % \dontleavehmode\hpack\bgroup % \setbox\scratchbox \ruledhbox \bgroup % \glyphxscale 400 % \glyphyscale 400 % \getglyphstyled{Serif}{T}% choose a font here % \egroup % \scratchheight 2.75\ht\scratchbox % \boxyoffset\scratchbox\scratchheight % \boxorientation\scratchbox\plustwo % \ht\scratchbox\scratchheight % \box\scratchbox % \egroup % \stopsetups % \definesymbol % [iTee] % [\directsetup{glyph:iTee}] % \startTEXpage [offset=1ts,width=2cm] % \ruledhbox {\tfx T \symbol{iTee}} \par % \ruledhbox {T \symbol{iTee}} \par % \ruledhbox {\tfa T \symbol{iTee}} \par % \ruledhbox {\bfd T \symbol{iTee}} % \stopTEXpage \definefontsynonym[MinionRegular][MinionPro-Regular.otf*default] \startsetups glyph:glottalhamzah \dontleavehmode\hpack\bgroup \setbox\scratchbox \ruledhbox \bgroup \glyphxscale 500 \glyphyscale 500 \getglyphstyled{MinionRegular}{c}% choose a font here \egroup \scratchheight 2.03\ht\scratchbox \boxyoffset\scratchbox\scratchheight \boxorientation\scratchbox\plustwo \ht\scratchbox\scratchheight \box\scratchbox \egroup \stopsetups \startsetups glyph:glottalayn \dontleavehmode\hpack\bgroup \setbox\scratchbox \ruledhbox \bgroup \glyphxscale 500 \glyphyscale 500 \getglyphstyled{MinionRegular}{c}% choose a font here \egroup \scratchheight 1.00\ht\scratchbox \boxyoffset\scratchbox\scratchheight % \boxorientation\scratchbox\plustwo \ht\scratchbox\scratchheight \box\scratchbox \egroup \stopsetups \definesymbol [glottalhamzah] [\directsetup{glyph:glottalhamzah}] \definesymbol [glottalayn] [\directsetup{glyph:glottalayn}] \definecolor [transparentgreen] [g=1,t=.7,a=1] \definecolor [transparentred][r=1,t=.7,a=1] \definecolor [transparentyellow] [y=1,t=.7,a=1] \startTEXpage [offset=1ts,width=2cm] \ruledhbox {\tfx c\symbol{glottalhamzah}c} \par \ruledhbox {c\symbol{glottalhamzah}c} \par \ruledhbox {\tfa c\symbol{glottalhamzah}c} \par \ruledhbox {\bfd c\symbol{glottalhamzah}c} \par \ruledhbox {\tfx c\symbol{glottalayn}c} \par \ruledhbox {c\symbol{glottalayn}c} \par \ruledhbox {\tfa c\symbol{glottalayn}c} \par \ruledhbox {\bfd c\symbol{glottalayn}c} \par \hbox{\rlap{\ruledhbox {\transparentgreen\tfx c\symbol{glottalhamzah}c}}% \hskip-.09em \ruledhbox {\transparentred c\symbol{glottalhamzah}c}} \hbox{\rlap{\ruledhbox {\transparentgreen\tfx c\symbol{glottalayn}c}}% \ruledhbox {\transparentredc\symbol{glottalayn}c}} \stopTEXpage == Note the \rlap's (see attached pdf): we see that \tfx doesn't scale the \symbol, although \tfa and higher do work. I guess fixing \tfx-symbol interaction will be part of your conversation with Wolfgang -) > well, you wented symbols so Ultimately I just want to be able to type the Unicode symbols for 02BE and 02BF -- ʾ and ʿ -- and get proper results. The overwhelming majority of hq fonts don't have them, and the few that do do them poorly, etc. (So there is no substitute for full control of these transliteration characters.) So even if we use symbols, would like to feed these setups to the CLD template you provided some days ago and feed the final result to \definefontfeature. === Best wishes Idris -- Professor Idris Samawi Hamid Department of Philosophy Colorado State University Fort Collins, CO 80523 test-scaling-hans.pdf Description: test-scaling-hans.pdf ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / https://www.ntg.nl/mailman/listinfo/ntg-context webpage : https://www.pragma-ade.nl / http://context.aanhet.net archive : https://bitbucket.org/phg/context-mirror/commits/ wiki : https://contextgarden.net ___
[NTG-context] Re: Scaling characters without font switching in CLD
On 8/12/2023 11:33 PM, Hamid,Idris wrote: On Aug 12, 2023, 2:11 PM -0600, Hans Hagen via ntg-context , wrote: impossible to reply as impossible to see what is your and mine text here Hm.. This new/modern email client (forced to update by the university) supports inline replies, and I can see the levels, but the distinctions between levels of reply appears to get lost when filtered by the ntg-context list (looking at the archives). So here it is again, with levels of reply made explicit: On Aug 12, 2023, 9:35 AM -0600, Hans Hagen , wrote: ** Caution: EXTERNAL Sender ** On 8/12/2023 4:03 PM, Hamid,Idris wrote: \tfx causes a switch to computer modern. Indeed. Something I need to discuss with Wolfgang as double checking is needed before I patch. Ah.. ok. But what if we want to scale independently of font switching? There is no need to go lua here (esp when you have not done vf magick before and i'm not going to debug code that i have little clue what it's about to do). Many thanks. Part of the context is that I have some updatable mission-critical documents that depended on \defineactivecharacter, which is apparently deprecated in LMTX. See earlier thread with that subject line. i adapted some recently but anyway active chars are a bad idea [BTW: Just this morning someone from the Persian Gulf asked for an updated version of a document whose compilation depended on \defineactivecharacter, so I need to get this working in the new regime -)] Now the templates that you provided - many, many thanks! - have what is needed to care of everything except for two characters: 02BE and 02BF. you'll figure it out, right? For one of those two remaining characters we also need scaling, for the other we also need scaling + rotation. It is not clear to me whether the scaling/rotation commands should fall under the character function, e.g., the demo shows both: x/.y scaling and 90/180/270 rotation === -- ʿ ringhalfleft local function ringhalfleft (characters,target,base,accent) === the initialize function === local function initialize(tfmdata,value) === or whether we just make a new function altogether === local function scale (ringhalfleft) -- shooting in the dark here === So the reason I said CLD is best is because we already defined all of the needed characters that way -- using your template -- except for these two, for which we need to add scaling and or rotation. The attached (linked in the previous email but attached here) gives us rotation but no scaling. - we cheat here and yuse glyph scaled (I have to provide a relative to current x/y scaling, don't use \glyphscale as that one is used by context itself - we use the style variant so that it adapts - you have to replace "Serif" with "YourFont" and map that one onto a file (YourFont YourFontBold etc) - more about these box manipulations in the low level manual Ok. Just discovered the 11 low-level manuals yesterday, not sure which one to focus on in this case -) \startsetups glyph:iTee \dontleavehmode\hpack\bgroup \setbox\scratchbox \ruledhbox \bgroup \glyphxscale 400 \glyphyscale 400 \getglyphstyled{Serif}{T}> choose a font here \egroup \scratchheight 2.75\ht\scratchbox \boxyoffset \scratchbox\scratchheight \boxorientation\scratchbox\plustwo \ht \scratchbox\scratchheight \box\scratchbox \egroup \stopsetups \definesymbol [iTee] [\directsetup{glyph:iTee}] \startTEXpage [offset=1ts,width=2cm] \ruledhbox {\tfx T \symbol{iTee}} \par \ruledhbox {T \symbol{iTee}} \par \ruledhbox {\tfa T \symbol{iTee}} \par \ruledhbox {\bfd T \symbol{iTee}} \stopTEXpage Great, will study this. The challenge (for me) will be integrating this approach into the lua definitions of the two needed characters. With \defineactivecharacter deprecated, there seems to be no way other than CLD to make and register the needed macro for \definefontfeature -- and we want to move forward with the new regime and not look back. well, you wented symbols so ... why lua then (btw, no need for squeezine as there are virtual commands for scaling; not for rotating; an alternative is to define some chars in metapost (see meta-imp-gamesymbols) which gives you plenty freedom With many thanks and much gratitude, Hans. Best wishes Idris -- Professor Idris Samawi Hamid Department of Philosophy Colorado State University Fort Collins, CO 80523 ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / https://www.ntg.nl/mailman/listinfo/ntg-context webpage : https://www.pragma-ade.nl / http://context.aanhet.net archive : https://bitbucket.org/phg/context-mirror/co
[NTG-context] Re: Scaling characters without font switching in CLD
On Aug 12, 2023, 2:11 PM -0600, Hans Hagen via ntg-context , wrote: > impossible to reply as impossible to see what is your and mine text here Hm.. This new/modern email client (forced to update by the university) supports inline replies, and I can see the levels, but the distinctions between levels of reply appears to get lost when filtered by the ntg-context list (looking at the archives). So here it is again, with levels of reply made explicit: On Aug 12, 2023, 9:35 AM -0600, Hans Hagen , wrote: ** Caution: EXTERNAL Sender ** On 8/12/2023 4:03 PM, Hamid,Idris wrote: >> \tfx causes a switch to computer modern. > Indeed. Something I need to discuss with Wolfgang as double checking is > needed before I patch. Ah.. ok. >> But what if we want to scale independently of font switching? > There is no need to go lua here (esp when you have not done vf magick > before and i'm not going to debug code that i have little clue what it's > about to do). Many thanks. Part of the context is that I have some updatable mission-critical documents that depended on \defineactivecharacter, which is apparently deprecated in LMTX. See earlier thread with that subject line. [BTW: Just this morning someone from the Persian Gulf asked for an updated version of a document whose compilation depended on \defineactivecharacter, so I need to get this working in the new regime -)] Now the templates that you provided - many, many thanks! - have what is needed to care of everything except for two characters: 02BE and 02BF. For one of those two remaining characters we also need scaling, for the other we also need scaling + rotation. It is not clear to me whether the scaling/rotation commands should fall under the character function, e.g., === -- ʿ ringhalfleft local function ringhalfleft (characters,target,base,accent) === the initialize function === local function initialize(tfmdata,value) === or whether we just make a new function altogether === local function scale (ringhalfleft) -- shooting in the dark here === So the reason I said CLD is best is because we already defined all of the needed characters that way -- using your template -- except for these two, for which we need to add scaling and or rotation. > The attached (linked in the previous email but attached here) gives us > rotation but no scaling. > - we cheat here and yuse glyph scaled (I have to provide a relative to > current x/y scaling, don't use \glyphscale as that one is used by > context itself > - we use the style variant so that it adapts > - you have to replace "Serif" with "YourFont" and map that one onto a > file (YourFont YourFontBold etc) > - more about these box manipulations in the low level manual Ok. Just discovered the 11 low-level manuals yesterday, not sure which one to focus on in this case -) > \startsetups glyph:iTee > \dontleavehmode\hpack\bgroup > \setbox\scratchbox \ruledhbox \bgroup > \glyphxscale 400 > \glyphyscale 400 > \getglyphstyled{Serif}{T}> choose a font here > \egroup > \scratchheight 2.75\ht\scratchbox > \boxyoffset \scratchbox\scratchheight > \boxorientation\scratchbox\plustwo > \ht \scratchbox\scratchheight > \box\scratchbox > \egroup > \stopsetups > \definesymbol > [iTee] > [\directsetup{glyph:iTee}] > \startTEXpage [offset=1ts,width=2cm] > \ruledhbox {\tfx T \symbol{iTee}} \par > \ruledhbox {T \symbol{iTee}} \par > \ruledhbox {\tfa T \symbol{iTee}} \par > \ruledhbox {\bfd T \symbol{iTee}} > \stopTEXpage Great, will study this. The challenge (for me) will be integrating this approach into the lua definitions of the two needed characters. With \defineactivecharacter deprecated, there seems to be no way other than CLD to make and register the needed macro for \definefontfeature -- and we want to move forward with the new regime and not look back. With many thanks and much gratitude, Hans. Best wishes Idris -- Professor Idris Samawi Hamid Department of Philosophy Colorado State University Fort Collins, CO 80523 ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / https://www.ntg.nl/mailman/listinfo/ntg-context webpage : https://www.pragma-ade.nl / http://context.aanhet.net archive : https://bitbucket.org/phg/context-mirror/commits/ wiki : https://contextgarden.net ___
[NTG-context] Re: Scaling characters without font switching in CLD
On Aug 12, 2023, 9:35 AM -0600, Hans Hagen , wrote: ** Caution: EXTERNAL Sender ** On 8/12/2023 4:03 PM, Hamid,Idris wrote: \tfx causes a switch to computer modern. Indeed. Something I need to discuss with Wolfgang as double checking is needed before I patch. Ah.. ok. But what if we want to scale independently of font switching? There is no need to go lua here (esp when you have not done vf magick before and i'm not going to debug code that i have little clue what it's about to do). Many thanks. Part of the context is that I have some updatable mission-critical documents that depended on \defineactivecharacter, which is apparently deprecated in LMTX. See earlier thread with that subject line. [BTW: Just this morning someone from the Persian Gulf asked for an updated version of a document whose compilation depended on \defineactivecharacter, so I need to get this working in the new regime -)] Now the templates that you provided - many, many thanks! - have what is needed to care of everything except for two characters: 02BE and 02BF. For one of those two remaining characters we also need scaling, for the other we also need scaling + rotation. It is not clear to me whether the scaling/rotation commands should fall under the character function, e.g., === -- ʿ ringhalfleft local function ringhalfleft (characters,target,base,accent) === the initialize function === local function initialize(tfmdata,value) === or whether we just make a new function altogether === local function scale (ringhalfleft) -- shooting in the dark here === So the reason I said CLD is best is because we already defined all of the needed characters that way -- using your template -- except for these two, for which we need to add scaling and or rotation. The attached (linked in the previous email but attached here) gives us rotation but no scaling. - we cheat here and yuse glyph scaled (I have to provide a relative to current x/y scaling, don't use \glyphscale as that one is used by context itself - we use the style variant so that it adapts - you have to replace "Serif" with "YourFont" and map that one onto a file (YourFont YourFontBold etc) - more about these box manipulations in the low level manual Ok. Just discovered the 11 low-level manuals yesterday, not sure which one to focus on in this case -) \startsetups glyph:iTee \dontleavehmode\hpack\bgroup \setbox\scratchbox \ruledhbox \bgroup \glyphxscale 400 \glyphyscale 400 \getglyphstyled{Serif}{T}% choose a font here \egroup \scratchheight 2.75\ht\scratchbox \boxyoffset \scratchbox\scratchheight \boxorientation\scratchbox\plustwo \ht \scratchbox\scratchheight \box\scratchbox \egroup \stopsetups \definesymbol [iTee] [\directsetup{glyph:iTee}] \startTEXpage [offset=1ts,width=2cm] \ruledhbox {\tfx T \symbol{iTee}} \par \ruledhbox {T \symbol{iTee}} \par \ruledhbox {\tfa T \symbol{iTee}} \par \ruledhbox {\bfd T \symbol{iTee}} \stopTEXpage Great, will study this. The challenge (for me) will be integrating this approach into the lua definitions of the two needed characters. With \defineactivecharacter deprecated, there seems to be no way other than CLD to make and register the needed macro for \definefontfeature -- and we want to move forward with the new regime and not look back. With many thanks and much gratitude, Hans. Best wishes Idris -- Professor Idris Samawi Hamid Department of Philosophy Colorado State University Fort Collins, CO 80523 transliteration--glottal-lua.pdf Description: transliteration--glottal-lua.pdf transliteration--glottal-lua.tex Description: transliteration--glottal-lua.tex ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / https://www.ntg.nl/mailman/listinfo/ntg-context webpage : https://www.pragma-ade.nl / http://context.aanhet.net archive : https://bitbucket.org/phg/context-mirror/commits/ wiki : https://contextgarden.net ___
[NTG-context] Re: Scaling characters without font switching in CLD
On 8/12/2023 4:03 PM, Hamid,Idris wrote: \tfx causes a switch to computer modern. Indeed. Something I need to discuss with Wolfgang as double checking is needed before I patch. But what if we want to scale independently of font switching? There is no need to go lua here (esp when you have not done vf magick before and i'm not going to debug code that i have little clue what it's about to do). - we cheat here and yuse glyph scaled (I have to provide a relative to current x/y scaling, don't use \glyphscale as that one is used by context itself - we use the style variant so that it adapts - you have to replace "Serif" with "YourFont" and map that one onto a file (YourFont YourFontBold etc) - more about these box manipulations in the low level manual \startsetups glyph:iTee \dontleavehmode\hpack\bgroup \setbox\scratchbox \ruledhbox \bgroup \glyphxscale 400 \glyphyscale 400 \getglyphstyled{Serif}{T}% choose a font here \egroup \scratchheight 2.75\ht\scratchbox \boxyoffset\scratchbox\scratchheight \boxorientation\scratchbox\plustwo \ht\scratchbox\scratchheight \box\scratchbox \egroup \stopsetups \definesymbol [iTee] [\directsetup{glyph:iTee}] \startTEXpage [offset=1ts,width=2cm] \ruledhbox {\tfx T \symbol{iTee}} \par \ruledhbox {T \symbol{iTee}} \par \ruledhbox {\tfa T \symbol{iTee}} \par \ruledhbox {\bfd T \symbol{iTee}} \stopTEXpage 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 / https://www.ntg.nl/mailman/listinfo/ntg-context webpage : https://www.pragma-ade.nl / http://context.aanhet.net archive : https://bitbucket.org/phg/context-mirror/commits/ wiki : https://contextgarden.net ___
[NTG-context] Scaling characters without font switching in CLD
Dear gang, I. In Context, as is well known, scaling a character is not independent of switching the font: === \startTEXpage[offset=1em] \definefont[Times][times @ 14pt] \Times Test \tfx Test \setupinterlinespace \Times Test \switchtobodyfont[x]Test \Times Test \high{Test} \stopTEXpage === \tfx causes a switch to computer modern. Of course, with the right typescripts and \setupbodyfont, one can maintain stylistic consistency when switching fonts. But what if we want to scale independently of font switching? II. One approach might be to use symbols: \startTEXpage \definesymbol[Tee][\getglyph{times}{T}] \symbol[Tee]est \tfx \symbol[Tee]est \tfa \symbol[Tee]est \stopTEXpage In this example, \tfa does scale the symbol Tee. But \tfx does not scale the symbol! Why does \tfa (or higher such as \tfb etc.) work, but not \tfx (or lower)? III. The best approach would be to do it in CLD (Context Lua Code). That is mostly beyond my skill to write from scratch without a template, but there are some experiments in the system file font-imp-effects.lua. There we will find, e.g., local specification = { name= "extend", description = "scale glyphs horizontally", initializers = { base = initializeextend, node = initializeextend, } } local specification = { name= "squeeze", description = "scale glyphs vertically", initializers = { base = initializesqueeze, node = initializesqueeze, } } This seems hopeful: \definecolor [transparentgreen] [g=1,t=.7,a=1] \definecolor [transparentred][r=1,t=.7,a=1] \definecolor [transparentyellow] [y=1,t=.7,a=1] \startTEXpage[offset=1em] \definefontfeature[scale][default][extend=yes,squeeze=yes] \hbox{\rlap{\definedfont[times @ 14pt]\transparentgreen Test}% \definedfont[times*scale @ 14pt]\transparentred Test} \stopTEXpage But there is no scaling of the character, extend=yes shifts the glyphs to the left, and squeeze=yes appears to do nothing at all. Here is a file collecting these experiments: https://www.dropbox.com/scl/fi/dggj3ypgjjeia1bo4eelb/test-scaling.tex?rlkey=hcky6ol594mw8u0j2j1z22heh&dl=0 https://www.dropbox.com/scl/fi/o2u1tsq515ycyoeup43qg/test-scaling.pdf?rlkey=h7gof1vyq3r0bh72qynh71apc&dl=0 IV. Objective: I need to be able to define a couple of characters in CLD -- glottal stops --, and add commands to scale and/or rotate a character without triggering a font switch. Again, writing this from scratch is beyond my current skill set - although I've recently started to study CLD. Something like this -- some of the semantics is almost certainly wrong and/or clumsy -) == -- ʿ ringhalfleft local function ringhalfleft (characters,target,base,accent) --if not characters[target] then local data1 = characters[base] local data2 = characters[accent] if data1 and data2 then characters[target] = { -- "ʿ" height = data1.height, depth= (data1.depth or 0) + 0.5*(data2.height or 0), width= data1.width, unicode = target, commands = { { "slot", 0, 0 }, { "left", -0.5*(data2.width or 0) + 0.5*(data2.width or 0)}, -- { "down", 0.2*(data2.height or 0) + (data2.height or 0) }, { "up", 0.0*(data2.height or 0) +(data2.height or 0) }, { "slot", 0, 0x063, }, { "squeeze", 0.75*(data2.height or 0) }, { "extend", 0.75*(data2.width or 0) }, }, } end --end end -- ʾ ringhalfright local function ringhalfright (characters,target,base,accent) --if not characters[target] then local data1 = characters[base] local data2 = characters[accent] if data1 and data2 then characters[target] = { -- "ʾ" height = data1.height, depth= (data1.depth or 0) + 0.5*(data2.height or 0), width= data1.width, unicode = target, commands = { { "slot", 0, 0 }, { "left", -0.35*(data2.width or 0) + 0.5*(data2.width or 0)}, { "down", 0.0*(data2.height or 0) + (data2.height or 0) }, -- { "up", 0.0*(data2.height or 0) + (data2.height or 0) }, { "slot", 0, 0x063, }, { "squeeze", 0.75*(data2.height or 0) }, { "extend", 0.75*(data2.width or 0) }, }, } end --end end local function initialize(tfmdata,value) if value then -- Hdotbelow(tfmda
[NTG-context] Custom TOC with makeup and setups
Hello, I am trying to create a presentation where at the start of each section in my presentation, a custom TOC page is shown. When I am at a particular section, the TOC will grey out all other sections (not implemented in my MWE). I have tried different ways but I find using makeups for the TOC page works ok (following https://wiki.contextgarden.net/Command/setuplistalternative and Aditya's presentation slides on their blog). My challenge is that when a makeup page is inserted, it leaves a page with the section name blank before it. How do I fix it? Any other way to achieve this is also welcome. My MWE: \setuppapersize[S6] \startuseMPgraphic{itemize:toc} save p; path p; p := ( (0,-0.5)--(0,0.5)--(0.866,0)--cycle ) scaled 1.5ExHeight; fill p withcolor \MPcolor{Black}; \stopuseMPgraphic \definesymbol[itemize:toc][\useMPgraphic{itemize:toc}] \definelistalternative [toclist] [renderingsetup=list:toclist] \setupheadtext[section=Table of Contents] \startsetups toclist \framed[align=normal, frame=off]{\placelist [section] [criterium=all, alternative=toclist]} \stopsetups \definehspace[tspace][4cm] \setupframed[ height=fit, width=fit, location=middle, frame=off, align=normal, offset=none, ] \startsetups list:toclist {\hbox to \hsize \bgroup \hspace[tspace] \framed[width=10mm,align=flushleft]{\symbol[itemize:toc]}% \framed[empty=yes]{\currentlistentrynumber\currentlistentrypagenumber}% \doifelse\currentlistentrylocation{\namedstructureheadlocation{section}}{% \framed[align=flushright,]{{\bfb\currentlistentrytitle}}% }{\framed[align=flushright,]{\currentlistentrytitle}} \egroup} \stopsetups \definemakeup [toc] [ doublesided=no, page=yes, bottom=, top=, pagestate=start, headerstate=empty, footerstate=empty, setups={toclist}, before=\setups{toc:setups}, ] \startsetups toc:setups \setupbackgrounds[page][background=color, backgroundcolor=blue] \stopsetups \definemakeup [standard] [ doublesided=no, page=right, pagestate=start, headerstate=empty, footerstate=empty, before=\setups{standard:setups}, ] \startsetups standard:setups \setupbackgrounds[page][background=color, backgroundcolor=lightgray] \stopsetups \define\TOC{ \starttocmakeup \stoptocmakeup } \starttext \startstandardmakeup \title{Your Title Here} \stopstandardmakeup \startsection[title={Motivation}] \TOC \startitemize \item something cool \item something else cool \stopitemize \stopsection \startsection[title={Main strands of theory}] \TOC \startitemize \item another cool thing \item cool too \stopitemize \stopsection \stoptext Thanks in advance. Jethro ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / https://www.ntg.nl/mailman/listinfo/ntg-context webpage : https://www.pragma-ade.nl / http://context.aanhet.net archive : https://bitbucket.org/phg/context-mirror/commits/ wiki : https://contextgarden.net ___
[NTG-context] https://wiki.contextgarden.net/Enumerations problem
In https://wiki.contextgarden.net/Enumerations there is this example: % \setupwhitespace[big] \definesymbol[1][$\triangleright$] \startcolumns {\bf joinedup:}\par before \startitemize[joinedup] \item test \item test \stopitemize after \par {\bf nowhite:} \par before \startitemize[nowhite] \item test \item test \stopitemize after \par {\bf joinedup,nowhite:}\par before \startitemize[joinedup,nowhite] \item test \item test \stopitemize after \column {\bf joinedup,nowhite,before:} \par before \startitemize[joinedup,nowhite,before] \item test \item test \stopitemize after \par {\bf joinedup,nowhite,after:} \par before \startitemize[joinedup,nowhite,after] \item test \item test \stopitemize after \stopcolumns % In my test "joinedup" leaves whitespace before the first list item and after the last, but in the sample output there is no space. While someone (?) is thinking about that, my (extremely rudimentary!) tests also indicate that there is no need to use "joinedup" when you use "nowhite". Is this indeed the case (in which case the wiki page could use an edit) or are there case where both "joinedup" and "nowhite" are needed together (in which case the wiki page could stand a little more information). Thanks. Jim ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / https://www.ntg.nl/mailman/listinfo/ntg-context webpage : https://www.pragma-ade.nl / http://context.aanhet.net archive : https://bitbucket.org/phg/context-mirror/commits/ wiki : https://contextgarden.net ___
Re: [NTG-context] Issue with interactive checkboxes[solved]
I’ve tested on my Mac OS Monterey 12.3.1 and the same phenomena as firefox it also is on google chrome. > 24 maj 2022 kl. 10:18 skrev Jan-Erik Hägglöf : > > HI Again! > > I discovered what went wrong, such a silly syntax error, here comes a working > code: > > \setupinteraction[state=start] > > \definesymbol[yes][{\externalfigure[check-mark-svgrepo-com.svg][conversion=mp]}] > \definesymbol[no][] > > \newcount\chk > \def\checkmark{% > \global\advance\chk by 1 > \setupfield[setup1][width=0.5cm, height=0.5cm,rulethickness=1pt, > corner=round, framecolor=red]% > \definefield[checkme\the\chk][check][setup1][yes,no][no]% > \field[checkme\the\chk]% > } > > \starttext > > \checkmark\ > > \checkmark\ > > \checkmark\ > > \stoptext > > Sorry to bother the list but maybe it is helpful for someone. > > Regards > > /Jan-Erik > >> 24 maj 2022 kl. 08:08 skrev Jan-Erik Hägglöf > <mailto:skrantajanne...@gmail.com>>: >> >> I’ve tried this >> >> \setupinteraction[state=start] >> >> \definesymbol[yes][{\externalfigure[check-mark-svgrepo-com.svg][conversion=mp]}] >> \definesymbol[no][] >> >> \newcount\chk >> \def\chk{% >> \global \advance \chk by 1 >> \setupfield[setup1][width=0.5cm, height=0.5cm,rulethickness=1pt, >> corner=round, framecolor=red]% >> \definefield[checkme\the\chk][check][setup1][yes,no][no]% >> \field[checkme\the\chk]% >> } >> >> \starttext >> >> \chk >> >> \chk >> >> \chk >> >> \stoptext >> >> But it gives the error ” You can’t use \global after \advance” >> >> But this example works fine >> >> \setupinteraction[state=start] >> >> \newcount\clozecount >> \def\mycloze{% >> \global \advance \clozecount by 1 >> \definefield[uniqcloze\the\clozecount][line]% >> \field[uniqcloze\the\clozecount]% >> } >> >> \starttext >> >> Frogs have four \mycloze\ and two eyes. >> Frogs have four \mycloze\ and two eyes. >> Frogs have four \mycloze\ and two eyes. >> Frogs have four \mycloze\ and two eyes. >> >> \stoptext >> >> From >> >> https://tex.stackexchange.com/questions/560042/how-to-create-unique-clozes-in-context-in-a-pdf-that-users-can-type-in >> >> <https://tex.stackexchange.com/questions/560042/how-to-create-unique-clozes-in-context-in-a-pdf-that-users-can-type-in> >> >>> 24 maj 2022 kl. 07:44 skrev Jan-Erik Hägglöf >> <mailto:skrantajanne...@gmail.com>>: >>> >>> Thank you, unfortunately it has no effect. Even if I make a macro, still it >>> is the same field. >>> >>>> 23 maj 2022 kl. 21:59 skrev Pablo Rodriguez via ntg-context >>>> mailto:ntg-context@ntg.nl>>: >>>> >>>> On 5/23/22 13:11, Jan-Erik Hägglöf via ntg-context wrote: >>>>> HI! >>>>> >>>>> Tried to make a checklist in an interactive document. >>>>> >>>>> The problem seems to be that all checks/uncecks in same click, not each >>>>> individually. >>>>> >>>>> Is there something wrong with my code? >>>> >>>> Hi Jan-Erik, >>>> >>>> you basically put the same field twice. >>>> >>>> Add something like: >>>> >>>> \definefield [check-you] [check] [setup 3] [yes,no] [no] >>>> >>>> \define\chka{\field[check-you]} >>>> >>>> \chka >>>> >>>> Checks will be different then. >>>> >>>> I hope it helps, >>>> >>>> Pablo >>>> ___ >>>> If your question is of interest to others as well, please add an entry to >>>> the Wiki! >>>> >>>> maillist : ntg-context@ntg.nl <mailto:ntg-context@ntg.nl> / >>>> http://www.ntg.nl/mailman/listinfo/ntg-context >>>> <http://www.ntg.nl/mailman/listinfo/ntg-context> >>>> webpage : http://www.pragma-ade.nl <http://www.pragma-ade.nl/> / >>>> http://context.aanhet.net <http://context.aanhet.net/> >>>> archive : https://bitbucket.org/phg/context-mirror/commits/ >>>> <https://bitbucket.org/phg/context-mirror/commits/> >>>> wiki : http://contextgarden.net <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] Issue with interactive checkboxes[solved]
On 5/24/22 10:18, Jan-Erik Hägglöf via ntg-context wrote: > HI Again! > > I discovered what went wrong, such a silly syntax error, here comes a > working code: Hi Jan-Erik, this will also make it: \setupinteraction[state=start] \definesymbol [yes] [{\externalfigure[on.svg][conversion=mp]}] \definesymbol [no] [{\externalfigure[off.svg][conversion=mp]}] \setupfield[setup3][width=2ex, height=2ex] \dorecurse{3} {\definefield [check-\recurselevel] [check] [setup3] [yes,no] [no]} \setupbodyfont[sans, 30pt] \starttext \startTEXpage[offset=1em, foregroundstyle=\ssbf] \dorecurse{3} {\field[check-\recurselevel]\ option \recurselevel\blank[1ex]} \stopTEXpage \stoptext But what I experienced in Acrobat Reader DC (on a borrowed computer) is that you get the standard image (only when field is enabled) when you click elsewhere in the document. I guess that this may be related to a missing implementation, but first I would like to confirm you are experiencing the same. Best, Pablo ___ 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] Issue with interactive checkboxes[solved]
HI Again! I discovered what went wrong, such a silly syntax error, here comes a working code: \setupinteraction[state=start] \definesymbol[yes][{\externalfigure[check-mark-svgrepo-com.svg][conversion=mp]}] \definesymbol[no][] \newcount\chk \def\checkmark{% \global\advance\chk by 1 \setupfield[setup1][width=0.5cm, height=0.5cm,rulethickness=1pt, corner=round, framecolor=red]% \definefield[checkme\the\chk][check][setup1][yes,no][no]% \field[checkme\the\chk]% } \starttext \checkmark\ \checkmark\ \checkmark\ \stoptext Sorry to bother the list but maybe it is helpful for someone. Regards /Jan-Erik > 24 maj 2022 kl. 08:08 skrev Jan-Erik Hägglöf : > > I’ve tried this > > \setupinteraction[state=start] > > \definesymbol[yes][{\externalfigure[check-mark-svgrepo-com.svg][conversion=mp]}] > \definesymbol[no][] > > \newcount\chk > \def\chk{% > \global \advance \chk by 1 > \setupfield[setup1][width=0.5cm, height=0.5cm,rulethickness=1pt, > corner=round, framecolor=red]% > \definefield[checkme\the\chk][check][setup1][yes,no][no]% > \field[checkme\the\chk]% > } > > \starttext > > \chk > > \chk > > \chk > > \stoptext > > But it gives the error ” You can’t use \global after \advance” > > But this example works fine > > \setupinteraction[state=start] > > \newcount\clozecount > \def\mycloze{% > \global \advance \clozecount by 1 > \definefield[uniqcloze\the\clozecount][line]% > \field[uniqcloze\the\clozecount]% > } > > \starttext > > Frogs have four \mycloze\ and two eyes. > Frogs have four \mycloze\ and two eyes. > Frogs have four \mycloze\ and two eyes. > Frogs have four \mycloze\ and two eyes. > > \stoptext > > From > > https://tex.stackexchange.com/questions/560042/how-to-create-unique-clozes-in-context-in-a-pdf-that-users-can-type-in > > <https://tex.stackexchange.com/questions/560042/how-to-create-unique-clozes-in-context-in-a-pdf-that-users-can-type-in> > >> 24 maj 2022 kl. 07:44 skrev Jan-Erik Hägglöf > <mailto:skrantajanne...@gmail.com>>: >> >> Thank you, unfortunately it has no effect. Even if I make a macro, still it >> is the same field. >> >>> 23 maj 2022 kl. 21:59 skrev Pablo Rodriguez via ntg-context >>> mailto:ntg-context@ntg.nl>>: >>> >>> On 5/23/22 13:11, Jan-Erik Hägglöf via ntg-context wrote: >>>> HI! >>>> >>>> Tried to make a checklist in an interactive document. >>>> >>>> The problem seems to be that all checks/uncecks in same click, not each >>>> individually. >>>> >>>> Is there something wrong with my code? >>> >>> Hi Jan-Erik, >>> >>> you basically put the same field twice. >>> >>> Add something like: >>> >>> \definefield [check-you] [check] [setup 3] [yes,no] [no] >>> >>> \define\chka{\field[check-you]} >>> >>> \chka >>> >>> Checks will be different then. >>> >>> I hope it helps, >>> >>> Pablo >>> ___ >>> If your question is of interest to others as well, please add an entry to >>> the Wiki! >>> >>> maillist : ntg-context@ntg.nl <mailto:ntg-context@ntg.nl> / >>> http://www.ntg.nl/mailman/listinfo/ntg-context >>> <http://www.ntg.nl/mailman/listinfo/ntg-context> >>> webpage : http://www.pragma-ade.nl <http://www.pragma-ade.nl/> / >>> http://context.aanhet.net <http://context.aanhet.net/> >>> archive : https://bitbucket.org/phg/context-mirror/commits/ >>> <https://bitbucket.org/phg/context-mirror/commits/> >>> wiki : http://contextgarden.net <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] Issue with interactive checkboxes
I’ve tried this \setupinteraction[state=start] \definesymbol[yes][{\externalfigure[check-mark-svgrepo-com.svg][conversion=mp]}] \definesymbol[no][] \newcount\chk \def\chk{% \global \advance \chk by 1 \setupfield[setup1][width=0.5cm, height=0.5cm,rulethickness=1pt, corner=round, framecolor=red]% \definefield[checkme\the\chk][check][setup1][yes,no][no]% \field[checkme\the\chk]% } \starttext \chk \chk \chk \stoptext But it gives the error ” You can’t use \global after \advance” But this example works fine \setupinteraction[state=start] \newcount\clozecount \def\mycloze{% \global \advance \clozecount by 1 \definefield[uniqcloze\the\clozecount][line]% \field[uniqcloze\the\clozecount]% } \starttext Frogs have four \mycloze\ and two eyes. Frogs have four \mycloze\ and two eyes. Frogs have four \mycloze\ and two eyes. Frogs have four \mycloze\ and two eyes. \stoptext From https://tex.stackexchange.com/questions/560042/how-to-create-unique-clozes-in-context-in-a-pdf-that-users-can-type-in > 24 maj 2022 kl. 07:44 skrev Jan-Erik Hägglöf : > > Thank you, unfortunately it has no effect. Even if I make a macro, still it > is the same field. > >> 23 maj 2022 kl. 21:59 skrev Pablo Rodriguez via ntg-context >> : >> >> On 5/23/22 13:11, Jan-Erik Hägglöf via ntg-context wrote: >>> HI! >>> >>> Tried to make a checklist in an interactive document. >>> >>> The problem seems to be that all checks/uncecks in same click, not each >>> individually. >>> >>> Is there something wrong with my code? >> >> Hi Jan-Erik, >> >> you basically put the same field twice. >> >> Add something like: >> >> \definefield [check-you] [check] [setup 3] [yes,no] [no] >> >> \define\chka{\field[check-you]} >> >> \chka >> >> Checks will be different then. >> >> I hope it helps, >> >> Pablo >> ___ >> 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] Issue with interactive checkboxes
HI!Tried to make a checklist in an interactive document.The problem seems to be that all checks/uncecks in same click, not each individually.Is there something wrong with my code?See attached below\setupinteraction[state=start]\setupexternalfigures[location=global]\usemodule[fields]\definesymbol [yes] [{\externalfigure[check-mark-svgrepo-com.svg][conversion=mp]}]\definesymbol [no] []\setupfield[setup 3][width=0.5cm, height=0.5cm,rulethickness=1pt, corner=round, framecolor=red]\definefield [check-me] [check] [setup 3] [yes,no] [no]\define\chk{\field[check-me]}\starttext\chk\blank[3cm]\chk\stoptext exempel1.pdf Description: Adobe PDF document ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context webpage : http://www.pragma-ade.nl / http://context.aanhet.net archive : https://bitbucket.org/phg/context-mirror/commits/ wiki : http://contextgarden.net ___
Re: [NTG-context] Interactive checkbox in ConTeXt
So far I accomplished this but problem is that when I check it checks all, not individually. \setupinteraction[state=start] \setupexternalfigures[location=global] \definesymbol [yes] [{\externalfigure[check-mark-svgrepo-com.svg][conversion=mp]}] \definesymbol [no] [] \setupfield [setup 3] [width=0.5cm, height=0.5cm, rulethickness=1pt, corner=round, framecolor=red] \definefield [check-me] [check] [setup 3] [yes,no] [no] \define\chk{\field[check-me]} \starttext \chkgfgkfgfghjl \chkdfdffdfff \stoptext > 22 maj 2022 kl. 10:47 skrev Jan-Erik Hägglöf : > > Thank you for the useful tip. > > I’ve tested the example given below but ran into missing figure, maybe I need > to reconstruct the MetaPost file as mentioned in setup. Se attached example: > > Thanks in advance! > > /Jan-Erik > > \setupinteraction[state=start] > \setupexternalfigures[location=global] > > \definesymbol [yes] [{\externalfigure[mp-cont.502]}] > \definesymbol [no] [] > > > \setupfield > [setup 3] > [width=2cm, height=2cm, > rulethickness=3pt, corner=round, framecolor=red] > > \definefield [check-me] [check] [setup 3] [yes,no] [no] > > \starttext > \field[check-me] > \stoptext > >> 20 maj 2022 kl. 12:28 skrev Henning Hraban Ramm via ntg-context >> : >> >> Am 20.05.22 um 12:01 schrieb Jan-Erik Hägglöf via ntg-context: >>> How do I accomplish a similar funktion like this, that is written in latex, >>> but in context instead? >>> LATEXCODE >>> |\documentclass{article} \usepackage{hyperref} \begin{document} >>> \begin{Form} \CheckBox[name=mycheckbox,checkboxsymbol=\ding{53}]{This is a >>> check box:} \end{Form} \end{document}| >> >> Have a look at https://wiki.contextgarden.net/Widgets and the "mwidget" >> manual. >> >> Custom symbols work unreliably, depending of the viewer. >> >> 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 ___
Re: [NTG-context] Interactive checkbox in ConTeXt
Thank you for the useful tip. I’ve tested the example given below but ran into missing figure, maybe I need to reconstruct the MetaPost file as mentioned in setup. Se attached example: Thanks in advance! /Jan-Erik \setupinteraction[state=start] \setupexternalfigures[location=global] \definesymbol [yes] [{\externalfigure[mp-cont.502]}] \definesymbol [no] [] \setupfield [setup 3] [width=2cm, height=2cm, rulethickness=3pt, corner=round, framecolor=red] \definefield [check-me] [check] [setup 3] [yes,no] [no] \starttext \field[check-me] \stoptext > 20 maj 2022 kl. 12:28 skrev Henning Hraban Ramm via ntg-context > : > > Am 20.05.22 um 12:01 schrieb Jan-Erik Hägglöf via ntg-context: >> How do I accomplish a similar funktion like this, that is written in latex, >> but in context instead? >> LATEXCODE >> |\documentclass{article} \usepackage{hyperref} \begin{document} \begin{Form} >> \CheckBox[name=mycheckbox,checkboxsymbol=\ding{53}]{This is a check box:} >> \end{Form} \end{document}| > > Have a look at https://wiki.contextgarden.net/Widgets and the "mwidget" > manual. > > Custom symbols work unreliably, depending of the viewer. > > 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 ___
Re: [NTG-context] What is the proper way to define many different list types in a document?
On Tue, 25 Jan 2022, Joel via ntg-context wrote: > I have about several different types of list that reoccur multiple times in > my documents. Though I tried to keep things simple, by just defining the type > when it appears, strange glitches appear. For instance, I have one that uses > the ☞ (pointing hand) logo, and sometimes that randomly appears in the wrong > lists, for reasons I cannot understand. > > Below is how I'm defining my lists. I have about a dozen more, this is a > sample. Is there some more robust and consistent manner in which I should be > defining them, so the settings from one type don't spill over into the other > types? > --Joel > > %prompt > > \definesymbol[bighand][{{☞}}] > > \define[1]\prompt{% > \setupitemize[symbol=bighand] > \startitemize > {\it #1} > \stopitemize > }% This is a global definition. So, once this macro is used, symbol=bighand for all itemize. What you can use instead is: \define[1]\prompt{% \startitemize[symbol=bighand] {\it #1} \stopitemize }% or even better: \defineitemgroup[prompt][symbol=bighand,style=italic] ... \startprompt \item \stopprompt > %written answer (produces some lines after the question for writing an answer) > > \define[1]\writingbox{% > \dorecurse{#1}{% > \hairline% > } > } There is also: https://wiki.contextgarden.net/Command/fillinrules 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 ___
[NTG-context] What is the proper way to define many different list types in a document?
I have about several different types of list that reoccur multiple times in my documents. Though I tried to keep things simple, by just defining the type when it appears, strange glitches appear. For instance, I have one that uses the ☞ (pointing hand) logo, and sometimes that randomly appears in the wrong lists, for reasons I cannot understand. Below is how I'm defining my lists. I have about a dozen more, this is a sample. Is there some more robust and consistent manner in which I should be defining them, so the settings from one type don't spill over into the other types? --Joel %prompt \definesymbol[bighand][{{☞}}] \define[1]\prompt{% \setupitemize[symbol=bighand] \startitemize {\it #1} \stopitemize }% \prompt{What did you learn about today?} %vocabulary \startcolumns[n=3]\startitemize[n] \item word1 \item word2 \item word3 \stopitemize\stopcolumns %nested outline \startitemize[1] \item some text \startitemize[2] \item some text \startitemize[3] \item some text \stopitemize \stopitemize \stopitemize %written answer (produces some lines after the question for writing an answer) \define[1]\writingbox{% \dorecurse{#1}{% \hairline% } } \startitemize[n] \item Which planet is closest to Earth? \writingbox{4} \item What is the moon made of? \writingbox{4} \stopitemize %materials list \startcolumns[n=3]\startitemize \item crayons \item scissors \item glue \stopitemize\stopcolumns %word search clues (should be simple, but strangely this keeps getting the ☞ logo added instead of showing numbers) \startitemize[n] \item a type of hat worn \item a cold season \stopitemize ___ 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] Dangerous bends symbol in manfnt.afm accidentally chopped by LMTX?
On 1/2/2022 11:30 AM, Benjamin Buchmuller via ntg-context wrote: Hi list, using this example from the wiki, the dbend symbol appears cropped on the left side on my machine (ConTeXt ver: 2021.12.10 11:41 LMTX fmt: 2021.12.14), but not on the ConTeXt live server? Any possible reasons? \definefontsynonym [bends] [file:manfnt.afm] \startsymbolset [Dangerous Bends] \definesymbol [dbend] [\resolvedglyphdirect{bends}{n:char_7e}] \definesymbol [lhdbend] [\resolvedglyphdirect{bends}{n:char_7f}] \stopsymbolset \setupsymbolset [Dangerous Bends] \starttext \symbol{dbend}\quad \symbol{lhdbend} \stoptext The lhdbend renders funny anyway. Maybe Taco is willing to have a look at it. It might actually make sense to make an opentype font and get rid of the afm/pfb here. 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 ___
[NTG-context] Dangerous bends symbol in manfnt.afm accidentally chopped by LMTX?
Hi list, using this example from the wiki, the dbend symbol appears cropped on the left side on my machine (ConTeXt ver: 2021.12.10 11:41 LMTX fmt: 2021.12.14), but not on the ConTeXt live server? Any possible reasons? \definefontsynonym [bends] [file:manfnt.afm] \startsymbolset [Dangerous Bends] \definesymbol [dbend] [\resolvedglyphdirect{bends}{n:char_7e}] \definesymbol [lhdbend] [\resolvedglyphdirect{bends}{n:char_7f}] \stopsymbolset \setupsymbolset [Dangerous Bends] \starttext \symbol{dbend}\quad \symbol{lhdbend} \stoptext Thanks Benjamin ___ 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 colored font
Thank you for the last update. It works perfectly. Marcus Vinicius On Sat, Aug 7, 2021 at 10:23 AM Marcus Vinicius Mesquita < marcusvinicius.mesqu...@gmail.com> wrote: > Thank you, Hans. I'll wait then for the next upload. > > Have a nice weekend. > > Marcus Vinicius > > > On Sat, Aug 7, 2021 at 10:14 AM Hans Hagen wrote: > >> On 8/7/2021 1:09 PM, Marcus Vinicius Mesquita via ntg-context wrote: >> > Dear list, >> > >> > I'm trying to use the BabelStone Flags font, with colored flags of many >> > countries,available freely under the SIL Open Font License 1.1 at: >> > https://babelstone.co.uk/Fonts/Download/BabelStoneFlagsDual.ttf >> > <https://babelstone.co.uk/Fonts/Download/BabelStoneFlagsDual.ttf> >> > >> > In the MWE below, there is a spurious “at” in the first time that the >> > definition of the symbol for the Brazilian flag is used, but no problem >> > when the definition for the flag of Portugal is used or even when the >> > symbol for the Brazilian flag is used a second time. How to correct >> this >> > behavior? >> > >> > MWE: >> > >> > \definefontfeature[colored][colr=yes] >> > \definefontsynonym[flags][file:BabelStoneFlagsDual.ttf*colored at 7pt] >> > \definesymbol[BR][\getglyphdirect{flags}{\char"F0023}] >> > \definesymbol[PT][\getglyphdirect{flags}{\char"F00A1}] >> > >> > \starttext >> > >> > Brasil \symbol[BR] >> > >> > Portugal \symbol[PT] >> > >> > Brasil \symbol[BR] >> > >> > \stoptext >> the fontsize is automatic so the "at .." interferes >> >> here is an alternative (call by name): >> >>\definesymbol[BR][{\getnamedglyphdirect{flags}{br}}] >>\definesymbol[PT][{\getnamedglyphdirect{flags}{pt}}] >> >> now, because you want it smaller i'll add this >> >>\definesymbol[BR][{\getnamedglyphdirectscaled{.7}{flags}{br}}] >>\definesymbol[PT][{\getnamedglyphdirectscaled{.7}{flags}{pt}}] >> >> in the next upload >> >> 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 >> - >> > > > -- > Todas as coisas fatigam o corpo, salvo a música, que não fatiga nem o > corpo nem seus membros, por ser descanso da alma, primavera do coração, > distração do aflito, entretenimento do solitário, e viático do viajante. > > Kunnâsh al-Hâ'ik (Cancioneiro de al-Hâ'ik) > -- Todas as coisas fatigam o corpo, salvo a música, que não fatiga nem o corpo nem seus membros, por ser descanso da alma, primavera do coração, distração do aflito, entretenimento do solitário, e viático do viajante. Kunnâsh al-Hâ'ik (Cancioneiro de al-Hâ'ik) ___ 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 colored font
Thank you, Hans. I'll wait then for the next upload. Have a nice weekend. Marcus Vinicius On Sat, Aug 7, 2021 at 10:14 AM Hans Hagen wrote: > On 8/7/2021 1:09 PM, Marcus Vinicius Mesquita via ntg-context wrote: > > Dear list, > > > > I'm trying to use the BabelStone Flags font, with colored flags of many > > countries,available freely under the SIL Open Font License 1.1 at: > > https://babelstone.co.uk/Fonts/Download/BabelStoneFlagsDual.ttf > > <https://babelstone.co.uk/Fonts/Download/BabelStoneFlagsDual.ttf> > > > > In the MWE below, there is a spurious “at” in the first time that the > > definition of the symbol for the Brazilian flag is used, but no problem > > when the definition for the flag of Portugal is used or even when the > > symbol for the Brazilian flag is used a second time. How to correct this > > behavior? > > > > MWE: > > > > \definefontfeature[colored][colr=yes] > > \definefontsynonym[flags][file:BabelStoneFlagsDual.ttf*colored at 7pt] > > \definesymbol[BR][\getglyphdirect{flags}{\char"F0023}] > > \definesymbol[PT][\getglyphdirect{flags}{\char"F00A1}] > > > > \starttext > > > > Brasil \symbol[BR] > > > > Portugal \symbol[PT] > > > > Brasil \symbol[BR] > > > > \stoptext > the fontsize is automatic so the "at .." interferes > > here is an alternative (call by name): > >\definesymbol[BR][{\getnamedglyphdirect{flags}{br}}] >\definesymbol[PT][{\getnamedglyphdirect{flags}{pt}}] > > now, because you want it smaller i'll add this > >\definesymbol[BR][{\getnamedglyphdirectscaled{.7}{flags}{br}}] >\definesymbol[PT][{\getnamedglyphdirectscaled{.7}{flags}{pt}}] > > in the next upload > > 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 > - > -- Todas as coisas fatigam o corpo, salvo a música, que não fatiga nem o corpo nem seus membros, por ser descanso da alma, primavera do coração, distração do aflito, entretenimento do solitário, e viático do viajante. Kunnâsh al-Hâ'ik (Cancioneiro de al-Hâ'ik) ___ 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 colored font
On 8/7/2021 1:09 PM, Marcus Vinicius Mesquita via ntg-context wrote: Dear list, I'm trying to use the BabelStone Flags font, with colored flags of many countries,available freely under the SIL Open Font License 1.1 at: https://babelstone.co.uk/Fonts/Download/BabelStoneFlagsDual.ttf <https://babelstone.co.uk/Fonts/Download/BabelStoneFlagsDual.ttf> In the MWE below, there is a spurious “at” in the first time that the definition of the symbol for the Brazilian flag is used, but no problem when the definition for the flag of Portugal is used or even when the symbol for the Brazilian flag is used a second time. How to correct this behavior? MWE: \definefontfeature[colored][colr=yes] \definefontsynonym[flags][file:BabelStoneFlagsDual.ttf*colored at 7pt] \definesymbol[BR][\getglyphdirect{flags}{\char"F0023}] \definesymbol[PT][\getglyphdirect{flags}{\char"F00A1}] \starttext Brasil \symbol[BR] Portugal \symbol[PT] Brasil \symbol[BR] \stoptext the fontsize is automatic so the "at .." interferes here is an alternative (call by name): \definesymbol[BR][{\getnamedglyphdirect{flags}{br}}] \definesymbol[PT][{\getnamedglyphdirect{flags}{pt}}] now, because you want it smaller i'll add this \definesymbol[BR][{\getnamedglyphdirectscaled{.7}{flags}{br}}] \definesymbol[PT][{\getnamedglyphdirectscaled{.7}{flags}{pt}}] in the next upload 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 ___
[NTG-context] Problem with colored font
Dear list, I'm trying to use the BabelStone Flags font, with colored flags of many countries, available freely under the SIL Open Font License 1.1 at: https://babelstone.co.uk/Fonts/Download/BabelStoneFlagsDual.ttf In the MWE below, there is a spurious “at” in the first time that the definition of the symbol for the Brazilian flag is used, but no problem when the definition for the flag of Portugal is used or even when the symbol for the Brazilian flag is used a second time. How to correct this behavior? MWE: \definefontfeature[colored][colr=yes] \definefontsynonym[flags][file:BabelStoneFlagsDual.ttf*colored at 7pt] \definesymbol[BR][\getglyphdirect{flags}{\char"F0023}] \definesymbol[PT][\getglyphdirect{flags}{\char"F00A1}] \starttext Brasil \symbol[BR] Portugal \symbol[PT] Brasil \symbol[BR] \stoptext -- Todas as coisas fatigam o corpo, salvo a música, que não fatiga nem o corpo nem seus membros, por ser descanso da alma, primavera do coração, distração do aflito, entretenimento do solitário, e viático do viajante. Kunnâsh al-Hâ'ik (Cancioneiro de al-Hâ'ik) ___ 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] Missing symb-imp-was.mkiv ?
On 7/10/2021 8:24 AM, Ramkumar KB wrote: Hello, I am trying to follow the steps described here for using \usesymbols <https://wiki.contextgarden.net/Command/usesymbols>[was] and details described here - https://wiki.contextgarden.net/Symbols/was <https://wiki.contextgarden.net/Symbols/was> Looks like the file `symb-imp-was.mkiv` is missing from the path - \tex\texmf-context\tex\context\base\mkiv Thank you for any tips or pointers. The wiki page actually mentiones jmn symbols but these are by (the late) Januz so that should be corrected. Anyway, the wasy font symbol setup was never converted to mkiv so attached is a draft. Up to you to complete it. From CTAN, download the type one package and put the afm and pfb files under (e.g.) texmf-fonts/fonts/data/wasy (no need for subdirs) and run "mtxrun --generate" to update the file database. You can look in the afm files to see what names are provided. It looks like the files were updated in 2020 (taco is mentiones). Rhaban made the mkii file so you can consult him. I advice to stick to the regular symbols not the weirdly composed ones. You can patch the file and send me the result. You can 'run the file' in order to get the overview. You should see at least most symbols. So ... work to do ... 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 - %D \module %D [ file=symb-was, %Dversion=2005.10.15, %D title=\CONTEXT\ Symbol Libraries, %D subtitle=Roland Waldi's Symbols (wasy-2), %D author=Henning Hraban Ramm, %D date=\currentdate, %D copyright={Public Domain}] %C %C This module is in the public domain. %D Converted to \MKIV\ by Hans but not yet complete. \unprotect \definefontsynonym [WaldiSymbol] [wasy10] \definefontsynonym [WaldiSymbolBold] [wasyb10] % \def\wasy@over#1#2{{\setbox0\hbox{$#2$}\hbox to \wd0{\hss$#1$\hss}\kern-\wd0\box0}} \def\WaldiSymbol {\getnamedglyphdirect{WaldiSymbol}} % #1 \def\WaldiSymbol#1{\getglyph{WaldiSymbol}{\fontchar{#1}}} % general symbols \startsymbolset [wasy general] \definesymbol [male][\WaldiSymbol{male}] \definesymbol [female] [\WaldiSymbol{female}] \definesymbol [currency][\WaldiSymbol{currency}] \definesymbol [cent][\WaldiSymbol{cent}] \definesymbol [lozenge] [\WaldiSymbol{lozenge}] \definesymbol [kreuz] [\WaldiSymbol{kreuz}] \definesymbol [smiley] [\WaldiSymbol{smiley}] \definesymbol [blacksmiley] [\WaldiSymbol{blacksmil}] \definesymbol [frownie] [\WaldiSymbol{frownie}] \definesymbol [sun] [\WaldiSymbol{sun}] \definesymbol [checked] [\WaldiSymbol{checked}] \definesymbol [brokenvert] [\WaldiSymbol{brokenver}] \definesymbol [diameter][\WaldiSymbol{diameter}] \definesymbol [invdiameter] [\WaldiSymbol{invdiamet}] \definesymbol [phone] [\WaldiSymbol{phone}] \definesymbol [recorder][\WaldiSymbol{recorder}] \definesymbol [clock] [\WaldiSymbol{clock}] \definesymbol [permil] [\WaldiSymbol{permil}] \definesymbol [bell][\WaldiSymbol{bell}] \definesymbol [ataribox][\WaldiSymbol{ataribox}] \definesymbol [pointer] [\WaldiSymbol{pointer}] \definesymbol [lightning] [\WaldiSymbol{lightning}] \definesymbol [agemO] [\WaldiSymbol{agemO}] \stopsymbolset \startsymbolset [wasy music] \definesymbol [eighthnote] [\WaldiSymbol{eighthnote}] \definesymbol [quarternote] [\WaldiSymbol{quarternote}] \definesymbol [halfnote][\WaldiSymbol{halfnote}] \definesymbol [fullnote][\WaldiSymbol{fullnote}] \definesymbol [twonotes][\WaldiSymbol{twonotes}] \stopsymbolset \startsymbolset [wasy astronomy] \definesymbol [ascnode] [\WaldiSymbol{ascnode}] \definesymbol [descnode][\WaldiSymbol{descnode}] \definesymbol [astrosun][\WaldiSymbol{astrosun}] \definesymbol [sun] [\WaldiSymbol{sun}] \definesymbol [newmoon] [\WaldiSymbol{newmoon}] \definesymbol [fullmoon][\WaldiSymbol{fullmoon}] \definesymbol [rightmoon] [\WaldiSymbol{rightmoon}] \definesymbol [leftmoon][\WaldiSymbol{leftmoon}] \definesymbol [vernal] [\WaldiSymbol{vernal}] \definesymbol [mercury] [\WaldiSymbol{mercury}] \definesymbol [mars][\WaldiSymbol{mars}] \definesymbol [saturn] [\WaldiSymbol{saturn}] \definesymbol [neptune] [\WaldiSymbol{neptune}] \definesymbol [earth] [\WaldiSymbol{earth}] \definesymbol [venus] [\WaldiSymbol{venus}] \definesymbol [jupiter] [\WaldiSymbol{jupiter}] \definesymbol [uranus] [\WaldiSym
Re: [NTG-context] Lua code and table
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). 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 - \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.MyTable { action = function(value) context(value == "X" and 1 or 0) end, conversion = "Characters", pattern = { ".XXX..XX", "X...XXX.", "X..X.XXX", "X.X.X..X", ".X.X.XX.", ".XX.X...", "XXX.X...", "X.XX" } } \stopluacode \startluacode document.MyTable { action = function(value) context(value == "X" and 1 or 0) end, conversion = "Greek", pattern = { ".XXX..XX", "X...XXX.", "X..X.XXX", "X.X.X..X", } } \stopluacode \startluacode document.MyTable { action = function(value) if value == "X" then context.symbol { "MyRedCross" } end end, conversion = "Romannumerals", pattern = { ".XXX..XX", "X...XXX.", "X..X.XXX", "X.X.X..X", ".X.X.XX.", ".XX.X...", "XXX.X...", "X.XX" } } \stopluacode \startluacode document.MyTable { action = function(value) context.symbol { value == "X" and "MyRedCross" or "MyGreenCross" } end, conversion = "Romannumerals", pattern = { "X.X.X..X", ".X.X.XX.", ".XX.X...", "XXX.X...", "X.XX" } } \stopluacode \stoptext xx.pdf Description: Adobe PDF document ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context webpage : http://www.pragma-ade.nl / http://context.aanhet.net archive : https://bitbucket.org/phg/context-mirror/commits/ wiki : http://contextgarden.net ___
Re: [NTG-context] 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}] > > \startlu
Re: [NTG-context] Lua code and table
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.MyTable { action = function(value) context(value == "X" and 1 or 0) end, conversion = "Characters", pattern = { ".XXX..XX", "X...XXX.", "X..X.XXX", "X.X.X..X", ".X.X.XX.", ".XX.X...", "XXX.X...", "X.XX" } } \stopluacode \startluacode document.MyTable { action = function(value) context(value == "X" and 1 or 0) end, conversion = "Greek", pattern = { ".XXX..XX", "X...XXX.", "X..X.XXX", "X.X.X..X", } } \stopluacode \startluacode document.MyTable { action = function(value) if value == "X" then context.symbol { "MyRedCross" } end end, conversion = "Romannumerals", pattern = { ".XXX..XX", "X...XXX.", "X..X.XXX", "X.X.X..X", ".X.X.XX.", ".XX.X...", "XXX.X...", "X.XX" } } \stopluacode \startluacode document.MyTable { action = function(value) context.symbol { value == "X" and "MyRedCross" or "MyGreenCross" } end, conversion = "Romannumerals", pattern = { "X.X.X..X", ".X.X.XX.", ".XX.X...", "XXX.X...", "X.XX" } } \stopluacode \stoptext - Han
Re: [NTG-context] fancybreak module
Hmm... That did not work for me. The example on the garden (https://wiki.contextgarden.net/Command/setupfancybreak) is not working either. I get a "tex error > tex error on line 2 in file ./mwe.tex: Undefined control sequence" on \setupfancybreak. \usemodule[fancybreak] \setupfancybreak[symbol=star] \starttext Paragraph \fancybreak Paragraph \stoptext Thanks, Clyde -Original Message- From: Wolfgang Schuster [mailto:wolfgang.schuster.li...@gmail.com] Sent: Monday, January 25, 2021 7:22 PM To: mailing list for ConTeXt users Cc: Clyde Johnston Subject: Re: [NTG-context] fancybreak module Clyde Johnston schrieb am 25.01.2021 um 17:55: > I just realized that \starbreak was one of my own macros (defined ages > ago) so the MWE should be: > > \usemodule[fancybreak] > > \define\starbreak{ > \fancybreak{ > \strut\hfill\hfill\symbol[star]\hfill\symbol[star]\hfill\symbol[star]\hfill\ hfill\strut > }} \definesymbol [starbreak] [\maxaligned\bgroup \hfill\hfill \strut\symbol{star}\hfill\symbol{star}\hfill\symbol{star}% \hfill\hfill \egroup] \definefancybreak [starbreak] [symbol=starbreak] 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] fancybreak module
Clyde Johnston schrieb am 25.01.2021 um 17:55: I just realized that \starbreak was one of my own macros (defined ages ago) so the MWE should be: \usemodule[fancybreak] \define\starbreak{ \fancybreak{ \strut\hfill\hfill\symbol[star]\hfill\symbol[star]\hfill\symbol[star]\hfill\hfill\strut }} \definesymbol [starbreak] [\maxaligned\bgroup \hfill\hfill \strut\symbol{star}\hfill\symbol{star}\hfill\symbol{star}% \hfill\hfill \egroup] \definefancybreak [starbreak] [symbol=starbreak] 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 ___
[NTG-context] fancybreak fails in LMTX
Hello all, The following example produces the expected output in MkIV, but fails in LMTX (both dated 2020-11-07). The modules directory was copied into the LMTX tree from the MkIV tree, and the log indicates that the module is loaded. It gives no other clues. The output has a blank line where the break should be, as shown in the included snips. \usemodule [fancybreak] \definesymbol [asterisms][*\qquad fancybreak\qquad *] \setupfancybreak[indentnext=no,symbol=asterisms] \starttext Before \fancybreak After \stoptext MkIV output: LMTX output: -- Rik ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context webpage : http://www.pragma-ade.nl / http://context.aanhet.net archive : https://bitbucket.org/phg/context-mirror/commits/ wiki : http://contextgarden.net ___
[NTG-context] Can't output direct glyphs either in MKIV or LMTX
Hello list. I'm trying to call a direct glyph from the Phaistos font, but it seems it doesn't work. The font is loaded, the log file says it so: system > 12: filename=/home/vantta/.fonts/Phaistos.otf format=otf foundname=/home/vantta/.fonts/Phaistos.otf fullname=/home/vantta/.fonts/Phaistos.otf usedmethod=direct However, the glyph is not displayed in the pdf. I've tried both in MKIV and LMTX with no luck. Maybe someone here will have a clue. MWE: %% \definesymbol[arbol] [\getnamedglyphdirect{phaistos}{u101F2}] \starttext \switchtobodyfont[72pt] \symbol[arbol] \stoptext %%% -- Andrés Conrado Montoya Andi Kú andresconr...@gmail.com http://sesentaycuatro.com http://messier87.com http://chiquitico.org Los fines no justifican los medios, porque la medida verdadera de nuestro carácter está dada por los medios que estamos dispuestos a utilizar, no por los fines que proclamamos. “You develop an instant global consciousness, a people orientation, an intense dissatisfaction with the state of the world, and a compulsion to do something about it. From out there on the moon, international politics look so petty. You want to grab a politician by the scruff of the neck and drag him a quarter of a million miles out and say, ‘Look at that, you son of a bitch.’” — Apollo 14 astronaut Edgar Mitchell ___ 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] Defining \qed (was: Bug with \wordright...)
Hi Wolfgang, Thanks for your explanations and the correct definition of the close symbol in an enumeration. Following up the discussions with Hans, in order to put a close sympbol at the end of a formula, I have the following for the definition of \qed: %% begin example-qed.tex \showframe \definesymbol[Fin][\mathematics{\square}] \def\qed{% \ifmmode \inrightmargin{\hskip-7.5mm\symbol[Fin]} % --> attention here \else \dontleavehmode\wordright{\symbol[Fin]} \fi} \setupformulas[location=left] \starttext One sees that \placeformula \startformula a^2 + b^2 = c^2 \stopformula which is the Pythagoras theorem. \qed Another proof of Pythagors theorem is based on the figure below in which one sees that: \placeformula \startformula (a+b)^2 = c^2 + 2ab \quad \imply \quad a^2 + b^2 = c^2. \qed \stopformula \stoptext %% end example-qed.tex Now how can I replace « \hskip-7.5mm » (which was found by trial and error…) in a robust manner so that the close symbols in the formulas are vertically aligned with the close symbols in the text? In other terms can one compute automatically the amount of negative \hskip so that the definition is correct when one changes the font size and the layout? Thanks in advance: Otared > On 5 Aug 2020, at 21:15, Wolfgang Schuster > wrote: > […] > > Below is a cleaner version to put a symbol at the end of each proof. The > \blank setting in the \PlaceProofSymbol definition moves the symbol back in > the math formula to avoid the vertical space between them, you can remove it > but I would at leas use \blank[back] to get rid of the empty line between the > formula and the symbol. > > \define[1]\PlaceProofSymbol > {\blank[back,overlay]% > \dontleavehmode\wordright{#1}} > > \defineenumeration > [proof] > [ closesymbol={\symbol[square]}, > closecommand=\PlaceProofSymbol] > > \starttext > > \startproof > \startformula >a^2 + b^2 = c^2 > \stopformula > \stopproof > > \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 ___
Re: [NTG-context] Bug with \wordright in LMTX version 2020-08-03 14:25
Fabrice Couvreur schrieb am 05.08.2020 um 19:33: 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] [..., closesymbol={\symbol[\qed]}] 1. \symbol is meant to access pre defined symbols, as fallback method when the requested symbol doesn't exist ConTeXt outputs the argument. This fallback is in my opinion problematic because it's easy to miss it. \starttext \symbol[square] \symbol[quadrat] \stoptext 2. When you use the closesymbol for a enumeration ConTeXt uses also the argument of the closecommand to apply something to the symbol, by default the argument to the closecommand key is \wordright. This means you're putting \wordright (which itself is flushed as symbol) within \wordright which has to fail at some point. Below is a cleaner version to put a symbol at the end of each proof. The \blank setting in the \PlaceProofSymbol definition moves the symbol back in the math formula to avoid the vertical space between them, you can remove it but I would at leas use \blank[back] to get rid of the empty line between the formula and the symbol. \define[1]\PlaceProofSymbol {\blank[back,overlay]% \dontleavehmode\wordright{#1}} \defineenumeration [proof] [ closesymbol={\symbol[square]}, closecommand=\PlaceProofSymbol] \starttext \startproof \startformula a^2 + b^2 = c^2 \stopformula \stopproof \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 ___
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 ___
Re: [NTG-context] Bug with \wordright in LMTX version 2020-08-03 14:25
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 ___
Re: [NTG-context] Bug with \wordright in LMTX version 2020-08-03 14:25
On 8/3/2020 10:10 PM, Otared Kavian wrote: Hi Hans, A file which used to be typeset correctly with the previous versions of lmtx, now produces an error. Despite the error message being extremely cryptic: Error ! Missing number, treated as zero I could guess the origin of the bug, which seems to be \wordright, but although the following minimal example shows a bug it does not produce the same ERROR output page: the square ''end of proof'' \definesymbol[Fin][\mathematics{\square}] \def\qed{\wordright{\symbol[Fin]}} \starttext \startformula a^2 + b^2 = c^2 \stopformula \qed % the problem is here \stoptext In the above example if one adds something before \qed, then the square end-of-proof appears. However in my real file ConTeXt ouputs an error page and says: Error ! Missing number, treated as zero. One can debate if the old behavior was ok ... wordright is meant for adding something at the end of a paragraph and you have none here. You can add a \strut in your definition to force a line. The lmtx implementation actually permit this: \definesymbol[Fin][\mathematics{\square}] \def\qed{\strut\wordright{\symbol[Fin1]}\wordright{\symbol[Fin2]}\wordright{\symbol[Fin3]}} \starttext \startformula a^2 + b^2 = c^2 \stopformula \qed % the problem is here \stoptext i'm still exploring this but it has to do with collecting stuff, as in: \wordright{before} test \par test \wordright{before} \par (i'll look at the number issue which indeed looks a like a bug) - 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 ___
[NTG-context] Bug with \wordright in LMTX version 2020-08-03 14:25
Hi Hans, A file which used to be typeset correctly with the previous versions of lmtx, now produces an error. Despite the error message being extremely cryptic: Error ! Missing number, treated as zero I could guess the origin of the bug, which seems to be \wordright, but although the following minimal example shows a bug it does not produce the same ERROR output page: the square ''end of proof'' \definesymbol[Fin][\mathematics{\square}] \def\qed{\wordright{\symbol[Fin]}} \starttext \startformula a^2 + b^2 = c^2 \stopformula \qed % the problem is here \stoptext In the above example if one adds something before \qed, then the square end-of-proof appears. However in my real file ConTeXt ouputs an error page and says: Error ! Missing number, treated as zero. Best regards: Otared ___ 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] Emoji color fonts not working on LMTX/Context MKIV
I've tried the following from the manuals and adapted some code to see if it works: 1. \definefontfeature[svg][svg=yes] \definefontsynonym[Emoji][file:emojionecolor-svginot.ttf*default,svg] \definesymbol[bug][\getglyphdirect{Emoji}{\char"1F41B}] \starttext \symbol[bug] \stoptext The emoji has no color when compiled with LuaTeX. Furthermore, the log includes a lot of lines like the ones below: fonts > svg conversion > executing runner 'otfsvg': inkscape --export-area-drawing --shell > temp-otf-svg-shape.log fonts > svg conversion > processing 1829 svg containers xml > core > load error: invalid xml file - parsed text With LMTX it gives an error about mlib-svg. 2. \definefontfeature[overlay][default][ccmp=yes,colr=yes,dist=yes] \definefontfeature[svg] [default][svg=yes] \definefontfeature[bitmap] [default][sbix=yes] \definefontfeature [colored] [default] [ccmp=yes,dist=yes, colr=yes,svg=yes,sbix=yes] \definefontsynonym[Emoji][file:notocoloremoji*default,colored] \definesymbol[bug][\getglyphdirect{Emoji}{\char"1F41B}] \starttext \symbol[bug] \stoptext What I get is: fonts > png conversion > processing 3374 png containers sh: 1: gm: not found sh: 1: gm: not found sh: 1: gm: not found sh: 1: gm: not found ... and the same line repeating itself ... close source > level 1, order 3, name '/home/lol/lmtx/tex/texmf-context/tex/context/base/mkiv/cont-yes.mkiv' ! error: (file /usr/share/fonts/truetype/noto/NotoColorEmoji.ttf) (ttf): loca table not found LMTX prints a file without any emoji. Only Twemoji Mozilla and Segoe UI Emoji worked for me, so, what am I doing wrong? I'm working with Ubuntu 20.04 LTS x86_64 and Inkscape 0.92.5 (2060ec1f9f, 2020-04-08) in case it helps. Thank you in advance. ___ 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] \setupitemgroup[itemize],/setupitemize
Wolfgang, thank you for this expalantion. Kind regards Willi > On 18 Dec 2019, at 23:15, Wolfgang Schuster > wrote: > > Willi Egger schrieb am 18.12.2019 um 19:58: >> Wolfgans, Hraban, >> >> thank you very much for this instruction! >> >> - In the real itemlist I have of course \startitemize (sorry for the >> ommission in the MWE >> - I misinterpreted the Wiki. There is no mentioning in the red section that >> n is possible. However the n in the green section must be used as the symbol >> with n=123 or symbol=2. > > The n-key is used to set the number of columns when you set your items in > multiple columns and it has the same effect as the two, three etc. keywords. > > The way how numbered items work is different. To change the symbol for the > bullets or use numbers instead ConTeXt checks if the applies keywords include > the name of a symbol (something you create with \definesymbol) or the name of > a number conversion (something you create with \defineconversion) and applies > it to the current entry. > > This check also you to create your own symbols or numbers orders by simply > creating a new symbol and conversion. > > 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] \setupitemgroup[itemize],/setupitemize
Willi Egger schrieb am 18.12.2019 um 19:58: Wolfgans, Hraban, thank you very much for this instruction! - In the real itemlist I have of course \startitemize (sorry for the ommission in the MWE - I misinterpreted the Wiki. There is no mentioning in the red section that n is possible. However the n in the green section must be used as the symbol with n=123 or symbol=2. The n-key is used to set the number of columns when you set your items in multiple columns and it has the same effect as the two, three etc. keywords. The way how numbered items work is different. To change the symbol for the bullets or use numbers instead ConTeXt checks if the applies keywords include the name of a symbol (something you create with \definesymbol) or the name of a number conversion (something you create with \defineconversion) and applies it to the current entry. This check also you to create your own symbols or numbers orders by simply creating a new symbol and conversion. 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] radiobuttons
On 8/13/2019 8:01 PM, Henning Hraban Ramm wrote: Regardless of my other mails, I’d appreciate to have this bug fixed. I wasted the whole day on trying all kind of tricks and comparing pdf's made with acronbat and context etc etc just to find out that the preference is the problem ... forms -> highlight color -> show border hover color it badly interfering with these widgets ... there seems to be no way to turn that off (forms made with acrobat suffer a bit less because they use a funny mix of appearances and border settings and ... because they make these buttons from dingbats (i think) anyway, it's bad in the latest reader as well as in acrobat x which shows it's an old issue and as it's that old one can fear it has become a feature ... (of that no one cares) so, the only solution seems to be to check the prefs (mupdf is doing it right) Hans --- test file --- \setupinteraction [state=start] \definesymbol[yes][1] \definesymbol[nop][0] \setupfield[whatever][width=20mm,height=20mm,frame=off] \definefield[what][radio][whatever][whatone,whattwo][whatone] \definesubfield[whatone][][yes,nop] \definesubfield[whattwo][][yes,nop] \startuniqueMPgraphic{0} fill fullcircle scaled 1cm withcolor red ; \stopuniqueMPgraphic \startuniqueMPgraphic{1} fill fullcircle scaled 1cm withcolor green ; \stopuniqueMPgraphic \definesymbol[YES][\uniqueMPgraphic{1}] \definesymbol[NOP][\uniqueMPgraphic{0}] \setupfield[WHATEVER][width=20mm,height=20mm,frame=off] \definefield[WHAT][radio][WHATEVER][WHATONE,WHATTWO][WHATONE] \definesubfield[WHATONE][][YES,NOP] \definesubfield[WHATTWO][][YES,NOP] \starttext \startTEXpage[offset=2cm] \field[whatone]\space\field[whattwo] \field[WHATONE]\space\field[WHATTWO] \field[WHATONE]\space\field[WHATTWO] \stopTEXpage \startTEXpage[offset=2cm] \field[whatone]\space\field[whattwo] \field[WHATONE]\space\field[WHATTWO] \field[WHATONE]\space\field[WHATTWO] \stopTEXpage \stoptext - 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] radiobuttons
On 8/13/2019 8:01 PM, Henning Hraban Ramm wrote: Regardless of my other mails, I’d appreciate to have this bug fixed. Last time I checked this (widget crap) there was an issue with acrobat and apearances ... I think that this model of parents and kids never really worked well and when one switches a page existing renderings get messed up. Irr some of these widgets (check boxes?) can't even have a custom visualization any more that is kept when one goes through pages. I also have no clue to what extend all this is part of the 'standard'. Anyway, if you can make a working example (uncompressed pdf) in official acrobat (not some other tool) that works in acrobat reader we can maybe figure out what todays demands are. Implementing stuff like this is trivial but the trial and error is painful. Hans (I only have acrobat X and reader for checking this.) \nopdfcompression \setupinteraction [state=start] \definesymbol[yes][1] \definesymbol[nop][0] \setupfield[whatever][width=20mm,height=20mm,frame=off] \definefield[what][radio][whatever][whatone,whattwo][whatone] \definesubfield[whatone][][yes,nop] \definesubfield[whattwo][][yes,nop] \setupfield[textstuff][horizontal][width=50mm,height=15mm,offset=0pt,option={printable},offset=overlay] \definefield[whatthree][text][textstuff] \starttext \startTEXpage[offset=2cm] \field[whatone]\space\field[whattwo]\space\field[whatthree] \stopTEXpage % \startTEXpage[offset=2cm] % \field[whatone]\space\field[whattwo]\space\field[whatthree] % \stopTEXpage \stoptext Greetlings, Hraban Am 2019-08-05 um 10:03 schrieb Henning Hraban Ramm : Hi, coming back to an old form project I find that something changed WRT to form fields. For one, some fields appear smaller and shifted upwards – I managed to fix that with setups. What I can’t change is behaviour of radiobuttons: if I click one, all rbs of one group activate, and I can’t deactivate them any more. In my project all of the fields are duplicated on other pages, and while all other fields’ contents get copied, it doesn’t work for radiobuttons; my minimal example unfortunately can’t show that. \setupinteraction[state=start] \setupfield[MMradio][ option=printable, frame=overlay, corner=round, height=1em, width=1em, align=bottom, ] \definefield[chooseTeX][radio][MMradio][rbContext,rbLatex,rbOther][rbContext] \definesubfield[rbContext][][] \definesubfield[rbLatex][][] \definesubfield[rbOther][][] \starttext I want to use \field[rbContext] \CONTEXT\ \field[rbLatex] \LaTeX\ \field[rbOther] other. \page Just to confirm: I want to use \field[rbContext] \CONTEXT\ \field[rbLatex] \LaTeX\ \field[rbOther] other. \stoptext Greetlings, 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 ___ -- - 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] Itemization formatting
Taco Hoekwater schrieb am 29.05.2019 um 16:15: Hi all, I must be getting old :( It used to be that I could get ConTeXt to do what I wanted, but that is increasingly getting harder. Current problem: I would like to have itemizations that behave like in this dummy ascii formatting: * Lorem ipsum dolor sit amet, consectetur adipiscing elit. Donec dapibus turpis et nulla venenatis tincidunt. Curabitur sit amet vehicula nisi, sit amet and so far it has been impossible for me to set up \setupitemize to do what I want. In descriptive text, what I want is: 1. some global indentation to the left and/or right. That is what the margin= key does 2. the symbol (or number) typeset in a specific width. That is the width= key 3. some distance between the number box and the following text. That is the distance= key 4. on line 2 and forward to the end of the item, I want a *different* indentation from the first item line. In this particular case, I want no extra indentation except for ‘margin’, but in other cases I may like either more or less indentation than on line 1 of the first para of the item. The desired effect is simple achieve with primitive operations, but I would like the input to look nice (not to mention that I do not want to loose options for cross-referencing etc). \setupitemize[option=intext] is nearly right for this case (with indentation equal to the left margin), so I assumed I would be able to tweak that. But the problem there is that while it does 2-4, it ignores the extra indentation required for nested itemizations (it even ignores explicit margin= settings for the nested level). After fighting with this for hours, I am nearly ready to give up. Anybody have any idea how to get itemizations to do what I want? MWE attached. Best wishes, Taco PS It seems that “indentnext=no” does not work for nested itemizations? You can use the "text" option and add \par at the end of each item but your requirements (hanging text, different margin and before/after ssettings) are easier to solve with a description or enumeration. \definesymbol [taco] [{\inframed[frame=off,width=2em,align=flushleft]{\textbullet}}] \starttext \samplefile{zapf} \startitemize[text][symbol=taco] \item \samplefile{weisman}\par \startitemize \item \samplefile{ward}\par \stopitemize \stopitemize \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 ___
Re: [NTG-context] Itemization formatting
Hi Taco, \start \definesymbol[mystar][\llap{\symbol{star}\hskip10mm}] \setupitemgroup[itemize][intext,mystar] \setupitemgroup[itemize][leftmargin=15mm,rightmargin=5mm] \setupitemgroup[itemize][width=2cm,distance=-25mm] \startitemize \startitem \dorecurse{3}{Taco likes an occasional hack! } \stopitem \stopitemize \stop \start \definesymbol[mystar][\rlap{\hskip10mm\symbol{star}}] \setupitemgroup[itemize][intext,mystar] \setupitemgroup[itemize][leftmargin=15mm,rightmargin=5mm] \setupitemgroup[itemize][width=1cm,distance=5mm] \startitemize \startitem \dorecurse{3}{Taco likes an occasional hack! } \stopitem \stopitemize \stop But what you're actually asking is something hangindent yes? 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] Filling the diamond in enumeration
Hi Fabrice, You can define your own symbol, as in the following: \starttext \definesymbol[mysymbol][{$\red\blacklozenge$}] \definesymbol[redtriangle][{$\red\blacktriangleright$}] \startitemize[mysymbol] \item foo \item bar \item baz \stopitemize \startitemize[redtriangle] \item foo \item bar \item baz \stopitemize \stoptext Best regards: OK > On 20 Apr 2019, at 12:24, Fabrice Couvreur > wrote: > > Hi, > Is it possible to fill the diamond ? > Thank you. > Fabrice > > \starttext > \startitemize[4][color=red] > \item One > \item Two > \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 > ___ ___ 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: Meptapost Drawing not showing-up in Context Letter Style
Eventually, these two options worked. Firstly changing \setupbackgrounds % BEGIN MP LOGO SETUP \startuseMPgraphic{mpglogo} path p; p := (0,0)--(100,0)--(100,100)--(0,100)--cycle; path q; q := p cornered 30pt; draw q withcolor black withpen pencircle scaled 7pt; \stopuseMPgraphic \definelayer [logo] [repeat=no] \setlayer [logo] [hoffset=160mm,voffset=17mm] {\scale[width=25mm,height=25mm]{\useMPgraphic{mpglogo}}} \setupbackgrounds[paper][background=logo] % END MP LOGO SETUP, BEGIN LETTER SETUP \usemodule [letter] [style=dinb] \setupletterlayer [reference] [list={name,phone,email,date}] \setupletterlayer [address] [y=55mm] \setupletterdescription [enclosure] [location=top, leftmargin=0.5em, symbol=#1,] \usesymbols [mvs] \definesymbol [1] [{\symbol[martinvogel 2][PointingHand]}] \setupletter [toname={John Doe}, toaddress={201, Main Street\\23124 London\\United Kingdom}, fromname={Jansen NV}, fromaddress={Waalhaven 2200\\2842 KL Rotterdam}, name={Piet jansen}, phone={+31(010)4234 4232}, email={peter.jan...@gmail.com}, date={\currentdate}, signature={Pete},] % END LETTER SETUP, START LETTER \startletter [subject={Outstanding Invoices}, opening={Dear Sir,}, closing={Kind Regards,}, enclosure={list:Commercial Invoice,Accounts Statement},] \dorecurse{3}{\input knuth \par} \stopletter Alternatively, adjusting \setupletterlayer \usemodule [letter] [style=dinb] % BEGIN MP LOGO SETUP \startuseMPgraphic{mpglogo} path p; p := (0,0)--(100,0)--(100,100)--(0,100)--cycle; path q; q := p cornered 30pt; draw q withcolor black withpen pencircle scaled 7pt; \stopuseMPgraphic \startsetups[letter:layer:lettermain] \scale [width=25mm,height=25mm] {\useMPgraphic{mpglogo}} \stopsetups \setupletterlayer [lettermain] [alternative=setups, x=160mm, y=17mm] % END MP LOGO SETUP, BEGIN LETTER SETUP \setupletterlayer [reference] [list={name,phone,email,date}] \setupletterlayer [address] [y=55mm] \setupletterdescription [enclosure] [location=top, leftmargin=0.5em, symbol=#1,] \usesymbols [mvs] \definesymbol [1] [{\symbol[martinvogel 2][PointingHand]}] \setupletter [toname={John Doe}, toaddress={201, Main Street\\23124 London\\United Kingdom}, fromname={Jansen NV}, fromaddress={Waalhaven 2200\\2842 KL Rotterdam}, name={Piet jansen}, phone={+31(010)4234 4232}, email={peter.jan...@gmail.com}, date={\currentdate}, signature={Pete},] % END LETTER SETUP, START LETTER \startletter [subject={Outstanding Invoices}, opening={Dear Sir,}, closing={Kind Regards,}, enclosure={list:Commercial Invoice,Accounts Statement},] \dorecurse {3} {\input knuth \par} \stopletter -- Forwarded message - From: Wolfgang Schuster Date: ma 11 mrt. 2019 om 20:55 Subject: Re: [NTG-context] Meptapost Drawing not showing-up in Context Letter Style To: mailing list for ConTeXt users , Context NTG < context...@gmail.com> Context NTG schrieb am 10.03.19 um 16:59: > I am trying to get a metapost drawing as logo added to right upper > corner of a DIN B style letterhead, but it does not show up, just the > letter itself. Is there anything to change to the layers for the MP toe > reveal itself? The letter module uses local settings for the page background to place all the layer for the header, footer etc. and your own background setup is overloaded by the module. What you can do in this case is to use the predefined but unused lettermain layer to place your logo in the background. \usemodule[letter][style=dinb] \startuseMPgraphic{mpglogo} path p; p := (0,0)--(100,0)--(100,100)--(0,100)--cycle ; path q; q := p cornered 30pt; draw q withcolor black withpen pencircle scaled 7pt ; \stopuseMPgraphic \startsetups[letter:layer:lettermain] \scale[width=25mm,height=25mm]{\useMPgraphic{mpglogo}} \stopsetups \setupletterlayer [lettermain] [alternative=setups, x=160mm, y=17mm] \startletter \dorecurse{3}{\input knuth \par} \stopletter Another way to place content in the background is to use the “paper” (or “text”) background which isn’t used by the letter module and your settings won’t be overloaded. 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 ___
[NTG-context] Meptapost Drawing not showing-up in Context Letter Style
I am trying to get a metapost drawing as logo added to right upper corner of a DIN B style letterhead, but it does not show up, just the letter itself. Is there anything to change to the layers for the MP toe reveal itself? Thanks, Jeroen % BEGIN MP LOGO SETUP \startuseMPgraphic{mpglogo} path p; p := (0,0)--(100,0)--(100,100)--(0,100)--cycle; path q; q := p cornered 30pt; draw q withcolor black withpen pencircle scaled 7pt; \stopuseMPgraphic \definelayer [logo] [repeat=no] \setlayer [logo] [hoffset=160mm,voffset=17mm] {\scale[width=25mm,height=25mm]{\useMPgraphic{mpglogo}}} \setupbackgrounds[page][background=logo] % END MP LOGO SETUP, BEGIN LETTER SETUP \usemodule[letter][style=dinb] \setupletterlayer [reference] [list={name,phone,email,date}] \setupletterlayer [address] [y=55mm] \setupletterdescription [enclosure] [location=top, leftmargin=0.5em, symbol=#1,] \usesymbols[mvs] \definesymbol[1][{\symbol[martinvogel 2][PointingHand]}] \setupletter [toname={John Doe}, toaddress={201, Main Street\\23124 London\\United Kingdom}, fromname={Jansen NV}, fromaddress={Waalhaven 2200\\2842 KL Rotterdam}, name={Piet jansen}, phone={+31(010)4234 4232}, email={peter.jan...@gmail.com}, date={\currentdate}, signature={\externalfigure[autograph][height=4\lineheight]\\\correspondenceparameter{name}},] % END LETTER SETUP, START LETTER \startletter [subject={Outstanding Invoices}, opening={Dear Sir,}, closing={Kind Regards,}, enclosure={list:Commercial Invoice,Accounts Statement},] \dorecurse{3}{\input knuth \par} \stopletter ___ 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] Works and Doesn't Work
jdh schrieb am 16.01.19 um 08:18: Here is my small sample ConTeXt sample: I want to be able to control the blank gap between the end of an item and the next item. It has to be fine tuned at times. Any advice would be appreciated. NOTE: Two cases with inbetween attempting use use two variations of the \blank command which causes 'context' run to hang. The comment escape on them has to be removed to test them. The rightmost column contains result comments. Note that inbetween=\blank[.5mm] and \blank[small] cause context to hang . But, underbar'd command with a text string works as advertised. Regards dh start of contxt source \definesymbol[5][$\diamond$] \starttext \setupitemgroup[itemize][each][packed][before=\underbar{mae-da },after=\underbar{ato-da}] % WORKS \setupitemgroup[itemize][each][ ][symbol=5]% WORKS Don’t use empty arguments when they aren’t necessary, skipping the argument is enough in most cases. \setupitemgroup[itemize][each][symbol=5] \setupitemgroup[itemize][each][ ][left=\underbar{lefttxt}]% NO EFFECT \setupitemgroup[itemize][each][ ][right=\underbar{rhttxt}]% NO EFFECT The left and right keys are only used for numbered items. \setupitemgroup[itemize][each][ ][inbetween=\underbar{inbetween} ] % WORKS %\setupitemgroup[itemize][each][ ][inbetween=\blank[small]]% !!! HANGS WONT COMPILE !!! %\setupitemgroup[itemize][each][ ][inbetween=\blank[2mm]] % !!! HANGS WONT COMPILE !!! You needs braces around the blank setting, e.g. \setupitemgroup [itemize] [each] [inbetween={\blank[...]}| \setupitemgroup[itemize][each][ ][beforehead=\underbar{befhead}] % NO EFFECT \setupitemgroup[itemize][each][ ][afterhead=\underbar{AHEAD}] % NO EFFECT The beforehead and afterhead keys are only used when you use \head or \starthead. \setupitemgroup[itemize][each][ ][itemalign=right]% NO EFFECT This works only when you use a fixed width for the item symbol. \setupitemgroup[itemize][each][ ][textdistance=3cm] % NO EFFECT The textdistance keys controls the horizontal space between inline items (all items appears in single paragraph). 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 ___
[NTG-context] Works and Doesn't Work
Here is my small sample ConTeXt sample: I want to be able to control the blank gap between the end of an item and the next item. It has to be fine tuned at times. Any advice would be appreciated. NOTE: Two cases with inbetween attempting use use two variations of the \blank command which causes 'context' run to hang. The comment escape on them has to be removed to test them. The rightmost column contains result comments. Note that inbetween=\blank[.5mm] and \blank[small] cause context to hang . But, underbar'd command with a text string works as advertised. Regards dh start of contxt source \definesymbol[5][$\diamond$] \starttext \setupitemgroup[itemize][each][packed][before=\underbar{mae-da },after=\underbar{ato-da}] % WORKS \setupitemgroup[itemize][each][ ][symbol=5]% WORKS \setupitemgroup[itemize][each][ ][left=\underbar{lefttxt}] % NO EFFECT \setupitemgroup[itemize][each][ ][right=\underbar{rhttxt}] % NO EFFECT \setupitemgroup[itemize][each][ ][inbetween=\underbar{inbetween} ] % WORKS %\setupitemgroup[itemize][each][ ][inbetween=\blank[small]] % !!! HANGS WONT COMPILE !!! %\setupitemgroup[itemize][each][ ][inbetween=\blank[2mm]] % !!! HANGS WONT COMPILE !!! \setupitemgroup[itemize][each][ ][beforehead=\underbar{befhead}] % NO EFFECT \setupitemgroup[itemize][each][ ][afterhead=\underbar{AHEAD}] % NO EFFECT \setupitemgroup[itemize][each][ ][itemalign=right] % NO EFFECT \setupitemgroup[itemize][each][ ][textdistance=3cm]% NO EFFECT \startitemize[] \item \input knuth \item \input knuth \item \input knuth \stopitemize \stoptext end of sample context source ___ 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] How to get mail and phone symbols?
\definesymbol[e-mail][\getglyphdirect{FontAwesome}{\number"F003}] \definesymbol[phone][\getglyphdirect{FontAwesome}{\number"F095}] \starttext \symbol[e-mail] someone@somewhere \symbol[phone] your number \stoptext Fonts Awesome: https://fontawesome.com/ ___ 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] Dangerous bend sign in mkiv
Thanks Hans! That’s great indeed! I put on the wiki your code http://wiki.contextgarden.net/symbolset but could not explain where to find the information which tells us that the desired characters are \resolvedglyphdirect{bends}{n:char_7e} and \resolvedglyphdirect{bends}{n:char_7f}. Best regrads: OK > On 31 Aug 2017, at 21:12, Hans Hagen wrote: > > On 8/31/2017 4:02 PM, Otared Kavian wrote: >> Hi, >> Is there a way to get the dangerous bend sign (which exists in the Donald >> Knuth’s manfnt) in mkiv? >> The following (given by one of our gurus and dating back to sevral years) >> works fine in mkii, but I don’t know how to translate it in mkiv… >> %%% begin dangerous-bend.tex >> \loadmapfile [manfnt.map] >> \definefontsynonym [bends] [manfnt] >> \def\GetSym#1{\getglyph{bends}{\char#1}} >> \startsymbolset [Dangerous Bends] >> \definesymbol [dbend] [\GetSym{127}] >> \definesymbol [lhdbend] [\GetSym{126}] >> \stopsymbolset >> \setupsymbolset [Dangerous Bends] >> \setupbodyfont[manfnt] >> \starttext >> \symbol{dbend} >> \blank[big] >> \symbol{lhdbend} >> \stoptext >> %%% end dangerous-bend.tex >> Thanks in advance: OK > \definefontsynonym [bends] [file:manfnt.afm] > > \startsymbolset [Dangerous Bends] >\definesymbol [dbend] [\resolvedglyphdirect{bends}{n:char_7e}] >\definesymbol [lhdbend] [\resolvedglyphdirect{bends}{n:char_7f}] > \stopsymbolset > > \setupsymbolset [Dangerous Bends] > > \starttext >\symbol{dbend}\quad \symbol{lhdbend} > \stoptext > > > - > 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] Dangerous bend sign in mkiv
On 8/31/2017 4:02 PM, Otared Kavian wrote: Hi, Is there a way to get the dangerous bend sign (which exists in the Donald Knuth’s manfnt) in mkiv? The following (given by one of our gurus and dating back to sevral years) works fine in mkii, but I don’t know how to translate it in mkiv… %%% begin dangerous-bend.tex \loadmapfile [manfnt.map] \definefontsynonym [bends] [manfnt] \def\GetSym#1{\getglyph{bends}{\char#1}} \startsymbolset [Dangerous Bends] \definesymbol [dbend] [\GetSym{127}] \definesymbol [lhdbend] [\GetSym{126}] \stopsymbolset \setupsymbolset [Dangerous Bends] \setupbodyfont[manfnt] \starttext \symbol{dbend} \blank[big] \symbol{lhdbend} \stoptext %%% end dangerous-bend.tex Thanks in advance: OK \definefontsynonym [bends] [file:manfnt.afm] \startsymbolset [Dangerous Bends] \definesymbol [dbend] [\resolvedglyphdirect{bends}{n:char_7e}] \definesymbol [lhdbend] [\resolvedglyphdirect{bends}{n:char_7f}] \stopsymbolset \setupsymbolset [Dangerous Bends] \starttext \symbol{dbend}\quad \symbol{lhdbend} \stoptext - 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 ___
[NTG-context] Dangerous bend sign in mkiv
Hi, Is there a way to get the dangerous bend sign (which exists in the Donald Knuth’s manfnt) in mkiv? The following (given by one of our gurus and dating back to sevral years) works fine in mkii, but I don’t know how to translate it in mkiv… %%% begin dangerous-bend.tex \loadmapfile [manfnt.map] \definefontsynonym [bends] [manfnt] \def\GetSym#1{\getglyph{bends}{\char#1}} \startsymbolset [Dangerous Bends] \definesymbol [dbend] [\GetSym{127}] \definesymbol [lhdbend] [\GetSym{126}] \stopsymbolset \setupsymbolset [Dangerous Bends] \setupbodyfont[manfnt] \starttext \symbol{dbend} \blank[big] \symbol{lhdbend} \stoptext %%% end dangerous-bend.tex Thanks in advance: OK ___ 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] question about Linux Libertine
thank you for this comprehensive explanation. i digged a little bit in your previous answer, and i found it perfect for using alternative glyphs like oldstyle ones. On Mon, May 8, 2017 at 6:52 PM, Hans Hagen wrote: > On 5/8/2017 12:20 AM, kaddour kardio wrote: > >> i managed to get the ornaments from Linux Libertine by using a rather >> low-level command >> >> \definesymbol >> [leaf] >> [\getnamedglyphdirect >> {kad} >> {ampersand.alt}] >> >> >> But for other symbols i have to use another command like that: >> >> \definesymbol[orn1][\getglyph{kad}{\char9753}] >> >> >> because using \getnamedglyphdirect{kad}{uni2619} doesn't work. >> >> Did i miss a thing ? >> > > it has no name in the font > > you can add this to symb-ini.mkvi: > > \unexpanded\def\resolvedglyphstyled#fontname#character% > {{\setstyledsymbolicfont{#fontname}\clf_tochar{#character}}} > \unexpanded\def\resolvedglyphdirect#fontname#character% > {{\setdirectsymbolicfont{#fontname}\clf_tochar{#character}}} > > and remake the format and then say: > > \definesymbol > [leaf] > [\resolvedglyphdirect > {name:linuxlibertine}{n:ampersand.alt}] > > \definesymbol > [orn1] > [\resolvedglyphdirect > {name:linuxlibertine}{x:2619}] > > valid prefixes are: > > e entity > x hexadecimal unicode > d decimal unicode > s hexadecimal index (slot) > i decimal index > n name > u unicode description (synonym) > a namd or description > c char (name itself) > > 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/list > info/ntg-context > webpage : http://www.pragma-ade.nl / http://context.aanhet.net > archive : https://bitbucket.org/phg/context-mirror/commits/ > wiki : http://contextgarden.net > > ___ > -- Dr YAHYAOUI Mohamed Kaddour, cardiologue.Clinique EL ABRAR. ___ 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] question about Linux Libertine
On 5/8/2017 12:20 AM, kaddour kardio wrote: i managed to get the ornaments from Linux Libertine by using a rather low-level command \definesymbol [leaf] [\getnamedglyphdirect {kad} {ampersand.alt}] But for other symbols i have to use another command like that: \definesymbol[orn1][\getglyph{kad}{\char9753}] because using \getnamedglyphdirect{kad}{uni2619} doesn't work. Did i miss a thing ? it has no name in the font you can add this to symb-ini.mkvi: \unexpanded\def\resolvedglyphstyled#fontname#character% {{\setstyledsymbolicfont{#fontname}\clf_tochar{#character}}} \unexpanded\def\resolvedglyphdirect#fontname#character% {{\setdirectsymbolicfont{#fontname}\clf_tochar{#character}}} and remake the format and then say: \definesymbol [leaf] [\resolvedglyphdirect {name:linuxlibertine}{n:ampersand.alt}] \definesymbol [orn1] [\resolvedglyphdirect {name:linuxlibertine}{x:2619}] valid prefixes are: e entity x hexadecimal unicode d decimal unicode s hexadecimal index (slot) i decimal index n name u unicode description (synonym) a namd or description c char (name itself) 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] question about Linux Libertine
i managed to get the ornaments from Linux Libertine by using a rather low-level command \definesymbol > [leaf] > [\getnamedglyphdirect > {kad} > {ampersand.alt}] But for other symbols i have to use another command like that: \definesymbol[orn1][\getglyph{kad}{\char9753}] because using \getnamedglyphdirect{kad}{uni2619} doesn't work. Did i miss a thing ? On Sun, May 7, 2017 at 12:15 AM, Hans Hagen wrote: > On 5/7/2017 12:44 AM, kaddour kardio wrote: > >> Hi, i would ask you a stupid question: how to get ornaments from Linux >> Libertine font in ConTeXT/mkiv ? >> > > it's probably a stylistic alternate so some ssNN feature that you need to > enable > > as a test you can try > > \definefontfeature[default][default][ss01=yes] > > before loading (or some other ss number) > > Thnk you in advance >> >> -- >> Dr YAHYAOUI Mohamed Kaddour, cardiologue.Clinique EL ABRAR. >> >> >> >> ___ >> 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/list >> info/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/list > info/ntg-context > webpage : http://www.pragma-ade.nl / http://context.aanhet.net > archive : https://bitbucket.org/phg/context-mirror/commits/ > wiki : http://contextgarden.net > > ___ -- Dr YAHYAOUI Mohamed Kaddour, cardiologue.Clinique EL ABRAR. ___ 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 sets
Hello all, i tried Wolfgang's tma method and wrote the attached symb-imp-win.mkiv. Perhaps is it useful for someone else. (wingdng2 and wingdng3 are included) Greetings Lutz P.S. Scheif virtuelle Tastatur Am 31. März 2017 10:56:20 MESZ schrieb Henning Hraban Ramm : >Am 2017-03-30 um 23:35 schrieb Wolfgang Schuster >: > >>> Henning Hraban Ramm 30. März 2017 um 13:14 via Postbox >>> I’m trying to define a symbolset: >>> >>> \definefontsynonym [Webdings] [file:Webdings.ttf] >>> \def\WebdingsSymbol#1{\getglyphstyled{Webdings}{\tochar{x:#1}}} >>> >>> \startsymbolset[webdings] >>> \definesymbol [spider] [\WebdingsSymbol{f021}] >>> \definesymbol [spiderweb] [\WebdingsSymbol{f022}] >>> \definesymbol [sunglasses] [\WebdingsSymbol{f024}] >>> \definesymbol [award] [\WebdingsSymbol{f026}] >>> \definesymbol [ribbon] [\WebdingsSymbol{f02d}] >>> \definesymbol [plane] [\WebdingsSymbol{f0f1}] >>> % … >>> \stopsymbolset >>> >>> \usesymbols[webdings] >>> \showsymbolset[webdings] >>> \symbol[webdings][spider] >>> >>> The font is included in my pdf, \showsymbolset[webdings] lists the >names, but the symbols never show up. >>> I also tried other fonts. >>> What’s wrong? >> You can get the right number for each symbol from webdings.tma (look >at the end of the file). >> >> \definefontsynonym [Webdings] [file:Webdings.ttf] >> >> \def\WebdingsSymbol#1{\getglyphstyled{Webdings}{\tochar{d:#1}}} >> >> \startsymbolset[webdings] >> \definesymbol [spider] [\WebdingsSymbol{983044}] >> \definesymbol [web][\WebdingsSymbol{983045}] >> \definesymbol [cool] [\WebdingsSymbol{983047}] >> \stopsymbolset >> >> \starttext >> \symbol[webdings][spider] >> \symbol[webdings][web] >> \symbol[webdings][cool] >> \stoptext > >Thank you! > >There seems to be a problem with Webdings.ttf: Fontexplorer shows glyph >numbers with an 0xf000 offset, i.e. spider at 0xf021 instead of 0x0021. >But ConTeXt can’t seem to find the glyphs even at the correct location, >but by name it works. > >So I exported the name list with fontforge and created the attached set >- feel free to add it to the distribution. >Also Wingdings. > >Access by number works with other fonts, e.g. with Symbola.otf – I just >introduced an error when I copied the webdings code and forgot to >change the font name reference. > >Greetlings, Hraban >--- >http://www.fiee.net >http://wiki.contextgarden.net >GPG Key ID 1C9B22FD -- Diese Nachricht wurde von meinem Android-Mobiltelefon mit K-9 Mail gesendet. symb-imp-win.mkiv Description: Binary data \usesymbols[win] \starttext \tfa {\tfc Wingding} \blank[2*big] \showsymbolset[wingding] \page {\tfc Webdings} \blank[2*big] \showsymbolset[webdings] \page {\tfc Wingdng2} \blank[2*big] \showsymbolset[wingdngii] \page {\tfc Wingdng3} \blank[2*big] \showsymbolset[wingdngiii] \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 sets
Am 2017-03-30 um 23:35 schrieb Wolfgang Schuster : >> Henning Hraban Ramm 30. März 2017 um 13:14 via Postbox >> I’m trying to define a symbolset: >> >> \definefontsynonym [Webdings] [file:Webdings.ttf] >> \def\WebdingsSymbol#1{\getglyphstyled{Webdings}{\tochar{x:#1}}} >> >> \startsymbolset[webdings] >> \definesymbol [spider] [\WebdingsSymbol{f021}] >> \definesymbol [spiderweb] [\WebdingsSymbol{f022}] >> \definesymbol [sunglasses] [\WebdingsSymbol{f024}] >> \definesymbol [award] [\WebdingsSymbol{f026}] >> \definesymbol [ribbon] [\WebdingsSymbol{f02d}] >> \definesymbol [plane] [\WebdingsSymbol{f0f1}] >> % … >> \stopsymbolset >> >> \usesymbols[webdings] >> \showsymbolset[webdings] >> \symbol[webdings][spider] >> >> The font is included in my pdf, \showsymbolset[webdings] lists the names, >> but the symbols never show up. >> I also tried other fonts. >> What’s wrong? > You can get the right number for each symbol from webdings.tma (look at the > end of the file). > > \definefontsynonym [Webdings] [file:Webdings.ttf] > > \def\WebdingsSymbol#1{\getglyphstyled{Webdings}{\tochar{d:#1}}} > > \startsymbolset[webdings] > \definesymbol [spider] [\WebdingsSymbol{983044}] > \definesymbol [web][\WebdingsSymbol{983045}] > \definesymbol [cool] [\WebdingsSymbol{983047}] > \stopsymbolset > > \starttext > \symbol[webdings][spider] > \symbol[webdings][web] > \symbol[webdings][cool] > \stoptext Thank you! There seems to be a problem with Webdings.ttf: Fontexplorer shows glyph numbers with an 0xf000 offset, i.e. spider at 0xf021 instead of 0x0021. But ConTeXt can’t seem to find the glyphs even at the correct location, but by name it works. So I exported the name list with fontforge and created the attached set - feel free to add it to the distribution. Also Wingdings. Access by number works with other fonts, e.g. with Symbola.otf – I just introduced an error when I copied the webdings code and forgot to change the font name reference. Greetlings, Hraban --- http://www.fiee.net http://wiki.contextgarden.net GPG Key ID 1C9B22FD symb-imp-webdings.mkiv Description: Binary data symb-imp-wingdings.mkiv Description: Binary data ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context webpage : http://www.pragma-ade.nl / http://context.aanhet.net archive : https://bitbucket.org/phg/context-mirror/commits/ wiki : http://contextgarden.net ___
Re: [NTG-context] symbol sets
Henning Hraban Ramm <mailto:te...@fiee.net> 30. März 2017 um 13:14via Postbox <https://www.postbox-inc.com/?utm_source=email&utm_medium=sumlink&utm_campaign=reach> I’m trying to define a symbolset: \definefontsynonym [Webdings] [file:Webdings.ttf] \def\WebdingsSymbol#1{\getglyphstyled{Webdings}{\tochar{x:#1}}} \startsymbolset[webdings] \definesymbol [spider] [\WebdingsSymbol{f021}] \definesymbol [spiderweb] [\WebdingsSymbol{f022}] \definesymbol [sunglasses] [\WebdingsSymbol{f024}] \definesymbol [award] [\WebdingsSymbol{f026}] \definesymbol [ribbon] [\WebdingsSymbol{f02d}] \definesymbol [plane] [\WebdingsSymbol{f0f1}] % … \stopsymbolset \usesymbols[webdings] \showsymbolset[webdings] \symbol[webdings][spider] The font is included in my pdf, \showsymbolset[webdings] lists the names, but the symbols never show up. I also tried other fonts. What’s wrong? You can get the right number for each symbol from webdings.tma (look at the end of the file). \definefontsynonym [Webdings] [file:Webdings.ttf] \def\WebdingsSymbol#1{\getglyphstyled{Webdings}{\tochar{d:#1}}} \startsymbolset[webdings] \definesymbol [spider] [\WebdingsSymbol{983044}] \definesymbol [web][\WebdingsSymbol{983045}] \definesymbol [cool] [\WebdingsSymbol{983047}] \stopsymbolset \starttext \symbol[webdings][spider] \symbol[webdings][web] \symbol[webdings][cool] \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 ___
Re: [NTG-context] symbol sets
I recently had the same problem. I installwd fontforge and opened the fobtfile. There you can see the names of the glyphs. After that i succeded with following code. \definefontsynonym [WebDing] [file:webdings.ttf] \def\WebDingSymbol{\getnamedglyphdirect{WebDing}} \startsymbolset [webding] \definesymbol[surf][\WebDingSymbol{surf}] \definesymbol[motorcycle][\WebDingSymbol{motorcycle}] \definesymbol[mountain][\WebDingSymbol{mountain}] \definesymbol[art][\WebDingSymbol{art}] \definesymbol[occasion][\WebDingSymbol{occasion}] \stopsymbolset \starttext \tfc \symbol[webding][surf] \symbol[webding][motorcycle] \symbol[webding][mountain] \symbol[webding][art] \symbol[webding][occasion] \stoptext I should write a symb-imp-win.mkv Am 30. März 2017 13:14:26 MESZ schrieb Henning Hraban Ramm : >I’m trying to define a symbolset: > >\definefontsynonym [Webdings] [file:Webdings.ttf] >\def\WebdingsSymbol#1{\getglyphstyled{Webdings}{\tochar{x:#1}}} > >\startsymbolset[webdings] >\definesymbol [spider][\WebdingsSymbol{f021}] >\definesymbol [spiderweb][\WebdingsSymbol{f022}] >\definesymbol [sunglasses][\WebdingsSymbol{f024}] >\definesymbol [award][\WebdingsSymbol{f026}] >\definesymbol [ribbon] [\WebdingsSymbol{f02d}] >\definesymbol [plane][\WebdingsSymbol{f0f1}] >% … >\stopsymbolset > >\usesymbols[webdings] >\showsymbolset[webdings] >\symbol[webdings][spider] > >The font is included in my pdf, \showsymbolset[webdings] lists the >names, but the symbols never show up. >I also tried other fonts. >What’s wrong? > > >Greetlings, Hraban >--- >http://www.fiee.net >http://wiki.contextgarden.net >GPG Key ID 1C9B22FD > >___ >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 >___ -- Diese Nachricht wurde von meinem Android-Mobiltelefon mit K-9 Mail gesendet.___ 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 sets
I’m trying to define a symbolset: \definefontsynonym [Webdings] [file:Webdings.ttf] \def\WebdingsSymbol#1{\getglyphstyled{Webdings}{\tochar{x:#1}}} \startsymbolset[webdings] \definesymbol [spider][\WebdingsSymbol{f021}] \definesymbol [spiderweb][\WebdingsSymbol{f022}] \definesymbol [sunglasses][\WebdingsSymbol{f024}] \definesymbol [award][\WebdingsSymbol{f026}] \definesymbol [ribbon][\WebdingsSymbol{f02d}] \definesymbol [plane][\WebdingsSymbol{f0f1}] % … \stopsymbolset \usesymbols[webdings] \showsymbolset[webdings] \symbol[webdings][spider] The font is included in my pdf, \showsymbolset[webdings] lists the names, but the symbols never show up. I also tried other fonts. What’s wrong? Greetlings, Hraban --- http://www.fiee.net http://wiki.contextgarden.net GPG Key ID 1C9B22FD ___ 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] A better \definesymbol sought
On 1/24/2017 8:01 PM, Rik Kabel wrote: On 2017-01-24 03:34, Hans Hagen wrote: On 1/24/2017 4:04 AM, Rik wrote: What I want is that the background of the page (yellow in this case) should show through. That is what is done with fill / reverse / cycle, as in: \setupbackgrounds [page] [background=color,backgroundcolor=yellow] \startuseMPgraphic{CircleTest} path p,q ; p := fullcircle scaled 2cm ; q := fullcircle scaled 1cm ; fill p -- reverse q -- cycle withcolor blue; \stopuseMPgraphic \starttext \useMPgraphic{CircleTest} \stoptext where the background color (yellow) comes through the inner circle (path q). Can this be done with text characters? I suspect that the answer is that the glyphs have to be converted to paths and that it will only work when \setupbackgrounds [page] [background=color, backgroundcolor=yellow] \starttext \startcolor[blue]\starteffect[outer]PQR\stopeffect\stopcolor \stoptext Still not there. Is there a way to define the ? characters to remove their coloring in the output of the following so that the background yellow appears through the outline even within the portions of the ?s placed on the blue heart? I want to be able to place this over arbitrary text and color backgrounds (stencil-like) so that the arbitrary text and background color shows through. \setupbackgrounds [page] [background={color,bgtext},backgroundcolor=yellow] \definelayer [bgtext] [x=1in, y=2.0in, state=start] \setlayerframed [bgtext] {\setupbodyfont[36pt]@@@} \definefont [DVSrB] [file:DejaVuSerif-Bold.ttf] \startbuffer[Outer] \startcolor[blue] \starteffect [outer] {\DVSrB ???} \stopeffect \stopcolor \stopbuffer \startuseMPgraphic{HeartTest} picture h,q ; h := "♥" infont "\truefontname{DejaVuSerif-Bold.ttf}" scaled 5 ; q := textext("{\getbuffer[Outer]}") scaled 3 ; draw h withcolor blue ; draw q ; \stopuseMPgraphic \starttext \starttext \useMPgraphic{HeartTest} \stoptext \setupbackgrounds [page] [background={color,bgtext}, backgroundcolor=yellow] \definelayer [bgtext] [x=1in, y=2.0in, state=start] \setlayerframed [bgtext] {\setupbodyfont[36pt]@@@} \definefont [DVSrB] [file:DejaVuSerif-Bold.ttf*default] \startuseMPgraphic{HeartTest} draw outlinetext.f ("\DVSrB ♥") (withcolor red) scaled 5 ; draw outlinetext.b ("\DVSrB ???") (withcolor yellow) (withcolor blue) scaled 3 ; \stopuseMPgraphic \starttext \useMPgraphic{HeartTest} \stoptext -- - 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] A better \definesymbol sought
On 2017-01-24 03:34, Hans Hagen wrote: On 1/24/2017 4:04 AM, Rik wrote: What I want is that the background of the page (yellow in this case) should show through. That is what is done with fill / reverse / cycle, as in: \setupbackgrounds [page] [background=color,backgroundcolor=yellow] \startuseMPgraphic{CircleTest} path p,q ; p := fullcircle scaled 2cm ; q := fullcircle scaled 1cm ; fill p -- reverse q -- cycle withcolor blue; \stopuseMPgraphic \starttext \useMPgraphic{CircleTest} \stoptext where the background color (yellow) comes through the inner circle (path q). Can this be done with text characters? I suspect that the answer is that the glyphs have to be converted to paths and that it will only work when \setupbackgrounds [page] [background=color, backgroundcolor=yellow] \starttext \startcolor[blue]\starteffect[outer]PQR\stopeffect\stopcolor \stoptext Still not there. Is there a way to define the ? characters to remove their coloring in the output of the following so that the background yellow appears through the outline even within the portions of the ?s placed on the blue heart? I want to be able to place this over arbitrary text and color backgrounds (stencil-like) so that the arbitrary text and background color shows through. \setupbackgrounds [page] [background={color,bgtext},backgroundcolor=yellow] \definelayer [bgtext] [x=1in, y=2.0in, state=start] \setlayerframed [bgtext] {\setupbodyfont[36pt]@@@} \definefont [DVSrB] [file:DejaVuSerif-Bold.ttf] \startbuffer[Outer] \startcolor[blue] \starteffect [outer] {\DVSrB ???} \stopeffect \stopcolor \stopbuffer \startuseMPgraphic{HeartTest} picture h,q ; h := "♥" infont "\truefontname{DejaVuSerif-Bold.ttf}" scaled 5 ; q := textext("{\getbuffer[Outer]}") scaled 3 ; draw h withcolor blue ; draw q ; \stopuseMPgraphic \starttext \starttext \useMPgraphic{HeartTest} \stoptext -- Rik ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context webpage : http://www.pragma-ade.nl / http://context.aanhet.net archive : https://bitbucket.org/phg/context-mirror/commits/ wiki : http://contextgarden.net ___
Re: [NTG-context] A better \definesymbol sought
On 1/24/2017 4:04 AM, Rik wrote: On 2017-01-23 14:09, Rik Kabel wrote: On 2017-01-23 00:06, Alan Braslau wrote: > On Sun, 22 Jan 2017 22:39:53 -0500 Rik Kabel > wrote: > >> So, how can I make the inner glyph (‘?’ in the example below) >> transparent, so that the background shows through along with >> anything else that lives on a lower layer? I’ve seen a method for >> constructed shapes, but nothing that I can apply to text glyphs. >> Undraw doesn’t do it. > > Undraw is simply draw using the background color. > > Transparency is a MetaFun extension to MetaPost (so part of > ConTeXt). > > draw q withtransparency (1,0.5) ; % (method,transparency) > > Alan Hmmm. That does not work for me (with any of many method and transparency values). The ‘?’ is solid black. I do see a message in the log that looks related: mkiv lua stats > page group warning: transparencies are used but no pagecolormodel is set but adding \setcolors[state=start,cmyk=yes] does not change that; both the warning and the solid black glyph remain. Could this be an issue of the PDF viewer? Is it a font issue? Okay, I got a clean compile using \definecolor and referencing that in the MP page. \setupbackgrounds [page] [background=color,backgroundcolor=yellow] \definecolor[Transp][r=1,t=0,a=12] \definefont [DVSrB] [file:DejaVuSerif-Bold.ttf] \startuseMPgraphic{HeartTest 1} picture h,q ; h := "♥" infont "\truefontname{DejaVuSerif-Bold.ttf}" scaled 20 ; q := textext("{\DVSrB ?}") scaled 10 ; q := q shifted - (xpart center q, 12pt) ; draw h withcolor blue ; draw q withtransparency(12,0) ; draw q shifted (72pt,0) withtransparency(12,0) ; \stopuseMPgraphic \startuseMPgraphic{HeartTest 2} picture h,q ; h := "♥" infont "\truefontname{DejaVuSerif-Bold.ttf}" scaled 20 ; q := textext("\color[Transp]{\DVSrB ?}") scaled 10 ; q := q shifted - (xpart center q, 12pt) ; draw h withcolor blue ; draw q ; draw q shifted (72pt,0) ; \stopuseMPgraphic \starttext \useMPgraphic{HeartTest 1} \useMPgraphic{HeartTest 2} \stoptext Unfortunately, the result is not what I want. The result is that the “?” disappears, allowing the color directly behind it to show through. The example above shows that it works with \definecolor but not withwithtransparency. I have no idea why, and certainly realize it could be my error. What I want is that the background of the page (yellow in this case) should show through. That is what is done with fill / reverse / cycle, as in: \setupbackgrounds [page] [background=color,backgroundcolor=yellow] \startuseMPgraphic{CircleTest} path p,q ; p := fullcircle scaled 2cm ; q := fullcircle scaled 1cm ; fill p -- reverse q -- cycle withcolor blue; \stopuseMPgraphic \starttext \useMPgraphic{CircleTest} \stoptext where the background color (yellow) comes through the inner circle (path q). Can this be done with text characters? I suspect that the answer is that the glyphs have to be converted to paths and that it will only work when \setupbackgrounds [page] [background=color, backgroundcolor=yellow] \starttext \startcolor[blue]\starteffect[outer]PQR\stopeffect\stopcolor \stoptext - 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] A better \definesymbol sought
On 2017-01-23 14:09, Rik Kabel wrote: On 2017-01-23 00:06, Alan Braslau wrote: > On Sun, 22 Jan 2017 22:39:53 -0500 Rik Kabel > wrote: > >> So, how can I make the inner glyph (‘?’ in the example below) >> transparent, so that the background shows through along with >> anything else that lives on a lower layer? I’ve seen a method for >> constructed shapes, but nothing that I can apply to text glyphs. >> Undraw doesn’t do it. > > Undraw is simply draw using the background color. > > Transparency is a MetaFun extension to MetaPost (so part of > ConTeXt). > > draw q withtransparency (1,0.5) ; % (method,transparency) > > Alan Hmmm. That does not work for me (with any of many method and transparency values). The ‘?’ is solid black. I do see a message in the log that looks related: mkiv lua stats > page group warning: transparencies are used but no pagecolormodel is set but adding \setcolors[state=start,cmyk=yes] does not change that; both the warning and the solid black glyph remain. Could this be an issue of the PDF viewer? Is it a font issue? Okay, I got a clean compile using \definecolor and referencing that in the MP page. \setupbackgrounds [page] [background=color,backgroundcolor=yellow] \definecolor[Transp][r=1,t=0,a=12] \definefont [DVSrB] [file:DejaVuSerif-Bold.ttf] \startuseMPgraphic{HeartTest 1} picture h,q ; h := "♥" infont "\truefontname{DejaVuSerif-Bold.ttf}" scaled 20 ; q := textext("{\DVSrB ?}") scaled 10 ; q := q shifted - (xpart center q, 12pt) ; draw h withcolor blue ; draw q withtransparency(12,0) ; draw q shifted (72pt,0) withtransparency(12,0) ; \stopuseMPgraphic \startuseMPgraphic{HeartTest 2} picture h,q ; h := "♥" infont "\truefontname{DejaVuSerif-Bold.ttf}" scaled 20 ; q := textext("\color[Transp]{\DVSrB ?}") scaled 10 ; q := q shifted - (xpart center q, 12pt) ; draw h withcolor blue ; draw q ; draw q shifted (72pt,0) ; \stopuseMPgraphic \starttext \useMPgraphic{HeartTest 1} \useMPgraphic{HeartTest 2} \stoptext Unfortunately, the result is not what I want. The result is that the “?” disappears, allowing the color directly behind it to show through. The example above shows that it works with \definecolor but not withwithtransparency. I have no idea why, and certainly realize it could be my error. What I want is that the background of the page (yellow in this case) should show through. That is what is done with fill / reverse / cycle, as in: \setupbackgrounds [page] [background=color,backgroundcolor=yellow] \startuseMPgraphic{CircleTest} path p,q ; p := fullcircle scaled 2cm ; q := fullcircle scaled 1cm ; fill p -- reverse q -- cycle withcolor blue; \stopuseMPgraphic \starttext \useMPgraphic{CircleTest} \stoptext where the background color (yellow) comes through the inner circle (path q). Can this be done with text characters? I suspect that the answer is that the glyphs have to be converted to paths and that it will only work when there are no islands (as in ‘P’). -- Rik ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context webpage : http://www.pragma-ade.nl / http://context.aanhet.net archive : https://bitbucket.org/phg/context-mirror/commits/ wiki : http://contextgarden.net ___
Re: [NTG-context] A better \definesymbol sought
On 2017-01-23 00:06, Alan Braslau wrote: On Sun, 22 Jan 2017 22:39:53 -0500 Rik Kabel > wrote: > >> So, how can I make the inner glyph (‘?’ in the example below) >> transparent, so that the background shows through along with >> anything else that lives on a lower layer? I’ve seen a method for >> constructed shapes, but nothing that I can apply to text glyphs. >> Undraw doesn’t do it. > > Undraw is simply draw using the background color. > > Transparency is a MetaFun extension to MetaPost (so part of > ConTeXt). > > draw q withtransparency (1,0.5) ; % (method,transparency) > > Alan Hmmm. That does not work for me (with any of many method and transparency values). The ‘?’ is solid black. I do see a message in the log that looks related: mkiv lua stats > page group warning: transparencies are used but no pagecolormodel is set but adding \setcolors[state=start,cmyk=yes] does not change that; both the warning and the solid black glyph remain. Could this be an issue of the PDF viewer? Is it a font issue? -- Rik ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context webpage : http://www.pragma-ade.nl / http://context.aanhet.net archive : https://bitbucket.org/phg/context-mirror/commits/ wiki : http://contextgarden.net ___
Re: [NTG-context] A better \definesymbol sought
On Sun, 22 Jan 2017 22:39:53 -0500 Rik Kabel wrote: > So, how can I make the inner glyph (‘?’ in the example below) > transparent, so that the background shows through along with anything > else that lives on a lower layer? I’ve seen a method for constructed > shapes, but nothing that I can apply to text glyphs. Undraw doesn’t > do it. Undraw is simply draw using the background color. Transparency is a MetaFun extension to MetaPost (so part of ConTeXt). draw q withtransparency (1,0.5) ; % (method,transparency) Alan ___ 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] A better \definesymbol sought
On 2017-01-20 23:54, Alan Braslau wrote: On Fri, 20 Jan 2017 22:33:40 -0500 Rik Kabel wrote: Can anyone suggest a better way to compose such symbols than using the raw TeX commands used here? Is there a more ConTeXt-ish way to do this? Is it possible to get options to center the glyphs from which the symbol is assembled (separate horizontal and vertical, with the ability to offset them)? Is there a ConTeXt way other than \definesymbol to create such combined symbols? MetaPost (with textext())? Thank you for that, Alan. I hadn’t ever used MetaPost before, thinking it was too complex for my needs. Now I see it may be quite useful. So, how can I make the inner glyph (‘?’ in the example below) transparent, so that the background shows through along with anything else that lives on a lower layer? I’ve seen a method for constructed shapes, but nothing that I can apply to text glyphs. Undraw doesn’t do it. \setupbackgrounds [page] [background=color,backgroundcolor=yellow] \definefont [DVSrB] [file:DejaVuSerif-Bold.ttf] \startuseMPgraphic{HeartTest} picture h; h := "♥" infont "\truefontname{DejaVuSerif-Bold.ttf}" scaled 20; picture q; q := textext("{\DVSrB ?}") scaled 10; % just a different way q := q shifted - (xpart center q, 12pt) ; draw h withcolor blue; undraw q; % this doesn't do it \stopuseMPgraphic \starttext \useMPgraphic{HeartTest} \stoptext -- Rik ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context webpage : http://www.pragma-ade.nl / http://context.aanhet.net archive : https://bitbucket.org/phg/context-mirror/commits/ wiki : http://contextgarden.net ___
Re: [NTG-context] A better \definesymbol sought
On Fri, 20 Jan 2017 22:33:40 -0500 Rik Kabel wrote: > Can anyone suggest a better way to compose such symbols than using > the raw TeX commands used here? Is there a more ConTeXt-ish way to do > this? Is it possible to get options to center the glyphs from which > the symbol is assembled (separate horizontal and vertical, with the > ability to offset them)? > > Is there a ConTeXt way other than \definesymbol to create such > combined symbols? MetaPost (with textext())? ___ 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] A better \definesymbol sought
ConTeXters, I have been using \definesymbol for a while, and for most purposes it suffices. However, there is one thing that it does not do that perhaps it should. What it does not do is offer the option to center one glyph over another (horizontally and/or vertically) when it should be centered. Rather, it leaves the work to a process of tuning the horizontal and vertical levers (kern and raise here) to get something that is close, but rarely perfect. I also see some problems with the horizontal spacing around the new symbol, but that may be a function of the underlying glyphs here. The following example shows what I mean \definefont [Inits] [dejavusans] \usesymbols[mvs] \define\SqSteel{% \tfc \symbol[martinvogel 2][SquareSteel] } \define\RedSansA{% \tfx \Inits{\red A} } \definesymbol [MyMark] [\SqSteel\kern-.87em{\raise.38ex\hbox{\RedSansA}}] \define\Test{Some text \symbol[MyMark] some more text.\par} \starttext \Test \setupbodyfont[8pt] \Test \setupbodyfont[18pt] \Test \scale[factor=40]{\Test} \stoptext Can anyone suggest a better way to compose such symbols than using the raw TeX commands used here? Is there a more ConTeXt-ish way to do this? Is it possible to get options to center the glyphs from which the symbol is assembled (separate horizontal and vertical, with the ability to offset them)? Is there a ConTeXt way other than \definesymbol to create such combined symbols? -- Rik ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context webpage : http://www.pragma-ade.nl / http://context.aanhet.net archive : https://bitbucket.org/phg/context-mirror/commits/ wiki : http://contextgarden.net ___
Re: [NTG-context] Vertical space around displayed formulas
Hi Nicola, Indeed there is a recent bug, reported by Mikael Sundqvist a few days ago, and Hans is aware of this. Hans said in the next release of ConTeXt beta the issue will be fixed. Best regards: OK > On 18 Jan 2017, at 16:00, Nicola wrote: > > Hello, > has something been changed in the last few months in the vertical > spacing of displayed formulas, frames or other environments? > > I am re-typesetting some presentations using the latest beta and the > content of slides (especially those containing formulas) now tends to > flow to the next page, while before it used to fit in one page. > > I paste below an example, if that helps. I am using a system font, > so you may not be able to reproduce my problem without it. > > Is there something I should change in my documents? > > Nicola > > %% > \setuppapersize[S6][S6] > > \setuplayout[ > width=middle, > height=middle, > topspace=2mm, > header=0mm, > headerdistance=0mm, > location=singlesided, > backspace=5mm, > margin=0mm, > edgedistance=0mm, > margindistance=0mm > ] > > \setupalign[nothyphenated,flushleft] > > % Ocean Sunset (color.adobe.com) > \definecolor[colorone][r=0.251, g=0.349, b=0.322] > \definecolor[colortwo][r=0.612, g=0.608, b=0.478] > \definecolor[colorthree] [r=1.0, g=0.827, b=0.576] > \definecolor[colorfour] [r=1.0, g=0.592, b=0.310] > \definecolor[colorfive] [r=0.960, g=0.310, b=0.161] %t=0.8 , a=multiply] > \definecolor[nearlywhite] [s=0.996] > > % Fonts > \definefontfamily[slidesfont][serif][Avenir] [ > tf=name:Avenir Light, > it=name:Avenir Light Oblique, > bf=name:Avenir Heavy, > bi=name:Avenir Heavy Oblique > ] > \definefontfamily[slidesfont][sans][Avenir] [ > tf=name:Avenir Light, > it=name:Avenir Light Oblique, > bf=name:Avenir Heavy, > bi=name:Avenir Heavy Oblique > ] > \definefallbackfamily[slidesfont][mono][Xits][range={"0222A,"02229,"02205}] % > ∪, ∩, ∅ > \definefontfamily[slidesfont][mono][Latin Modern Mono Light][features=none] > \definefallbackfamily[slidesfont][math][Xits][range={"025C7,"27D5}] % WHITE > DIAMOND, left-join, WHITE RIGHT-POINTING TRIANGLE > \definefontfamily[slidesfont][math][TeX Gyre Pagella Math] > > \setupbodyfont[slidesfont] > > % Foreground/background color > \setupcolors[textcolor=colorone] > \setupbackgrounds[page][background=color, backgroundcolor=nearlywhite] > > % Header > \startreusableMPgraphic{header:background} > fill OverlayBox >leftenlarged BackSpace >rightenlarged CutSpace >topenlarged TopSpace >withcolor OverlayColor ; > setbounds currentpicture to OverlayBox >enlarged max(BackSpace,CutSpace) ; > \stopreusableMPgraphic > > \defineoverlay[header:background][\reuseMPgraphic{header:background}] > > \define[2]\MySlide{\framed[ > frame=off, > background=header:background, > backgroundcolor=colorfive, > width=\textwidth, > align=flushleft > ]{#2}} > > \definehead[slide][subject] > \setuphead[slide][ > style=\ssb, > command=\MySlide, > color=nearlywhite, > insidesection=\doifnot{\structureuservariable{align}}{top}\vfill, > aftersection=\doifnot{\structureuservariable{align}}{top}\vfill, > page=yes, > ] > > % Footer > \setuppagenumbering[location=] > \setupfooter[style=small, color=colortwo] > \setupfootertexts[][\userpagenumber/\lastuserpage] > > % Lists > \startuseMPgraphic{itemize:main} > save p; path p; > p := fullcircle scaled 1.5ExHeight; > fill p withcolor \MPcolor{colorfive}; > \stopuseMPgraphic > > \startuseMPgraphic{itemize:nested} > save p; path p; > p := ((0,-0.5)--(0,0.5)--(0.866,0)--cycle) scaled 1.5ExHeight; > fill p withcolor \MPcolor{colorfive}; > \stopuseMPgraphic > > \definesymbol[itemize:main][\useMPgraphic{itemize:main}] > \definesymbol[itemize:nested][\useMPgraphic{itemize:nested}] > > \setupitemize[1][symbol=itemize:main] > \setupitemize[2][symbol=itemize:nested, width=1.5ex] > \setupitemize[2][nowhite] > > \setupitemize[ > headstyle=\ssa, > headcolor=colorfive, > afterhead={\blank[none]}, > inbetween={\blank[big]}, > leftmargin=1em, > rightmargin=1em, > ] > > % Tables > \setuptables[rulethickness=0.06em] > > \setupinteraction[state=start, % make hyperlinks active, etc. > style=\tf, > color=colortwo, > title={What Do You Mean, “Null”?}, > author={Nicola Vitacolonna}, > keyword={null}] > > % \usebtxdataset[main.bib] > % \usebtxdefinitions[apa] > \setupcombinations[distance=3cm,location=top] > \defineframedcontent[tablebackground][frame=off,back
[NTG-context] Vertical space around displayed formulas
Hello, has something been changed in the last few months in the vertical spacing of displayed formulas, frames or other environments? I am re-typesetting some presentations using the latest beta and the content of slides (especially those containing formulas) now tends to flow to the next page, while before it used to fit in one page. I paste below an example, if that helps. I am using a system font, so you may not be able to reproduce my problem without it. Is there something I should change in my documents? Nicola %% \setuppapersize[S6][S6] \setuplayout[ width=middle, height=middle, topspace=2mm, header=0mm, headerdistance=0mm, location=singlesided, backspace=5mm, margin=0mm, edgedistance=0mm, margindistance=0mm ] \setupalign[nothyphenated,flushleft] % Ocean Sunset (color.adobe.com) \definecolor[colorone][r=0.251, g=0.349, b=0.322] \definecolor[colortwo][r=0.612, g=0.608, b=0.478] \definecolor[colorthree] [r=1.0, g=0.827, b=0.576] \definecolor[colorfour] [r=1.0, g=0.592, b=0.310] \definecolor[colorfive] [r=0.960, g=0.310, b=0.161] %t=0.8 , a=multiply] \definecolor[nearlywhite] [s=0.996] % Fonts \definefontfamily[slidesfont][serif][Avenir] [ tf=name:Avenir Light, it=name:Avenir Light Oblique, bf=name:Avenir Heavy, bi=name:Avenir Heavy Oblique ] \definefontfamily[slidesfont][sans][Avenir] [ tf=name:Avenir Light, it=name:Avenir Light Oblique, bf=name:Avenir Heavy, bi=name:Avenir Heavy Oblique ] \definefallbackfamily[slidesfont][mono][Xits][range={"0222A,"02229,"02205}] % ∪, ∩, ∅ \definefontfamily[slidesfont][mono][Latin Modern Mono Light][features=none] \definefallbackfamily[slidesfont][math][Xits][range={"025C7,"27D5}] % WHITE DIAMOND, left-join, WHITE RIGHT-POINTING TRIANGLE \definefontfamily[slidesfont][math][TeX Gyre Pagella Math] \setupbodyfont[slidesfont] % Foreground/background color \setupcolors[textcolor=colorone] \setupbackgrounds[page][background=color, backgroundcolor=nearlywhite] % Header \startreusableMPgraphic{header:background} fill OverlayBox leftenlarged BackSpace rightenlarged CutSpace topenlarged TopSpace withcolor OverlayColor ; setbounds currentpicture to OverlayBox enlarged max(BackSpace,CutSpace) ; \stopreusableMPgraphic \defineoverlay[header:background][\reuseMPgraphic{header:background}] \define[2]\MySlide{\framed[ frame=off, background=header:background, backgroundcolor=colorfive, width=\textwidth, align=flushleft ]{#2}} \definehead[slide][subject] \setuphead[slide][ style=\ssb, command=\MySlide, color=nearlywhite, insidesection=\doifnot{\structureuservariable{align}}{top}\vfill, aftersection=\doifnot{\structureuservariable{align}}{top}\vfill, page=yes, ] % Footer \setuppagenumbering[location=] \setupfooter[style=small, color=colortwo] \setupfootertexts[][\userpagenumber/\lastuserpage] % Lists \startuseMPgraphic{itemize:main} save p; path p; p := fullcircle scaled 1.5ExHeight; fill p withcolor \MPcolor{colorfive}; \stopuseMPgraphic \startuseMPgraphic{itemize:nested} save p; path p; p := ((0,-0.5)--(0,0.5)--(0.866,0)--cycle) scaled 1.5ExHeight; fill p withcolor \MPcolor{colorfive}; \stopuseMPgraphic \definesymbol[itemize:main][\useMPgraphic{itemize:main}] \definesymbol[itemize:nested][\useMPgraphic{itemize:nested}] \setupitemize[1][symbol=itemize:main] \setupitemize[2][symbol=itemize:nested, width=1.5ex] \setupitemize[2][nowhite] \setupitemize[ headstyle=\ssa, headcolor=colorfive, afterhead={\blank[none]}, inbetween={\blank[big]}, leftmargin=1em, rightmargin=1em, ] % Tables \setuptables[rulethickness=0.06em] \setupinteraction[state=start, % make hyperlinks active, etc. style=\tf, color=colortwo, title={What Do You Mean, “Null”?}, author={Nicola Vitacolonna}, keyword={null}] % \usebtxdataset[main.bib] % \usebtxdefinitions[apa] \setupcombinations[distance=3cm,location=top] \defineframedcontent[tablebackground][frame=off,background=color,backgroundcolor=colorthree] \setuptables[rulethickness=0.06em,frame=tablebackground] \setupalign[nothyphenated,flushleft] \defineparagraphs[twocol][n=2] \setupparagraphs[twocol][1][width=.7\textwidth] \starttext \switchtobodyfont[17.3pt] \startslide[title={Which Nulls?}][align=top] All of the above may be abstracted into three categories: \startitemize[packed] \item Exists, but unknown ({\bf missing value}) \startformula \exists x\,\hbox{Yalta}(\hbox{Winston},x,\hbox{Churchill}) \stopformula \item Nonexistent, not applicable ({\bf inapplicable null}) \startformula \neg\exists x\,\hbox{Yalta}(\hbox{Winston},x,\hbox{Churchill}) \land \hbox{Yalta}_{-2}(\hbox{Winston},\hbox{Churchill}) \stopformula \item Not known to exist ({\bf no-information null}) \startformula \hbox{Yalta}_{-2}(\hbox{Winston},\hbox{Churchill}) \stopformula \s
Re: [NTG-context] Multiple Choice Quiz with self marking funciton
Thanks Wolfgang for pointing the direction. My effort so far gave the following: \setuppapersize[S4][S4]\setupinteraction[state=start,click=no] \definefield [Choice][radio][ChoiceSetup] [yes,no] \definesymbol [YesS] [Y] %[\ding{52},color=red] %% Not successful in getting the symbols I want to work\definesymbol [NoS] [\getglyph{Dingbats}{\char10008}] %[\ding{56},color=red]\definesymbol [BlankS] [] \definesubfield[yes][ChoiceSetup][YesS,BlankS]\definesubfield[no][ChoiceSetup][NoS,BlankS] \copyfield [no] [no1]\copyfield [no] [no2]\copyfield [no] [no3]\copyfield [no] [no4] \setupfield[ChoiceSetup] [width=2ex, height=2ex, frame=on, background=screen] \starttext \hbox to \hsize {\field[no1] A: correct \hfill \field[yes] maybe \hfill \field[no2] incorrect \hfill \field[no3] huh?} \starttabulate \field[no1] $x$ \NC \field[no2] $-x$ \NR %% can't figure out how to delink these radio fields from the above \field[no3] $\pm x$ \NC \field[yes] $|x|$ \NR \stoptabulate \stoptext My intention for including this is not for someone to help debug this but to show the limit of my coding skills. I was really hoping for a working example of a multiple choice quiz since ConTeXt was originally designed for educational purpose. Thanks anyway. @-->-- May you be happy and well! B.A. --<--@ On Saturday, 22 October 2016, 20:41, Wolfgang Schuster wrote: B.A.Lee 21. Oktober 2016 um 19:28 Hi, I am new to ConTeXt but have been using LaTeX for years. Just before I came across ConTeXt, I ran across Acrotex eDucation Bundle. One of its packages allows us to create multiple choice quizzes which has some self-harming features when done on screen. It also has a paper equivalent. I am wondering if anyone is willing to share his/her setups for multiple choice, with or without the self-harming feature. I am also wondering if ConTeXt has that self-harming feature too. If it can, I hope too see an example of how it can be done. Take a look at the widgets manual: http://pragma-ade.nl/show-man-13.htm 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 ___
[NTG-context] beta
Hi, I uploaded a new beta. This version has (experimental) support for color fonts. (not to be confused with 'coloring text in a font'). \definefontfeature[svg][default][svg=yes] \definefontfeature[colored][default][colr=yes] % \definefont[Emoj][file:emojionecolor-svginot.ttf*default,svg] % \definefont[Emoj][file:seguiemj.ttf*default,colored] \definesymbol[bug1][\getglyphdirect{file:emojionecolor-svginot.ttf*svg}{\char"1F41B}] \definesymbol[bug2][\getglyphdirect{file:seguiemj.ttf*colored} {\char"1F41B}] \startTEXpage [width=10em,align=middle,offset=1em] There are several kind of bugs, like \symbol [bug1] and \symbol [bug2], also in \CONTEXT ! \stopTEXpage The colr features uses (if present) the overlay method (microsoft fonts have that) which is quite clean and efficient, while the svg one uses (when present) svg information from the font. Caching the later one will take some initial time (due to conversion, i might figure out something better) and needs inkscape installed. Attached an example. I didn't look too extensively for a font, but on the agenda is turning the cowfont in a color one (maybe for the ctx meeting). At some point I might add overloading of colors (for the overlay variant). Hans - Hans Hagen | PRAGMA ADE Ridderstraat 27 | 8061 GH Hasselt | The Netherlands tel: 038 477 53 69 | www.pragma-ade.com | www.pragma-pod.nl - colors-002.pdf Description: Adobe PDF document ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context webpage : http://www.pragma-ade.nl / http://tex.aanhet.net archive : http://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___
Re: [NTG-context] Alignment/line break in a TABLE cell
Thanks, Wolfgang! \symbol[square] doesn't work for me, because the inside of the box has to be white also when on gray background, i.e. I need a box filled with white. I decided to do what I should've done in the first place and brushed up enough of my MetaPost that I could create a box with black outline and white fill (OK, I pinched most of it from the MetaFun manual...). This seems to work: \startuseMPgraphic{box3mm_filled} pickup pencircle scaled .02cm ; path p ; p := unitsquare scaled 3mm ; fill p withcolor white ; draw p withcolor black ; \stopuseMPgraphic \definesymbol[box3mm][{\useMPgraphic{box3mm_filled}}] \starttext \dontleavehmode\symbol[box3mm] 1 \stoptext Thank you for your speedy replies! Mari On Thu, May 19, 2016 at 2:08 PM, Wolfgang Schuster wrote: > Mari Voipio > 19. Mai 2016 um 12:45 > On Thu, May 19, 2016 at 1:04 PM, Wolfgang Schuster > > This kind of works. The box and the number are now on the same line, > but one of them - the number, I think - is offset and that looks > funny. Is there a trick that'd fix that? > > 1. Lower your graphic because it has margins around the lines which > positions it too high. > > \definesymbol[box3mm][{\offset[y=.25ex]{\externalfigure[box3mm]}}] > > \starttext > > \dontleavehmode\symbol[box3mm] 1 > > \stoptext > > > > 2. Use a box symbol which sits lower on the baseline. > > \starttext > > \dontleavehmode\symbol[square] 1 > > \stoptext > > > 3. Use metapost to create your own box. > > \startuseMPgraphic{box3mm} > draw unitsquare scaled 3mm ; > \stopuseMPgraphic > > \definesymbol[box3mm][{\useMPgraphic{box3mm}}] > > \starttext > > \dontleavehmode\symbol[box3mm] 1 > > \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://tex.aanhet.net > archive : http://foundry.supelec.fr/projects/contextrev/ > 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://tex.aanhet.net archive : http://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___
Re: [NTG-context] Alignment/line break in a TABLE cell
Mari Voipio <mailto:mari.voi...@iki.fi> 19. Mai 2016 um 12:45 On Thu, May 19, 2016 at 1:04 PM, Wolfgang Schuster This kind of works. The box and the number are now on the same line, but one of them - the number, I think - is offset and that looks funny. Is there a trick that'd fix that? 1. Lower your graphic because it has margins around the lines which positions it too high. \definesymbol[box3mm][{\offset[y=.25ex]{\externalfigure[box3mm]}}] \starttext \dontleavehmode\symbol[box3mm] 1 \stoptext 2. Use a box symbol which sits lower on the baseline. \starttext \dontleavehmode\symbol[square] 1 \stoptext 3. Use metapost to create your own box. \startuseMPgraphic{box3mm} draw unitsquare scaled 3mm ; \stopuseMPgraphic \definesymbol[box3mm][{\useMPgraphic{box3mm}}] \starttext \dontleavehmode\symbol[box3mm] 1 \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://tex.aanhet.net archive : http://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___
Re: [NTG-context] Numbering and module visualcounter
Hi Wolfgang, Without your help, I would not have found. I'll try to understand but as of today my knowledge is not yet sufficient. Thank you Fabrice 2016-01-25 16:08 GMT+01:00 Wolfgang Schuster : > Fabrice Couvreur > 25. Januar 2016 um 14:20 > > Hello, > In the code below, I use the module visualcounter > The numbering is obtained > > 1.1 > 1.2 > 1.3 > How to have > > 1 > 2 > 3 ? > thank you, > Fabrice > > \usemodule[visualcounter] > \unprotect > > You can drop the \unprotect and \protect command when you use > > \visualcounterparameter{XXX} > > instead of > > \visualcounterparameter\c!XXX > > > \definevisualcounter > [randomcircle] > [ > mp=visualcounter::randomcircle, > rulethickness=1pt, > ] > > \startuseMPgraphic{visualcounter::randomcircle} > begingroup; > > \includeMPgraphic{visualcounter::initialization} > > if (last_counter > 0) and (current_counter > 0) : > newpicture countertext ; countertext := > textext("\white\visualcounterparameter\c!text"); > > You need the value of the “n” key, not the “text” key. > > newpicture countertext ; countertext := > textext("\white\visualcounterparameter{n}"); > > newpicture max_countertext ; max_countertext := > textext("\white\visualcounterparameter{\c!max\c!text}"); > > newnumeric diameter; > diameter := 1.9 * max(bbwidth(max_countertext), > bbheight(max_countertext)); > > newpath randomcircle; > randomcircle := fullcircle xyscaled(diameter, diameter) randomized > (diameter/20); > > pickup pencircle scaled \visualcounterparameter\c!rulethickness ; > fill randomcircle withcolor green; % Can be made configurable > label (countertext, origin); > > > fi; > endgroup; > \stopuseMPgraphic > \protect > > \definevisualcounter > [fuzzyitem] > [randomcircle] > [counter=\getvalue{v_strc_itemgroups_counter}] > > You can set the counter for the enumeration with > > [counter=itemgroup:itemize] > > \definesymbol[fuzzy][{\framed[location=depth, frame=off, > strut=no]{\usevisualcounter{fuzzyitem}}}] > > Keep setups like this only in your examples when they are necessary which > isn’t the case here. > > \setuphead [part] > [command=\ChapterCommand, > page=yes, > textstyle=\ss, > sectionresetset=, > number=no, > placehead=yes, > bodypartlabel=chapter] > > 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://tex.aanhet.net > archive : http://foundry.supelec.fr/projects/contextrev/ > 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://tex.aanhet.net archive : http://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___
Re: [NTG-context] Numbering and module visualcounter
Fabrice Couvreur <mailto:fabrice1.couvr...@gmail.com> 25. Januar 2016 um 14:20 Hello, In the code below, I use the module visualcounter The numbering is obtained 1.1 1.2 1.3 How to have 1 2 3? thank you, Fabrice \usemodule[visualcounter] \unprotect You can drop the \unprotect and \protect command when you use \visualcounterparameter{XXX} instead of \visualcounterparameter\c!XXX \definevisualcounter [randomcircle] [ mp=visualcounter::randomcircle, rulethickness=1pt, ] \startuseMPgraphic{visualcounter::randomcircle} begingroup; \includeMPgraphic{visualcounter::initialization} if (last_counter > 0) and (current_counter > 0) : newpicture countertext ; countertext := textext("\white\visualcounterparameter\c!text"); You need the value of the “n” key, not the “text” key. newpicture countertext ; countertext := textext("\white\visualcounterparameter{n}"); newpicture max_countertext ; max_countertext := textext("\white\visualcounterparameter{\c!max\c!text}"); newnumeric diameter; diameter := 1.9 * max(bbwidth(max_countertext), bbheight(max_countertext)); newpath randomcircle; randomcircle := fullcircle xyscaled(diameter, diameter) randomized (diameter/20); pickup pencircle scaled \visualcounterparameter\c!rulethickness ; fill randomcircle withcolor green; % Can be made configurable label (countertext, origin); fi; endgroup; \stopuseMPgraphic \protect \definevisualcounter [fuzzyitem] [randomcircle] [counter=\getvalue{v_strc_itemgroups_counter}] You can set the counter for the enumeration with [counter=itemgroup:itemize] \definesymbol[fuzzy][{\framed[location=depth, frame=off, strut=no]{\usevisualcounter{fuzzyitem}}}] Keep setups like this only in your examples when they are necessary which isn’t the case here. \setuphead [part] [command=\ChapterCommand, page=yes, textstyle=\ss, sectionresetset=, number=no, placehead=yes, bodypartlabel=chapter] 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://tex.aanhet.net archive : http://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___
[NTG-context] Numbering and module visualcounter
Hello, In the code below, I use the module visualcounter The numbering is obtained 1.1 1.2 1.3 How to have 1 2 3 ? thank you, Fabrice \usemodule[visualcounter] \unprotect \definevisualcounter [randomcircle] [ mp=visualcounter::randomcircle, rulethickness=1pt, ] \startuseMPgraphic{visualcounter::randomcircle} begingroup; \includeMPgraphic{visualcounter::initialization} if (last_counter > 0) and (current_counter > 0) : newpicture countertext ; countertext := textext("\white\visualcounterparameter\c!text"); newpicture max_countertext ; max_countertext := textext("\white\visualcounterparameter{\c!max\c!text}"); newnumeric diameter; diameter := 1.9 * max(bbwidth(max_countertext), bbheight(max_countertext)); newpath randomcircle; randomcircle := fullcircle xyscaled(diameter, diameter) randomized (diameter/20); pickup pencircle scaled \visualcounterparameter\c!rulethickness ; fill randomcircle withcolor green; % Can be made configurable label (countertext, origin); fi; endgroup; \stopuseMPgraphic \protect \definevisualcounter [fuzzyitem] [randomcircle] [counter=\getvalue{v_strc_itemgroups_counter}] \definesymbol[fuzzy][{\framed[location=depth, frame=off, strut=no]{\usevisualcounter{fuzzyitem}}}] \setuphead [part] [command=\ChapterCommand, page=yes, textstyle=\ss, sectionresetset=, number=no, placehead=yes, bodypartlabel=chapter] \setuphead [chapter] [command=\ChapterCommand, textstyle=\ss, sectionresetset=, conversion=, number=no, page=no, placehead=yes, bodypartlabel=part, sectionsegments=chapter:chapter] \setuphead [section] [command=\ChapterCommand, textstyle=\ss, page=yes, conversion=numbers, sectionsegments=section:section, number=yes] \starttext \startpart [title={First Part}] \startchapter [title={First chapter}] \startsection [title={First section}] \startitemize[fuzzy] \startitem \input knuth \stopitem \startitem \input knuth \stopitem \stopitemize \stopsection \stopchapter \stoppart \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://tex.aanhet.net archive : http://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___
Re: [NTG-context] Fieldstacks are broken
Thanks Hans, Wolfgang, Luigi The new beta with Luatex 0.88 makes \fieldstacks and \startanimation work. The following example of Wolfgang is now working well. \def\MyGraphics#1{% \startMPcode path p,q; p:=fullcircle scaled 72; L:=length p; N:=20; q:=subpath (0,#1/N*L) of p; draw q withcolor red; fill fullcircle scaled 3 shifted point length q of q withcolor blue; setbounds currentpicture to unitsquare shifted (-0.5,-0.5) scaled 75; \stopMPcode} \usemodule[animation] \setupinteraction[state=start] \starttext \startanimation[menu=yes] {\MyGraphics {5}} {\MyGraphics {10}} {\MyGraphics {15}} {\MyGraphics {20}} \stopanimation \stoptext One more question. Is there any convenient way to list \MyGraphics{#1}? I tried \dorecurse, but it just display figures one by one. I also tried lua, but it stops with the error message “unexpected symbol near ‘\'”. \dorecurse{20} {{\MyGraphics {\recurselevel}} \startluacode for i = 1, 20 do context(“{\\MyGraphics {i}}”) end \stopluacode Thanks again. Best regards, Dalyoung > Today's Topics: > > 1. Re: Fieldstacks are broken (Hans Hagen) > > > -- > > Message: 1 > Date: Mon, 11 Jan 2016 10:53:56 +0100 > From: Hans Hagen > To: ntg-context@ntg.nl > Subject: Re: [NTG-context] Fieldstacks are broken > Message-ID: <56937bb4.1070...@wxs.nl> > Content-Type: text/plain; charset=utf-8; format=flowed > > On 1/10/2016 5:01 PM, Wolfgang Schuster wrote: >> Hi Hans, >> >> the fieldstack mechanism doesn’t work anymore. >> >> \setupinteraction[state=start] >> >> \starttext \showframe >> >> \definesymbol[frame-1][\tt 1] >> \definesymbol[frame-2][\tt 2] >> \definesymbol[frame-3][\tt 3] >> >> \definefieldstack[frame][frame-1,frame-2,frame-3] >> >> \placeontopofeachother >> {\framed[strut=no,offset=1ex]{\fieldstack[frame]}} >> {\goto{Play}[Walk{frame}]} >> >> \stoptext > > fixed in next engine update > > > - > Hans Hagen | PRAGMA ADE > Ridderstraat 27 | 8061 GH Hasselt | The Netherlands > tel: 038 477 53 69 | www.pragma-ade.com | 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://tex.aanhet.net archive : http://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___
Re: [NTG-context] Fieldstacks are broken
On 1/10/2016 5:01 PM, Wolfgang Schuster wrote: Hi Hans, the fieldstack mechanism doesn’t work anymore. \setupinteraction[state=start] \starttext \showframe \definesymbol[frame-1][\tt 1] \definesymbol[frame-2][\tt 2] \definesymbol[frame-3][\tt 3] \definefieldstack[frame][frame-1,frame-2,frame-3] \placeontopofeachother {\framed[strut=no,offset=1ex]{\fieldstack[frame]}} {\goto{Play}[Walk{frame}]} \stoptext fixed in next engine update - Hans Hagen | PRAGMA ADE Ridderstraat 27 | 8061 GH Hasselt | The Netherlands tel: 038 477 53 69 | www.pragma-ade.com | 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://tex.aanhet.net archive : http://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___
[NTG-context] Fieldstacks are broken
Hi Hans, the fieldstack mechanism doesn’t work anymore. \setupinteraction[state=start] \starttext \showframe \definesymbol[frame-1][\tt 1] \definesymbol[frame-2][\tt 2] \definesymbol[frame-3][\tt 3] \definefieldstack[frame][frame-1,frame-2,frame-3] \placeontopofeachother {\framed[strut=no,offset=1ex]{\fieldstack[frame]}} {\goto{Play}[Walk{frame}]} \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://tex.aanhet.net archive : http://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___
Re: [NTG-context] Smaller bullet points
On 11/29/2015 7:33 PM, Kate F wrote: On 29 November 2015 at 17:51, Hans Hagen wrote: On 11/29/2015 5:55 PM, Kate F wrote: Hi, I'm defining a slightly smaller bullet point symbol: \definesymbol[smallbullet][\small\bullet] \setupitemize[1][smallbullet] This aligns the smaller bullet point to the baseline of text, which is too low. I'd like to have it vertically centered, such that it aligns in the middle of where the regular-sized \bullet would be. I tried using \inframed[height=\lineheight], but I couldn't find a way to make that end up in the right place. \definesymbol [smallbullet] [\raise.1ex\hbox{\mathematics{\scriptstyle\bullet}}] Thanks! Where does the .1ex come from? Is that value derived from some measurement, or does it just look about right? the x height - Hans Hagen | PRAGMA ADE Ridderstraat 27 | 8061 GH Hasselt | The Netherlands tel: 038 477 53 69 | voip: 087 875 68 74 | www.pragma-ade.com | 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://tex.aanhet.net archive : http://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___
Re: [NTG-context] Smaller bullet points
On 29 November 2015 at 17:51, Hans Hagen wrote: > On 11/29/2015 5:55 PM, Kate F wrote: >> >> Hi, >> >> I'm defining a slightly smaller bullet point symbol: >> >> \definesymbol[smallbullet][\small\bullet] >> \setupitemize[1][smallbullet] >> >> This aligns the smaller bullet point to the baseline of text, which is >> too low. I'd like to have it vertically centered, such that it aligns >> in the middle of where the regular-sized \bullet would be. I tried >> using \inframed[height=\lineheight], but I couldn't find a way to make >> that end up in the right place. > > > \definesymbol > [smallbullet] > [\raise.1ex\hbox{\mathematics{\scriptstyle\bullet}}] > Thanks! Where does the .1ex come from? Is that value derived from some measurement, or does it just look about right? -- Kate ___ 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://tex.aanhet.net archive : http://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___
Re: [NTG-context] Smaller bullet points
On 11/29/2015 5:55 PM, Kate F wrote: Hi, I'm defining a slightly smaller bullet point symbol: \definesymbol[smallbullet][\small\bullet] \setupitemize[1][smallbullet] This aligns the smaller bullet point to the baseline of text, which is too low. I'd like to have it vertically centered, such that it aligns in the middle of where the regular-sized \bullet would be. I tried using \inframed[height=\lineheight], but I couldn't find a way to make that end up in the right place. \definesymbol [smallbullet] [\raise.1ex\hbox{\mathematics{\scriptstyle\bullet}}] - Hans Hagen | PRAGMA ADE Ridderstraat 27 | 8061 GH Hasselt | The Netherlands tel: 038 477 53 69 | voip: 087 875 68 74 | www.pragma-ade.com | 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://tex.aanhet.net archive : http://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___
[NTG-context] Smaller bullet points
Hi, I'm defining a slightly smaller bullet point symbol: \definesymbol[smallbullet][\small\bullet] \setupitemize[1][smallbullet] This aligns the smaller bullet point to the baseline of text, which is too low. I'd like to have it vertically centered, such that it aligns in the middle of where the regular-sized \bullet would be. I tried using \inframed[height=\lineheight], but I couldn't find a way to make that end up in the right place. Any suggestions please? Thanks, -- Kate ___ 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://tex.aanhet.net archive : http://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___
Re: [NTG-context] TikZ and wrong drawing order
On Thu, Jun 11, 2015 at 11:26 PM, Hans Hagen wrote: >>> On Thu, 11 Jun 2015, Mojca Miklavec wrote: >>> >>>> Hi, >>>> >>>> I would like to ask for help for either finding a fix or some clever >>>> workaround for the following problem. >>>> >>>> If I use a TikZ picture as item symbol and additionally use background >>>> text, then the first symbol in itemize environment gets covered by the >>>> background. Here's an example: >>>> >>>> \usemodule >>>> [tikz] >>>> >>>> \definesymbol[1] >>>> [{\tikz\shade[shading=ball,ball color=blue] (0,0) circle (.2cm);}] >>>> >>>> \definecolor >>>> [backcol] >>>> [s=1,a=1,t=0.1] >>>> >>>> \starttext >>>> >>>> \startframedtext[width=4cm,background=color,backgroundcolor=backcol] >>>> \startitemize >>>> \item one >>>> \item two >>>> \item three >>>> \stopitemize >>>> \stopframedtext >>>> >>>> \stoptext > > i suppose that tikz puts some pdf code in the output stream and this is > likely to interfere with the way context deals with colors > > a solution is: > > {\red x\dontleavehmode\forcecolorhack\tikz\fill[color=blue] (0,0) circle > (.2cm);x} > > the > > \forcecolorhack > > is, well, a hack that fools the optimizer and \dontleavehmode is needed to > get tex in the right mode Thank you very much. Using the following worked fine as a workaround. \definesymbol[1] [{\dontleavehmode\forcecolorhack\tikz\shade[shading=ball,ball color=blue] (0,0) circle (.2cm);}] Meanwhile I filed a ticket to the pgf's bug tracker to help us remember specifics about the problem. Mojca ___ 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://tex.aanhet.net archive : http://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___
Re: [NTG-context] TikZ and wrong drawing order
On 6/12/2015 12:28 AM, Mojca Miklavec wrote: On Thu, Jun 11, 2015 at 11:12 PM, Hans Hagen wrote: On 6/11/2015 7:27 PM, Mojca Miklavec wrote: \usemodule [tikz] \definesymbol[1] [{\tikz\shade[shading=ball,ball color=blue] (0,0) circle (.2cm);}] \startreusableMPgraphic{bullet} fill fullcircle scaled (1EmWidth) withshademethod "circular" withcolor red shadedinto blue ; \stopreusableMPgraphic \definesymbol[1]{\reuseMPgraphic{bullet}} Thank you. But TikZ simply delivers a "superior" result in this case (= better tuned). We should figure out how exactly the shading is done there (it's slightly eccentric etc.) and try to prepare a macro for metafun that delivers the same result (or at least a compatible one) with an input of a single colour as a parameter. Most shades look ugly and useless to me anyway but you have more control than you think (always had but nicer interfaced in mpiv): \startMPpage fill fullcircle scaled 10cm withshademethod "circular" withshadevector (5cm,1cm) withshadecenter (.1,.5) withshadedomain (.2,.6) withshadefactor 1.2 withshadecolors (red,green) ; \stopMPage Of course you need to play with the values as there is no 'best' combination. Hans - Hans Hagen | PRAGMA ADE Ridderstraat 27 | 8061 GH Hasselt | The Netherlands tel: 038 477 53 69 | voip: 087 875 68 74 | www.pragma-ade.com | 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://tex.aanhet.net archive : http://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___
Re: [NTG-context] TikZ and wrong drawing order
On Thu, Jun 11, 2015 at 11:12 PM, Hans Hagen wrote: > On 6/11/2015 7:27 PM, Mojca Miklavec wrote: >> >> \usemodule >> [tikz] >> >> \definesymbol[1] >> [{\tikz\shade[shading=ball,ball color=blue] (0,0) circle (.2cm);}] > > > \startreusableMPgraphic{bullet} > fill fullcircle > scaled (1EmWidth) > withshademethod "circular" > withcolor red shadedinto blue ; > \stopreusableMPgraphic > > \definesymbol[1]{\reuseMPgraphic{bullet}} Thank you. But TikZ simply delivers a "superior" result in this case (= better tuned). We should figure out how exactly the shading is done there (it's slightly eccentric etc.) and try to prepare a macro for metafun that delivers the same result (or at least a compatible one) with an input of a single colour as a parameter. Mojca ___ 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://tex.aanhet.net archive : http://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___
Re: [NTG-context] TikZ and wrong drawing order
On 6/11/2015 10:14 PM, Mojca Miklavec wrote: On Thu, Jun 11, 2015 at 7:59 PM, Aditya Mahajan wrote: On Thu, 11 Jun 2015, Mojca Miklavec wrote: Hi, I would like to ask for help for either finding a fix or some clever workaround for the following problem. If I use a TikZ picture as item symbol and additionally use background text, then the first symbol in itemize environment gets covered by the background. Here's an example: \usemodule [tikz] \definesymbol[1] [{\tikz\shade[shading=ball,ball color=blue] (0,0) circle (.2cm);}] \definecolor [backcol] [s=1,a=1,t=0.1] \starttext \startframedtext[width=4cm,background=color,backgroundcolor=backcol] \startitemize \item one \item two \item three \stopitemize \stopframedtext \stoptext Workaround (though I have no idea why this should work). Does it also work if you use the following? \definecolor [backcol] [s=1,a=1,t=0.95] Use background={foreground,color} I wanted to test background={color, foreground}, but wrote the above by mistake and it works!!! While it works in the sense that it gives a consistent look, it doesn't really lead to the desired result, at least not for me. The reason for using background colour in my case was to make text "visible" on a dark background photo. It doesn't really help if the main text gets hidden behind the semi-transparent layer. Unless you get different results than I do. i suppose that tikz puts some pdf code in the output stream and this is likely to interfere with the way context deals with colors a solution is: {\red x\dontleavehmode\forcecolorhack\tikz\fill[color=blue] (0,0) circle (.2cm);x} the \forcecolorhack is, well, a hack that fools the optimizer and \dontleavehmode is needed to get tex in the right mode i have no time to look into the internals of tikz to see if a different trick is possible Hans - Hans Hagen | PRAGMA ADE Ridderstraat 27 | 8061 GH Hasselt | The Netherlands tel: 038 477 53 69 | voip: 087 875 68 74 | www.pragma-ade.com | 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://tex.aanhet.net archive : http://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___
Re: [NTG-context] TikZ and wrong drawing order
On 6/11/2015 7:27 PM, Mojca Miklavec wrote: Hi, I would like to ask for help for either finding a fix or some clever workaround for the following problem. If I use a TikZ picture as item symbol and additionally use background text, then the first symbol in itemize environment gets covered by the background. Here's an example: \usemodule [tikz] \definesymbol[1] [{\tikz\shade[shading=ball,ball color=blue] (0,0) circle (.2cm);}] \startreusableMPgraphic{bullet} fill fullcircle scaled (1EmWidth) withshademethod "circular" withcolor red shadedinto blue ; \stopreusableMPgraphic \definesymbol[1]{\reuseMPgraphic{bullet}} - Hans Hagen | PRAGMA ADE Ridderstraat 27 | 8061 GH Hasselt | The Netherlands tel: 038 477 53 69 | voip: 087 875 68 74 | www.pragma-ade.com | 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://tex.aanhet.net archive : http://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___
Re: [NTG-context] TikZ and wrong drawing order
On Thu, Jun 11, 2015 at 7:59 PM, Aditya Mahajan wrote: > On Thu, 11 Jun 2015, Mojca Miklavec wrote: > >> Hi, >> >> I would like to ask for help for either finding a fix or some clever >> workaround for the following problem. >> >> If I use a TikZ picture as item symbol and additionally use background >> text, then the first symbol in itemize environment gets covered by the >> background. Here's an example: >> >> \usemodule >>[tikz] >> >> \definesymbol[1] >>[{\tikz\shade[shading=ball,ball color=blue] (0,0) circle (.2cm);}] >> >> \definecolor >>[backcol] >>[s=1,a=1,t=0.1] >> >> \starttext >> >> \startframedtext[width=4cm,background=color,backgroundcolor=backcol] >> \startitemize >> \item one >> \item two >> \item three >> \stopitemize >> \stopframedtext >> >> \stoptext > > > Workaround (though I have no idea why this should work). Does it also work if you use the following? \definecolor [backcol] [s=1,a=1,t=0.95] > Use > >background={foreground,color} > > I wanted to test background={color, foreground}, but wrote the above by > mistake and it works!!! While it works in the sense that it gives a consistent look, it doesn't really lead to the desired result, at least not for me. The reason for using background colour in my case was to make text "visible" on a dark background photo. It doesn't really help if the main text gets hidden behind the semi-transparent layer. Unless you get different results than I do. Mojca ___ 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://tex.aanhet.net archive : http://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___
Re: [NTG-context] TikZ and wrong drawing order
On Thu, 11 Jun 2015, Mojca Miklavec wrote: Hi, I would like to ask for help for either finding a fix or some clever workaround for the following problem. If I use a TikZ picture as item symbol and additionally use background text, then the first symbol in itemize environment gets covered by the background. Here's an example: \usemodule [tikz] \definesymbol[1] [{\tikz\shade[shading=ball,ball color=blue] (0,0) circle (.2cm);}] \definecolor [backcol] [s=1,a=1,t=0.1] \starttext \startframedtext[width=4cm,background=color,backgroundcolor=backcol] \startitemize \item one \item two \item three \stopitemize \stopframedtext \stoptext Workaround (though I have no idea why this should work). Use background={foreground,color} I wanted to test background={color, foreground}, but wrote the above by mistake and it works!!! 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://tex.aanhet.net archive : http://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___
[NTG-context] TikZ and wrong drawing order
Hi, I would like to ask for help for either finding a fix or some clever workaround for the following problem. If I use a TikZ picture as item symbol and additionally use background text, then the first symbol in itemize environment gets covered by the background. Here's an example: \usemodule [tikz] \definesymbol[1] [{\tikz\shade[shading=ball,ball color=blue] (0,0) circle (.2cm);}] \definecolor [backcol] [s=1,a=1,t=0.1] \starttext \startframedtext[width=4cm,background=color,backgroundcolor=backcol] \startitemize \item one \item two \item three \stopitemize \stopframedtext \stoptext Thank you, Mojca test.pdf Description: Adobe PDF document ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context webpage : http://www.pragma-ade.nl / http://tex.aanhet.net archive : http://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___