* (no subject) @ 2020-04-19 4:53 Jairo A. del Rio 2020-04-19 5:15 ` Fwd: Adding optional enumeration text to framed enumeration header Jairo A. del Rio 0 siblings, 1 reply; 3+ messages in thread From: Jairo A. del Rio @ 2020-04-19 4:53 UTC (permalink / raw) To: mailing list for ConTeXt users [-- Attachment #1.1: Type: text/plain, Size: 535 bytes --] I've seen the following solution in Stack Exchange to add referenceable enumeration labels to a framed enumeration environment: https://tex.stackexchange.com/questions/438588/context-and-metafun-framed-enumeration-with-counter-as-part-of-overlay It uses \wrappedcurrentconstruction. However, it only prints the counter label and the counter name. What if I need the text enclosed by braces in the frame header too? E. g. \starttheorem[thm1]{Residue theorem} so the framed title includes "Residue theorem" also. Thank you in advance. [-- Attachment #1.2: Type: text/html, Size: 766 bytes --] [-- Attachment #2: Type: text/plain, Size: 493 bytes --] ___________________________________________________________________________________ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context webpage : http://www.pragma-ade.nl / http://context.aanhet.net archive : https://bitbucket.org/phg/context-mirror/commits/ wiki : http://contextgarden.net ___________________________________________________________________________________ ^ permalink raw reply [flat|nested] 3+ messages in thread
* Fwd: Adding optional enumeration text to framed enumeration header 2020-04-19 4:53 (no subject) Jairo A. del Rio @ 2020-04-19 5:15 ` Jairo A. del Rio 2020-04-19 5:59 ` Aditya Mahajan 0 siblings, 1 reply; 3+ messages in thread From: Jairo A. del Rio @ 2020-04-19 5:15 UTC (permalink / raw) To: mailing list for ConTeXt users [-- Attachment #1.1: Type: text/plain, Size: 810 bytes --] Sorry, I resend my question because I forgot the subject ---------- Forwarded message --------- De: Jairo A. del Rio <jairoadelrio6@gmail.com> Date: sáb., 18 de abr. de 2020 a la(s) 23:53 Subject: To: mailing list for ConTeXt users <ntg-context@ntg.nl> I've seen the following solution in Stack Exchange to add referenceable enumeration labels to a framed enumeration environment: https://tex.stackexchange.com/questions/438588/context-and-metafun-framed-enumeration-with-counter-as-part-of-overlay It uses \wrappedcurrentconstruction. However, it only prints the counter label and the counter name. What if I need the text enclosed by braces in the frame header too? E. g. \starttheorem[thm1]{Residue theorem} so the framed title includes "Residue theorem" also. Thank you in advance. [-- Attachment #1.2: Type: text/html, Size: 1336 bytes --] [-- Attachment #2: Type: text/plain, Size: 493 bytes --] ___________________________________________________________________________________ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context webpage : http://www.pragma-ade.nl / http://context.aanhet.net archive : https://bitbucket.org/phg/context-mirror/commits/ wiki : http://contextgarden.net ___________________________________________________________________________________ ^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: Fwd: Adding optional enumeration text to framed enumeration header 2020-04-19 5:15 ` Fwd: Adding optional enumeration text to framed enumeration header Jairo A. del Rio @ 2020-04-19 5:59 ` Aditya Mahajan 0 siblings, 0 replies; 3+ messages in thread From: Aditya Mahajan @ 2020-04-19 5:59 UTC (permalink / raw) To: mailing list for ConTeXt users On Sun, 19 Apr 2020, Jairo A. del Rio wrote: > I've seen the following solution in Stack Exchange to add referenceable > enumeration labels to a framed enumeration environment: > > https://tex.stackexchange.com/questions/438588/context-and-metafun-framed-enumeration-with-counter-as-part-of-overlay > > It uses \wrappedcurrentconstruction. However, it only prints the counter > label and the counter name. What if I need the text enclosed by braces in > the frame header too? E. g. \starttheorem[thm1]{Residue theorem} so the > framed title includes "Residue theorem" also. Thank you in advance. It works out of the box but you have to enable enumeration titles using `title=yes` key while defining the enumeration... \startuseMPgraphic{FunnyFrame} picture p ; numeric w, h, o ; p := textext.rt("\wrappedcurrentconstruction"); w := OverlayWidth ; h := OverlayHeight ; o := BodyFontSize ; p := p shifted (2o,h-ypart center p); draw p ; path b; b := boundingbox p enlarged (o/10); drawoptions (withpen pencircle scaled 1pt withcolor .625red) ; draw (2o,h)--(0,h)--(0,0)--(w,0)--(w,h)--(xpart urcorner b,h) ; draw b; setbounds currentpicture to OverlayBox ; \stopuseMPgraphic \defineoverlay[FunnyFrame][\useMPgraphic{FunnyFrame}] \defineframedtext [FunnyFramedText] [ frame=off, background=FunnyFrame, offset=\bodyfontsize, width=\textwidth, ] \defineenumeration[Counter] [ title=yes, alternative=empty, before=\startFunnyFramedText, after=\stopFunnyFramedText, ] \starttext \startCounter[title={Residue Theorem}] Coming back to the use of typefaces in electronic publishing: many of the new typographers receive their knowledge and information about the rules of typography from books, from computer magazines or the instruction manuals which they get with the purchase of a PC or software. \stopCounter \startCounter Coming back to the use of typefaces in electronic publishing: many of the new typographers receive their knowledge and information about the rules of typography from books, from computer magazines or the instruction manuals which they get with the purchase of a PC or software. \stopCounter \stoptext Aditya ___________________________________________________________________________________ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context webpage : http://www.pragma-ade.nl / http://context.aanhet.net archive : https://bitbucket.org/phg/context-mirror/commits/ wiki : http://contextgarden.net ___________________________________________________________________________________ ^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2020-04-19 5:59 UTC | newest] Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed) -- links below jump to the message on this page -- 2020-04-19 4:53 (no subject) Jairo A. del Rio 2020-04-19 5:15 ` Fwd: Adding optional enumeration text to framed enumeration header Jairo A. del Rio 2020-04-19 5:59 ` Aditya Mahajan
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox; as well as URLs for NNTP newsgroup(s).