[NTG-context] background= key not working in \startbackground and \starttextbackground
Hi, I am testing some of my old styles on latest context and find that the background key of \startbackground and \starttextbackground doesn't work (\framed is working as expected). Here is a MWE: \startuseMPgraphic{background:test} fill OverlayBox withcolor 0.75[red,white]; draw OverlayBox withcolor red withpen pencircle scaled 2bp; \stopuseMPgraphic \defineoverlay[background:test][\useMPgraphic{background:test}] \definetextbackground [testA] [ location=paragraph, background=background:test, frame=off, ] \definebackground [testB] [ location=paragraph, background=background:test, frame=off, ] \defineframedtext [testC] [ background=background:test, frame=off, width=broad, ] \starttext \starttestA \input tufte \stoptestA \starttestB \input tufte \stoptestB \starttestC \input tufte \stoptestC \stoptext testA gives nothing, testB gives a gray(!) background, and testC works as expected. The output is attached. I am using 2024.05.31. Aditya 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: Why is only the first frame protruding into the margin?
On 5/17/24 11:02, madiazm.eo...@gmail.com wrote: > thanks Wolfgang for your advice and sorry for being so verbose, but > since the margins are "included" in the problem I decided to put my > layout there too. > > I made your suggested changes and unfortunately it doesnt work, but > being a bit surprised by the margins I printed a copy of the page > and still worse... Hi Miguel, this should work (also in the sense of a minimal sample): \showframe\showgrid \defineframedtext[FunnyText] [frame=on, align=flushright,location=right] \def\FrameTitle#1% {\setMPtext{FunnyFrame} {\hbox spread 1em{\hss\strut \color[blue]{\tfx Apartado #1}\hss}}} \define[2]\firstHeadings{% \dontleavehmode \switchtobodyfont[miCorm]% \FrameTitle#1% \startFunnyText {\switchtobodyfont[miCorm,20.7pt] #2} \stopFunnyText} \setuphead [section] [command=\firstHeadings, indentnext=no] \starttext \startsection[title=a] b \stopsection \startsection[title=a] b \stopsection \startsection[title=a] b \stopsection \stoptext BTW, you inadvertely introduce the space here: \define[2]\firstHeadings{% \dontleavehmode \switchtobodyfont[miCorm]% \FrameTitle#1% Unless you comment the space after the right bracket, it will be included in your definition of first headings. As for external downloads, better avoid unless required. In any case, the minimal code should be part of your message. Just in case 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 / 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: Why is only the first frame protruding into the margin?
madiazm.eo...@gmail.com schrieb am 17.05.2024 um 00:05: Hi, I used some code from the meta-fun manual to recreate a labelled frame around my sections. But the first framedtext protrudes a couple of mm into the margin. Only the first one in the page. I intentionaly added other sections and the frames aline to the margin ok. I tried to put something before the first frame (noindentation, dontleavehmode) because I sometimes read it solves problems, but not the case here. so Why is the first frame protruding and only the first? [...] Include only setups in your examples which are necessary to show the problem, the custom layout isn't necessary and can be left out. \startuseMPgraphic{FunnyFrame} picture p ; numeric w, h, o ; p := textext.rt(\MPstring{FunnyFrame}) ; w := OverlayWidth ; h := OverlayHeight ; o := BodyFontSize ; p := p shifted (2o,h-ypart center p) ; draw p ; drawoptions (withpen pencircle scaled .25pt withcolor blue) ; draw (2o,h)--(0,h)--(0,0)--(w,0)--(w,h)--(xpart urcorner p,h) ; %draw boundingbox p ; %%%quitamos el frame pequeño setbounds currentpicture to unitsquare xyscaled(w,h) ; \stopuseMPgraphic \defineoverlay[FunnyFrame][\useMPgraphic{FunnyFrame}] \defineframedtext[FunnyText][width=.85\textwidth, height=20mm, frame=off, background=FunnyFrame, align=flushright,location=right, after={\blank[2*big]}]%foregroundsytel amplía la palabra Apartado \def\FrameTitle#1% {\setMPtext{FunnyFrame}{\hbox spread 1em{\hss\strut \color[blue]{\tfx Apartado #1}\hss}}} \setMPtext{FunnyFrame}{} % initialize the text variable \define[2]\firstHeadings{% \dontleavehmode \switchtobodyfont[miCorm] \FrameTitle#1% \dontleavehmode \startFunnyText {\switchtobodyfont[miCorm,20.7pt] #2} \stopFunnyText } \setuphead [section] [color=blue, command=\firstHeadings, indentnext=no] Get rid of \dontleavehmode in your custom section layout, avoid blank lines in definitions and move the font changes to \setuphead. \define[2]\firstHeadings {\FrameTitle{#1}% \startFunnyText #2% \stopFunnyText} \setuphead [section] [color=blue, style={\switchtobodyfont[miCorm]}, textstyle={\switchtobodyfont[20.7pt]}, command=\firstHeadings, indentnext=no] \startsection[title=Aspectos generales] Esta guía contiene toda la documentación necesaria para administrar la prueba unificada de certificación que ha diseñado la comisión de alemán. Se ruega al profesorado\footnote{Todas las alusiones a la forma del masculino genérico que se recogen en este documento deberán entenderse referidas a la condición masculina o femenina de cada persona según corresponda.} que se familiarice con las secciones del documento a través del índice y acuda a ellas según vaya siendo necesario, de manera que se pueda administrar y corregir la prueba de la manera más satisfactoria posible. \stopsection Use dummy text when it possible to keep the example short and clean. \startsection[title=Aspectos generales] \samplefile{lorem} \stopsection 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] Why is only the first frame protruding into the margin?
Hi, I used some code from the meta-fun manual to recreate a labelled frame around my sections. But the first framedtext protrudes a couple of mm into the margin. Only the first one in the page. I intentionaly added other sections and the frames aline to the margin ok. I tried to put something before the first frame (noindentation, dontleavehmode) because I sometimes read it solves problems, but not the case here. so Why is the first frame protruding and only the first? \definepapersize[vertical][A4, portrait] \definepapersize[horizontal][A4, landscape] \setuppapersize[vertical] \setuplayout[location=middle, marking=off, topspace=1cm, topdistance=0cm, backspace=2.5cm, height=fit, width=fit, rightedge=5mm, rightedgedistance=0cm, rightmargin=20mm, rightmargindistance=7mm, leftmargin=1.5cm, header=1cm, headerdistance=.5cm, bottomspace=.5cm, bottomdistance=0mm, footer=.8cm, footerdistance=.2cm, setup=strict,] \startuseMPgraphic{FunnyFrame} picture p ; numeric w, h, o ; p := textext.rt(\MPstring{FunnyFrame}) ; w := OverlayWidth ; h := OverlayHeight ; o := BodyFontSize ; p := p shifted (2o,h-ypart center p) ; draw p ; drawoptions (withpen pencircle scaled .25pt withcolor blue) ; draw (2o,h)--(0,h)--(0,0)--(w,0)--(w,h)--(xpart urcorner p,h) ; %draw boundingbox p ; %%%quitamos el frame pequeño setbounds currentpicture to unitsquare xyscaled(w,h) ; \stopuseMPgraphic \defineoverlay[FunnyFrame][\useMPgraphic{FunnyFrame}] \defineframedtext[FunnyText][width=.85\textwidth, height=20mm, frame=off, background=FunnyFrame, align=flushright,location=right, after={\blank[2*big]}]%foregroundsytel amplía la palabra Apartado \def\FrameTitle#1% {\setMPtext{FunnyFrame}{\hbox spread 1em{\hss\strut \color[blue]{\tfx Apartado #1}\hss}}} \setMPtext{FunnyFrame}{} % initialize the text variable \define[2]\firstHeadings{% \dontleavehmode \switchtobodyfont[miCorm] \FrameTitle#1% \dontleavehmode \startFunnyText {\switchtobodyfont[miCorm,20.7pt] #2} \stopFunnyText } \setuphead [section] [color=blue, command=\firstHeadings, indentnext=no] \starttext \noindentation \dontleavehmode \startsection[title=Aspectos generales] Esta guía contiene toda la documentación necesaria para administrar la prueba unificada de certificación que ha diseñado la comisión de alemán. Se ruega al profesorado\footnote{Todas las alusiones a la forma del masculino genérico que se recogen en este documento deberán entenderse referidas a la condición masculina o femenina de cada persona según corresponda.} que se familiarice con las secciones del documento a través del índice y acuda a ellas según vaya siendo necesario, de manera que se pueda administrar y corregir la prueba de la manera más satisfactoria posible. \stopsection \startsection[title=another section] Las carpetas con las pruebas aparecen nombradas por idioma, nivel y set de pruebas, no apareciendo ninguna referencia a convocatorias anuales ni tampoco fechas. Sí aparece la referencia a la convocatoria en cada una de las guías de administración para los diferentes niveles. \stopsection \startsection[title=another section] La carpeta correspondiente a cada nivel contiene las distintas actividades de lengua, los audios para CTO y el audio/vídeo base para la mediación escrita. Además contiene esta guía con la información necesaria para tener una visión global de la prueba: los solucionarios, transcripciones, tablas de corrección, tablas de conversión y la rúbrica para la mediación escrita. Igualmente se incorporarán o enlazarán subcarpetas con los archivos necesarios para las pruebas orales: monólogos, diálogos y mediaciones orales. \stopsection \stoptext ___ 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: Why Difference Between \placefloat and \definefloat
urba...@ca.rr.com schrieb am 28.04.2024 um 19:54: I swear I used to understand this stuff. I plead old age. Why do I get two different results from the float placements here: \definefloat[mysidebar][mysidebars] \setupfloat[mysidebar][leftmargindistance=-.25in,rightmargindistance=-.25in,outer,none] 1. You can't pass assignments and keywords to the same argument. 2. The \setupfloat command accepts only assignments as arguments, this means "outer" and "none" are ignored. To set a default location for the float use \setupfloat[...][default={outer,none}] \defineframedtext [sidebartext] [width=.4\textwidth,bodyfont=small,corner=round,background=color,backgroundcolor=lightgray,align=flushleft] \starttext This is a bit of text \placefloat[sidebar][leftmargindistance=-.25in,rightmargindistance=-.25in,outer,none]{}{ 1. You're again passing assignments and keywords with a single argument. 2. The \placefloat commands accepts only keywords and ignores all assignments, this means your distance settings have no effect. 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: Why Difference Between \placefloat and \definefloat
I don't think that 'sidebar' has much to do with it. The part that is not working as expected is the 'mysidebar', which is not getting the 'outer' location, nor the 'none' captioning that I get with placefloat. setupfloat[mysidebar][leftmargindistance=-.25in,rightmargindistance=-.25in,outer,none] defineframedtext [sidebartext] [width=.4textwidth,bodyfont=small,corner=round,background=color,backgroundcolor=lightgray,align=flushleft] starttext This is a bit of text placefloat[newsidebar][leftmargindistance=-.25in,rightmargindistance=-.25in,outer,none]{}{ startsidebartext This is a short sidebar stopsidebartext } And something to follow. A bit of text placemysidebar{}{ startsidebartext This is a short sidebar stopsidebartext } And something to follow. stoptext ___ 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: Why Difference Between \placefloat and \definefloat
Where’s the float type "sidebar" defined? AFAIK it’s not a default type. And it might interfere with the actual sidebar stuff from https://source.contextgarden.net/tex/context/base/mkxl/anch-bar.mkxl, see also https://wiki.contextgarden.net/Command/setupsidebar Hraban Am 28.04.24 um 19:54 schrieb urba...@ca.rr.com: I swear I used to understand this stuff. I plead old age. Why do I get two different results from the float placements here: \definefloat[mysidebar][mysidebars] \setupfloat[mysidebar][leftmargindistance=-.25in,rightmargindistance=-.25in,outer,none] \defineframedtext [sidebartext] [width=.4\textwidth,bodyfont=small,corner=round,background=color,backgroundcolor=lightgray,align=flushleft] \starttext This is a bit of text \placefloat[sidebar][leftmargindistance=-.25in,rightmargindistance=-.25in,outer,none]{}{ \startsidebartext This is a short sidebar \stopsidebartext } And something to follow. A bit of text \placemysidebar{}{ \startsidebartext This is a short sidebar \stopsidebartext } And something to follow. \stoptext ___ 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] Why Difference Between \placefloat and \definefloat
I swear I used to understand this stuff. I plead old age. Why do I get two different results from the float placements here: definefloat[mysidebar][mysidebars] setupfloat[mysidebar][leftmargindistance=-.25in,rightmargindistance=-.25in,outer,none] defineframedtext [sidebartext] [width=.4textwidth,bodyfont=small,corner=round,background=color,backgroundcolor=lightgray,align=flushleft] starttext This is a bit of text placefloat[sidebar][leftmargindistance=-.25in,rightmargindistance=-.25in,outer,none]{}{ startsidebartext This is a short sidebar stopsidebartext } And something to follow. A bit of text placemysidebar{}{ startsidebartext This is a short sidebar stopsidebartext } And something to follow. stoptext ___ 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] multicolumn title and abstact (bachotex) using tugboat.mkxl
Hello, I am currently writing my paper for last year's BachoTeX proceedings. I am using tugboat.mkxl module to design the layout. In bachotex proceedings, the author's data and abstract are on a single column and the article is usually typeset on two columns. Comments in tugboat.mkxl states: %D We have several column mechanisms and they all serve a different purpose. Here we %D use pagecolumns. They support much of what we can do in single columns, but of %D course there are exceptions. Floats can go into columns of aremoved to the top or %D bottom when there is no room. We don't span mid column. Notes can go in columns %D or at the end. We can start with a single column (for titles and such). I can't figure out which part of the file should be used/adapted to start with a single column. What I did is to put datas and abstract in a frame and use \placefigure. As stated in pagecolumns manual, everything is put on the top of next page. (BTW, there is a typo: «of aremoved») I don't know, whether this MWE helps is relevant, but just in case, here is what I did: * copy tugboat.mkxl to a new file p-bachotex.mkxl * changed p-bachotex.mkxl like this: \startsetups bachotex:naglowek:columns \defineframedtext [Dane] \setupframedtext [Dane] [width=18cm , align=normal, frame=no] \definenarrower [Streszczenia] [2*middle] \startplacefigure [location={here,none}] {\startDane {\tfa\getvariable{tugboat}{author}}\par \getvariable{tugboat}{address}\par {\tt\getvariable{tugboat}{email}}\par \startStreszczenia \doifelsebufferempty {abstract} { % no abstract } { \blank[line] \enforced\let\\\endgraf \setups[tugboat:abstract:setup] \startAbstracts[title={Abstract}] \stopAbstracts } \stopStreszczenia \stopDane} \stopplacefigure \stopsetups \startsetups tugboat:article:start \starttext \setups{tugboat:columns:presets} \setups{tugboat:banner:setup:\getvariable{tugboat}{type}} \setupheadertexts [\setups{tugboat:banner:text:article}] [pagenumber] \setuppagenumber [number=\getvariable{tugboat}{page}] \startmode[columns] \startpagecolumns \stopmode \setups[tugboat:introduction:article] \doifmodeelse{columns}{ \setups{bachotex:naglowek:columns} } { \setups{bachotex:naglowek:nocolumns} } \stopsetups My article begins so: \enablemode [columns] \usemodule [bachotex] % skipped tugboat variables for this MWE \StartAbstract \input tufte \StopAbstract \StartArticle \input knuth \StopArticle Thank you for your help Damien T ___ 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] Wiki page : Mixed languages sample (French, Ancient Greek, Arabic, Chinese)
Dear List, Several years ago I tried to write documents, mainly lectures, but also essays, in which I tried to make several languages (Romance and non-Romance) coexist. Here below is an example of an attempt to compose an acceptable document, in the form of an exercise in which Arabic and Chinese are introduced into a document written in French. With footnotes and a few framed lines. I submit this example for your perusal and ask you whether it could possibly appear on a wiki page devoted to the combination of non-European languages in the same text. In English translation, of course. %We are giving below an example of a text written in a Latin language, in which we want to print here and there some text in ancient Greek, Arabic and Chinese. \setuplanguage[fr][patterns={fr,agr}] \mainlanguage[fr] \setuplayout [backspace=40mm] \setuppagenumbering[alternative=doublesided, location={header, inmargin}] \setupmargindata[inmargin][location=inner, style={\ssx\setupinterlinespace[line=2.8ex]}] \setupmarginframed[inmargin][align=right] \setupbodyfontenvironment[default][em=italic] % Use Theano Didot as Ancient Greek font \definefallbackfamily[mainface][serif][Theano Didot][preset=range:greek, it={Old Standard Italic}, force=yes] % Choose between Ipaexmincho font and NotoSansTC (Traditional Chinese) %\definefallbackfamily [mainface] [rm] [ipaexmincho] [range=cjkunifiedideographs] \definefallbackfamily [mainface] [rm] [notosanstc] [range=cjkunifiedideographs] % Choose between two Arabic fonts %\definefallbackfamily[mainface] [serif] [nafeesnastaleeq] [range=arabic] \definefallbackfamily[mainface] [serif] [hussaininastaleeq] [range=arabic] \definefontfamily [mainface] [serif] [GaramondNo8][sc=NewG8 Regular SC] \definefontfamily [mainface] [sans] [FreeSans] [rscale=0.7] \definefontfamily[mainface] [serif] [GFS Didot] \setupbodyfont[mainface] \setupindenting[1.5em] \setupindenting[yes] \setupcolors[state=start] \defineframedtext [MyFrame] [before={\blank}, after={\blank}, frame=off, background=MyFrame, %width=\textwidth, width=max, height=fit, style=italic] \definelabel [Définition] [headstyle=\bf\smallcaps] \startuseMPgraphic{MyFrame} path b; picture p; %p := textext.rt("\white\Définition"); p := textext.rt("\white\framedtextparameter{Title}"); %p := textext.rt("\white\getvariable{text}{text1}"); p := p shifted (2BodyFontSize,OverlayHeight-ypart center p+.25ExHeight); b := boundingbox p leftenlarged .5EmWidth rightenlarged .5EmWidth; fill OverlayBox withcolor lightgray; %\MPcolor{ fill b withcolor darkred; draw bottomboundary OverlayBox withpen pencircle scaled 1pt withcolor darkred; draw topboundary OverlayBox withpen pencircle scaled 1pt withcolor darkred; draw p; setbounds currentpicture to boundingbox currentpicture enlarged 2mm; \stopuseMPgraphic \defineoverlay [MyFrame] [\useMPgraphic{MyFrame}] \setupwhitespace[medium] \setupinterlinespace[line=3.2ex] \setupitemize[each][margin=yes] \setuphead[title][header=empty] \setupheader[style={\sc}] \setupfooter[style={\itxx}] \setupheadertexts[Utilisation de plusieurs langues dans un même texte avec \ConTeXt][][][{\getmarking[section]}] \setupfootertexts[][][][© J.-P. Delange, 2016 — La reproduction de ce texte est soumise à autorisation.] \defineparagraphs[TwoColumns][n=2, align={hz, hanging}] \setupparagraphs[TwoColumns][1][width=210pt, style=rm, align=left] \starttext \title{\ConTeXt, ou comment imprimer des langues non-romanes} \section {\sc Préambule} Lorsqu'il s'agit de proposer un document dans une langue nationale (le français), tout va bien. Lorsqu'il s'agit de rédiger en français un document un peu complexe, avec des citations — ou des références — dans une autre langue, qui en particulier n'a pas les mêmes exigences que le français, ni les mêmes {\em signes diacritiques} on se heurte à quelques difficultés. Les suites logicielles comme Microsoft Office ou LibreOffice ne manquent pas de puissance, mais à vrai dire, dès que nous entrons dans les exigences de l'édition professionnelle, qui consistent à présenter un texte lisible et enrichi (en notes, etc.), la situation devient vite techniquement assez pénible. La situation la plus courante que nous rencontrons dans les Lettres, en Philosophie, en Histoire, et plus généralement dans les Humanités, est celle d'un texte dans lequel il y a des citations d'auteurs grecs ou latin, avec des références en notes de bas de page, qui contiennent du grec. Cela pourrait être quelque chose comme ceci : \blank\startnarrower[1*left,1*right]\tfx\setupinterlinespace \noindent \quotation{Ἔφη γάρ οἱ Σωκράτη ἐντυχεῖν λελουμένον τε καὶ τὰς βλαύτας ὑποδεδεμένον, ἃ ἐκεῖνος ὀλιγάκις ἐποίει· καὶ ἐρέσθαι αὐτὸν ὅποι ἴοι οὕτω καλὸς γεγενημένος. καὶ τὸν εἰπεῖν ὅτι· Ἐπὶ δεῖπνον εἰς Ἀγάθωνος. χθὲς γὰρ αὐτὸν διέφυγον τοῖς ἐπινικίοις, φοβηθεὶς τὸν ὄχλον· ὡμολόγησα δ᾽ εἰς τήμερον παρέσεσθα
[NTG-context] About framedtext
Hi, Is this a bug or not ? The key to coloring the background of the text seems to no longer work. Thanks Fabrice \definecolor[MyColorC][s=0.8784] \definecolor[MyColorD][m=0.27,y=1] \definecolor[ColorA][0.8(white)] \definecolor[MyColorB][c=0.00, m=0.62, y=1.00, k=0.00] \definecolor[MyColorA][.75(MyColorB,white)] \defineframed [FrameTitle] [frame=off, foregroundstyle=\bfx\ss, foregroundcolor=white, background=color, backgroundcolor=MyColorD, location=depth] \defineframedtext [FramedText] [offset=0.25em, style=\ss, toffset=\zeropoint, background=color, backgroundcolor=MyColorA, foregroundstyle={\switchtobodyfont[9pt]}, align={right, broad}, frame=off, corner=00, radius=0.5em, width=10cm] \definedescription [Info] [before=, after=, text=Info, title=no, width=fit, distance=0.5em, headcommand=\FrameTitle, alternative=serried] \starttext \startFramedText[width=5cm] \startInfo \input{ward} \stopInfo \stopFramedText \stoptext ___ 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: Framed Text with Chapter Numbers as Counter
That works fine except that the following line does only issue the sequential number and not the chapter number. Refer to \in{code fragment}[tit1] bla MWE: \startuseMPgraphic{CountFrame} 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); path a; a := (2o,h)--(0,h)--(0,0)--(w,0)--(w,h)--(xpart urcorner b,h); drawoptions (withpen pencircle scaled 1pt withcolor black); draw a; draw b; setbounds currentpicture to OverlayBox; \stopuseMPgraphic \defineoverlay [CountFrame] [\useMPgraphic{CountFrame}] \defineframedtext [CountFramedText] [frame=off, background=CountFrame, offset=\bodyfontsize, width=\textwidth, % style={\switchtobodyfont[11pt,tt]}] bodyfont=11pt, style={\tt}] \defineenumeration [Code] [title=yes, alternative=empty, before=\startCountFramedText, after=\stopCountFramedText, left={\somenamedheadnumber{chapter}{current}.}] \starttext \startchapter [title=first] \startCode [title={The First Title}, reference={tit1}] Some verbatim text \stopCode \startCode [title={The Second Title}, reference={tit2}] Some verbatim text \stopCode Refer to \in{code fragment}[tit1] bla \stopchapter \startchapter [title=second] \startCode [title={The Third Title}, reference={tit3}] Some verbatim text \stopCode \stopchapter \stoptext Op zo 17 sep 2023 om 17:31 schreef Bruce Horrocks : > > > > On 16 Sep 2023, at 21:28, Jeroen wrote: > > > > This MWE has a framed text for some verbatim text (code) with as title > ref. a counter 1, 2, etc.. Is there a way to change this frame text title > as following with the chapter number and a sequential number and the title. > > Amemd the \defineenumeration as follows: > > \defineenumeration > [Counter] > [title=yes, >alternative=empty, >before=\startCountFramedText, >after=\stopCountFramedText, >left={\somenamedheadnumber{chapter}{current}:}] > > — > Bruce Horrocks > Hampshire, UK > > > ___ > 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 > > ___ ___ 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] Framed Text with Chapter Numbers as Counter
This MWE has a framed text for some verbatim text (code) with as title ref. a counter 1, 2, etc.. Is there a way to change this frame text title as following with the chapter number and a sequential number and the title. Code Fragment 1.1 (The First Title) Code Fragment 1.2 (The Second Title) Code Fragment 2.1 (The Third Title) MWE: \startuseMPgraphic{CountFrame} 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 black); draw (2o,h)--(0,h)--(0,0)--(w,0)--(w,h)--(xpart urcorner b,h); draw b; setbounds currentpicture to OverlayBox; \stopuseMPgraphic \defineoverlay [CountFrame] [\useMPgraphic{CountFrame}] \defineframedtext [CountFramedText] [frame=off, background=CountFrame, offset=\bodyfontsize, width=\textwidth, % style={\switchtobodyfont[11pt,tt]}] bodyfont=11pt, style={\tt}, ] \def\FrameTitle#1% {\setMPtext{CountFrame} {\hbox spread 1em{\hss\strut#1\hss}}}\setMPtext{CountFrame} {} \defineenumeration [Counter] [title=yes, alternative=empty, before=\startCountFramedText, after=\stopCountFramedText] \starttext \startchapter [title=first] \startCounter [title={The First Title}, reference={tit1}] Some verbatim text \stopCounter \startCounter [title={The Second Title}, reference={tit2}] Some verbatim text \stopCounter Refer to \in{code fragment}[tit1] bla \stopchapter \startchapter [title=second] \startCounter [title={The Third Title}, reference={tit3}] Some verbatim text \stopCounter \stopchapter \stoptext ___ 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] Verbatim Textbox with Reference NUmbering
This is a longshot, but would be great to have. Below I have at MWE1 the verbatim codefragment textbox I am using. I found in the forum MWE2 which is a textbox with an automatic reference number. Is there a way to get the same for MWE1 with automatic reference numbering like 1.1, 1.2 etc for chapter 1, codefragment 1, 2 etc. with the possibility that in the text I can refer to the codefragment like \in{codefragment\space}[code:ccpsample] similar as to tables and figures? Thanks Jeroen %% % MWE1 %% \startuseMPgraphic{mpos:par:myexample} path p; for i = 1 upto nofmultipars : p := multipars[1] topenlarged 4pt bottomenlarged 4pt cornered 2mm ; fill p withcolor 0.95white ; draw p withcolor black withpen pencircle scaled \MPvar{linewidth}; endfor; \stopuseMPgraphic \definetextbackground [listingbackground] [state=start, mp=mpos:par:myexample, location=paragraph, topoffset=0.4em, leftoffset=0em, rulethickness=0.7pt] \definetyping[Listing] [option=commands] \setuptyping [Listing] [bodyfont=10pt, margin=1em, before=% {\blank[3*medium] \setupinterlinespace[line=2.4ex] \starttextbackground[listingbackground]}, after=% {\stoptextbackground \blank[4*medium]}, align={flushleft,verytolerant}] \starttext \startListing this is a code example \stopListing \stoptext %% % MWE2 %% \startuseMPgraphic{FunnyFrame} picture p ; numeric w, h, o ; p := textext.rt(\MPstring{FunnyFrame}) ; w := OverlayWidth ; h := OverlayHeight ; o := BodyFontSize ; p := p shifted (2o,h-ypart center p) ; draw p ; drawoptions (withpen pencircle scaled 1pt withcolor .625red) ; draw (2o,h)--(0,h)--(0,0)--(w,0)--(w,h)--(xpart urcorner p,h) ; draw boundingbox p ; setbounds currentpicture to unitsquare xyscaled(w,h) ; \stopuseMPgraphic \defineoverlay[FunnyFrame][\useMPgraphic{FunnyFrame}] \defineframedtext[FunnyText][frame=off,background=FunnyFrame] \def\FrameTitle#1% {\setMPtext{FunnyFrame}{\hbox spread 1em{\hss\strut#1\hss}}} \setMPtext{FunnyFrame}{} % Add the enumeration \defineenumeration [Counter] [text=, alternative=empty, before={\FrameTitle{Counter \getnumber[Counter]} \startFunnyText}, after={\stopFunnyText}] \starttext \startCounter First example \stopCounter \startCounter Second example \stopCounter \stoptext ___ 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] Visual highlighted text with title, mix of enumeration and framedtext
On Mon, 6 Mar 2023, Henning Hraban Ramm via ntg-context wrote: > Am 06.03.23 um 12:19 schrieb Gerion Entrup via ntg-context: > > I want to typeset a "Good to know" section that is visually highlighted > > and can spawn across multiple pages. > > > > In LaTeX this would be possible with the mdframed package. See the > > attached screenshot for an example how it might look like (it is copied > > out of page 4: Definition: Inhomogeneous linear of the mdframed > > documentation: > > http://mirrors.ctan.org/macros/latex/contrib/mdframed/mdframed.pdf) > > > > I have searched in the wiki and found \defineenumeration: > > This is near of that what I need. However I explicitly does not need an > > enumeration (so no number or counter). Also I am not sure if I can set a > > background and so on. > > > > The other possibility is \defineframedtext. For example this goes much > > in the direction that I want: > > \definecolor[gbackground][s=0.98] > > \defineframedtext[gtk][frame=on, > > offset=5pt, > > background=color, > > width=0.95\textwidth, > > backgroundcolor=gbackground] > > > > However, there does not seem a possibility to define a title and it > > seems to not work on multiple pages. > > > > Is there a mix of an enumeration and framedtext that can produce > > something like in the attached picture? > > If you don’t need an enumeration, then don’t use one. > > Did you try text backgrounds? > https://wiki.contextgarden.net/TextBackground As an example, see this article that I had written years ago: https://www.tug.org/pracjourn/2006-4/mahajan/ The solution environment there is similar to what you want. Most of the code there should still work with minor changes. Aditya___ 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] Visual highlighted text with title, mix of enumeration and framedtext
Am 06.03.23 um 12:19 schrieb Gerion Entrup via ntg-context: I want to typeset a "Good to know" section that is visually highlighted and can spawn across multiple pages. In LaTeX this would be possible with the mdframed package. See the attached screenshot for an example how it might look like (it is copied out of page 4: Definition: Inhomogeneous linear of the mdframed documentation: http://mirrors.ctan.org/macros/latex/contrib/mdframed/mdframed.pdf) I have searched in the wiki and found \defineenumeration: This is near of that what I need. However I explicitly does not need an enumeration (so no number or counter). Also I am not sure if I can set a background and so on. The other possibility is \defineframedtext. For example this goes much in the direction that I want: \definecolor[gbackground][s=0.98] \defineframedtext[gtk][frame=on, offset=5pt, background=color, width=0.95\textwidth, backgroundcolor=gbackground] However, there does not seem a possibility to define a title and it seems to not work on multiple pages. Is there a mix of an enumeration and framedtext that can produce something like in the attached picture? If you don’t need an enumeration, then don’t use one. Did you try text backgrounds? https://wiki.contextgarden.net/TextBackground And then use the plethora of \framed options. Hraban ___ 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] Visual highlighted text with title, mix of enumeration and framedtext
Hi, I want to typeset a "Good to know" section that is visually highlighted and can spawn across multiple pages. In LaTeX this would be possible with the mdframed package. See the attached screenshot for an example how it might look like (it is copied out of page 4: Definition: Inhomogeneous linear of the mdframed documentation: http://mirrors.ctan.org/macros/latex/contrib/mdframed/mdframed.pdf) I have searched in the wiki and found \defineenumeration: This is near of that what I need. However I explicitly does not need an enumeration (so no number or counter). Also I am not sure if I can set a background and so on. The other possibility is \defineframedtext. For example this goes much in the direction that I want: \definecolor[gbackground][s=0.98] \defineframedtext[gtk][frame=on, offset=5pt, background=color, width=0.95\textwidth, backgroundcolor=gbackground] However, there does not seem a possibility to define a title and it seems to not work on multiple pages. Is there a mix of an enumeration and framedtext that can produce something like in the attached picture? Best, Gerion signature.asc Description: This is a digitally signed message part. ___ 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] Floating Figure in framed-environment
Dear Uschi Thanks for the example. But unfortunately it behaves similiar. As soon as I want to place the figure to the right by using \placefigure [right]… with floating text to the left. The framed environment behaves strange, i.e. it seems to ignore the image. Just using a centered image works perfectly. I included everything in this code, to show exactly, what is not working. \starttext \framed[corner=round, rulethickness=2pt, width=\textwidth, align=flushleft, offset=1em,background=color,framecolor=black] {{\bf Box with centered image} \blank[medium] \input khatt-en \placefigure[none]{This is an example of a logo.}{\externalfigure[dummy]} } \blank[2cm] \framed[corner=round, rulethickness=2pt, width=\textwidth, align=flushleft, offset=1em,background=color,framecolor=black] {{\bf Faulty box with floating text, image to the right} \blank[medium] \placefigure[right, none]{This is an example of a logo.}{\externalfigure[dummy]} \input khatt-en } \blank[2cm] {\bf Floating text with image to the right, without box} \blank[medium] \placefigure[right, none]{This is an example of a logo.}{\externalfigure[dummy]} \input khatt-en \stoptext Any ideas? Thanks a lot in advance. > Am 19.10.2022 um 13:52 schrieb Ursula Hermann via ntg-context - ntg-context > at ntg.nl : > > Dear Oliver, > > maybe something like this? > This is my example: > \starttext > > \setuppapersize > [A5] > > \setupexternalfigures > [location=default] > > \setupindenting > [yes, small] > > \setupwhitespace > [small] > > \defineframedtext > [prettyblock] > [width=10cm, > indenting={yes, small}, > background=color, backgroundcolor=lightgreen, > foreground=color, foregroundcolor=black, > offset=2mm, > align=flushleft] > > \starttext > > \startprettyblock > \setupindenting[next] > The Earth, as a habitat for animal life, is in old age and has a fatal > illness. Several, in fact. > > It would be happening whether humans had ever evolved or not. > > \placefigure > [][fig:church] > {Stephanus Church.} > {\externalfigure[ma-cb-24][width=.4\textwidth]} > > \stopprettyblock > \setupindenting[next] > Below, we have two separate columns; but up here, for the nonce, we have but > the one. > > \startcolumns [n=2] > Text, text, text \dots > all in the first column > \column > Words, words, words \dots > all in the second column. > And look ye here! Even more words! > \stopcolumns > > \stoptext > > Many regards > Uschi > > -Ursprüngliche Nachricht- > Von: ntg-context Im Auftrag von Oliver Sieber > via ntg-context > Gesendet: Mittwoch, 19. Oktober 2022 11:31 > An: ntg-context@ntg.nl > Cc: Oliver Sieber > Betreff: [NTG-context] Floating Figure in framed-environment > > Dear ConTeXt Users > > I am relatively new to context and I am suffering with a problem with the > framed environment. > > I want to use a framed textbox for Definitions in my script. I also want to > use floating figures. But this does not work and I haven’t found out why. > Maybe I totally use it the wrong way. I would appreciate if someone could > help me or has a tipp. > > Here is an example code, where the figure does not behave as expected, i.e. > the figure is behind the text: > > \starttext > \framed[corner=round, rulethickness=2pt, width=\textwidth, align=flushleft, > offset=1em,background=color,framecolor=black] > {{\bf Definition: Hello World} \blank[medium] > > \placefigure[right, none]{This is an example of a > logo.}{\externalfigure[dummy]} > > Carrot cake tiramisu lollipop dragée lollipop marshmallow carrot cake sweet > pastry. Tiramisu danish jelly tootsie roll tart gummi bears. Carrot cake > chupa chups cake wafer lemon drops lemon drops tiramisu. Chocolate lemon > drops sugar plum cheesecake jelly beans sugar plum. Tootsie roll cupcake > jujubes pie chocolate bar bear claw chupa chups shortbread. Candy candy canes > jelly-o jelly beans sugar plum muffin danish donut. Bonbon lemon drops powder > jujubes marshmallow biscuit halvah. Powder carrot cake caramels chocolate > cake carrot cake jelly-o. Topping danish tootsie roll gummi bears oat cake > jujubes. Sweet candy canes cotton candy pie topping. Jelly-o carrot cake ice > cream lemon drops macaroon gummies lemon drops tiramisu chocolate cake. > Cupcake sugar plum shortbread gummi bears tootsie roll. Chocolate cake sugar > plum macaroon candy canes chocolate bar donut cake icing tootsie roll. > } > \stoptext > > > Best regards > Oli > ___ > If your
Re: [NTG-context] Floating Figure in framed-environment
Dear Oliver, maybe something like this? This is my example: \starttext \setuppapersize [A5] \setupexternalfigures [location=default] \setupindenting [yes, small] \setupwhitespace [small] \defineframedtext [prettyblock] [width=10cm, indenting={yes, small}, background=color, backgroundcolor=lightgreen, foreground=color, foregroundcolor=black, offset=2mm, align=flushleft] \starttext \startprettyblock \setupindenting[next] The Earth, as a habitat for animal life, is in old age and has a fatal illness. Several, in fact. It would be happening whether humans had ever evolved or not. \placefigure [][fig:church] {Stephanus Church.} {\externalfigure[ma-cb-24][width=.4\textwidth]} \stopprettyblock \setupindenting[next] Below, we have two separate columns; but up here, for the nonce, we have but the one. \startcolumns [n=2] Text, text, text \dots all in the first column \column Words, words, words \dots all in the second column. And look ye here! Even more words! \stopcolumns \stoptext Many regards Uschi -Ursprüngliche Nachricht- Von: ntg-context Im Auftrag von Oliver Sieber via ntg-context Gesendet: Mittwoch, 19. Oktober 2022 11:31 An: ntg-context@ntg.nl Cc: Oliver Sieber Betreff: [NTG-context] Floating Figure in framed-environment Dear ConTeXt Users I am relatively new to context and I am suffering with a problem with the framed environment. I want to use a framed textbox for Definitions in my script. I also want to use floating figures. But this does not work and I haven’t found out why. Maybe I totally use it the wrong way. I would appreciate if someone could help me or has a tipp. Here is an example code, where the figure does not behave as expected, i.e. the figure is behind the text: \starttext \framed[corner=round, rulethickness=2pt, width=\textwidth, align=flushleft, offset=1em,background=color,framecolor=black] {{\bf Definition: Hello World} \blank[medium] \placefigure[right, none]{This is an example of a logo.}{\externalfigure[dummy]} Carrot cake tiramisu lollipop dragée lollipop marshmallow carrot cake sweet pastry. Tiramisu danish jelly tootsie roll tart gummi bears. Carrot cake chupa chups cake wafer lemon drops lemon drops tiramisu. Chocolate lemon drops sugar plum cheesecake jelly beans sugar plum. Tootsie roll cupcake jujubes pie chocolate bar bear claw chupa chups shortbread. Candy candy canes jelly-o jelly beans sugar plum muffin danish donut. Bonbon lemon drops powder jujubes marshmallow biscuit halvah. Powder carrot cake caramels chocolate cake carrot cake jelly-o. Topping danish tootsie roll gummi bears oat cake jujubes. Sweet candy canes cotton candy pie topping. Jelly-o carrot cake ice cream lemon drops macaroon gummies lemon drops tiramisu chocolate cake. Cupcake sugar plum shortbread gummi bears tootsie roll. Chocolate cake sugar plum macaroon candy canes chocolate bar donut cake icing tootsie roll. } \stoptext Best regards Oli ___ 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 ___ ___ 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 framed texts
Pablo Rodriguez via ntg-context schrieb am 24.04.2022 um 20:56: Dear list, I have the following sample: \defineframedtext[backcover] \setupframedtext[backcover] [frame=off, offset=overlay, width=\textwidth] \starttext \startframedtext[backcover] \input zapf \stopframedtext \stoptext Using current LMTX (2022.04.20 19:18), I’m afraid no format from \setupframedtext is applied to the backcover framed text. Can anyone confirm the issue or explain what I’m doing wrong? You have to use \startbackcover ... \stopbackcover in your document. While you can pass a instance to \starframed (e.g. \startframed[backcover]) the same isn't possible with \startframedtext. 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] issue with framed texts
Dear list, I have the following sample: \defineframedtext[backcover] \setupframedtext[backcover] [frame=off, offset=overlay, width=\textwidth] \starttext \startframedtext[backcover] \input zapf \stopframedtext \stoptext Using current LMTX (2022.04.20 19:18), I’m afraid no format from \setupframedtext is applied to the backcover framed text. Can anyone confirm the issue or explain what I’m doing wrong? Just in case it may be relevant, I’m on Linux 64bit. Many thanks for your help, 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] Switching fonts changes framedtext justification
Works flawlessly, thank you! Here's a demo with left and right speech bubbles: \definefont [TextFontEmoji] [OpenSansEmoji] \startuseMPgraphic{TextBubble}{side} z1 = (0, 0) ; z2 = (OverlayWidth, 0) ; z3 = (OverlayWidth, OverlayHeight) ; z4 = (0, OverlayHeight) ; offset := 1 ; tail := 1 ; % Flip the tail's location and direction. if \MPvar{side} = 1: offset := 5 ; tail := -1 ; fi (offset/6)[x1,x2] = x8 + .25cm * tail = x7 + .25cm = x9 - .25cm ; y7 = 0cm ; y8 = -.5cm ; y9 = 0cm ; path p ; p = (z1--z7--z8--z9--z2--z3--z4--cycle) cornered .25cm ; draw p withpen pencircle scaled 0.75 ; setbounds currentpicture to OverlayBox ; \stopuseMPgraphic \defineframedtext[TextBubbleFrame][ style=TextFontEmoji, frame=off, width=.618\textwidth, autowidth=force, offset=.75em, after={\blank[2*big]}, ] % Receive text (left-facing). \defineoverlay[TextBubbleRxOverlay][\useMPgraphic{TextBubble}{side=0}] \defineframedtext[TextBubbleRxFrame][TextBubbleFrame][ background=TextBubbleRxOverlay, location=left, ] % Send text (right-facing). \defineoverlay[TextBubbleTxOverlay][\useMPgraphic{TextBubble}{side=1}] \defineframedtext[TextBubbleTxFrame][TextBubbleFrame][ background=TextBubbleTxOverlay, location=right, ] % Map XHTML class names to start/stop environments. \definestartstop[bubblerx][ before={\startnarrower\startTextBubbleRxFrame}, after={\stopTextBubbleRxFrame\stopnarrower}, ] \definestartstop[bubbletx][ before={\startnarrower\startTextBubbleTxFrame}, after={\stopTextBubbleTxFrame\stopnarrower}, ] \starttext \startbubblerx Welcome to the future, human ! \input zapf \stopbubblerx \startbubbletx Welcome to the future, human ! \input zapf \stopbubbletx \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] Conditional text appearing in a fixed vertical space
You can also consider using viewerlayer: \setupinteraction[state=start] \defineviewerlayer[solution] \setupcolors[state=start] \usecolors[xwi] \definecolor[keyColor][1.0(maroon)] \starttext \startitemize[n] \but[ToggleLayer{solution}] \samplefile{tufte} \blank[big] \startviewerlayer[solution] \keyColor \samplefile{knuth} \stopviewerlayer \stopitemize \stoptext I print the file with the solution layer off to a 'clean' file for students. Gavin via ntg-context 於 2022年1月12日 週三 下午11:30寫道: > Thanks Fabrice and Aditya! > > With three completely different approaches, I learned three times more > than I was expecting. This has been a great help. I will probably use the > framedtext method, but I learned something from each. > > Gavin > > > > On Jan 11, 2022, at 4:44 PM, Aditya Mahajan wrote: > > > > On Tue, 11 Jan 2022, Gavin via ntg-context wrote: > > > >> Hello List, > >> > >> I am making problem sets for a physics class. Solutions use the style > defined in the example below, and only appear if the “solution” mode is > enabled. I am struggling to get a vertical space for the solution which is > the same whether or not the solution is printed. Different problems require > different amounts of space, so this should be an argument or key-value. > > > > This is how I would do it: piggyback on framedtext. Note that framedtext > doesn't break across pages. So, if you have long answers, a different > mechanism is needed. > > > > \definemode[solution][no] > > > > \doifmodeelse{solution} > > {\defineframedtext[solution][empty=no]} > > {\defineframedtext[solution][empty=yes]} > > > > % Doesn't work. Why? > > % > \expanded{\defineframedtext[solution][empty=\doifmodeelse{solution}{no}{yes}]} > > > > \setupframedtext > > [solution] > > [ > >spacebefore=medium, > >spaceafter=medium, > >width=broad, > >foregroundstyle=\rm\it, > >loffset=2em, > >roffset=2em, > >indentnext=no, > > ] > > > > > > \starttext > > > > Sample question. Always show answer. > > > > \startsolution[height=1in, empty=no] > > Alotta wood! > > \stopsolution > > > > > > How much wood? > > > > \startsolution[height=1in] > > Alotta wood! > > \stopsolution > > > > You don't need to specify the height: > > > > \startsolution > > \input ward > > \stopsolution > > > > No more questions. > > \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 ___
Re: [NTG-context] Conditional text appearing in a fixed vertical space
Thanks Fabrice and Aditya! With three completely different approaches, I learned three times more than I was expecting. This has been a great help. I will probably use the framedtext method, but I learned something from each. Gavin > On Jan 11, 2022, at 4:44 PM, Aditya Mahajan wrote: > > On Tue, 11 Jan 2022, Gavin via ntg-context wrote: > >> Hello List, >> >> I am making problem sets for a physics class. Solutions use the style >> defined in the example below, and only appear if the “solution” mode is >> enabled. I am struggling to get a vertical space for the solution which is >> the same whether or not the solution is printed. Different problems require >> different amounts of space, so this should be an argument or key-value. > > This is how I would do it: piggyback on framedtext. Note that framedtext > doesn't break across pages. So, if you have long answers, a different > mechanism is needed. > > \definemode[solution][no] > > \doifmodeelse{solution} > {\defineframedtext[solution][empty=no]} > {\defineframedtext[solution][empty=yes]} > > % Doesn't work. Why? > % > \expanded{\defineframedtext[solution][empty=\doifmodeelse{solution}{no}{yes}]} > > \setupframedtext > [solution] > [ >spacebefore=medium, >spaceafter=medium, >width=broad, >foregroundstyle=\rm\it, >loffset=2em, >roffset=2em, >indentnext=no, > ] > > > \starttext > > Sample question. Always show answer. > > \startsolution[height=1in, empty=no] > Alotta wood! > \stopsolution > > > How much wood? > > \startsolution[height=1in] > Alotta wood! > \stopsolution > > You don't need to specify the height: > > \startsolution > \input ward > \stopsolution > > No more questions. > \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] Conditional text appearing in a fixed vertical space
On Tue, 11 Jan 2022, Gavin via ntg-context wrote: > Hello List, > > I am making problem sets for a physics class. Solutions use the style defined > in the example below, and only appear if the “solution” mode is enabled. I am > struggling to get a vertical space for the solution which is the same whether > or not the solution is printed. Different problems require different amounts > of space, so this should be an argument or key-value. This is how I would do it: piggyback on framedtext. Note that framedtext doesn't break across pages. So, if you have long answers, a different mechanism is needed. \definemode[solution][no] \doifmodeelse{solution} {\defineframedtext[solution][empty=no]} {\defineframedtext[solution][empty=yes]} % Doesn't work. Why? % \expanded{\defineframedtext[solution][empty=\doifmodeelse{solution}{no}{yes}]} \setupframedtext [solution] [ spacebefore=medium, spaceafter=medium, width=broad, foregroundstyle=\rm\it, loffset=2em, roffset=2em, indentnext=no, ] \starttext Sample question. Always show answer. \startsolution[height=1in, empty=no] Alotta wood! \stopsolution How much wood? \startsolution[height=1in] Alotta wood! \stopsolution You don't need to specify the height: \startsolution \input ward \stopsolution No more questions. \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] Extra shift with ornament
On Fri, Dec 17, 2021 at 10:05 AM Hans Hagen wrote: > > On 12/17/2021 6:40 AM, Mikael Sundqvist via ntg-context wrote: > > Hi, > > > > When using an ornament on a \startframedtext \stoptextframed the frame > > is shifted just a little bit. Can one get rid of that shift? MWE > > below. > > > > /Mikael > > > > \defineornament[MyOrn][ > >corner={right,bottom}, > >location={right,top}, > >alternative=b, > >][ > >frame=off, > >] > > > > \showframe > > > > \starttext > > \startframedtext[width=\textwidth,height=2cm]foo\stopframedtext > > > > \MyOrn{bar}{\startframedtext[width=\textwidth,height=2cm]foo\stopframedtext} > > \stoptext > framedtext is more for text flow so you get some interferences > > \MyOrn >{bar} >{\framed > [offset=overlay, > align=normal, > width=\textwidth, > height=2cm]{foo}} > > works but maybe you want this instead: > > \defineoverlay >[MyOrn] >[\MyOrn > {\framedtextparameter{MyTitle}} > {\novrule width \overlaywidth height \overlayheight}] > > \defineframedtext >[MyText] >[background=MyOrn,width=\textwidth,height=2cm] > > \startMyText[MyTitle={oeps}] > foo > \stopMyText > > 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 > - Thanks, Hans! You indeed knew what I wanted. /Mikael ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/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] Extra shift with ornament
On 12/17/2021 6:40 AM, Mikael Sundqvist via ntg-context wrote: Hi, When using an ornament on a \startframedtext \stoptextframed the frame is shifted just a little bit. Can one get rid of that shift? MWE below. /Mikael \defineornament[MyOrn][ corner={right,bottom}, location={right,top}, alternative=b, ][ frame=off, ] \showframe \starttext \startframedtext[width=\textwidth,height=2cm]foo\stopframedtext \MyOrn{bar}{\startframedtext[width=\textwidth,height=2cm]foo\stopframedtext} \stoptext framedtext is more for text flow so you get some interferences \MyOrn {bar} {\framed [offset=overlay, align=normal, width=\textwidth, height=2cm]{foo}} works but maybe you want this instead: \defineoverlay [MyOrn] [\MyOrn {\framedtextparameter{MyTitle}} {\novrule width \overlaywidth height \overlayheight}] \defineframedtext [MyText] [background=MyOrn,width=\textwidth,height=2cm] \startMyText[MyTitle={oeps}] foo \stopMyText 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] using a red frame as an overlay
Hi, I used red frame which is in the metafun manual for long time. But it is not working now. Here is a MWE and a part of the log file. What should I change in the definitions? I am using "ConTeXt ver: 2021.07.10 21:51 LMTX fmt: 2021.7.12 int: english/english”. framed Text with title %%% \startuseMPgraphic{redFrame} picture p ; numeric o ; path a, b ; pair c ; p := textext.rt(\MPstring{FrameText}) ; o := BodyFontSize ; a := unitsquare xyscaled (OverlayWidth,OverlayHeight) ; p := p shifted (2o,OverlayHeight-ypart center p) ; drawoptions (withpen pencircle scaled 1pt withcolor .625red) ; b := a superellipsed .95 ; %fill b withcolor .85white ; draw b ; b := (boundingbox p) superellipsed .95 ; fill b withcolor .85white ; %.425green;%. draw b ; draw p withcolor black ; setbounds currentpicture to a ; \stopuseMPgraphic \defineoverlay[rFrame][\useMPgraphic{redFrame}] \defineframedtext[rfText] [frame=off, background=rFrame, offset=\bodyfontsize, width=\textwidth, before=\blank, after=\blank] \def\StartFrame{\blank\startrfText} \def\StopFrame {\stoprfText\blank} \starttext \StartFrame This is a test for the frame. This is a test for the frame. This is a test for the frame. This is a test for the frame. This is a test for the frame. This is a test for the frame. \StopFrame \stoptext \starttext log file: fonts > 'fallback modern-designsize rm 12pt' is loaded tex error > tex error on line 41 in file /Users/graph/Library/Mobile Documents/com~apple~CloudDocs/texMain/test.tex: Use of \meta_usempgraphic_nop doesn't match its definition } \executedefinedoverlay #1#2->\bgroup \setlayoutcomponentattribute {\v!overlay :#1}\setbox \scratchbox \hbox \layoutcomponentboxattribute {\the \everyoverlay #2} \boxxoffset \scratchbox -.5\dimexpr \wd \scratchbox -\d_framed_target_wd \relax \boxyoffset \scratchbox -.5\dimex \pack_framed_process_background_indeed_internal #1->\bgroup \setbox \b_framed_extra \hpack \bgroup \ifzeropt \framedbackgroundoffset \else \kern -\framedbackgroundoffset \fi \hbox \bgroup #1 \egroup \egroup \wd \b_framed_extra \zeropoint \ht \b_framed_extra \framedbackgroundheight \dp \b_framed_ext \m_framed_background ...background \endcsname \expandafter \pack_framed_process_background_indeed_internal \lastnamedcs \orelse \ifcsname \??overlay \m_framed_background \endcsname \expandafter \pack_framed_process_background_indeed_external \lastnamedcs \fi \pack_framed_process_backgrounds #1,#2->\edef \m_framed_background {#1}\ifx \m_framed_background \s!unknown \else \pack_framed_process_background \expandafter \pack_framed_process_backgrounds \fi #2 \p_framed_component ...s\let \foregroundbox \pack_framed_background_box_content \hpack \layoutcomponentboxattribute to \framedbackgroundwidth \bgroup \the \everybackgroundbox \expandafter \pack_framed_process_backgrounds \p_framed_background ,\s!unknown ,\relax \box ... ... \StopFrame 31 32 \starttext 33 34 \StartFrame 35 This is a test for the frame. 36 This is a test for the frame. 37 This is a test for the frame. 38 This is a test for the frame. 39 This is a test for the frame. 40 This is a test for the frame. 41 >> \StopFrame 42 43 \stoptext 44 If you say, e.g., '\def\a1{...}', then you must always put '1' after '\a', since control sequence names are made up of letters only. The macro here has not been followed by the required stuff, so I'm ignoring it. mtx-context | fatal error: return code: 256___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/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] Header for a book
Fabrice Couvreur schrieb am 12.07.2021 um 16:32: Hi, For my book, the header for each chapter should be like the attached image. I don't know if I am using the best method, but the result looks like what I want. Nevertheless, I am having some problems : 1. the header appears on each page ; 2. the title of the chapter should not appear in the body of the text. Thanks for your help. Fabrice [...] You can use the following example as a start. \definefont [ChapterNumberStyle] [Sans*default,uppercasing sa 1.5] \definefont [ChapterTextStyle] [SansBold*default sa 2.2] \startuseMPgraphic{chapterframe} fill OverlayBox leftenlarged (BackSpace + 5mm) rightenlarged (CutSpace + 5mm) topenlarged (TopSpace + 5mm) withcolor "lightgray"; setbounds currentpicture to OverlayBox; \stopuseMPgraphic \defineoverlay [chapterframe] [\useMPgraphic{chapterframe}] \defineframedtext [ChapterFrame] [frame=off, background=chapterframe, width=max, height=6cm, after={\blank[2*line]}, offset=0pt] \setuphead [chapter] [align=flushright, textcommand=\groupedcommand{\blank[medium]}{}, numbercolor=darkgray, textstyle=ChapterTextStyle, numberstyle=ChapterNumberStyle, before=\startChapterFrame, after=\stopChapterFrame, header=high] \setuplabeltext [fr] [chapter=Chapitre ] \mainlanguage [fr] \starttext \chapter {La récurrence} \samplefile{lorem} \chapter {Combinatoire-Dénombrement} \samplefile{lorem} \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 ___
[NTG-context] Problem with chapter numbering
Hi, For my book, the header for each chapter should be like the attached image. I don't know if I am using the best method, but the result looks like what I want. Nevertheless, I am having a problem. I don't understand why the first chapter is not numbered while the second is with number 1 etc. Thanks. Fabrice ### \definecolor[MyColorA][r=0.8784, g=0.8784, b=0.8784] \defineframedtext [FramedText] [ offset=0.6em, style=, toffset=\lineheight, background=color, backgroundcolor=MyColorA, foregroundstyle={\switchtobodyfont[11pt]}, align={left, broad}, frame=off, width=\textwidth, ] \setuplabeltext [en] [chapter=CHAPITRE] \setuppagenumbering [alternative=doublesided,location=] \unexpanded\def\HeadTitle#1#2% { \FramedText{{\cap\labeltext{chapter}}\space#1 \\ \bfc#2} } \unexpanded\def\processheadnumber#1% {\getmarking[chapternumber]} \setuphead [chapter] [style=\bfd, align={flushleft,broad}, numbercommand=\processheadnumber, command=\HeadTitle] \starttext \startchapter [title={La récurrence}] \startsection[title={Le principe de récurrence}] \input knuth \stopsection \startsection[title={Le raisonement par récurrence}] \input knuth \stopsection \startsection[title={Récurrences fortes}] \input knuth \stopsection \startsection[title={Exercices corrigés}] \input knuth \stopsection \stopchapter \startchapter [title=Combinatoire-Dénombrement] \input knuth \stopchapter \startchapter [title=Suites] \input knuth \stopchapter \stoptext ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context webpage : http://www.pragma-ade.nl / http://context.aanhet.net archive : https://bitbucket.org/phg/context-mirror/commits/ wiki : http://contextgarden.net ___
Re: [NTG-context] Header for a book
Hi, My first solution is incorrect ; with the second solution, I don't understand why the first chapter is not numbered while the second is with number 1. Thanks. Fabrice \unexpanded\def\HeadTitle#1#2% { \FramedText{{\cap\labeltext{chapter}}\space#1 \\ \bfc#2} } \unexpanded\def\processheadnumber#1% {\getmarking[chapternumber]} \setuphead [chapter] [style=\bfd, align={flushleft,broad}, numbercommand=\processheadnumber, command=\HeadTitle] \starttext \startchapter [title={La récurrence}] \startsection[title={Le principe de récurrence}] \dorecurse{10}{\input knuth} \stopsection \startsection[title={Le raisonement par récurrence}] \dorecurse{10}{\input knuth} \stopsection \startsection[title={Récurrences fortes}] \dorecurse{10}{\input knuth} \stopsection \startsection[title={Exercices corrigés}] \dorecurse{10}{\input knuth} \stopsection \stopchapter \startchapter [title=Combinatoire-Dénombrement] \dorecurse{10}{\input knuth} \stopchapter \stoptext Le lun. 12 juil. 2021 à 16:32, Fabrice Couvreur a écrit : > Hi, > For my book, the header for each chapter should be like the attached image. I > don't know if I am using the best method, but the result looks like what I > want. Nevertheless, I am having some problems : > 1. the header appears on each page ; > 2. the title of the chapter should not appear in the body of the text. > Thanks for your help. > Fabrice > > \definecolor[MyColorA][r=0.8784, g=0.8784, b=0.8784] > \defineframedtext > [FramedText] > [ > offset=0.6em, > style=, > toffset=\lineheight, > background=color, > backgroundcolor=MyColorA, > foregroundstyle={\switchtobodyfont[11pt]}, > align={left, broad}, > frame=off, > width=\textwidth, > ] > > > \setuplabeltext > [en] > [chapter=CHAPITRE] > > \setuphead >[chapter] >[bodypartlabel=] > > > \startsetups [header] > \labeltext{chapter} \getmarking[chapternumber] > \stopsetups > > \setupheadertexts > [] > [{\FramedText{{\cap\labeltext{chapter}\space\getmarking[chapternumber]} > \\ > \bfc\getmarking[chapter]}}] > [] > [\FramedText{{\cap\labeltext{chapter}\space \getmarking[chapternumber]} > \\ >\bfc\getmarking[chapter]}] > > > \setuppagenumbering > [alternative=doublesided,location=] > \starttext > \startchapter [title=La récurrence] > \startsection[title={Le principe de récurrence}] > \dorecurse{10}{\input knuth} > \stopsection > \startsection[title={Le raisonement par récurrence}] > \dorecurse{10}{\input knuth} > \stopsection > \startsection[title={Récurrences fortes}] > \dorecurse{10}{\input knuth} > \stopsection >\startsection[title={Exercices corrigés}] > \dorecurse{10}{\input knuth} > \stopsection > \stopchapter > \startchapter [title=Combinatoire-Dénombrement] > \dorecurse{10}{\input knuth} > \stopchapter > > \stoptext[image: pied_3.png] > > ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context webpage : http://www.pragma-ade.nl / http://context.aanhet.net archive : https://bitbucket.org/phg/context-mirror/commits/ wiki : http://contextgarden.net ___
[NTG-context] Header for a book
Hi, For my book, the header for each chapter should be like the attached image. I don't know if I am using the best method, but the result looks like what I want. Nevertheless, I am having some problems : 1. the header appears on each page ; 2. the title of the chapter should not appear in the body of the text. Thanks for your help. Fabrice \definecolor[MyColorA][r=0.8784, g=0.8784, b=0.8784] \defineframedtext [FramedText] [ offset=0.6em, style=, toffset=\lineheight, background=color, backgroundcolor=MyColorA, foregroundstyle={\switchtobodyfont[11pt]}, align={left, broad}, frame=off, width=\textwidth, ] \setuplabeltext [en] [chapter=CHAPITRE] \setuphead [chapter] [bodypartlabel=] \startsetups [header] \labeltext{chapter} \getmarking[chapternumber] \stopsetups \setupheadertexts [] [{\FramedText{{\cap\labeltext{chapter}\space\getmarking[chapternumber]} \\ \bfc\getmarking[chapter]}}] [] [\FramedText{{\cap\labeltext{chapter}\space \getmarking[chapternumber]} \\ \bfc\getmarking[chapter]}] \setuppagenumbering [alternative=doublesided,location=] \starttext \startchapter [title=La récurrence] \startsection[title={Le principe de récurrence}] \dorecurse{10}{\input knuth} \stopsection \startsection[title={Le raisonement par récurrence}] \dorecurse{10}{\input knuth} \stopsection \startsection[title={Récurrences fortes}] \dorecurse{10}{\input knuth} \stopsection \startsection[title={Exercices corrigés}] \dorecurse{10}{\input knuth} \stopsection \stopchapter \startchapter [title=Combinatoire-Dénombrement] \dorecurse{10}{\input knuth} \stopchapter \stoptext[image: pied_3.png] ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context webpage : http://www.pragma-ade.nl / http://context.aanhet.net archive : https://bitbucket.org/phg/context-mirror/commits/ wiki : http://contextgarden.net ___
Re: [NTG-context] Center a text (Metafun)
Fabrice Couvreur schrieb am 06.03.2021 um 11:17: Hi Hans, Some time ago, you offered this code to respond to a specific request from me. I used this code again and wanted to know if it was possible for the title "Algorithm" to be automatically centered based on the content. Thank you Fabrice \definecolor[MyBlue][c=0.2 , m=0.03, y=0.00, k=0.00] \definecolor[maincolor] [b=.5] \defineframedtext [MyFrame] [frame=off, background=MyFrame, width=fit, height=fit, style=small] \startuseMPgraphic{MyFrame} path b; picture p; p := textext.rt("\tfx\bf\white\framedtextparameter{Title}"); p := p shifted (2BodyFontSize,OverlayHeight-ypart center p+.25ExHeight); p := textext.t("\tfx\bf\white\framedtextparameter{Title}"); p := p shifted (OverlayWidth/2,OverlayHeight-ypart center p+.25ExHeight); 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] Center a text (Metafun)
Hi Hans, Some time ago, you offered this code to respond to a specific request from me. I used this code again and wanted to know if it was possible for the title "Algorithm" to be automatically centered based on the content. Thank you Fabrice \definecolor[MyBlue][c=0.2 , m=0.03, y=0.00, k=0.00] \definecolor[maincolor] [b=.5] \defineframedtext [MyFrame] [frame=off, background=MyFrame, width=fit, height=fit, style=small] \startuseMPgraphic{MyFrame} path b; picture p; p := textext.rt("\tfx\bf\white\framedtextparameter{Title}"); p := p shifted (2BodyFontSize,OverlayHeight-ypart center p+.25ExHeight); b := boundingbox p leftenlarged .5EmWidth rightenlarged .5EmWidth topenlarged .5EmWidth bottomenlarged .5EmWidth ; fill OverlayBox withcolor "MyBlue" ; fill b withcolor \MPcolor{maincolor} ; draw p ; setbounds currentpicture to boundingbox currentpicture enlarged 2mm ; \stopuseMPgraphic \defineoverlay [MyFrame] [\useMPgraphic{MyFrame}] \starttext \MyFrame[Title=Algorithme]{% \m{a\gets 2x-1} \m{b\gets a²-1} \m{c\gets b\div 4} \m{d\gets c-a+x} } \stoptext ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context webpage : http://www.pragma-ade.nl / http://context.aanhet.net archive : https://bitbucket.org/phg/context-mirror/commits/ wiki : http://contextgarden.net ___
Re: [NTG-context] Typesetting poetry with particular indenting
I have found this, that works, buy I don't know if there's a possibility of using less code: % !TEX encoding = UTF-8 Unicode % !TEX TS-program = ConTeXt-MkIV % questo codice centra il blocco dei versi sulla pagina \defineframedtext [poemframed] [width=\textwidth, autowidth=force, align=flushleft, before=, after=, frame=off] \definenarrower[poemnarrower] \definelines [poemlines] [before={\startpoemnarrower[left]}, after=\stoppoemnarrower] \definebuffer[poem] \def\stoppoem{\setups{poems:buffer}} \startsetups poems:buffer \setupnarrower[poemnarrower][left=0pt] \setbox\scratchbox\vbox {\poemframed {\startpoemlines \getpoem \stoppoemlines}} \edef\poemhsize{\the\dimexpr(\hsize-\wd\scratchbox)/2\relax} \setupnarrower[poemnarrower][left=\poemhsize] \startpoemlines \getpoem \stoppoemlines \stopsetups % questo codice rientra ogni secondo e terzo verso \unprotect \installindentingmethod {three} {\c_spac_indentation_toggle_state\plusthree} \unexpanded\def\spac_indentation_tri_toggle_indeed {\glet\checkindentation\spac_indentation_tri_toggle} \unexpanded\def\spac_indentation_tri_toggle {\gdef\checkindentation {\spac_indentation_remove \gdef\checkindentation{\spac_indentation_tri_toggle_indeed}}} % this next macro is redefinition of a core macro! \def\spac_indentation_check_toggle {\ifcase\c_spac_indentation_toggle_state % nothing \or \spac_indentation_no_toggle \or \spac_indentation_do_toggle \or \spac_indentation_tri_toggle \fi} \protect % questo codice attiva il rientro \setupindenting[yes,1em] \setuplines[indenting=three] \starttext \startpoem Per correr miglior acque alza le vele omai la navicella del mio ingegno, che lascia dietro a sé mar sì crudele; e canterò di quel secondo regno dove l'umano spirito si purga e di salire al ciel diventa degno. Ma qui la morta poesì resurga, o sante Muse, poi che vostro sono; e qui Calïopè alquanto surga, seguitando il mio canto con quel suono di cui le Piche misere sentiro lo colpo tal, che disperar perdono. \stoppoem \stoptext Il giorno gio 2 lug 2020 alle ore 17:14 Tommaso Gordini < illinguista1...@gmail.com> ha scritto: > Thanks, Wolfgang. Your example works, but the verse indentation ( > \setuplines[indenting=three]) is lost. > There's a way to preserve it? > > Tommy > > ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/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] Filter module for R
On Mon, 15 Jun 2020, Fabrice L wrote: Dear Aditya, Le 15 juin 2020 à 01:45, Aditya Mahajan a écrit : This is an adapted version of the code that I use for my course where I use the vim module to do the typesetting: \usemodule[filter] \usemodule[vim] \definecolor [darkblue] [r=0.1, g=0.11, b=0.84] \definecolor [darkgreen] [g=0.7] \definecolor [lightblue] [h=87cefa] \definecolor [lightgreen] [g=0.95,b=0.8,r=0.8] \defineframedtext [leftbartext] [ width=local, frame=off, framecolor=darkblue, leftframe=on, rulethickness=1ex, offset=0.25ex, loffset=3ex, background=color, backgroundcolor=lightblue, ] \definevimtyping [RCODE] [ syntax=r, directory=output, strip=yes, escape=yes, before={\blank[quarterline]\startleftbartext}, after={\stopleftbartext}, ] \define[1]\ShowOutput {\typeRCODEfile{\externalfilterinputfile} \startleftbartext[framecolor=darkgreen, backgroundcolor=lightgreen] \setupalign[flushleft, verytolerant] % range={1,-1} not currently supported % See below for details \typefile[range={1,-1}]{#1} \stopleftbartext} \defineexternalfilter [R] [ filtercommand={R CMD BATCH -q --no-timing --save --restore \externalfilterinputfile\space \externalfilteroutputfile}, output=\externalfilterbasefile.out, directory=output, readcommand=\ShowOutput, read=no, cache=yes, purge=yes, % THE COMMA WAS MISSING ] \starttext Some text... \startR[read=yes] pdf("RPlots/MyHistogram.pdf",5,5) X <- rnorm(200,mean=10,sd=2) hist(X, col = "red3" , xlab="Score QI" , main="", ylab="fréquence") \stopR \externalfigure[RPlots/MyHistogram.pdf][width=.5\textwidth] \stoptext Thanks so much for your answer. I had (of course) to install nvim in order the code to work, but this works ! Sorry, that was a leftover. I was testing in a docker container where I did not have vim installed. This will also work with regular vim. Thanks also for your additional work regarding the locale setting.. this is really deep magic for me. I think the facility to run R code directly from context can open ConTeXt to new users. The alliance between R and LaTeX is a winning combination to a lot of my colleagues. Do you think this would be appropriate to do a simple page on the wiki explaining how R code can be done in ConTeXt, with eventual formatting, with some simple examples, or this is too much noise ? Definitely. I think there is already a short page. But it will be good to add more detailed instructions. Aditya___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context webpage : http://www.pragma-ade.nl / http://context.aanhet.net archive : https://bitbucket.org/phg/context-mirror/commits/ wiki : http://contextgarden.net ___
Re: [NTG-context] Filter module for R
Dear Aditya, > Le 15 juin 2020 à 01:45, Aditya Mahajan a écrit : > > This is an adapted version of the code that I use for my course where I use > the vim module to do the typesetting: > > \usemodule[filter] > \usemodule[vim] > > \definecolor [darkblue] [r=0.1, g=0.11, b=0.84] > \definecolor [darkgreen] [g=0.7] > \definecolor [lightblue] [h=87cefa] > \definecolor [lightgreen] [g=0.95,b=0.8,r=0.8] > > \defineframedtext > [leftbartext] > [ >width=local, >frame=off, >framecolor=darkblue, >leftframe=on, >rulethickness=1ex, >offset=0.25ex, >loffset=3ex, >background=color, >backgroundcolor=lightblue, > ] > > \definevimtyping > [RCODE] > [ >syntax=r, >directory=output, >strip=yes, >escape=yes, >before={\blank[quarterline]\startleftbartext}, >after={\stopleftbartext}, > ] > > \define[1]\ShowOutput >{\typeRCODEfile{\externalfilterinputfile} > \startleftbartext[framecolor=darkgreen, backgroundcolor=lightgreen] > \setupalign[flushleft, verytolerant] > % range={1,-1} not currently supported > % See below for details > \typefile[range={1,-1}]{#1} > \stopleftbartext} > > > \defineexternalfilter > [R] > [ filtercommand={R CMD BATCH -q --no-timing --save --restore > \externalfilterinputfile\space \externalfilteroutputfile}, > output=\externalfilterbasefile.out, > directory=output, > readcommand=\ShowOutput, > read=no, > cache=yes, > purge=yes, % THE COMMA WAS MISSING > ] > > \starttext > > Some text... > > \startR[read=yes] > pdf("RPlots/MyHistogram.pdf",5,5) > X <- rnorm(200,mean=10,sd=2) > hist(X, col = "red3" , xlab="Score QI" , main="", ylab="fréquence") > \stopR > > \externalfigure[RPlots/MyHistogram.pdf][width=.5\textwidth] > > \stoptext > > Thanks so much for your answer. I had (of course) to install nvim in order the code to work, but this works ! Thanks also for your additional work regarding the locale setting.. this is really deep magic for me. I think the facility to run R code directly from context can open ConTeXt to new users. The alliance between R and LaTeX is a winning combination to a lot of my colleagues. Do you think this would be appropriate to do a simple page on the wiki explaining how R code can be done in ConTeXt, with eventual formatting, with some simple examples, or this is too much noise ? Thanks. Fabrice. ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context webpage : http://www.pragma-ade.nl / http://context.aanhet.net archive : https://bitbucket.org/phg/context-mirror/commits/ wiki : http://contextgarden.net ___
Re: [NTG-context] Filter module for R
On Mon, 15 Jun 2020, Aditya Mahajan wrote: On Mon, 15 Jun 2020, Aditya Mahajan wrote: On Sun, 14 Jun 2020, Fabrice L wrote: Hi, Following a question about the broken R module (R the statistical software), Aditya suggested me the filter module (thanks to him). I’m about to distribute a set of course notes to colleagues, and I need to deal with details now. I have one problem and two questions. 1) the filter collect R code between \startR / \stopR and submit this code to R. As it can be seen in the following minimal example, when a label contains an accented character (« Fréquence » in my example), the pdf graphic does not contains the « é ». Strangely, the snippet of code (which is saved locally as « test2-temp-R-0.tmp » (for test2.tex)) when submitted with the same command as the filtercommand, works correctly; that means the same file works when submitted to R outside of ConTeXt. I have no idea how to solve this. Are you running the exact same command as the `filtercommand`. If so, I don't know why running the `filtercommand` through context vs directly typing it on the terminal should behave differently. The filter module effectively just runs os.execute("filtercommand"). I don't use R so I am unable to debug further. I can reproduce this output side the filter module. If I directly run os.execute(...) from a lua session, the output is correct but running it through context gives the wrong output. I am guessing this is something to do with locale. I notice that the output of os.execute("locale") from context is different from that from my shell. But I don't know why locale should affect UTF characters in R. It is indeed related to locale. Here is a minimal example that works. I use a beforebuffer to set the locale so that you don't have to do it in each snippet and then filter out the first line in the typeset code listing and filter out the first two lines in the output. \usemodule[filter] \usemodule[vim] \definecolor [darkblue] [r=0.1, g=0.11, b=0.84] \definecolor [darkgreen] [g=0.7] \definecolor [lightblue] [h=87cefa] \definecolor [lightgreen] [g=0.95,b=0.8,r=0.8] \defineframedtext [leftbartext] [ width=local, frame=off, framecolor=darkblue, leftframe=on, rulethickness=1ex, offset=0.25ex, loffset=3ex, background=color, backgroundcolor=lightblue, ] \definevimtyping [RCODE] [ vimcommand=nvim, syntax=r, directory=output, strip=yes, escape=yes, before={\blank[quarterline]\startleftbartext}, after={\stopleftbartext}, ] \define[1]\ShowOutput {\typeRCODEfile[start=2]{\externalfilterinputfile} \startleftbartext[framecolor=darkgreen, backgroundcolor=lightgreen] \setupalign[flushleft, verytolerant] \typefile[range={3,-1}]{#1} \stopleftbartext} \startbuffer[locale] Sys.setlocale(category="LC_ALL", locale="en_US.UTF-8") \stopbuffer \defineexternalfilter [R] [ filtercommand={R CMD BATCH -q --no-timing --save --restore \externalfilterinputfile\space \externalfilteroutputfile}, output=\externalfilterbasefile.out, directory=output, readcommand=\ShowOutput, read=no, bufferbefore=locale, cache=yes, purge=yes, ] \starttext Some text... \startR[read=yes] pdf("RPlots/MyHistogram.pdf",5,5) X <- rnorm(200,mean=10,sd=2) hist(X, col = "red3" , xlab="Score QI" , main="", ylab="fréquence") \stopR \externalfigure[RPlots/MyHistogram.pdf][width=.5\textwidth] \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 ___
Re: [NTG-context] Filter module for R
On Sun, 14 Jun 2020, Fabrice L wrote: Hi, Following a question about the broken R module (R the statistical software), Aditya suggested me the filter module (thanks to him). I’m about to distribute a set of course notes to colleagues, and I need to deal with details now. I have one problem and two questions. 1) the filter collect R code between \startR / \stopR and submit this code to R. As it can be seen in the following minimal example, when a label contains an accented character (« Fréquence » in my example), the pdf graphic does not contains the « é ». Strangely, the snippet of code (which is saved locally as « test2-temp-R-0.tmp » (for test2.tex)) when submitted with the same command as the filtercommand, works correctly; that means the same file works when submitted to R outside of ConTeXt. I have no idea how to solve this. Are you running the exact same command as the `filtercommand`. If so, I don't know why running the `filtercommand` through context vs directly typing it on the terminal should behave differently. The filter module effectively just runs os.execute("filtercommand"). I don't use R so I am unable to debug further. 2) In a teaching context, we may want sometimes to show the code. The filter module actually permits to show the output of the code submitted to R (which can include or not the input commands); would it be possible to typeset the submitted code ? This is an adapted version of the code that I use for my course where I use the vim module to do the typesetting: \usemodule[filter] \usemodule[vim] \definecolor [darkblue] [r=0.1, g=0.11, b=0.84] \definecolor [darkgreen] [g=0.7] \definecolor [lightblue] [h=87cefa] \definecolor [lightgreen] [g=0.95,b=0.8,r=0.8] \defineframedtext [leftbartext] [ width=local, frame=off, framecolor=darkblue, leftframe=on, rulethickness=1ex, offset=0.25ex, loffset=3ex, background=color, backgroundcolor=lightblue, ] \definevimtyping [RCODE] [ syntax=r, directory=output, strip=yes, escape=yes, before={\blank[quarterline]\startleftbartext}, after={\stopleftbartext}, ] \define[1]\ShowOutput {\typeRCODEfile{\externalfilterinputfile} \startleftbartext[framecolor=darkgreen, backgroundcolor=lightgreen] \setupalign[flushleft, verytolerant] % range={1,-1} not currently supported % See below for details \typefile[range={1,-1}]{#1} \stopleftbartext} \defineexternalfilter [R] [ filtercommand={R CMD BATCH -q --no-timing --save --restore \externalfilterinputfile\space \externalfilteroutputfile}, output=\externalfilterbasefile.out, directory=output, readcommand=\ShowOutput, read=no, cache=yes, purge=yes, % THE COMMA WAS MISSING ] \starttext Some text... \startR[read=yes] pdf("RPlots/MyHistogram.pdf",5,5) X <- rnorm(200,mean=10,sd=2) hist(X, col = "red3" , xlab="Score QI" , main="", ylab="fréquence") \stopR \externalfigure[RPlots/MyHistogram.pdf][width=.5\textwidth] \stoptext 3) Finally, using "R CMD BATCH… » as the filtercommand add an extra line at the end of the output file which can be typeset to visualize results. Would it be possible by a magic trick to deleter the last line of the file ? It is possible to filter lines using `\typefile[range={start, stop}]{filename}`. You can use `range={1,3}` to only include lines 1 upto 3 or `range={1, +2}` to include line 1 followed by 2 lines. What you want is something like `range={1,-1}`, i.e., include from the first to last-1 line, but this is not currently supported. You could ask Hans to do so, as it is relatively simple to add. Of course, you will then need to document this on the wiki. Aditya___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context webpage : http://www.pragma-ade.nl / http://context.aanhet.net archive : https://bitbucket.org/phg/context-mirror/commits/ wiki : http://contextgarden.net ___
Re: [NTG-context] Fwd: Adding optional enumeration text to framed enumeration header
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 ___
Re: [NTG-context] multipage typing
On 1/19/2020 12:59 PM, Tomas Hala wrote: Hi all, content of typing environment is automatically broken at the end of a page, so is it no problem to typeset multipage code. But when I used startframedtext inside (see below), the multipage code was suppressed. Is there any way how to get over it? Best wishes, Tomáš \setupstartstop[DefaultSnippet][before=,after=,style=] \defineframedtext[MPtyping][background=color,backgroundcolor=gray,width=\makeupwidth,offset=2dd,loffset=6dd,roffset=6dd,frame=on,] \setuptyping[MP][before=\startMPtyping,after=\stopMPtyping,indentnext=auto,] search for textbackgrounds - 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] multipage typing
Hi all, content of typing environment is automatically broken at the end of a page, so is it no problem to typeset multipage code. But when I used startframedtext inside (see below), the multipage code was suppressed. Is there any way how to get over it? Best wishes, Tomáš \setupstartstop[DefaultSnippet][before=,after=,style=] \defineframedtext[MPtyping][background=color,backgroundcolor=gray,width=\makeupwidth,offset=2dd,loffset=6dd,roffset=6dd,frame=on,] \setuptyping[MP][before=\startMPtyping,after=\stopMPtyping,indentnext=auto,] ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/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] typing+framedtext: different behaviour between TL2017 and 2019
Hi Wolfgang, two files with the difference are attached. I thought about the current beta -- it could be good way for me but unfortunately it does not suit for my students. Tomáš Fri, Jan 17, 2020 ve 07:40:57PM +0100 Wolfgang Schuster napsal(a): # Tomas Hala schrieb am 17.01.2020 um 15:18: # >Hi all, # > # >if I compile the following (minimised) code with ConTeXt from TL2017, # >I receive expected result -- one framed gray box with correct width. # > # >\starttext\showframe # >\defineframedtext[MPT][background=color,backgroundcolor=gray,width=\makeupwidth,frame=on,offset=1cc,] # >\setuptyping[MP][before={\startMPT},after={\stopMPT},] # >\startMP bla \stopMP # >\stoptext # > # >Now I tried it with ConTeXt from TL2019 (TL2018 produces the same result as TL2019) # >and I have got _two_ boxes -- the outer one is correct and frames the typing environment # >as in the past whereas the new box frames the text inside the typing. # # Your example works fine with the current beta and since you don't # show the differences between the different installations there is # nothing which can be done. # # Wolfgang typing-tl17.pdf Description: Adobe PDF document typing-tl19.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] typing+framedtext: different behaviour between TL2017 and 2019
Hi Wolfgang,Indeed the sample sent by Tomas works fine with recent lmtx and mkiv, but with the mkiv version in TeXLive2019 one gets the result attached.This means that Tomas has to update to a newer version of ConTeXt…Best regards: OK typing-and-framedtext.pdf Description: Adobe PDF document On 17 Jan 2020, at 19:40, Wolfgang Schuster <wolfgang.schuster.li...@gmail.com> wrote:Tomas Hala schrieb am 17.01.2020 um 15:18:Hi all,if I compile the following (minimised) code with ConTeXt from TL2017,I receive expected result -- one framed gray box with correct width.\starttext\showframe\defineframedtext[MPT][background="" class="">\setuptyping[MP][before={\startMPT},after={\stopMPT},]\startMP bla \stopMP\stoptextNow I tried it with ConTeXt from TL2019 (TL2018 produces the same result as TL2019)and I have got _two_ boxes -- the outer one is correct and frames the typing environmentas in the past whereas the new box frames the text inside the typing.Your example works fine with the current beta and since you don't show the differences between the different installations there is nothing which can be done.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-contextwebpage : http://www.pragma-ade.nl / http://context.aanhet.netarchive : 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] typing+framedtext: different behaviour between TL2017 and 2019
Tomas Hala schrieb am 17.01.2020 um 15:18: Hi all, if I compile the following (minimised) code with ConTeXt from TL2017, I receive expected result -- one framed gray box with correct width. \starttext\showframe \defineframedtext[MPT][background=color,backgroundcolor=gray,width=\makeupwidth,frame=on,offset=1cc,] \setuptyping[MP][before={\startMPT},after={\stopMPT},] \startMP bla \stopMP \stoptext Now I tried it with ConTeXt from TL2019 (TL2018 produces the same result as TL2019) and I have got _two_ boxes -- the outer one is correct and frames the typing environment as in the past whereas the new box frames the text inside the typing. Your example works fine with the current beta and since you don't show the differences between the different installations there is nothing which can be done. 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] typing+framedtext: different behaviour between TL2017 and 2019
Hi all, if I compile the following (minimised) code with ConTeXt from TL2017, I receive expected result -- one framed gray box with correct width. \starttext\showframe \defineframedtext[MPT][background=color,backgroundcolor=gray,width=\makeupwidth,frame=on,offset=1cc,] \setuptyping[MP][before={\startMPT},after={\stopMPT},] \startMP bla \stopMP \stoptext Now I tried it with ConTeXt from TL2019 (TL2018 produces the same result as TL2019) and I have got _two_ boxes -- the outer one is correct and frames the typing environment as in the past whereas the new box frames the text inside the typing. Unfortunately, both boxes seems to be controlled by the \defineframedtext[MPT] which caused that the inner box runs outside the typesetting area, i.e. the left offset value is applied twice. I found out that it is related with the given name MP. Therefore, I renamed it to another name (it was ok) but after adding "option=mp" I came across the same problem. Is there any way how to define behaviour of both boxes in the existing \startMP environment apart? Or is it not possible? Best wishes, Tomáš ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/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] Indentation problem inside enumeration
On Tue, Dec 17, 2019 at 8:39 AM Mikael P. Sundqvist wrote: > Hi! > > I've met a strange problem with indentation in consecutive enumerations. > It seems to me that if > > 1) the first enumeration uses indentnext=no > AND > 2) the next enumeration uses a background > > then the second(?) paragraph of the second enumeration is not indented. > > Here is a small example (see what lines to comment to avoid the problem). > > %%% > \defineenumeration[losning][ > text=Lösning, > title=yes, > alternative=serried, > width=fit, > number=no, > headstyle={\em}, > titlestyle=, > indentnext=no,% another way to get indentation is to comment this line > indenting={yes,medium}, > ] > > \defineframedtext[anmärkningsbakgrunden][ > width=\textwidth, > background=color, > backgroundcolor=gray, > ] > > \defineenumeration[anmarkning][ > text=Anmärkning, > title=yes, > headstyle={\definedfont[Bold*default]\WORD}, > alternative=serried, > width=fit, > number=no, > prefix=no, > indentnext=no, > indenting={yes,medium}, > before={\startanmärkningsbakgrunden},% if these two lines are commented > then > after={\stopanmärkningsbakgrunden},% the indentation works > ] > > \starttext > > \startlosning > This environment destroys indentation in the next. > \stoplosning > > \startanmarkning > This is just a first paragraph. > > This paragraph should be indented. > > This paragraph is always indented. > \stopanmarkning > \stoptext > %%% > > (This is a stripped down example with some settings removed. But it shows > the point.) > > Am I doing something wrong? The resulting pdf is attached. > > /Mikael > > PS I think I saw this problem both with mkiv and lmtx. > > Bump. (Am I doing something wrong?) /Mikael ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/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] Indentation problem inside enumeration
Hi! I've met a strange problem with indentation in consecutive enumerations. It seems to me that if 1) the first enumeration uses indentnext=no AND 2) the next enumeration uses a background then the second(?) paragraph of the second enumeration is not indented. Here is a small example (see what lines to comment to avoid the problem). %%% \defineenumeration[losning][ text=Lösning, title=yes, alternative=serried, width=fit, number=no, headstyle={\em}, titlestyle=, indentnext=no,% another way to get indentation is to comment this line indenting={yes,medium}, ] \defineframedtext[anmärkningsbakgrunden][ width=\textwidth, background=color, backgroundcolor=gray, ] \defineenumeration[anmarkning][ text=Anmärkning, title=yes, headstyle={\definedfont[Bold*default]\WORD}, alternative=serried, width=fit, number=no, prefix=no, indentnext=no, indenting={yes,medium}, before={\startanmärkningsbakgrunden},% if these two lines are commented then after={\stopanmärkningsbakgrunden},% the indentation works ] \starttext \startlosning This environment destroys indentation in the next. \stoplosning \startanmarkning This is just a first paragraph. This paragraph should be indented. This paragraph is always indented. \stopanmarkning \stoptext %%% (This is a stripped down example with some settings removed. But it shows the point.) Am I doing something wrong? The resulting pdf is attached. /Mikael PS I think I saw this problem both with mkiv and lmtx. debugging.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 ___
[NTG-context] A question about an algorithm environment
Hi Wolfgang, Why in the first example, the indentation of my Python code that I wish is not respected and that I have to do as the second example to have what I want ? Thank you. Fabrice \defineframedtext [algorithmframe] [width=fit, location=middle, foregroundstyle={\tt\switchtobodyfont[11pt]}, framecolor=darkblue, corner=round] \definelines [algorithm] [space=on, before=\startalgorithmframe, after=\stopalgorithmframe] \starttext \startlinecorrection[blank] \startmidaligned \startalgorithm {\blue def nom} (argument1, argument2,\unknown): \unknown {\orange return} résultat \stopalgorithm \stopmidaligned \stoplinecorrection \startlinecorrection[blank] \startmidaligned \startalgorithm {\blue def nom} (argument1, argument2,\unknown): \unknown {\orange return} résultat \stopalgorithm \stopmidaligned \stoplinecorrection \stoptext ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context webpage : http://www.pragma-ade.nl / http://context.aanhet.net archive : https://bitbucket.org/phg/context-mirror/commits/ wiki : http://contextgarden.net ___
[NTG-context] Unexpected symbol with Enumeration
Hello, Why items are numbered with a square instead of a bullet ? Thanks. Fabrice \definecolor[MyColorC][s=0.8784] \definecolor[MyColorD][m=0.27,y=1] \defineframed [FrameTitle] [frame=off, foregroundstyle=\bfx\ss, foregroundcolor=white, background=color, backgroundcolor=MyColorD, location=depth] \defineframedtext [FramedText] [offset=0.25em, style=\ss, toffset=\zeropoint, background=color, backgroundcolor=MyColorC, foregroundstyle={\switchtobodyfont[10pt]}, align={right, broad}, frame=off, corner=00, radius=0.5em, width=10cm] \definedescription [Info] [before=, after=, text=Vocabulaire, title=no, width=fit, distance=0.5em, headcommand=\FrameTitle, alternative=serried] \starttext \startFramedText[width=7cm] \startInfo \startitemize[1] \startitem La droite \m{(AM)} est {\bf une sécante} à la courbe {\setupbodyfont[xits]\m{{\mathscript C}}} en \m{A}. \stopitem \par \startitem La position limite de la sécante \m{(AM)} lorsque \m{M} se rapproche de \m{A} est {\bf la tangente à la courbe} au point \m{A}. \stopitem\par \startitem Le coefficient directeur de la tangente est {\bf la limite}, lorsque \m{h} tend vers 0, du taux de variation. On l'appelle {\bf nombre dérivé} de la fonction \m{f} en 1. \stopitem \stopitemize \stopInfo \stopFramedText \stoptext ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context webpage : http://www.pragma-ade.nl / http://context.aanhet.net archive : https://bitbucket.org/phg/context-mirror/commits/ wiki : http://contextgarden.net ___
Re: [NTG-context] Something wrong after ConTeXt installation, could somebody help me please?
Ursula Hermann schrieb am 12.06.2019 um 11:55: Hello List! \setuppapersize[A4] \setupexternalfigures [location=default] \setupbodyfont[Computer Modern Roman ,rm, tfx 7pt] \setupbodyfont[7pt] everything else can be removed because 1. "rm" is the default style in most typescripts 2. there is no typescript with the name "Computer Modern Roman" 3. "tfx" is a font switch in the document \setupindenting [yes, small] \setupwhitespace [small] \setupcombination [location=top, distance=\spaceamount] \bTABLE[align=flushleft,columndistance=0.1em] \bTR \bTD[width=.2\textwidth]Small \eTD \bTD[width=0.05\textwidth] \eTD \eTR \eTABLE \setupexternalfigures [location=default] \setupindenting [yes, small] \setupwhitespace [small] \definecolor [rosybrown:1][h=FFBCB3] \defineframedtext [prettyblock] [width=10cm, indenting={yes, small}, background=color, backgroundcolor=rosybrown:1, foreground=color, foregroundcolor=black, offset=2mm, align=flushleft] \starttext \startprettyblock[width=7.5 cm,align={flushleft}] \noindentation The Earth, as a habitat for animal life, is in old age and has a fatal illness. Several, in fact. \stopprettyblock Below, we have two separate columns; but up here, for the nonce, we have but the one. \startcolumns [n=2] Text, text, text \dots all in the first column \column Words, words, words \dots all in the second column. \stopcolumns \stoptext \startcolumns[n=2] \input ward \column \input weisman \stopcolumns After installing ConTeXt in WinEdt: Command Line: C:\Users\Hermann\Downloads\context-mswin\bin\mtxrun.exe --synctex=-1 "melon.tex" Change "mtxrun.exe" to "context.exe" or "mtxrun.exe --script context". 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] Something wrong after ConTeXt installation, could somebody help me please?
I have forgotten: As Editor I have WinEdt. Uschi Von: ntg-context Im Auftrag von Ursula Hermann Gesendet: Mittwoch, 12. Juni 2019 11:55 An: mailing list for ConTeXt users Betreff: [NTG-context] Something wrong after ConTeXt installation, could somebody help me please? Hello List! \setuppapersize[A4] \setupexternalfigures [location=default] \setupbodyfont[Computer Modern Roman ,rm, tfx 7pt] \setupindenting [yes, small] \setupwhitespace [small] \setupcombination [location=top, distance=\spaceamount] \bTABLE[align=flushleft,columndistance=0.1em] \bTR \bTD[width=.2\textwidth]Small \eTD \bTD[width=0.05\textwidth] \eTD \eTR \eTABLE \setupexternalfigures [location=default] \setupindenting [yes, small] \setupwhitespace [small] \definecolor [rosybrown:1][h=FFBCB3] \defineframedtext [prettyblock] [width=10cm, indenting={yes, small}, background=color, backgroundcolor=rosybrown:1, foreground=color, foregroundcolor=black, offset=2mm, align=flushleft] \starttext \startprettyblock[width=7.5 cm,align={flushleft}] \noindentation The Earth, as a habitat for animal life, is in old age and has a fatal illness. Several, in fact. \stopprettyblock Below, we have two separate columns; but up here, for the nonce, we have but the one. \startcolumns [n=2] Text, text, text \dots all in the first column \column Words, words, words \dots all in the second column. \stopcolumns \stoptext \startcolumns[n=2] \input ward \column \input weisman \stopcolumns After installing ConTeXt in WinEdt: Command Line: C:\Users\Hermann\Downloads\context-mswin\bin\mtxrun.exe --synctex=-1 "melon.tex" Startup Folder: \\ub.univie.ac.at\U_Dom\Users G-L\Hermann\Documents\My Documents mtxrun | forcing cache reload resolvers | resolving | looking for regular 'texmfcnf.lua' on given path 'C:/Users/Hermann/texmf/web2c' from specification 'home:texmf/web2c' resolvers | resolving | looking for regular 'texmfcnf.lua' on given path 'C:/Users/Hermann/Downloads/texmf-local/web2c' from specification 'selfautoparent:/texmf-local/web2c' resolvers | resolving | looking for regular 'texmfcnf.lua' on given path 'C:/Users/Hermann/Downloads/texmf-context/web2c' from specification 'selfautoparent:/texmf-context/web2c' resolvers | resolving | looking for regular 'texmfcnf.lua' on given path 'C:/Users/Hermann/Downloads/texmf-dist/web2c' from specification 'selfautoparent:/texmf-dist/web2c' resolvers | resolving | looking for regular 'texmfcnf.lua' on given path 'C:/Users/Hermann/Downloads/texmf/web2c' from specification 'selfautoparent:/texmf/web2c' resolvers | resolving | looking for fallback 'contextcnf.lua' on given path 'C:/Users/Hermann/texmf/web2c' from specification 'home:texmf/web2c' resolvers | resolving | looking for fallback 'contextcnf.lua' on given path 'C:/Users/Hermann/Downloads/texmf-local/web2c' from specification 'selfautoparent:/texmf-local/web2c' resolvers | resolving | looking for fallback 'contextcnf.lua' on given path 'C:/Users/Hermann/Downloads/texmf-context/web2c' from specification 'selfautoparent:/texmf-context/web2c' resolvers | resolving | looking for fallback 'contextcnf.lua' on given path 'C:/Users/Hermann/Downloads/texmf-dist/web2c' from specification 'selfautoparent:/texmf-dist/web2c' resolvers | resolving | looking for fallback 'contextcnf.lua' on given path 'C:/Users/Hermann/Downloads/texmf/web2c' from specification 'selfautoparent:/texmf/web2c' resolvers | resolving | resolvers | resolving | warning: no lua configuration files found resolvers | resolving | no texmf paths are defined (using TEXMF) resolvers | resolving | mtxrun | the resolver databases are not present or outdated resolvers | resolving | using suffix based filetype 'scripts' resolvers | resolving | remembering file 'mtx-base.lua' using hash 'lua::mtx-base.lua' resolvers | resolving | using suffix based filetype 'scripts' resolvers | resolving | remembering file 'mtx-bases.lua' using hash 'lua::mtx-bases.lua' resolvers | resolving | remembered file 'mtx-base.lua' resolvers | resolving | using suffix based filetype 'scripts' resolvers | resolving | remembering file 'mtx-t-mtx-base.lua' using hash 'lua::mtx-t-mtx-base.lua' resolvers | resolving | using suffix based filetype 'scripts' resolvers | resolving | remembering file 'mtx-t-mtx-bases.lua' using hash 'lua::mtx-t-mtx-bases.lua' resolvers | resolving | remembered file 'mtx-t-mtx-base.lua' resolvers | resolving | remembered file 'mtx-base.lua' mtxrun | unknown script 'mtx-base.lua' or 'mtx-mtx-base.lua' There's something wrong, but I don't know what. _ ConTeXt Compilation Report (Pages: 0) Errors: 0 Warnings: 0 Ba
[NTG-context] Something wrong after ConTeXt installation, could somebody help me please?
Hello List! \setuppapersize[A4] \setupexternalfigures [location=default] \setupbodyfont[Computer Modern Roman ,rm, tfx 7pt] \setupindenting [yes, small] \setupwhitespace [small] \setupcombination [location=top, distance=\spaceamount] \bTABLE[align=flushleft,columndistance=0.1em] \bTR \bTD[width=.2\textwidth]Small \eTD \bTD[width=0.05\textwidth] \eTD \eTR \eTABLE \setupexternalfigures [location=default] \setupindenting [yes, small] \setupwhitespace [small] \definecolor [rosybrown:1][h=FFBCB3] \defineframedtext [prettyblock] [width=10cm, indenting={yes, small}, background=color, backgroundcolor=rosybrown:1, foreground=color, foregroundcolor=black, offset=2mm, align=flushleft] \starttext \startprettyblock[width=7.5 cm,align={flushleft}] \noindentation The Earth, as a habitat for animal life, is in old age and has a fatal illness. Several, in fact. \stopprettyblock Below, we have two separate columns; but up here, for the nonce, we have but the one. \startcolumns [n=2] Text, text, text \dots all in the first column \column Words, words, words \dots all in the second column. \stopcolumns \stoptext \startcolumns[n=2] \input ward \column \input weisman \stopcolumns After installing ConTeXt in WinEdt: Command Line: C:\Users\Hermann\Downloads\context-mswin\bin\mtxrun.exe --synctex=-1 "melon.tex" Startup Folder: \\ub.univie.ac.at\U_Dom\Users G-L\Hermann\Documents\My Documents mtxrun | forcing cache reload resolvers | resolving | looking for regular 'texmfcnf.lua' on given path 'C:/Users/Hermann/texmf/web2c' from specification 'home:texmf/web2c' resolvers | resolving | looking for regular 'texmfcnf.lua' on given path 'C:/Users/Hermann/Downloads/texmf-local/web2c' from specification 'selfautoparent:/texmf-local/web2c' resolvers | resolving | looking for regular 'texmfcnf.lua' on given path 'C:/Users/Hermann/Downloads/texmf-context/web2c' from specification 'selfautoparent:/texmf-context/web2c' resolvers | resolving | looking for regular 'texmfcnf.lua' on given path 'C:/Users/Hermann/Downloads/texmf-dist/web2c' from specification 'selfautoparent:/texmf-dist/web2c' resolvers | resolving | looking for regular 'texmfcnf.lua' on given path 'C:/Users/Hermann/Downloads/texmf/web2c' from specification 'selfautoparent:/texmf/web2c' resolvers | resolving | looking for fallback 'contextcnf.lua' on given path 'C:/Users/Hermann/texmf/web2c' from specification 'home:texmf/web2c' resolvers | resolving | looking for fallback 'contextcnf.lua' on given path 'C:/Users/Hermann/Downloads/texmf-local/web2c' from specification 'selfautoparent:/texmf-local/web2c' resolvers | resolving | looking for fallback 'contextcnf.lua' on given path 'C:/Users/Hermann/Downloads/texmf-context/web2c' from specification 'selfautoparent:/texmf-context/web2c' resolvers | resolving | looking for fallback 'contextcnf.lua' on given path 'C:/Users/Hermann/Downloads/texmf-dist/web2c' from specification 'selfautoparent:/texmf-dist/web2c' resolvers | resolving | looking for fallback 'contextcnf.lua' on given path 'C:/Users/Hermann/Downloads/texmf/web2c' from specification 'selfautoparent:/texmf/web2c' resolvers | resolving | resolvers | resolving | warning: no lua configuration files found resolvers | resolving | no texmf paths are defined (using TEXMF) resolvers | resolving | mtxrun | the resolver databases are not present or outdated resolvers | resolving | using suffix based filetype 'scripts' resolvers | resolving | remembering file 'mtx-base.lua' using hash 'lua::mtx-base.lua' resolvers | resolving | using suffix based filetype 'scripts' resolvers | resolving | remembering file 'mtx-bases.lua' using hash 'lua::mtx-bases.lua' resolvers | resolving | remembered file 'mtx-base.lua' resolvers | resolving | using suffix based filetype 'scripts' resolvers | resolving | remembering file 'mtx-t-mtx-base.lua' using hash 'lua::mtx-t-mtx-base.lua' resolvers | resolving | using suffix based filetype 'scripts' resolvers | resolving | remembering file 'mtx-t-mtx-bases.lua' using hash 'lua::mtx-t-mtx-bases.lua' resolvers | resolving | remembered file 'mtx-t-mtx-base.lua' resolvers | resolving | remembered file 'mtx-base.lua' mtxrun | unknown script 'mtx-base.lua' or 'mtx-mtx-base.lua' There's something wrong, but I don't know what. _ ConTeXt Compilation Report (Pages: 0) Errors: 0 Warnings: 0 Bad Boxes: 0 ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context webpage : http://www.pragma-ade.nl / http://context.aanhet.net archiv
Re: [NTG-context] Left frame on a block of text
Hi Aditya and Gilles, It seems to me that adding a bar in the margin either with framedtext or with MetaPost, lacks the ability to continue through a page break. Using the ConTeXt built-in sidebar mechanism has the advantage of continuing through a page break, but it is still not perfetct because in some occasions (but not always…) the sidebar plunges into the footnote area. I don't know if the issue can be solved (adding negative bottomoffset solves partly the problem but when there is no footnote then the sidebar appears to be too short…). Here is an example of how I use the sidebar to enhance \proclaim like texts. Best regards: OK begin test-sidebar-proclaim.tex %%% \definesidebar[ProclaimSidebar] \setupsidebar[ProclaimSidebar] [rulecolor=darkred, rulethickness=1pt, alternative=2, distance=5mm, % bottomoffset=-7mm, % topoffset=-2mm ] \defineenumeration[proclaim] [text=, before={\startsidebar[ProclaimSidebar]}, after={\stopsidebar}, style=slanted, title=yes, titleleft=, titleright={.}, % alternative=serried, alternative=hanging, % hang=2, width=fit, right={~}, way=bysection, prefix=yes, prefixsegments={chapter:section}] %%% \starttext \dorecurse{2}{\input knuth.tex\par} \input tufte.tex \footnote{The sidebar gets into the footnote\dots} \startproclaim{Lemma} \dorecurse{4}{\input ward.tex \par} \stopproclaim \stoptext %% end test-sidebar-proclaim.tex test-sidebar-proclaim.pdf Description: Adobe PDF document > On 20 Apr 2019, at 15:46, Aditya Mahajan wrote: > > On Sat, 20 Apr 2019, Gilles Waeber wrote: > >> Hi, >> I'm trying to create a style with a left border in the margin. >> >> I want the border to start and stop with the text. For the bottom I used >> framedepth but the bar still goes too far on the top? >> >> \showframe >> \showboxes >> \defineframedtext[leftbartext][ >> width=broad, >> frame=off, >> leftframe=on, >> rulethickness=.5ex, >> offset=-\framedparameter{rulethickness}, >> frameoffset=\dimexpr\leftmargindistance + >> \framedparameter{rulethickness}\relax, >> framedepth=-\framedparameter{frameoffset}, >> ] >> \starttext >> \startleftbartext >> \input knuth >> \stopleftbartext >> \stoptext > > Framed does not provide enough hooks to control the spaces. For something > like this, you can also use metapost to draw the background: > > \showframe > \showboxes > \defineframedtext[leftbartext][ >width=broad, >frame=off, >rulethickness=.5ex, >background=mp:offsetframe, >offset=overlay, > ] > > \defineoverlay[mp:offsetframe][\useMPgraphic{mp:offsetframe}] > > \startuseMPgraphic{mp:offsetframe} > draw leftboundary OverlayBox >xshifted -(LeftMarginDistance + 0.5OverlayLineWidth) >withpen pencircle scaled OverlayLineWidth; > setbounds currentpicture to OverlayBox; > \stopuseMPgraphic > > \starttext > \startleftbartext > \input knuth > \stopleftbartext > \stoptext > > > Aditya > ___ > If your question is of interest to others as well, please add an entry to the > Wiki! > > maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context > webpage : http://www.pragma-ade.nl / http://context.aanhet.net > archive : https://bitbucket.org/phg/context-mirror/commits/ > wiki : http://contextgarden.net > ___ ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context webpage : http://www.pragma-ade.nl / http://context.aanhet.net archive : https://bitbucket.org/phg/context-mirror/commits/ wiki : http://contextgarden.net ___
Re: [NTG-context] Left frame on a block of text
Thanks, that's exactly what I needed. I got inspired by your post at https://adityam.github.io/context-blog/post/frame-with-solid-left-line/ for my original code. I just added linecap:=butt; at the beginning of the metapost code to get squared ends. Gilles > Framed does not provide enough hooks to control the spaces. For something > like this, you can also use metapost to draw the background: > > \showframe > \showboxes > \defineframedtext[leftbartext][ > width=broad, > frame=off, > rulethickness=.5ex, > background=mp:offsetframe, > offset=overlay, > ] > > \defineoverlay[mp:offsetframe][\useMPgraphic{mp:offsetframe}] > \startuseMPgraphic{mp:offsetframe} linecap:=butt; draw leftboundary OverlayBox xshifted -(LeftMarginDistance + 0.5OverlayLineWidth) withpen pencircle scaled OverlayLineWidth; setbounds currentpicture to OverlayBox; \stopuseMPgraphic > > \starttext > \startleftbartext > \input knuth > \stopleftbartext > \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 ___
Re: [NTG-context] Left frame on a block of text
On Sat, 20 Apr 2019, Gilles Waeber wrote: Hi, I'm trying to create a style with a left border in the margin. I want the border to start and stop with the text. For the bottom I used framedepth but the bar still goes too far on the top? \showframe \showboxes \defineframedtext[leftbartext][ width=broad, frame=off, leftframe=on, rulethickness=.5ex, offset=-\framedparameter{rulethickness}, frameoffset=\dimexpr\leftmargindistance + \framedparameter{rulethickness}\relax, framedepth=-\framedparameter{frameoffset}, ] \starttext \startleftbartext \input knuth \stopleftbartext \stoptext Framed does not provide enough hooks to control the spaces. For something like this, you can also use metapost to draw the background: \showframe \showboxes \defineframedtext[leftbartext][ width=broad, frame=off, rulethickness=.5ex, background=mp:offsetframe, offset=overlay, ] \defineoverlay[mp:offsetframe][\useMPgraphic{mp:offsetframe}] \startuseMPgraphic{mp:offsetframe} draw leftboundary OverlayBox xshifted -(LeftMarginDistance + 0.5OverlayLineWidth) withpen pencircle scaled OverlayLineWidth; setbounds currentpicture to OverlayBox; \stopuseMPgraphic \starttext \startleftbartext \input knuth \stopleftbartext \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 ___
[NTG-context] Left frame on a block of text
Hi, I'm trying to create a style with a left border in the margin. I want the border to start and stop with the text. For the bottom I used framedepth but the bar still goes too far on the top? \showframe \showboxes \defineframedtext[leftbartext][ width=broad, frame=off, leftframe=on, rulethickness=.5ex, offset=-\framedparameter{rulethickness}, frameoffset=\dimexpr\leftmargindistance + \framedparameter{rulethickness}\relax, framedepth=-\framedparameter{frameoffset}, ] \starttext \startleftbartext \input knuth \stopleftbartext \stoptext Regards, Gilles ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/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] My own backgroundcolor in a frame
Am Fri, Mar 08, 2019 at 03:43:20PM + schrieb Ursula Hermann: > Dear List! > > I have the following example: > > \defineframedtext > [prettyblock] > [width=10cm, >indenting={yes, small}, >background=color, backgroundcolor=lightgreen, >foreground=color, foregroundcolor=black , >offset=2mm, >align=flushleft] > > My problem is now: > how can I write, if I have an Rgb Color and I do not know the name. I have > looked at the list, but cannot find the color. > Can I say: background=color, backgroundcolor=rgb and put the numbers in (lets > say: r=200, g=112, b=300)? > Is that correct, or do I have to take a special way? Or do I have to define > it? I would define a color and use it: \definecolor [myblue] [r=0.000, g=0.314, b=0.580] You can use the color anywhere with "color=myblue". juh -- Autoren-Homepage: . http://literatur.hasecke.com Satiren & Essays: . http://www.sudelbuch.de Privater Blog: http://www.hasecke.eu Netzliteratur-Projekt: http://www.generationenprojekt.de ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/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] My own backgroundcolor in a frame
Dear List! I have the following example: \defineframedtext [prettyblock] [width=10cm, indenting={yes, small}, background=color, backgroundcolor=lightgreen, foreground=color, foregroundcolor=black , offset=2mm, align=flushleft] My problem is now: how can I write, if I have an Rgb Color and I do not know the name. I have looked at the list, but cannot find the color. Can I say: background=color, backgroundcolor=rgb and put the numbers in (lets say: r=200, g=112, b=300)? Is that correct, or do I have to take a special way? Or do I have to define it? Many thanks and regards Uschi Hermann ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/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] Frame
High list! Another example, instead oft he cow, I took another figure: \setuppapersize [A5] \setupexternalfigures [location=default] \setupindenting [yes, small] \setupwhitespace [small] \defineframedtext [prettyblock] [width=10cm, indenting={yes, small}, background=color, backgroundcolor=lightgreen, foreground=color, foregroundcolor=black, offset=2mm, align=flushleft] \starttext \startprettyblock \setupindenting[next] The Earth, as a habitat for animal life, is in old age and has a fatal illness. Several, in fact. It would be happening whether humans had ever evolved or not. \placefigure [][fig:church] {Stephanus Church.} {\externalfigure[ma-cb-24][width=.4\textwidth]} \stopprettyblock \setupindenting[next] Below, we have two separate columns; but up here, for the nonce, we have but the one. \startcolumns [n=2] Text, text, text \dots all in the first column \column Words, words, words \dots all in the second column. And look ye here! Even more words! \stopcolumns \stoptext Works great. Many Regards Uschi -Ursprüngliche Nachricht- Von: ntg-context Im Auftrag von Wolfgang Schuster Gesendet: Donnerstag, 21. Februar 2019 18:24 An: mailing list for ConTeXt users ; Marco Patzer Betreff: Re: [NTG-context] Frame Marco Patzer schrieb am 21.02.19 um 12:19: > On Thu, 21 Feb 2019 10:50:21 + > Ursula Hermann wrote: > >> Here is my example: >> >> \setuppapersize[A5] >> \setupcolors[state=start] > This is the default, no need to start the colours any longer. > >> {\framed >> [width=10cm, >> background=color,backgroundcolor=darkblue, >> foreground=color,foregroundcolor=white, >> align={flushleft}] >> {The Earth, as a habitat for animal life, is in old age and has a >> fatal illness. Several, in fact.\par \setupindenting[yes, small] It >> would be happening whether humans had ever evolved or not. >> >> \externalfigure[cow.pdf][width=1cm]} >> >> \setupwhitespace[small] >> \starttext >> Below, we have two separate columns; but up here, for the nonce, we >> have but the one. >> >> \startcolumns[n=2] % Two columns, please >> Text, text, text \dots >> all in the first column >> \column >> Words, words, words \dots >> all in the second column. >> And look ye here! Even more words! >> \stopcolumns >> \stoptext >> Why can‘t I see the cow? > You're missing > >\setupexternalfigures > [location=default] > > Without setting the location context doesn't check the system > directories for the sample images. > > Furthermore, you're typesetting before \starttext. That's why your > font is monospaced. > > And I try to separate content from style. That's why I move all style > information before \starttext and after \starttext comes only content > and markup (if possible). Nothing wrong with mixing it, but it's > easier to read and easier to change the layout after the fact. > I'd write your example as follows. > > \setuppapersize >[A5] > > \setupexternalfigures >[location=default] > > \setupindenting >[yes, small] > > \setupwhitespace >[small] > > \defineframedtext >[prettyblock] >[width=10cm, > indenting={yes, small}, > background=color, backgroundcolor=darkblue, > foreground=color, foregroundcolor=white, > offset=2mm, > align=flushleft] > > \starttext > > \startprettyblock >\noindentation You don’t need \noindentation when you add “next” to the indenting options. 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] Frame
Marco Patzer schrieb am 21.02.19 um 12:19: On Thu, 21 Feb 2019 10:50:21 + Ursula Hermann wrote: Here is my example: \setuppapersize[A5] \setupcolors[state=start] This is the default, no need to start the colours any longer. {\framed [width=10cm, background=color,backgroundcolor=darkblue, foreground=color,foregroundcolor=white, align={flushleft}] {The Earth, as a habitat for animal life, is in old age and has a fatal illness. Several, in fact.\par \setupindenting[yes, small] It would be happening whether humans had ever evolved or not. \externalfigure[cow.pdf][width=1cm]} \setupwhitespace[small] \starttext Below, we have two separate columns; but up here, for the nonce, we have but the one. \startcolumns[n=2] % Two columns, please Text, text, text \dots all in the first column \column Words, words, words \dots all in the second column. And look ye here! Even more words! \stopcolumns \stoptext Why can‘t I see the cow? You're missing \setupexternalfigures [location=default] Without setting the location context doesn't check the system directories for the sample images. Furthermore, you're typesetting before \starttext. That's why your font is monospaced. And I try to separate content from style. That's why I move all style information before \starttext and after \starttext comes only content and markup (if possible). Nothing wrong with mixing it, but it's easier to read and easier to change the layout after the fact. I'd write your example as follows. \setuppapersize [A5] \setupexternalfigures [location=default] \setupindenting [yes, small] \setupwhitespace [small] \defineframedtext [prettyblock] [width=10cm, indenting={yes, small}, background=color, backgroundcolor=darkblue, foreground=color, foregroundcolor=white, offset=2mm, align=flushleft] \starttext \startprettyblock \noindentation You don’t need \noindentation when you add “next” to the indenting options. 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] Frame
Hello Marco! Thanks a lot, that worked. Many regards Uschi -Ursprüngliche Nachricht- Von: ntg-context Im Auftrag von Marco Patzer Gesendet: Donnerstag, 21. Februar 2019 12:19 An: ntg-context@ntg.nl Betreff: Re: [NTG-context] Frame On Thu, 21 Feb 2019 10:50:21 + Ursula Hermann wrote: > Here is my example: > > \setuppapersize[A5] > \setupcolors[state=start] This is the default, no need to start the colours any longer. > {\framed >[width=10cm, >background=color,backgroundcolor=darkblue, >foreground=color,foregroundcolor=white, >align={flushleft}] > {The Earth, as a habitat for animal life, is in old age and has a > fatal illness. Several, in fact.\par \setupindenting[yes, small] It > would be happening whether humans had ever evolved or not. > > \externalfigure[cow.pdf][width=1cm]} > > \setupwhitespace[small] > \starttext > Below, we have two separate columns; but up here, for the nonce, we > have but the one. > > \startcolumns[n=2] % Two columns, please > Text, text, text \dots > all in the first column > \column > Words, words, words \dots >all in the second column. > And look ye here! Even more words! > \stopcolumns > \stoptext > Why can‘t I see the cow? You're missing \setupexternalfigures [location=default] Without setting the location context doesn't check the system directories for the sample images. Furthermore, you're typesetting before \starttext. That's why your font is monospaced. And I try to separate content from style. That's why I move all style information before \starttext and after \starttext comes only content and markup (if possible). Nothing wrong with mixing it, but it's easier to read and easier to change the layout after the fact. I'd write your example as follows. \setuppapersize [A5] \setupexternalfigures [location=default] \setupindenting [yes, small] \setupwhitespace [small] \defineframedtext [prettyblock] [width=10cm, indenting={yes, small}, background=color, backgroundcolor=darkblue, foreground=color, foregroundcolor=white, offset=2mm, align=flushleft] \starttext \startprettyblock \noindentation The Earth, as a habitat for animal life, is in old age and has a fatal illness. Several, in fact. It would be happening whether humans had ever evolved or not. \externalfigure[cow][width=1cm] \stopprettyblock Below, we have two separate columns; but up here, for the nonce, we have but the one. \startcolumns [n=2] Text, text, text \dots all in the first column \column Words, words, words \dots all in the second column. And look ye here! Even more words! \stopcolumns \stoptext Marco ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context webpage : http://www.pragma-ade.nl / http://context.aanhet.net archive : https://bitbucket.org/phg/context-mirror/commits/ wiki : http://contextgarden.net ___ ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context webpage : http://www.pragma-ade.nl / http://context.aanhet.net archive : https://bitbucket.org/phg/context-mirror/commits/ wiki : http://contextgarden.net ___
Re: [NTG-context] Frame
On Thu, 21 Feb 2019 10:50:21 + Ursula Hermann wrote: > Here is my example: > > \setuppapersize[A5] > \setupcolors[state=start] This is the default, no need to start the colours any longer. > {\framed >[width=10cm, >background=color,backgroundcolor=darkblue, >foreground=color,foregroundcolor=white, >align={flushleft}] > {The Earth, as a habitat for animal life, is in old age and has a > fatal illness. Several, in fact.\par \setupindenting[yes, small] > It would be happening whether humans had ever evolved or not. > > \externalfigure[cow.pdf][width=1cm]} > > \setupwhitespace[small] > \starttext > Below, we have two separate columns; but up here, for the nonce, we > have but the one. > > \startcolumns[n=2] % Two columns, please > Text, text, text \dots > all in the first column > \column > Words, words, words \dots >all in the second column. > And look ye here! Even more words! > \stopcolumns > \stoptext > Why can‘t I see the cow? You're missing \setupexternalfigures [location=default] Without setting the location context doesn't check the system directories for the sample images. Furthermore, you're typesetting before \starttext. That's why your font is monospaced. And I try to separate content from style. That's why I move all style information before \starttext and after \starttext comes only content and markup (if possible). Nothing wrong with mixing it, but it's easier to read and easier to change the layout after the fact. I'd write your example as follows. \setuppapersize [A5] \setupexternalfigures [location=default] \setupindenting [yes, small] \setupwhitespace [small] \defineframedtext [prettyblock] [width=10cm, indenting={yes, small}, background=color, backgroundcolor=darkblue, foreground=color, foregroundcolor=white, offset=2mm, align=flushleft] \starttext \startprettyblock \noindentation The Earth, as a habitat for animal life, is in old age and has a fatal illness. Several, in fact. It would be happening whether humans had ever evolved or not. \externalfigure[cow][width=1cm] \stopprettyblock Below, we have two separate columns; but up here, for the nonce, we have but the one. \startcolumns [n=2] Text, text, text \dots all in the first column \column Words, words, words \dots all in the second column. And look ye here! Even more words! \stopcolumns \stoptext Marco ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context webpage : http://www.pragma-ade.nl / http://context.aanhet.net archive : https://bitbucket.org/phg/context-mirror/commits/ wiki : http://contextgarden.net ___
[NTG-context] index problem: [entry not flushed]
Dear all, I used a customized Theorem structure which is made by the help of experts in this list. I have two questions. 1. Recently I added titles of theorems which was indexed and found a strange error message "[entry not flushed]” in the list of index. Please run the following sample code? %% \defineframed [MyFramed] [frame=off, loffset=1ex, roffset=1ex, foregroundstyle=\ssbf] \startuseMPgraphic{MyFrame} picture p ; numeric o ; path a, b ; pair c ; %p := textext.rt("\FunnyFramed{\enumerationparameter{text} \convertedcounter[Theorem]}") ; p := textext.rt("\wrappedconstruction{\MyFramed{\currentconstructiontext}}") ; % p := textext.rt("\FunnyFramed{\currentconstructiontext}") ; o := BodyFontSize ; a := unitsquare xyscaled (OverlayWidth,OverlayHeight) ; p := p shifted (2o,OverlayHeight-ypart center p) ; drawoptions (withpen pencircle scaled 1pt withcolor .625red) ; b := a superellipsed .95 ; draw b ; b := (boundingbox p) superellipsed .95 ; fill b withcolor .85white ; draw b ; draw p withcolor black ; setbounds currentpicture to a ; \stopuseMPgraphic \defineoverlay[MyFrame][\useMPgraphic{MyFrame}] \defineframedtext [MyText] [frame=off, background=MyFrame, before={\blank[line,halfline]}, after={\blank[line]}, offset=\bodyfontsize, width=\textwidth] \defineenumeration[Theorem] [alternative=empty, title=yes, titleleft=, titleright=, text={\translate[en=Theorem, kr=정리]}, prefix=yes, prefixsegments=chapter, way=bychapter, % alternative=command, before=\startMyText, after=\stopMyText] \defineenumeration[Lemma] [alternative=empty, title=no, text={\translate[en=Lemma, kr=보조정리]}, prefix=yes, prefixsegments=chapter, way=bychapter, counter=Theorem, before=\startMyText, after=\stopMyText] \defineenumeration[Exam] [text={\white\translate[en=Example, kr=예제]}, numbercommand={\inframed[corner=round, framecolor=dYellow,toffset=-1pt,boffset=-1pt, loffset=1ex,roffset=1ex, background=color,backgroundcolor=blue]}, %height=1.3em, title=yes, prefix=yes, prefixsegments=chapter, way=bychapter, before={\blank}, after=\blank] \setupbodyfont[rm, 11pt] \starttext \startchapter[title={First}] \startTheorem This is the first Theorem \stopTheorem \startExam We call it \index{OneTwo}{\bf OneTwo} \stopExam \startTheorem{\index{OneOne}{\bf OneOne}} This is the first Theorem \stopTheorem \startExam We call it \index{OneTwo}{\bf OneTwo} \stopExam \stopchapter \startchapter[title={Second}] \startTheorem{\index{TwoOne}{\bf TwoOne}} This is the first Theorem \stopTheorem \startExam We call it \index{Two 3}{\bf Two 3} \stopExam \startExam We call it \index{TwoTwo}{\bf TwoTwo} \stopExam \stopchapter \startchapter[title={Third}] \startExam We call it \index{Three 1}{\bf Three 1} \stopExam \startTheorem{\index{ThreeOne}{\bf ThreeOne}} This is the first Theorem \stopTheorem \startExam We call it \index{ThreeThree}{\bf ThreeThree} \stopExam \stopchapter \page \placeindex \stoptext %% How to get rid of the message [entry not flushed]? 2. Also, the numbers of examples is not reset even though the new chapter began, for example, Example 2.3, 2.4, 3.5, 3.6 etc. However, I couldn’t make the same error with this code, It never happened without theorems, but it appeared when I added \startTheorem in my book. So, I add "\setcounter[Exam][0]” before the \startchapter everytime. I couldn’t figure out what relation is there between Theorems and Exam. Thank you for reading. Best regards, Dalyoung ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context webpage : http://www.pragma-ade.nl / http://context.aanhet.net archive : https://bitbucket.org/phg/context-mirror/commits/ wiki : http://contextgarden.net ___
[NTG-context] How to pass a parameter with \definedescription[]
Hi, Hans and Wolfgang helped me to design this framed text. How to pass in text parameter as we can for the length? The text is set to "Note" and I would like it to be "Vocabulary" for the second framed text. Thank you Fabrice \definecolor[MyColorA][s=0.8784] \definecolor[MyColorB][m=0.27,y=1] \defineframed [FrameTitle] [frame=off, foregroundstyle=\bfx\ss, foregroundcolor=white, background=color, backgroundcolor=MyColorB, location=depth] \defineframedtext [FramedText] [offset=0.5em, style=\ss, toffset=.25\lineheight, background=color, backgroundcolor=MyColorA, foregroundstyle={\switchtobodyfont[12pt]}, align={right, broad}, frame=off, corner=round, radius=1em, width=10cm] \definedescription [Info] [before=, after=, text=Note, title=no, width=fit, distance=1em, headcommand=\FrameTitle, alternative=serried] \starttext \startFramedText[width=\textwidth] \startInfo Cette suite d'appels sera notée Anissa--Boris--Gween et on dira qu'elle a pour longueur 2. \stopInfo \stopFramedText \startFramedText[width=\textwidth] \startInfo La matrice \m{M} est appelée {\bf matrice d'adjacence} du graphe. \stopInfo \stopFramedText \stoptext ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context webpage : http://www.pragma-ade.nl / http://context.aanhet.net archive : https://bitbucket.org/phg/context-mirror/commits/ wiki : http://contextgarden.net ___
Re: [NTG-context] Use \framedtext to write an algorithm (again)
Hi Fabrice, I’m sorry but I don’t understand the question. Can you explain what do you expect from the example but doesn’t work. Wolfgang Fabrice Couvreur schrieb am 17.10.18 um 21:58: Hi Wolfgang, You offered me the following code to write algorithms. It seems that this does not function very well because the withdrawal of the text no longer exists. Thank you Fabrice \defineframedtext [algorithmframe] [width=fit, background=color, backgroundcolor=lightgray, framecolor=darkred, corner=round] \definelines [algorithm] [space=on, before=\startalgorithmframe, after=\stopalgorithmframe] \starttext \startalgorithm Variables \math{I} et \math{J} entiers T tableau d'entiers Début Pour \math{I} allant de \math{1} à \math{3} Pour \math{J} allant de \math{1} à \math{3} Si \math{J>I} Alors \math{T[I, J]=J-I} Sinon \math{T[I, J]=0} Fin Si Fin Pour Fin \stopalgorithm \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] Use \framedtext to write an algorithm (again)
Hi Wolfgang, You offered me the following code to write algorithms. It seems that this does not function very well because the withdrawal of the text no longer exists. Thank you Fabrice \defineframedtext [algorithmframe] [width=fit, background=color, backgroundcolor=lightgray, framecolor=darkred, corner=round] \definelines [algorithm] [space=on, before=\startalgorithmframe, after=\stopalgorithmframe] \starttext \startalgorithm Variables \math{I} et \math{J} entiers T tableau d'entiers Début Pour \math{I} allant de \math{1} à \math{3} Pour \math{J} allant de \math{1} à \math{3} Si \math{J>I} Alors \math{T[I, J]=J-I} Sinon \math{T[I, J]=0} Fin Si Fin Pour Fin \stopalgorithm \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] prevent page break when using blocks
Jan Willem Flamma schrieb am 27.09.18 um 17:18: Dear list members, How can I prevent that a question block breaks across a page? Kind regards, Jan Willem Flamma MWE \defineblock[question] \defineblock[answer] \hideblocks[question] \hideblocks[answer] \defineenumeration [question] [text={Question}, after={\blank[2*big]}, inbetween={\blank[nowhite]}, way=bychapter, prefixsegments=chapter, prefix=yes] Put your questions in a framedtext environment. \defineframedtext [questionframe] [before=\blank, after=, offset=none, frame=off] \defineenumeration [question] [..., before=\startquestionframe, after=\stopquestionframe, ...] Wolfgang ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context webpage : http://www.pragma-ade.nl / http://context.aanhet.net archive : https://bitbucket.org/phg/context-mirror/commits/ wiki : http://contextgarden.net ___
Re: [NTG-context] Text wrapped with an ornement
Hi Hans, It's great and with alternative =serried, that's exactly what I'm trying to do ! Thanks. Fabrice PS : @Pablo Thanks for your help. Le dim. 19 août 2018 à 12:40, Hans Hagen a écrit : > On 8/19/2018 11:47 AM, Pablo Rodriguez wrote: > > On 08/18/2018 11:51 PM, Fabrice Couvreur wrote: > >> Hi Palbo, > >> In fact I want the text '' Coming back ... '' to start on the same > >> baseline as the title of the ornament as in the photo. > > > > Hi Fabrice, > > > > I’m afraid I don’t know how to do that (if that is possible with frames). > \definecolor[MyColorA][s=0.8784] > \definecolor[MyColorB][m=0.27,y=1] > > \defineframed >[FrameTitle] >[frame=off, > foregroundstyle=\bfx\ss, > foregroundcolor=white, > background=color, > backgroundcolor=MyColorB, > location=depth] > > \defineframedtext >[FramedText] >[offset=0.6em, > style=\ss, > toffset=.25\lineheight, > background=color, > backgroundcolor=MyColorA, > oregroundstyle={\switchtobodyfont[10pt]}, > align={right, broad}, > frame=off, > corner=round, > radius=1.5em, > width=10cm] > > \definedescription >[Info] >[before=, > after=, > text=Info, > title=no, > width=fit, > distance=1em, > headcommand=\FrameTitle, > alternative=hanging] > > \showframe > > \starttext > \startFramedText >\startInfo > \input zapf >\stopInfo > \stopFramedText > \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] Text wrapped with an ornement
On 8/19/2018 11:47 AM, Pablo Rodriguez wrote: On 08/18/2018 11:51 PM, Fabrice Couvreur wrote: Hi Palbo, In fact I want the text '' Coming back ... '' to start on the same baseline as the title of the ornament as in the photo. Hi Fabrice, I’m afraid I don’t know how to do that (if that is possible with frames). \definecolor[MyColorA][s=0.8784] \definecolor[MyColorB][m=0.27,y=1] \defineframed [FrameTitle] [frame=off, foregroundstyle=\bfx\ss, foregroundcolor=white, background=color, backgroundcolor=MyColorB, location=depth] \defineframedtext [FramedText] [offset=0.6em, style=\ss, toffset=.25\lineheight, background=color, backgroundcolor=MyColorA, oregroundstyle={\switchtobodyfont[10pt]}, align={right, broad}, frame=off, corner=round, radius=1.5em, width=10cm] \definedescription [Info] [before=, after=, text=Info, title=no, width=fit, distance=1em, headcommand=\FrameTitle, alternative=hanging] \showframe \starttext \startFramedText \startInfo \input zapf \stopInfo \stopFramedText \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] Text wrapped with an ornement
Hi Palbo, In fact I want the text '' Coming back ... '' to start on the same baseline as the title of the ornament as in the photo. Thanks. Fabrice Info Coming back ... blablablablabla Le sam. 18 août 2018 à 13:26, Pablo Rodriguez a écrit : > On 08/18/2018 11:11 AM, Fabrice Couvreur wrote: > > Hi Pablo, > > These options are to be added to \defineframedtext [] [] ? > > Without success at home ! > > Hi Fabrice, > > your sample should read: > > \definecolor[MyColorA][r=0.8784, g=0.8784, b=0.8784] > \definecolor[MyColorB][c=0.00,m=0.27,y=1.00,k=0.00] > > \defineornament > [FrameTitle] > [preset=lefttop] > [ > frame=off, > foregroundstyle=\bfx\ss, > foregroundcolor=white, > background=color, > backgroundcolor=MyColorB, > ] > > \defineframedtext > [FramedText] > [ > offset=0.6em, > style=\ss, > toffset=\lineheight, > background=color, > backgroundcolor=MyColorA, > foregroundstyle={\switchtobodyfont[10pt]}, > align={right, broad}, > frame=off, > corner=round, > radius=1.5em, > width=10cm, > ] > > \showframe > > \starttext > >\FrameTitle{Info}{% >\startFramedText% > \input zapf > \stopFramedText} > > \stoptext > > The width option works now, because I didn’t realize that your sample > had it right after the "\startFramedText" command. > > I hope it helps now. If anything is not working as you expect, please > explain what should be different. > > Pablo > -- > http://www.ousia.tk > > ___ > If your question is of interest to others as well, please add an entry to > the Wiki! > > maillist : ntg-context@ntg.nl / > http://www.ntg.nl/mailman/listinfo/ntg-context > webpage : http://www.pragma-ade.nl / http://context.aanhet.net > archive : https://bitbucket.org/phg/context-mirror/commits/ > wiki : http://contextgarden.net > > ___ ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context webpage : http://www.pragma-ade.nl / http://context.aanhet.net archive : https://bitbucket.org/phg/context-mirror/commits/ wiki : http://contextgarden.net ___
Re: [NTG-context] Text wrapped with an ornement
On 08/18/2018 11:11 AM, Fabrice Couvreur wrote: > Hi Pablo, > These options are to be added to \defineframedtext [] [] ? > Without success at home ! Hi Fabrice, your sample should read: \definecolor[MyColorA][r=0.8784, g=0.8784, b=0.8784] \definecolor[MyColorB][c=0.00,m=0.27,y=1.00,k=0.00] \defineornament [FrameTitle] [preset=lefttop] [ frame=off, foregroundstyle=\bfx\ss, foregroundcolor=white, background=color, backgroundcolor=MyColorB, ] \defineframedtext [FramedText] [ offset=0.6em, style=\ss, toffset=\lineheight, background=color, backgroundcolor=MyColorA, foregroundstyle={\switchtobodyfont[10pt]}, align={right, broad}, frame=off, corner=round, radius=1.5em, width=10cm, ] \showframe \starttext \FrameTitle{Info}{% \startFramedText% \input zapf \stopFramedText} \stoptext The width option works now, because I didn’t realize that your sample had it right after the "\startFramedText" command. I hope it helps now. If anything is not working as you expect, please explain what should be different. Pablo -- http://www.ousia.tk ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context webpage : http://www.pragma-ade.nl / http://context.aanhet.net archive : https://bitbucket.org/phg/context-mirror/commits/ wiki : http://contextgarden.net ___
Re: [NTG-context] Text wrapped with an ornement
Hi Pablo, These options are to be added to \defineframedtext [] [] ? Without success at home ! Fabrice Le sam. 18 août 2018 à 10:17, Pablo Rodriguez a écrit : > On 08/18/2018 01:08 AM, Fabrice Couvreur wrote: > > Hello, > > That's true Wolfgang, I just checked right now, sorry! > > What I would like to do is on the image below. > > Hi Fabrice, > > you should use the following commands: > >align={right, broad}, >radius=2em, > > And I don’t know why the width option doesn’t work here. > > Pablo > -- > http://www.ousia.tk > > ___ > If your question is of interest to others as well, please add an entry to > the Wiki! > > maillist : ntg-context@ntg.nl / > http://www.ntg.nl/mailman/listinfo/ntg-context > webpage : http://www.pragma-ade.nl / http://context.aanhet.net > archive : https://bitbucket.org/phg/context-mirror/commits/ > wiki : http://contextgarden.net > > ___ ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context webpage : http://www.pragma-ade.nl / http://context.aanhet.net archive : https://bitbucket.org/phg/context-mirror/commits/ wiki : http://contextgarden.net ___
Re: [NTG-context] Text wrapped with an ornement
Neither framedtext nor framed have a alternative key. You can check this very easy by looking into setup-en.pdf. Wolfgang Fabrice Couvreur schrieb am 17.08.18 um 11:24: Hello, Aditya offered me the following code to insert comments with an ornament. I notice that the option alternative= serried does not seem to work. Thank you. Fabrice \definecolor[MyColorA][r=0.8784, g=0.8784, b=0.8784] \definecolor[MyColorB][c=0.00,m=0.27,y=1.00,k=0.00] \defineornament [FrameTitle] [preset=lefttop] [ frame=off, foregroundstyle=\bfx, foregroundcolor=white, background=color, backgroundcolor=MyColorB, ] \defineframedtext [FramedText] [ offset=0.6em, toffset=\lineheight, background=color, backgroundcolor=MyColorA, foregroundstyle={\switchtobodyfont[10pt]}, align=verytolerant, alternative=serried, % text wrapped frame=off, corner=round, ] \showframe \starttext \FrameTitle{Info}{\startFramedText[width=\textwidth] \dorecurse{100}{blabla} \stopFramedText} \stoptext ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context webpage : http://www.pragma-ade.nl / http://context.aanhet.net archive : https://bitbucket.org/phg/context-mirror/commits/ wiki : http://contextgarden.net ___
[NTG-context] Text wrapped with an ornement
Hello, Aditya offered me the following code to insert comments with an ornament. I notice that the option alternative= serried does not seem to work. Thank you. Fabrice \definecolor[MyColorA][r=0.8784, g=0.8784, b=0.8784] \definecolor[MyColorB][c=0.00,m=0.27,y=1.00,k=0.00] \defineornament [FrameTitle] [preset=lefttop] [ frame=off, foregroundstyle=\bfx, foregroundcolor=white, background=color, backgroundcolor=MyColorB, ] \defineframedtext [FramedText] [ offset=0.6em, toffset=\lineheight, background=color, backgroundcolor=MyColorA, foregroundstyle={\switchtobodyfont[10pt]}, align=verytolerant, alternative=serried, % text wrapped frame=off, corner=round, ] \showframe \starttext \FrameTitle{Info}{\startFramedText[width=\textwidth] \dorecurse{100}{blabla} \stopFramedText} \stoptext ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context webpage : http://www.pragma-ade.nl / http://context.aanhet.net archive : https://bitbucket.org/phg/context-mirror/commits/ wiki : http://contextgarden.net ___
Re: [NTG-context] Strange behavior !
Hi Fabrice, This is because you define MyColorA, MyColorB but you don't define MyColor and myColor: but you use these two colors in your MPgraphic. Best regards: OK > On 16 Jul 2018, at 00:03, Fabrice Couvreur > wrote: > > Good evening, > In the code below, I get frames filled in black ! > Thank you > Fabrice > > \setupbodyfont [palatino,11pt] > > \definecolor[MyColorB][c=0.00, m=0.62, y=1.00, k=0.00] > \definecolor[MyColorA][.75(MyColorB,white)] > > \defineframedtext >[MyText] >[frame=off, > background=MyFrame, > width=\textwidth, > location=right] > > \defineoverlay >[MyFrame] >[\useMPgraphic{MyFrame}] > > \definelabel >[Définition] >[headstyle=\bf\smallcaps] > > > \startuseMPgraphic{MyFrame} > picture p ; > p := textext.rt(\MPstring{MyFrame}) ; > p := p shifted (0,OverlayHeight-ypart center p) ; > fill OverlayBox leftenlarged .1TextWidth withcolor \MPcolor{MyColor} ; > fill boundingbox p withcolor \MPcolor{myColor} ; > draw p withcolor white ; > setbounds currentpicture to OverlayBox ; > \stopuseMPgraphic > > > \starttext > > \startMyText > \input knuth > \stopMyText > > \startMyText > \input knuth > \stopMyText > > \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 ___
Re: [NTG-context] Strange behavior !
MyColor is undefined and defaults to black. Alan On Mon, 16 Jul 2018 00:03:33 +0200 Fabrice Couvreur wrote: > Good evening, > In the code below, I get frames filled in black > > ! > Thank you > Fabrice > > \setupbodyfont [palatino,11pt] > > \definecolor[MyColorB][c=0.00, m=0.62, y=1.00, k=0.00] > \definecolor[MyColorA][.75(MyColorB,white)] > > \defineframedtext >[MyText] >[frame=off, > background=MyFrame, > width=\textwidth, > location=right] > > \defineoverlay >[MyFrame] >[\useMPgraphic{MyFrame}] > > \definelabel >[Définition] >[headstyle=\bf\smallcaps] > > > \startuseMPgraphic{MyFrame} > picture p ; > p := textext.rt(\MPstring{MyFrame}) ; > p := p shifted (0,OverlayHeight-ypart center p) ; > fill OverlayBox leftenlarged .1TextWidth withcolor > \MPcolor{MyColor} ; fill boundingbox p withcolor \MPcolor{myColor} ; > draw p withcolor white ; > setbounds currentpicture to OverlayBox ; > \stopuseMPgraphic > > > \starttext > > \startMyText > \input knuth > \stopMyText > > \startMyText > \input knuth > \stopMyText > > \stoptext ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context webpage : http://www.pragma-ade.nl / http://context.aanhet.net archive : https://bitbucket.org/phg/context-mirror/commits/ wiki : http://contextgarden.net ___
[NTG-context] Strange behavior !
Good evening, In the code below, I get frames filled in black ! Thank you Fabrice \setupbodyfont [palatino,11pt] \definecolor[MyColorB][c=0.00, m=0.62, y=1.00, k=0.00] \definecolor[MyColorA][.75(MyColorB,white)] \defineframedtext [MyText] [frame=off, background=MyFrame, width=\textwidth, location=right] \defineoverlay [MyFrame] [\useMPgraphic{MyFrame}] \definelabel [Définition] [headstyle=\bf\smallcaps] \startuseMPgraphic{MyFrame} picture p ; p := textext.rt(\MPstring{MyFrame}) ; p := p shifted (0,OverlayHeight-ypart center p) ; fill OverlayBox leftenlarged .1TextWidth withcolor \MPcolor{MyColor} ; fill boundingbox p withcolor \MPcolor{myColor} ; draw p withcolor white ; setbounds currentpicture to OverlayBox ; \stopuseMPgraphic \starttext \startMyText \input knuth \stopMyText \startMyText \input knuth \stopMyText \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] Framed & before/after
On 03/21/2018 02:24 PM, Procházka Lukáš Ing. wrote: > Hello, > > does \framed recognize before and after keys, as mentioned here: > > http://wiki.contextgarden.net/Command/defineframed > or: http://wiki.contextgarden.net/Command/setupframedtexts ? Hi Lukáš, \framed inherits from \setupframed (as explained in tex/texmf-context/tex/context/interface/mkiv/i-context.pdf). \setupframedtext (which I don’t think is exactly the same as \setupframed) inherits from \setupplacement (which contains both keys before and after). That being said, I don’t know why before and after don’t work with framed texts. Pablo > In the following example it seems both keys are ignored: > > > \defineframedtext[AddressBox][before=\red,after=\small] > > \starttext >\green A >\AddressBox{\cldcontext{"Hele"}} >B > \stoptext > > > Best regards, > > Lukas -- http://www.ousia.tk ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context webpage : http://www.pragma-ade.nl / http://context.aanhet.net archive : https://bitbucket.org/phg/context-mirror/commits/ wiki : http://contextgarden.net ___
Re: [NTG-context] referencing the customized enumeration with framed title
On 1/12/2018 5:22 PM, Jeong Dal wrote: Dear Hans, Thank you for the quick answer. Repalcing “p:=textext.rt();” and commenting out “headcommand=gobbleone…” with your suggestion, the references are working. However, there is a side effect. “Theorem 1.1” appears twice, one in the frame which I expected and one at the beginning of the framed text which I don’t want. One more thing, is there no way to show the number of the Definition? you can download a beta and try \defineenumeration[Theorem] [alternative=empty, before=\startMyText, after=\stopMyText] \defineframed [MyFramed] [frame=off, loffset=1ex, roffset=1ex, foregroundstyle=\ssbf] \startuseMPgraphic{MyFrame} picture p ; numeric o ; path a, b ; pair c ; % p := textext.rt("\MyFramed{\currentconstructiontext}") ; p := textext.rt("\wrappedconstruction{\MyFramed{\currentconstructiontext}}") ; % p := textext.rt("\MyFramed{\wrappedconstruction{\currentconstructiontext}}") ; % p := textext.rt("\MyFramed{\wrappedcurrentconstruction}") ; o := BodyFontSize ; a := OverlayBox ; p := p shifted (2o,OverlayHeight-ypart center p) ; drawoptions (withpen pencircle scaled 1pt withcolor .625red) ; b := a superellipsed .95 ; draw b ; b := (boundingbox p) superellipsed .95 ; fill b withcolor .85white ; draw b ; draw p withcolor black ; setbounds currentpicture to a ; \stopuseMPgraphic \defineoverlay[MyFrame][\useMPgraphic{MyFrame}] \defineframedtext [MyText] [frame=off, background=MyFrame, offset=\bodyfontsize, width=\textwidth] \starttext \startTheorem[lem] bla bla \stopTheorem Bla bla \in {Lemma} [lem] bla bla. \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] referencing the customized enumeration with framed title
Dear Hans, Thank you for the quick answer. Repalcing “p:=textext.rt();” and commenting out “headcommand=gobbleone…” with your suggestion, the references are working. However, there is a side effect. “Theorem 1.1” appears twice, one in the frame which I expected and one at the beginning of the framed text which I don’t want. One more thing, is there no way to show the number of the Definition? Thanks again. Best regards, Dalyoung %% \setupcolors[state=start] \definecolor[dGreen] [r=0,g=.375,b=.0] %%% define the background of Theorems: \defineframed [FunnyFramed] [frame=off, loffset=1ex, roffset=1ex, foregroundstyle=\ssbf] \startuseMPgraphic{FunnyFrame} picture p ; numeric o ; path a, b ; pair c ; %p := textext.rt(“\FunnyFramed{\enumerationparameter{text} \convertedcounter[Theorem]}”) ; p := textext.rt("\FunnyFramed{\currentconstructiontext}") ; o := BodyFontSize ; a := unitsquare xyscaled (OverlayWidth,OverlayHeight) ; p := p shifted (2o,OverlayHeight-ypart center p) ; drawoptions (withpen pencircle scaled 1pt withcolor .625red) ; b := a superellipsed .95 ; draw b ; b := (boundingbox p) superellipsed .95 ; fill b withcolor .85white ; draw b ; draw p withcolor black ; setbounds currentpicture to a ; \stopuseMPgraphic \defineoverlay[FunnyFrame][\useMPgraphic{FunnyFrame}] \defineframedtext [FunnyText] [frame=off, background=FunnyFrame, before={\blank[line,halfline]}, after={\blank[line]}, offset=\bodyfontsize, width=\textwidth] \defineenumeration[Theorem] [title=no, text={\translate[en=Theorem, kr=정리]}, prefix=yes, prefixsegments=chapter, way=bychapter, alternative=command, %% headcommand=\gobbleoneargument, before=\startFunnyText, after=\stopFunnyText] Definition style \definenumber[DefNumber][way=bychapter,sectionumber=yes] \setuptextrules[rulecolor=dBlue] \define\DefCommand{\incrementnumber[DefNumber] \textrule[top]{\translate[en=Definition, kr=정 의] \getnumber[DefNumber]} } \defineenumeration[Definition] [width=fit, alternative=serried, text={}, number=no, before={\DefCommand}, after=\vskip3pt\hrule\blank] %%% Examples with or without solutions \defineenumeration[Exam] [text={\white\translate[en=Example, kr=예제]}, numbercommand={\inframed[corner=round, framecolor=dYellow,toffset=-1pt,boffset=-1pt, loffset=1ex,roffset=1ex, background=color,backgroundcolor=dGreen]}, %title=no, alternataive=hanging, prefix=yes, prefixsegments=chapter, way=bychapter, before={\blank[big]}, after=\blank] \starttext \chapter{Spaces} \section{Space 1} \startDefinition[def:first] Let $X$ be a uncountable set. Let $\infty$ is a fixed point of $X$. Let $\mathcal T$ be the family of subsets $G$ such that either (i) $\infty \notin G$ or (ii) $\infty \in G \text{ and } G^c$ is finite. The space $(X, {\mathcal T} )$ is called {\bf Fort's space}. \stopDefinition \startTheorem[lem:first] Fort's space is a compact and Hausdorff topological space.\par \stopTheorem \startTheorem[thm:second] Fort's space is a compact and Hausdorff topological space. \stopTheorem \startExam[Ex:first] Example Example Example Example Example Example Example Example Example Example Example Example Example Example Example Example Example Example Example Example Example Example Example Example Example Example Example \stopExam In this example, we defined \in{Definition}[def:first]. After that, we proved \in{Lemma}[lem:first] and \in{정리}[thm:second]. Finally, \in{Example}[Ex:first], we saw an example of it. \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] referencing the customized enumeration with framed title
On 1/12/2018 3:54 AM, Jeong Dal wrote: Hi, Some time ago, I am able to use following code(the framed title for Theorems and etc.) Thank Wolfgang and Otared again. Since it uses the customized style of numbering, there is a problem to reference them. As in the following code, \in{Definition}[] shows no number and \in{Theorem}[] shows ?? instead of numbers while \in{Exam}[] shows correctly. Is there a way to show the numbers correctly? % in cont-new.mkiv: \unprotect \defineconstructionalternative [\v!empty] [\c!renderingsetup=\??constructionrenderings:\v!empty] \startsetups[\??constructionrenderings:\v!empty] \noindent \useconstructionstyleandcolor\c!style\c!color \ignorespaces \stopsetups \protect % till here \defineenumeration[Theorem] [alternative=empty, before=\startMyText, after=\stopMyText] \defineframed [MyFramed] [frame=off, loffset=1ex, roffset=1ex, foregroundstyle=\ssbf] \startuseMPgraphic{MyFrame} picture p ; numeric o ; path a, b ; pair c ; p := textext.rt("\MyFramed{\currentconstructiontext}") ; % p := textext.rt("\wrappedconstruction{\MyFramed{\currentconstructiontext}}") ; % p := textext.rt("\MyFramed{\wrappedconstruction{\currentconstructiontext}}") ; % p := textext.rt("\MyFramed{\wrappedcurrentconstruction}") ; o := BodyFontSize ; a := OverlayBox ; p := p shifted (2o,OverlayHeight-ypart center p) ; drawoptions (withpen pencircle scaled 1pt withcolor .625red) ; b := a superellipsed .95 ; draw b ; b := (boundingbox p) superellipsed .95 ; fill b withcolor .85white ; draw b ; draw p withcolor black ; setbounds currentpicture to a ; \stopuseMPgraphic \defineoverlay[MyFrame][\useMPgraphic{MyFrame}] \defineframedtext [MyText] [frame=off, background=MyFrame, offset=\bodyfontsize, width=\textwidth] \starttext \startTheorem[lem] bla bla \stopTheorem Bla bla \in {Lemma} [lem] bla bla. \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] referencing the customized enumeration with framed title
On 1/12/2018 3:54 AM, Jeong Dal wrote: Hi, Some time ago, I am able to use following code(the framed title for Theorems and etc.) Thank Wolfgang and Otared again. Since it uses the customized style of numbering, there is a problem to reference them. As in the following code, \in{Definition}[] shows no number and \in{Theorem}[] shows ?? instead of numbers while \in{Exam}[] shows correctly. Is there a way to show the numbers correctly? Thank you for reading. Best regards, Dalyoung %%% \setupcolors[state=start] \definecolor[dGreen] [r=0,g=.375,b=.0] %%% define the background of Theorems: \defineframed [FunnyFramed] [frame=off, loffset=1ex, roffset=1ex, foregroundstyle=\ssbf] \startuseMPgraphic{FunnyFrame} picture p ; numeric o ; path a, b ; pair c ; p := textext.rt("\FunnyFramed{\enumerationparameter{text} \convertedcounter[Theorem]}") ; p := textext.rt("\FunnyFramed{\currentconstructiontext}") ; in a next version: % p := textext.rt("\wrappedconstruction{\FunnyFramed{\currentconstructiontext}}") ; % p := textext.rt("\FunnyFramed{\wrappedconstruction{\currentconstructiontext}}") ; % p := textext.rt("\FunnyFramed{\wrappedcurrentconstruction}") ; o := BodyFontSize ; a := unitsquare xyscaled (OverlayWidth,OverlayHeight) ; p := p shifted (2o,OverlayHeight-ypart center p) ; drawoptions (withpen pencircle scaled 1pt withcolor .625red) ; b := a superellipsed .95 ; draw b ; b := (boundingbox p) superellipsed .95 ; fill b withcolor .85white ; draw b ; draw p withcolor black ; setbounds currentpicture to a ; \stopuseMPgraphic \defineoverlay[FunnyFrame][\useMPgraphic{FunnyFrame}] \defineframedtext [FunnyText] [frame=off, background=FunnyFrame, before={\blank[line,halfline]}, %before={\blank[line]}, after={\blank[line]}, offset=\bodyfontsize, width=\textwidth] \defineenumeration[Theorem] [title=yes, text={\translate[en=Theorem, kr=정리]}, prefix=yes, prefixsegments=chapter, way=bychapter, alternative=command, headcommand=\gobbleoneargument, Don't do this ^^ before=\startFunnyText, after=\stopFunnyText] Definition style \definenumber[DefNumber][way=bychapter,sectionumber=yes] \setuptextrules[rulecolor=dBlue] \define\DefCommand{\incrementnumber[DefNumber] \textrule[top]{\translate[en=Definition, kr=정 의] \getnumber[DefNumber]} } \defineenumeration[Definition] [alternative=hanging, width=fit, alternative=serried, text={}, number=no, before={\DefCommand}, after=\vskip3pt\hrule\blank] %%% Examples with or without solutions \defineenumeration[Exam] [text={\white\translate[en=Example, kr=예제]}, numbercommand={\inframed[corner=round, framecolor=dYellow,toffset=-1pt,boffset=-1pt, loffset=1ex,roffset=1ex, background=color,backgroundcolor=dGreen]},%height=1.3em, %title=no, prefix=yes, prefixsegments=chapter, way=bychapter, before={\blank[big]}, after=\blank] \starttext \chapter{Spaces} \section{Space 1} \startDefinition[def:first] Let $X$ be a uncountable set. Let $\infty$ is a fixed point of $X$. Let $\mathcal T$ be the family of subsets $G$ such that either (i) $\infty \notin G$ or (ii) $\infty \in G \text{ and } G^c$ is finite. The space $(X, {\mathcal T} )$ is called {\bf Fort's space}. \stopDefinition \startTheorem[lem:first] Fort's space is a compact and Hausdorff topological space.\par \stopTheorem \startTheorem[thm:second] Fort's space is a compact and Hausdorff topological space. \stopTheorem \startExam[Ex:first] Example Example Example Example Example Example Example Example Example Example Example Example Example Example Example Example Example Example Example Example Example Example Example Example Example Example Example \stopExam In this example, we defined \in{Definition}[def:first]. After that, we proved \in{Lemma}[lem:first] and \in{정리}[thm:second]. Finally, \in{Example}[Ex:first], we saw an example of it. \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 ___ -- - Hans Hagen | PRAGMA ADE Ridderstraat 27 | 8061 GH Hasselt | The Netherlands tel: 038
[NTG-context] referencing the customized enumeration with framed title
Hi, Some time ago, I am able to use following code(the framed title for Theorems and etc.) Thank Wolfgang and Otared again. Since it uses the customized style of numbering, there is a problem to reference them. As in the following code, \in{Definition}[] shows no number and \in{Theorem}[] shows ?? instead of numbers while \in{Exam}[] shows correctly. Is there a way to show the numbers correctly? Thank you for reading. Best regards, Dalyoung %%% \setupcolors[state=start] \definecolor[dGreen] [r=0,g=.375,b=.0] %%% define the background of Theorems: \defineframed [FunnyFramed] [frame=off, loffset=1ex, roffset=1ex, foregroundstyle=\ssbf] \startuseMPgraphic{FunnyFrame} picture p ; numeric o ; path a, b ; pair c ; p := textext.rt("\FunnyFramed{\enumerationparameter{text} \convertedcounter[Theorem]}") ; o := BodyFontSize ; a := unitsquare xyscaled (OverlayWidth,OverlayHeight) ; p := p shifted (2o,OverlayHeight-ypart center p) ; drawoptions (withpen pencircle scaled 1pt withcolor .625red) ; b := a superellipsed .95 ; draw b ; b := (boundingbox p) superellipsed .95 ; fill b withcolor .85white ; draw b ; draw p withcolor black ; setbounds currentpicture to a ; \stopuseMPgraphic \defineoverlay[FunnyFrame][\useMPgraphic{FunnyFrame}] \defineframedtext [FunnyText] [frame=off, background=FunnyFrame, before={\blank[line,halfline]}, %before={\blank[line]}, after={\blank[line]}, offset=\bodyfontsize, width=\textwidth] \defineenumeration[Theorem] [title=yes, text={\translate[en=Theorem, kr=정리]}, prefix=yes, prefixsegments=chapter, way=bychapter, alternative=command, headcommand=\gobbleoneargument, before=\startFunnyText, after=\stopFunnyText] Definition style \definenumber[DefNumber][way=bychapter,sectionumber=yes] \setuptextrules[rulecolor=dBlue] \define\DefCommand{\incrementnumber[DefNumber] \textrule[top]{\translate[en=Definition, kr=정 의] \getnumber[DefNumber]} } \defineenumeration[Definition] [alternative=hanging, width=fit, alternative=serried, text={}, number=no, before={\DefCommand}, after=\vskip3pt\hrule\blank] %%% Examples with or without solutions \defineenumeration[Exam] [text={\white\translate[en=Example, kr=예제]}, numbercommand={\inframed[corner=round, framecolor=dYellow,toffset=-1pt,boffset=-1pt, loffset=1ex,roffset=1ex, background=color,backgroundcolor=dGreen]}, %height=1.3em, %title=no, prefix=yes, prefixsegments=chapter, way=bychapter, before={\blank[big]}, after=\blank] \starttext \chapter{Spaces} \section{Space 1} \startDefinition[def:first] Let $X$ be a uncountable set. Let $\infty$ is a fixed point of $X$. Let $\mathcal T$ be the family of subsets $G$ such that either (i) $\infty \notin G$ or (ii) $\infty \in G \text{ and } G^c$ is finite. The space $(X, {\mathcal T} )$ is called {\bf Fort's space}. \stopDefinition \startTheorem[lem:first] Fort's space is a compact and Hausdorff topological space.\par \stopTheorem \startTheorem[thm:second] Fort's space is a compact and Hausdorff topological space. \stopTheorem \startExam[Ex:first] Example Example Example Example Example Example Example Example Example Example Example Example Example Example Example Example Example Example Example Example Example Example Example Example Example Example Example \stopExam In this example, we defined \in{Definition}[def:first]. After that, we proved \in{Lemma}[lem:first] and \in{정리}[thm:second]. Finally, \in{Example}[Ex:first], we saw an example of it. \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] framed with titles
Hi Dalyoung, would it be possible that you add both samples to the wiki? This is the best way to have a reference for future needs. Pablo On 12/03/2017 12:11 AM, Jeong Dal wrote: > Hi, > > Some days ago, I asked a method to put theorem numbers in a framed title. > Recently, Wolfgang gave me a solution which worked very well. > > Although the first one is much simpler than the second, I’d like to show > two samples made by his suggestion. > I hope that it may help someone who has the similar problem. > > Thanks Wolfgang again. > > Best regards, > > Dalyoung > > %% first method > %1. use \enumerationparameter{text} and add “text=Theorem” in > \defineenumeration. > %%% > \defineframed > [FunnyFramed] > [frame=off, > loffset=1ex, > roffset=1ex, > foregroundstyle=\ssbf] > > \startuseMPgraphic{FunnyFrame} > picture p ; numeric o ; path a, b ; pair c ; > p := textext.rt("\FunnyFramed{\enumerationparameter{text} > \convertedcounter[Theorem]}") ; > o := BodyFontSize ; > a := unitsquare xyscaled (OverlayWidth,OverlayHeight) ; > p := p shifted (2o,OverlayHeight-ypart center p) ; > drawoptions (withpen pencircle scaled 1pt withcolor .625red) ; > b := a superellipsed .95 ; > draw b ; > b := (boundingbox p) superellipsed .95 ; > fill b withcolor .85white ; > draw b ; > draw p withcolor black ; > setbounds currentpicture to a ; > \stopuseMPgraphic > > > \defineoverlay[FunnyFrame][\useMPgraphic{FunnyFrame}] > > \defineframedtext > [FunnyText] > [frame=off, > background=FunnyFrame, > before={\blank[line,halfline]}, > after={\blank[line]}, > offset=\bodyfontsize, > width=\textwidth] > > \defineenumeration[Theorem] > [title=no, > text=Theorem, > prefix=yes, > prefixsegments=chapter, > way=bychapter, > alternative=command, > headcommand=\gobbleoneargument, > before=\startFunnyText, > after=\stopFunnyText] > > \defineenumeration[Lemma] > [title=no, > text=Lemma, > prefix=yes, > prefixsegments=chapter, > way=bychapter, > alternative=command, > counter=Theorem, > headcommand=\gobbleoneargument, > before=\startFunnyText, > after=\stopFunnyText] > > \defineenumeration[Coro] > [title=no, > text=Corollary, > prefix=yes, > prefixsegments=chapter, > way=bychapter, > alternative=command, > counter=Theorem, > headcommand=\gobbleoneargument, > before=\startFunnyText, > after=\stopFunnyText] > \starttext > > \dorecurse{3} > {\chapter{Chapter Title} > > > \startLemma > Fort's space is a compact and Hausdorff topological space. > \stopLemma > > \startTheorem > Fort's space is a compact and Hausdorff topological space. > \stopTheorem > > > \startTheorem > Let $X$ be a uncountable set. Let $\infty$ is a fixed point of $X$. Let > $\mathcal T$ be the family of subsets $G$ such that either (i) $\infty > \notin G$ or (ii) $\infty \in G \text{ and } G^c$ is finite. The space > $(X, {\mathcal T} )$ is called {\bf Fort's space}. > \stopTheorem > > \startLemma > Fort's space is a compact and Hausdorff topological space. > \stopLemma > > \startCoro > Fort's space is a compact and Hausdorff topological space. > \stopCoro > } > > \stoptext > > % 2nd method > %2. use \MPvar{} and define 3 different backgrounds, 3 different > framedtexts like > %\defineoverlay[FunnyFrameT][\useMPgraphic{FunnyFrame}{what=Theorem}] > % > > \defineframed > [FunnyFramed] > [frame=off, > loffset=1ex, > roffset=1ex, > foregroundstyle=\ssbf] > > \startuseMPgraphic{FunnyFrame} > picture p ; numeric o ; path a, b ; pair c ; > p := textext.rt("\FunnyFramed{\MPvar{what} > \convertedcounter[Theorem]}") ; > o := BodyFontSize ; > a := unitsquare xyscaled (OverlayWidth,OverlayHeight) ; > p := p shifted (2o,OverlayHeight-ypart center p) ; > drawoptions (withpen pencircle scaled 1pt withcolor .625red) ; > b := a superellipsed .95 ; > draw b ; > b := (boundingbox p) superellipsed .95 ; > fill b withcolor .85white ; > draw b ; > draw p withcolor black ; > setbounds currentpicture to a ; > \stopuseMPgraphic > > \defineoverlay[FunnyFrameT][\useMPgraphic{FunnyFrame}{what=Theorem}] > \defineoverlay[FunnyFrameL][\useMPgraphic{FunnyFrame}{what=Lemma}] > \defineoverlay[FunnyFrameC][\useMPgraphic{FunnyFrame}{what=Corollary}] > > \defineframedtext > [FunnyTheorem] > [
Re: [NTG-context] framed with titles
Hi, Some days ago, I asked a method to put theorem numbers in a framed title. Recently, Wolfgang gave me a solution which worked very well. Although the first one is much simpler than the second, I’d like to show two samples made by his suggestion. I hope that it may help someone who has the similar problem. Thanks Wolfgang again. Best regards, Dalyoung %% first method %1. use \enumerationparameter{text} and add “text=Theorem” in \defineenumeration. %%% \defineframed [FunnyFramed] [frame=off, loffset=1ex, roffset=1ex, foregroundstyle=\ssbf] \startuseMPgraphic{FunnyFrame} picture p ; numeric o ; path a, b ; pair c ; p := textext.rt("\FunnyFramed{\enumerationparameter{text} \convertedcounter[Theorem]}") ; o := BodyFontSize ; a := unitsquare xyscaled (OverlayWidth,OverlayHeight) ; p := p shifted (2o,OverlayHeight-ypart center p) ; drawoptions (withpen pencircle scaled 1pt withcolor .625red) ; b := a superellipsed .95 ; draw b ; b := (boundingbox p) superellipsed .95 ; fill b withcolor .85white ; draw b ; draw p withcolor black ; setbounds currentpicture to a ; \stopuseMPgraphic \defineoverlay[FunnyFrame][\useMPgraphic{FunnyFrame}] \defineframedtext [FunnyText] [frame=off, background=FunnyFrame, before={\blank[line,halfline]}, after={\blank[line]}, offset=\bodyfontsize, width=\textwidth] \defineenumeration[Theorem] [title=no, text=Theorem, prefix=yes, prefixsegments=chapter, way=bychapter, alternative=command, headcommand=\gobbleoneargument, before=\startFunnyText, after=\stopFunnyText] \defineenumeration[Lemma] [title=no, text=Lemma, prefix=yes, prefixsegments=chapter, way=bychapter, alternative=command, counter=Theorem, headcommand=\gobbleoneargument, before=\startFunnyText, after=\stopFunnyText] \defineenumeration[Coro] [title=no, text=Corollary, prefix=yes, prefixsegments=chapter, way=bychapter, alternative=command, counter=Theorem, headcommand=\gobbleoneargument, before=\startFunnyText, after=\stopFunnyText] \starttext \dorecurse{3} {\chapter{Chapter Title} \startLemma Fort's space is a compact and Hausdorff topological space. \stopLemma \startTheorem Fort's space is a compact and Hausdorff topological space. \stopTheorem \startTheorem Let $X$ be a uncountable set. Let $\infty$ is a fixed point of $X$. Let $\mathcal T$ be the family of subsets $G$ such that either (i) $\infty \notin G$ or (ii) $\infty \in G \text{ and } G^c$ is finite. The space $(X, {\mathcal T} )$ is called {\bf Fort's space}. \stopTheorem \startLemma Fort's space is a compact and Hausdorff topological space. \stopLemma \startCoro Fort's space is a compact and Hausdorff topological space. \stopCoro } \stoptext % 2nd method %2. use \MPvar{} and define 3 different backgrounds, 3 different framedtexts like % \defineoverlay[FunnyFrameT][\useMPgraphic{FunnyFrame}{what=Theorem}] % \defineframed [FunnyFramed] [frame=off, loffset=1ex, roffset=1ex, foregroundstyle=\ssbf] \startuseMPgraphic{FunnyFrame} picture p ; numeric o ; path a, b ; pair c ; p := textext.rt("\FunnyFramed{\MPvar{what} \convertedcounter[Theorem]}") ; o := BodyFontSize ; a := unitsquare xyscaled (OverlayWidth,OverlayHeight) ; p := p shifted (2o,OverlayHeight-ypart center p) ; drawoptions (withpen pencircle scaled 1pt withcolor .625red) ; b := a superellipsed .95 ; draw b ; b := (boundingbox p) superellipsed .95 ; fill b withcolor .85white ; draw b ; draw p withcolor black ; setbounds currentpicture to a ; \stopuseMPgraphic \defineoverlay[FunnyFrameT][\useMPgraphic{FunnyFrame}{what=Theorem}] \defineoverlay[FunnyFrameL][\useMPgraphic{FunnyFrame}{what=Lemma}] \defineoverlay[FunnyFrameC][\useMPgraphic{FunnyFrame}{what=Corollary}] \defineframedtext [FunnyTheorem] [frame=off, background=FunnyFrameT, before={\blank[line,halfline]}, after={\blank[line]}, offset=\bodyfontsize, width=\textwidth] \defineframedtext [FunnyLemma] [frame=off, background=FunnyFrameL, before={\blank[line,halfline]}, after={\blank[line]}, offset=\bodyfontsize, width=\textwidth] \defineframedtext [FunnyCoro] [frame=off, background=FunnyFrameC, before={\blank[line,halfline]}, after={\blank[line]}, offset=\bodyfontsize, width=\textwidth] \defineenumeration[Theorem] [title=no, prefix=yes, prefixsegments=chapter, way=bychapter, alternative=command, headcommand=\gobbleoneargument, before=\startFunnyTheorem, after=\stopFunnyTheorem] \defineenumeration[Lemma] [title=no, prefix=yes, prefixsegments=chapter, way=bychapter, alternative=command, counter=Theorem, headcommand=\gobbleoneargument, before=\startFunnyLemma, after=\stopFunnyLemma] \de
Re: [NTG-context] framed with titles
Hi, I got a partial solution to suppress the automatic display by changing “text=theorem,” to “text=,” and “number=yes” to “number=no”. But, I couldn’t remove a blank line before the main text. So it is a partial solution. > 1. to put “Theorem #.#” inside the FrameTitle?(#.# means that chapter > number.theorem number) > 2. to suppress the automatically display of “Thm #” inside the text? The command \FrameTitle{Theorem \getmarking[chapternumber].\recurselevel} shows “Theorem 1.1”, but the it shows the chapternumber -1 not the real chapternumber. Also I don’t know how to put the theorem counter after chapternumber instead of \recurselevel. Here is a sample code. Thank you for reading. Best regards, Dalyoung framed Text copied from MetaFun manual \startuseMPgraphic{FunnyFrame} picture p ; numeric o ; path a, b ; pair c ; p := textext.rt(\MPstring{FunnyFrame}) ; o := BodyFontSize ; a := unitsquare xyscaled (OverlayWidth,OverlayHeight) ; p := p shifted (2o,OverlayHeight-ypart center p) ; drawoptions (withpen pencircle scaled 1pt withcolor .625red) ; b := a superellipsed .95 ; %fill b withcolor .85white ; draw b ; b := (boundingbox p) superellipsed .95 ; fill b withcolor .85white ; %.425green;%. draw b ; draw p withcolor black ; setbounds currentpicture to a ; \stopuseMPgraphic \defineoverlay[FunnyFrame][\useMPgraphic{FunnyFrame}] \defineframedtext[FunnyText][frame=off,background=FunnyFrame, offset=\bodyfontsize, width=\textwidth]%\overlaywidth]% \def\FrameTitle #1% {\setMPtext{FunnyFrame}{\hbox spread 1em{\hss\strut\ss\bf #1\hss}}} \defineenumeration[Thm] [text=, style=, title=no, prefix=yes, prefixsegments={chapter}, way=bychapter, number=no, before={\FrameTitle {Theorem \getmarking[chapternumber].\recurselevel} \startFunnyText}, after={\stopFunnyText\blank}] %\define[2]\thm{\FrameTitle{#1} %\startFunnyText #2 \stopFunnyText} \starttext \dorecurse{3} {\chapter{Chapter Title} {\FrameTitle{Fort's space test} \startFunnyText Let $X$ be a uncountable set. Let $\infty$ is a fixed point of $X$. Let $\mathcal T$ be the family of subsets $G$ such that either (i) $\infty \notin G$ or (ii) $\infty \in G \text{ and } G^c$ is finite. The space $(X, {\mathcal T} )$ is called {\bf Fort's space}. \stopFunnyText} {\getmarking[chapternumber]}.\recurselevel}% \startThm Fort's space is a compact and Hausdorff topological space. \stopThm \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] framed with titles
Hi, Here is a sample code of framed text with titles using FunnyFrame. I tried to use it to display theorems “Theorem #.#” inside the FrameTitle, and the text in FunnyFrame. So, I defined “\defineenumeration[Thm]”. But I couldn’t make it. Is it possible to do that? If so, please let me know how to do the following two things. 1. to put “Theorem #.#” inside the FrameTitle?(#.# means that chapter number.theorem number) 2. to suppress the automatically display of “Thm #” inside the text? Thanks for reading. Best regards, Dalyoung framed Text copied from MetaFun book. \startuseMPgraphic{FunnyFrame} picture p ; numeric o ; path a, b ; pair c ; p := textext.rt(\MPstring{FunnyFrame}) ; o := BodyFontSize ; a := unitsquare xyscaled (OverlayWidth,OverlayHeight) ; p := p shifted (2o,OverlayHeight-ypart center p) ; drawoptions (withpen pencircle scaled 1pt withcolor .625red) ; b := a superellipsed .95 ; %fill b withcolor .85white ; draw b ; b := (boundingbox p) superellipsed .95 ; fill b withcolor .85white ; %.425green;%. draw b ; draw p withcolor black ; setbounds currentpicture to a ; \stopuseMPgraphic \defineoverlay[FunnyFrame][\useMPgraphic{FunnyFrame}] \defineframedtext[FunnyText][frame=off,background=FunnyFrame, offset=\bodyfontsize, width=\textwidth]%\overlaywidth]% \def\FrameTitle #1% {\setMPtext{FunnyFrame}{\hbox spread 1em{\hss\strut\ss\bf #1\hss}}} \defineenumeration[Thm] [%text=\thm, style=, title=yes, prefix=yes, prefixsegments=chapter, way=bychapter, number=yes, before={\blank[big]\FrameTitle{Theorem} \startFunnyText}, after={\stopFunnyText\blank}] \starttext {\FrameTitle{Fort's space} \startFunnyText{Fort's space} Let $X$ be a uncountable set. Let $\infty$ is a fixed point of $X$. Let $\mathcal T$ be the family of subsets $G$ such that either (i) $\infty \notin G$ or (ii) $\infty \in G \text{ and } G^c$ is finite. The space $(X, {\mathcal T} )$ is called {\bf Fort's space}. \stopFunnyText} \startThm Fort's space is a compact and Hausdorff topological space. \stopThm \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] framed with titles
Oups ! There is a little error in the sample I've given : Don't read "\knuth" but "\input knuth" below ! \startMyFrame[Title=Knuth Text] \input knuth \stopMyFrame \stoptext - Mail original - De: "Jean-Pierre Delange" <adeiman...@free.fr> À: "mailing list for ConTeXt users" <ntg-context@ntg.nl> Envoyé: Dimanche 5 Novembre 2017 11:40:03 Objet: Re: [NTG-context] framed with titles Hi Javier, As Thomas put it, it is beter to provide a minimal sample, even if it doesn't work correctly. Given that, you can dig in this list archives, which contain few questions on the topic you are dealing with. I am afraid that you can't achieve your goal (which is more or less a text within a frame with a title), without MP, which seems to me a good tool to draw such frame. I remember that Fabrice Couvreur once has asked in 2016 a similar question, in order to draw a frame for a "summary" at the end of a chapter. You need to populate the preamble of your file with something like below (you have to test it and modify it to your needs). Pay attention ! You have to give a \start command, after the \starttext command, inside the body of your text, when you want \startMyFrame[Title=A Title], and when to stop the frame with the \stopMyFrame command. Have a look to the code below and test it (note that the frame is red in this sample). % Début de la définition d'un texte encadré en rouge % Defining a framed text \defineframedtext [MyFrame] [before={\blank[3*big]}, after={\blank[5*big]}, frame=off, background=MyFrame, %width=\textwidth, width=max, height=fit, style={\setupbodyfont[9pt]}] % Defining a label \definelabel [Definition] [headstyle=\bf\smallcaps] \startuseMPgraphic{MyFrame} path b; picture p; %p := textext.rt("\white\Definition"); p := textext.rt("\white\framedtextparameter{Title}"); %p := textext.rt("\white\getvariable{text}{text1}"); p := p shifted (2BodyFontSize,OverlayHeight-ypart center p+.25ExHeight); b := boundingbox p leftenlarged .5EmWidth rightenlarged .5EmWidth; fill OverlayBox withcolor lightgray; %\MPcolor{ fill b withcolor darkred; draw bottomboundary OverlayBox withpen pencircle scaled 1pt withcolor darkred; draw topboundary OverlayBox withpen pencircle scaled 1pt withcolor darkred; draw p; setbounds currentpicture to boundingbox currentpicture enlarged 2mm; \stopuseMPgraphic \defineoverlay [MyFrame] [\useMPgraphic{MyFrame}] % Fin de la définition d'un texte encadré en rouge \starttext \startMyFrame[Title=Knuth Text] \knuth \stopMyFrame \stoptext Hope it helps ! JP - Mail original - De: "Javier M Mora" <jmm...@us.es> À: ntg-context@ntg.nl Envoyé: Dimanche 5 Novembre 2017 10:14:47 Objet: [NTG-context] framed with titles Hi, I'm trying to generate a frame with a title. My first idea is something like (ASCII Art): +- Title -+ | Text text text text | | more and more text | +--+ A frame with title breaking the top line . But I am not picky and something like beamer floating boxes (theorem, proof, ...) for latex is good for me too. In wiki, the frames doesn't have title and I'm not sure about if I have to fight with overlays, with MP and this is out of my league. Questions: * what is the way for implement a title in the frame? * Could you write a minimal example witch allows me to complete it for my needs? Thanks. Javier M. Mora ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context webpage : http://www.pragma-ade.nl / http://context.aanhet.net archive : https://bitbucket.org/phg/context-mirror/commits/ wiki : http://contextgarden.net ___ ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context webpage : http://www.pragma-ade.nl / http://context.aanhet.net archive : https://bitbucket.org/phg/context-mirror/commits/ wiki : http://contextgarden.net ___ ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context webpage : http://www.pragma-ade.nl / http://context.aanhet.net archive : https://bitbucket.org/phg/context-mirror/commits/ wiki : http://contextgarden.net ___
Re: [NTG-context] framed with titles
Hi Javier, As Thomas put it, it is beter to provide a minimal sample, even if it doesn't work correctly. Given that, you can dig in this list archives, which contain few questions on the topic you are dealing with. I am afraid that you can't achieve your goal (which is more or less a text within a frame with a title), without MP, which seems to me a good tool to draw such frame. I remember that Fabrice Couvreur once has asked in 2016 a similar question, in order to draw a frame for a "summary" at the end of a chapter. You need to populate the preamble of your file with something like below (you have to test it and modify it to your needs). Pay attention ! You have to give a \start command, after the \starttext command, inside the body of your text, when you want \startMyFrame[Title=A Title], and when to stop the frame with the \stopMyFrame command. Have a look to the code below and test it (note that the frame is red in this sample). % Début de la définition d'un texte encadré en rouge % Defining a framed text \defineframedtext [MyFrame] [before={\blank[3*big]}, after={\blank[5*big]}, frame=off, background=MyFrame, %width=\textwidth, width=max, height=fit, style={\setupbodyfont[9pt]}] % Defining a label \definelabel [Definition] [headstyle=\bf\smallcaps] \startuseMPgraphic{MyFrame} path b; picture p; %p := textext.rt("\white\Definition"); p := textext.rt("\white\framedtextparameter{Title}"); %p := textext.rt("\white\getvariable{text}{text1}"); p := p shifted (2BodyFontSize,OverlayHeight-ypart center p+.25ExHeight); b := boundingbox p leftenlarged .5EmWidth rightenlarged .5EmWidth; fill OverlayBox withcolor lightgray; %\MPcolor{ fill b withcolor darkred; draw bottomboundary OverlayBox withpen pencircle scaled 1pt withcolor darkred; draw topboundary OverlayBox withpen pencircle scaled 1pt withcolor darkred; draw p; setbounds currentpicture to boundingbox currentpicture enlarged 2mm; \stopuseMPgraphic \defineoverlay [MyFrame] [\useMPgraphic{MyFrame}] % Fin de la définition d'un texte encadré en rouge \starttext \startMyFrame[Title=Knuth Text] \knuth \stopMyFrame \stoptext Hope it helps ! JP - Mail original - De: "Javier M Mora" <jmm...@us.es> À: ntg-context@ntg.nl Envoyé: Dimanche 5 Novembre 2017 10:14:47 Objet: [NTG-context] framed with titles Hi, I'm trying to generate a frame with a title. My first idea is something like (ASCII Art): +- Title -+ | Text text text text | | more and more text | +--+ A frame with title breaking the top line . But I am not picky and something like beamer floating boxes (theorem, proof, ...) for latex is good for me too. In wiki, the frames doesn't have title and I'm not sure about if I have to fight with overlays, with MP and this is out of my league. Questions: * what is the way for implement a title in the frame? * Could you write a minimal example witch allows me to complete it for my needs? Thanks. Javier M. Mora ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/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] Centering an algorithm
Hello, Wolfgang offered me a way to present an algorithm. Can not I center it ? Thank you. Fabrice \definecolor[MyBlue][c=0.06 , m=0.03, y=0.00, k=0.00] \defineframedtext [algorithmframe] [width=fit, background=color, foregroundstyle={\tt}, backgroundcolor=MyBlue, framecolor=darkblue, corner=round] \definelines [algorithm] [space=on, before=\startalgorithmframe, after=\stopalgorithmframe] \starttext \startlinecorrection[blank] \startmidaligned \startalgorithm Variables : \math{V} est un réel \math{N} est un entier naturel Début Affecter à \math{V} la valeur 354\,412 Affecter à \math{N} la valeur 0 Tant que \unknown\unknown \math{N} prend la valeur \unknown\unknown \math{V} prend la valeur \unknown\unknown Fin Tant que Afficher \unknown\unknown Fin \stopalgorithm \stopmidaligned \stoplinecorrection \stoptext ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context webpage : http://www.pragma-ade.nl / http://context.aanhet.net archive : https://bitbucket.org/phg/context-mirror/commits/ wiki : http://contextgarden.net ___
Re: [NTG-context] Background with rounded corners (Metafun)
> \defineornament >[FrameTitle] >[preset=lefttop] I tried this example and I wonder what the [preset=lefttop] does. Because whatever I fill in for lefttop, the ornament appears always in the topleft corner and nowhere else. Hans van der Meer > On 23 Aug 2017, at 00:50, Aditya Mahajan <adit...@umich.edu> wrote: > > On Wed, 23 Aug 2017, Fabrice Couvreur wrote: > >> Hello, >> I would like to have three corners rounded as in the figure. > > Not sure if you had simplified your example or not. But if all you want is a > rounded corner, you can consider using corner=number parameter of framed and > framed text: > > http://wiki.contextgarden.net/Framed#Rounded_Corners > > Here is an example (that does not use metapost). > > \definecolor[MyColorA][r=0.8784, g=0.8784, b=0.8784] > \definecolor[MyColorB][c=0.00,m=0.27,y=1.00,k=0.00] > > \defineornament >[FrameTitle] >[preset=lefttop] >[ > frame=off, > foregroundstyle=\bfx, > foregroundcolor=white, > background=color, > backgroundcolor=MyColorB, >] > > \defineframedtext > [FramedText] > [ >offset=0.6em, >toffset=\lineheight, >background=color, >backgroundcolor=MyColorA, >foregroundstyle={\switchtobodyfont[10pt]}, >align=verytolerant, >frame=off, >corner=01, > ] > > > \showframe > \starttext > > \FrameTitle{Info}{\startFramedText[width=10cm] > L'équivalent vingt pieds (EVP) est une unité de mesure de conteneurs > (de longueur courante 20 pieds, soit environ \unit{6,1 meter}). > > 1 EVP représente environ \unit{38,5 cubic meter}. >\stopFramedText} > > \stoptext___ > If your question is of interest to others as well, please add an entry to the > Wiki! > > maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context > webpage : http://www.pragma-ade.nl / http://context.aanhet.net > archive : https://bitbucket.org/phg/context-mirror/commits/ > wiki : http://contextgarden.net > ___ ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/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] Background with rounded corners (Metafun)
Hi Pablo, I speak of the text in the frame as in the image https://mail.google.com/mail/u/0/?ui=2=d5d294e54c=att=15e0c2d8c5b8cf7c=0.1=safe=f_j6o6zsx20 Fabrice 2017-08-30 22:45 GMT+02:00 Pablo Rodriguez <oi...@gmx.es>: > On 08/30/2017 06:07 PM, Fabrice Couvreur wrote: > > Hi Aditya, > > I tried : > > [...] > > to have my text wrapped around the ornament as in the figure but it > > does not work. > > Hi Fabrice, > > sorry if I’m missing something, but I wonder whether the next sample is > what you intend. > > \definecolor[MyColorA][r=0.8784, g=0.8784, b=0.8784] > \definecolor[MyColorB][c=0.00,m=0.27,y=1.00,k=0.00] > > \defineornament > [FrameTitle] > [preset=lefttop] > [ > frame=off, > foregroundstyle=\bfx, > foregroundcolor=white, > background=color, > backgroundcolor=MyColorB, > ] > > > \defineframedtext > [FramedText] > [ > offset=0.6em, > toffset=\lineheight, > background=color, > backgroundcolor=MyColorA, > foregroundstyle={\switchtobodyfont[10pt]}, > align=verytolerant, > alternative=serried, % text wrapped > frame=off, > corner=round, > ] > > \definefloat > [recipe] > [figure] > > \setupfloat > [recipe] > [default={right,none}] > > \showframe > > \starttext > \placerecipe{} >{\FrameTitle{Info}{\startFramedText[width=10cm] > L'équivalent vingt pieds (EVP) est une unité de mesure de > conteneurs (de longueur courante 20 pieds, soit environ > \unit{6,1 meter}). > > 1 EVP représente environ \unit{38,5 cubic meter}. > \stopFramedText}} > > \input zapf > > \stoptext > > Just in case it helps, > > Pablo > -- > http://www.ousia.tk > > ___ > If your question is of interest to others as well, please add an entry to > the Wiki! > > maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/ > listinfo/ntg-context > webpage : http://www.pragma-ade.nl / http://context.aanhet.net > archive : https://bitbucket.org/phg/context-mirror/commits/ > wiki : http://contextgarden.net > > ___ > ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context webpage : http://www.pragma-ade.nl / http://context.aanhet.net archive : https://bitbucket.org/phg/context-mirror/commits/ wiki : http://contextgarden.net ___
Re: [NTG-context] Background with rounded corners (Metafun)
On 08/30/2017 06:07 PM, Fabrice Couvreur wrote: > Hi Aditya, > I tried : > [...] > to have my text wrapped around the ornament as in the figure but it > does not work. Hi Fabrice, sorry if I’m missing something, but I wonder whether the next sample is what you intend. \definecolor[MyColorA][r=0.8784, g=0.8784, b=0.8784] \definecolor[MyColorB][c=0.00,m=0.27,y=1.00,k=0.00] \defineornament [FrameTitle] [preset=lefttop] [ frame=off, foregroundstyle=\bfx, foregroundcolor=white, background=color, backgroundcolor=MyColorB, ] \defineframedtext [FramedText] [ offset=0.6em, toffset=\lineheight, background=color, backgroundcolor=MyColorA, foregroundstyle={\switchtobodyfont[10pt]}, align=verytolerant, alternative=serried, % text wrapped frame=off, corner=round, ] \definefloat [recipe] [figure] \setupfloat [recipe] [default={right,none}] \showframe \starttext \placerecipe{} {\FrameTitle{Info}{\startFramedText[width=10cm] L'équivalent vingt pieds (EVP) est une unité de mesure de conteneurs (de longueur courante 20 pieds, soit environ \unit{6,1 meter}). 1 EVP représente environ \unit{38,5 cubic meter}. \stopFramedText}} \input zapf \stoptext Just in case it helps, Pablo -- http://www.ousia.tk ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context webpage : http://www.pragma-ade.nl / http://context.aanhet.net archive : https://bitbucket.org/phg/context-mirror/commits/ wiki : http://contextgarden.net ___
Re: [NTG-context] Background with rounded corners (Metafun)
Hi Aditya, I tried : \defineframedtext [FramedText] [ offset=0.6em, toffset=\lineheight, background=color, backgroundcolor=MyColorA, foregroundstyle={\switchtobodyfont[10pt]}, align=verytolerant, alternative=serried, % text wrapped frame=off, corner=00, ] to have my text wrapped around the ornament as in the figure but it does not work. Thanks Fabrice 2017-08-23 1:20 GMT+02:00 Fabrice Couvreur <fabrice1.couvr...@gmail.com>: > Sorry 'corner=00' ! > > 2017-08-23 1:01 GMT+02:00 Fabrice Couvreur <fabrice1.couvr...@gmail.com>: > >> Hi Aditya, >> Sorry I forgot to attach the image of what I want to do. I know corner=number >> parameter of framed and framed text but I wanted to do it with Metafun. >> Thank you >> Fabrice >> >> 2017-08-23 0:50 GMT+02:00 Aditya Mahajan <adit...@umich.edu>: >> >>> On Wed, 23 Aug 2017, Fabrice Couvreur wrote: >>> >>> Hello, >>>> I would like to have three corners rounded as in the figure. >>>> >>> >>> Not sure if you had simplified your example or not. But if all you want >>> is a rounded corner, you can consider using corner=number parameter of >>> framed and framed text: >>> >>> http://wiki.contextgarden.net/Framed#Rounded_Corners >>> >>> Here is an example (that does not use metapost). >>> >>> \definecolor[MyColorA][r=0.8784, g=0.8784, b=0.8784] >>> \definecolor[MyColorB][c=0.00,m=0.27,y=1.00,k=0.00] >>> >>> \defineornament >>> [FrameTitle] >>> [preset=lefttop] >>> [ >>> frame=off, >>> foregroundstyle=\bfx, >>> foregroundcolor=white, >>> background=color, >>> backgroundcolor=MyColorB, >>> ] >>> >>> \defineframedtext >>> [FramedText] >>> [ >>> offset=0.6em, >>> toffset=\lineheight, >>> background=color, >>> backgroundcolor=MyColorA, >>> foregroundstyle={\switchtobodyfont[10pt]}, >>> align=verytolerant, >>> frame=off, >>> corner=01, >>> ] >>> >>> >>> \showframe >>> \starttext >>> >>> \FrameTitle{Info}{\startFramedText[width=10cm] >>> L'équivalent vingt pieds (EVP) est une unité de mesure de >>> conteneurs >>> (de longueur courante 20 pieds, soit environ \unit{6,1 meter}). >>> >>> 1 EVP représente environ \unit{38,5 cubic meter}. >>> \stopFramedText} >>> >>> \stoptext >>> >>> ___ >>> If your question is of interest to others as well, please add an entry >>> to the Wiki! >>> >>> maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/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 >>> >>> ___ >>> >> >> > ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/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] Background with rounded corners (Metafun)
Sorry 'corner=00' ! 2017-08-23 1:01 GMT+02:00 Fabrice Couvreur <fabrice1.couvr...@gmail.com>: > Hi Aditya, > Sorry I forgot to attach the image of what I want to do. I know corner=number > parameter of framed and framed text but I wanted to do it with Metafun. > Thank you > Fabrice > > 2017-08-23 0:50 GMT+02:00 Aditya Mahajan <adit...@umich.edu>: > >> On Wed, 23 Aug 2017, Fabrice Couvreur wrote: >> >> Hello, >>> I would like to have three corners rounded as in the figure. >>> >> >> Not sure if you had simplified your example or not. But if all you want >> is a rounded corner, you can consider using corner=number parameter of >> framed and framed text: >> >> http://wiki.contextgarden.net/Framed#Rounded_Corners >> >> Here is an example (that does not use metapost). >> >> \definecolor[MyColorA][r=0.8784, g=0.8784, b=0.8784] >> \definecolor[MyColorB][c=0.00,m=0.27,y=1.00,k=0.00] >> >> \defineornament >> [FrameTitle] >> [preset=lefttop] >> [ >> frame=off, >> foregroundstyle=\bfx, >> foregroundcolor=white, >> background=color, >> backgroundcolor=MyColorB, >> ] >> >> \defineframedtext >> [FramedText] >> [ >> offset=0.6em, >> toffset=\lineheight, >> background=color, >> backgroundcolor=MyColorA, >> foregroundstyle={\switchtobodyfont[10pt]}, >> align=verytolerant, >> frame=off, >> corner=01, >> ] >> >> >> \showframe >> \starttext >> >> \FrameTitle{Info}{\startFramedText[width=10cm] >> L'équivalent vingt pieds (EVP) est une unité de mesure de conteneurs >> (de longueur courante 20 pieds, soit environ \unit{6,1 meter}). >> >> 1 EVP représente environ \unit{38,5 cubic meter}. >> \stopFramedText} >> >> \stoptext >> >> ___ >> If your question is of interest to others as well, please add an entry to >> the Wiki! >> >> maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/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 >> >> ___ >> > > ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/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] Background with rounded corners (Metafun)
With your solution 'corner=01' 2017-08-23 1:01 GMT+02:00 Fabrice Couvreur <fabrice1.couvr...@gmail.com>: > Hi Aditya, > Sorry I forgot to attach the image of what I want to do. I know corner=number > parameter of framed and framed text but I wanted to do it with Metafun. > Thank you > Fabrice > > 2017-08-23 0:50 GMT+02:00 Aditya Mahajan <adit...@umich.edu>: > >> On Wed, 23 Aug 2017, Fabrice Couvreur wrote: >> >> Hello, >>> I would like to have three corners rounded as in the figure. >>> >> >> Not sure if you had simplified your example or not. But if all you want >> is a rounded corner, you can consider using corner=number parameter of >> framed and framed text: >> >> http://wiki.contextgarden.net/Framed#Rounded_Corners >> >> Here is an example (that does not use metapost). >> >> \definecolor[MyColorA][r=0.8784, g=0.8784, b=0.8784] >> \definecolor[MyColorB][c=0.00,m=0.27,y=1.00,k=0.00] >> >> \defineornament >> [FrameTitle] >> [preset=lefttop] >> [ >> frame=off, >> foregroundstyle=\bfx, >> foregroundcolor=white, >> background=color, >> backgroundcolor=MyColorB, >> ] >> >> \defineframedtext >> [FramedText] >> [ >> offset=0.6em, >> toffset=\lineheight, >> background=color, >> backgroundcolor=MyColorA, >> foregroundstyle={\switchtobodyfont[10pt]}, >> align=verytolerant, >> frame=off, >> corner=01, >> ] >> >> >> \showframe >> \starttext >> >> \FrameTitle{Info}{\startFramedText[width=10cm] >> L'équivalent vingt pieds (EVP) est une unité de mesure de conteneurs >> (de longueur courante 20 pieds, soit environ \unit{6,1 meter}). >> >> 1 EVP représente environ \unit{38,5 cubic meter}. >> \stopFramedText} >> >> \stoptext >> >> ___ >> If your question is of interest to others as well, please add an entry to >> the Wiki! >> >> maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/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 >> >> ___ >> > > ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/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] Background with rounded corners (Metafun)
Hi Aditya, Sorry I forgot to attach the image of what I want to do. I know corner=number parameter of framed and framed text but I wanted to do it with Metafun. Thank you Fabrice 2017-08-23 0:50 GMT+02:00 Aditya Mahajan <adit...@umich.edu>: > On Wed, 23 Aug 2017, Fabrice Couvreur wrote: > > Hello, >> I would like to have three corners rounded as in the figure. >> > > Not sure if you had simplified your example or not. But if all you want is > a rounded corner, you can consider using corner=number parameter of framed > and framed text: > > http://wiki.contextgarden.net/Framed#Rounded_Corners > > Here is an example (that does not use metapost). > > \definecolor[MyColorA][r=0.8784, g=0.8784, b=0.8784] > \definecolor[MyColorB][c=0.00,m=0.27,y=1.00,k=0.00] > > \defineornament > [FrameTitle] > [preset=lefttop] > [ > frame=off, > foregroundstyle=\bfx, > foregroundcolor=white, > background=color, > backgroundcolor=MyColorB, > ] > > \defineframedtext > [FramedText] > [ > offset=0.6em, > toffset=\lineheight, > background=color, > backgroundcolor=MyColorA, > foregroundstyle={\switchtobodyfont[10pt]}, > align=verytolerant, > frame=off, > corner=01, > ] > > > \showframe > \starttext > > \FrameTitle{Info}{\startFramedText[width=10cm] > L'équivalent vingt pieds (EVP) est une unité de mesure de conteneurs > (de longueur courante 20 pieds, soit environ \unit{6,1 meter}). > > 1 EVP représente environ \unit{38,5 cubic meter}. > \stopFramedText} > > \stoptext > > ___ > If your question is of interest to others as well, please add an entry to > the Wiki! > > maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/ > listinfo/ntg-context > webpage : http://www.pragma-ade.nl / http://context.aanhet.net > archive : https://bitbucket.org/phg/context-mirror/commits/ > wiki : http://contextgarden.net > > ___ > ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/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] Background with rounded corners (Metafun)
On Wed, 23 Aug 2017, Fabrice Couvreur wrote: Hello, I would like to have three corners rounded as in the figure. Not sure if you had simplified your example or not. But if all you want is a rounded corner, you can consider using corner=number parameter of framed and framed text: http://wiki.contextgarden.net/Framed#Rounded_Corners Here is an example (that does not use metapost). \definecolor[MyColorA][r=0.8784, g=0.8784, b=0.8784] \definecolor[MyColorB][c=0.00,m=0.27,y=1.00,k=0.00] \defineornament [FrameTitle] [preset=lefttop] [ frame=off, foregroundstyle=\bfx, foregroundcolor=white, background=color, backgroundcolor=MyColorB, ] \defineframedtext [FramedText] [ offset=0.6em, toffset=\lineheight, background=color, backgroundcolor=MyColorA, foregroundstyle={\switchtobodyfont[10pt]}, align=verytolerant, frame=off, corner=01, ] \showframe \starttext \FrameTitle{Info}{\startFramedText[width=10cm] L'équivalent vingt pieds (EVP) est une unité de mesure de conteneurs (de longueur courante 20 pieds, soit environ \unit{6,1 meter}). 1 EVP représente environ \unit{38,5 cubic meter}. \stopFramedText} \stoptext___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context webpage : http://www.pragma-ade.nl / http://context.aanhet.net archive : https://bitbucket.org/phg/context-mirror/commits/ wiki : http://contextgarden.net ___
[NTG-context] Background with rounded corners (Metafun)
Hello, I would like to have three corners rounded as in the figure. Thank you Fabrice \definecolor[MyColorA][r=0.8784, g=0.8784, b=0.8784] \definecolor[MyColorB][c=0.00,m=0.27,y=1.00,k=0.00] \startuseMPgraphic{MyFrame} path b ; picture p ; p := textext.rt("\bf\tfx\white\framedtextparameter{Title}") ; p := p shifted (.3EmWidth,OverlayHeight-.6EmWidth) ; b := boundingbox p enlarged .3EmWidth ; fill OverlayBox withcolor \MPcolor{MyColorA} ; fill b withcolor \MPcolor{MyColorB} ; draw p ; setbounds currentpicture to boundingbox currentpicture enlarged 2mm ; \stopuseMPgraphic \defineoverlay [MyFrame] [\useMPgraphic{MyFrame}] \defineframedtext [MyFrame] [frame=off, foregroundstyle={\switchtobodyfont[10pt]}, background=MyFrame, align={verytolerant}, height=fit] \definefloat [recipe] [figure] \setupfloat [recipe] [default={right,none}] \showframe \starttext \placerecipe{} {\startMyFrame[Title=Info,width=10cm] L'équivalent vingt pieds (EVP) est une unité de mesure de conteneurs (de longueur courante 20 pieds, soit environ \unit{6,1 meter}). 1 EVP représente environ \unit{38,5 cubic meter}. \stopMyFrame } \input knuth \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 ___