* \startalign \stopalign equation number placement seems wrong @ 2016-08-17 12:20 Mikael P. Sundqvist 2016-08-17 13:23 ` Otared Kavian 0 siblings, 1 reply; 9+ messages in thread From: Mikael P. Sundqvist @ 2016-08-17 12:20 UTC (permalink / raw) To: mailing list for ConTeXt users [-- Attachment #1: Type: text/plain, Size: 536 bytes --] Hi, The test file \starttext \placeformula \startformula \startalign \NC \exp(t_1)\exp(t_2)\NC =x_1x_2=\exp(\ln(x_1x_2))\NR \NC \NC =\exp(\ln x_1+\ln x_2)=\exp(t_1+t_2).\NR[eq:explag1] \stopalign \stopformula \placeformula \startformula 1+1=2 \stopformula \stoptext gives the attached pdf. In the first formula, the location of the equation number seems to be wrong (I would have expected it to be to the right, like in the second example). In the (nice, but rather old now) My Way by Aditya, this does not seem to happen. /Mikael [-- Attachment #2: ctx-example3.pdf --] [-- Type: application/pdf, Size: 9314 bytes --] [-- Attachment #3: Type: text/plain, Size: 485 bytes --] ___________________________________________________________________________________ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context webpage : http://www.pragma-ade.nl / http://tex.aanhet.net archive : http://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___________________________________________________________________________________ ^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: \startalign \stopalign equation number placement seems wrong 2016-08-17 12:20 \startalign \stopalign equation number placement seems wrong Mikael P. Sundqvist @ 2016-08-17 13:23 ` Otared Kavian 2016-08-17 14:36 ` space before/after colored framed text Jean-Pierre Delange 2016-08-28 15:08 ` \startalign \stopalign equation number placement seems wrong Mikael P. Sundqvist 0 siblings, 2 replies; 9+ messages in thread From: Otared Kavian @ 2016-08-17 13:23 UTC (permalink / raw) To: mailing list for ConTeXt users Hi Mikael, I confirm that the latest beta (ConTeXt version 2016.08.11 13:56 MKIV beta) has the issue you are reporting. This bug is absent from the current version from TeXLive2016, that is ConTeXt version 2016.05.17 19:20 MKIV current. Some time ago I reported an analogous issue with startalign, and it seemed to me that Hans fixed it. But it appeared again with the beta 2016.08.11 13:56. Best regards: OK > On 17 Aug 2016, at 14:20, Mikael P. Sundqvist <mickep@gmail.com> wrote: > > Hi, > > The test file > > \starttext > \placeformula > \startformula > \startalign > \NC \exp(t_1)\exp(t_2)\NC =x_1x_2=\exp(\ln(x_1x_2))\NR > \NC \NC =\exp(\ln x_1+\ln x_2)=\exp(t_1+t_2).\NR[eq:explag1] > \stopalign > \stopformula > > \placeformula > \startformula > 1+1=2 > \stopformula > \stoptext > > gives the attached pdf. In the first formula, the location of the > equation number seems to be wrong (I would have expected it to be to > the right, like in the second example). In the (nice, but rather old > now) My Way by Aditya, this does not seem to happen. > > /Mikael > <ctx-example3.pdf>___________________________________________________________________________________ > If your question is of interest to others as well, please add an entry to the Wiki! > > maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context > webpage : http://www.pragma-ade.nl / http://tex.aanhet.net > archive : http://foundry.supelec.fr/projects/contextrev/ > wiki : http://contextgarden.net > ___________________________________________________________________________________ ___________________________________________________________________________________ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context webpage : http://www.pragma-ade.nl / http://tex.aanhet.net archive : http://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___________________________________________________________________________________ ^ permalink raw reply [flat|nested] 9+ messages in thread
* space before/after colored framed text 2016-08-17 13:23 ` Otared Kavian @ 2016-08-17 14:36 ` Jean-Pierre Delange 2016-08-17 15:14 ` Thomas A. Schmitz 2016-08-28 15:08 ` \startalign \stopalign equation number placement seems wrong Mikael P. Sundqvist 1 sibling, 1 reply; 9+ messages in thread From: Jean-Pierre Delange @ 2016-08-17 14:36 UTC (permalink / raw) To: mailing list for ConTeXt users [-- Attachment #1.1: Type: text/plain, Size: 1883 bytes --] Dear list, I use for one of my own projects some code given by Wolfgang to Fabrice (see below), which is working fine : at the end of each chapter, I've placed a framed text as a summary (25 lines with few footnotes). I have 2 questions : 1. What are the keys to manage the space before and after the frame ? Here I have : \defineframedtext [MyFrame] [before={\blank}, after={\blank}, frame=off, background=MyFrame, %width=\textwidth, width=max, height=fit, style=regular] But the [before={\blank} command forces the framed text to be printed on the next page. Is there other keys to better fit this framed text ? 2. As you see, the key style is 'regular' here; I know it might be 'italics' or 'bold'. But I want to play with the size of the fonts only in this frame. How can achieve that ? Many thanks for your help. JP This is the sample code : % Begin framed text settings \defineframedtext [MyFrame] [before={\blank}, after={\blank}, frame=off, background=MyFrame, %width=\textwidth, width=max, height=fit, style=regular] \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}] % end framed text settings [-- Attachment #1.2: Type: text/html, Size: 10367 bytes --] [-- Attachment #2: Type: text/plain, Size: 485 bytes --] ___________________________________________________________________________________ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context webpage : http://www.pragma-ade.nl / http://tex.aanhet.net archive : http://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___________________________________________________________________________________ ^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: space before/after colored framed text 2016-08-17 14:36 ` space before/after colored framed text Jean-Pierre Delange @ 2016-08-17 15:14 ` Thomas A. Schmitz 2016-08-17 15:57 ` Jean-Pierre Delange 0 siblings, 1 reply; 9+ messages in thread From: Thomas A. Schmitz @ 2016-08-17 15:14 UTC (permalink / raw) To: mailing list for ConTeXt users > On 17 Aug 2016, at 16:36, Jean-Pierre Delange <adeimantos@free.fr> wrote: > > Dear list, > > I use for one of my own projects some code given by Wolfgang to Fabrice (see below), which is working fine : at the end of each chapter, I've placed a framed text as a summary (25 lines with few footnotes). I have 2 questions : You’ve been told before: please make minimal compilable examples. Yours is neither minimal (contains lots of completely extraneous stuff) nor does it compile. This is considered rude because it is taken to mean: I value my time so much more than yours. Please don’t do this. Thomas ___________________________________________________________________________________ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context webpage : http://www.pragma-ade.nl / http://tex.aanhet.net archive : http://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___________________________________________________________________________________ ^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: space before/after colored framed text 2016-08-17 15:14 ` Thomas A. Schmitz @ 2016-08-17 15:57 ` Jean-Pierre Delange 2016-08-17 17:02 ` Pablo Rodriguez 0 siblings, 1 reply; 9+ messages in thread From: Jean-Pierre Delange @ 2016-08-17 15:57 UTC (permalink / raw) To: mailing list for ConTeXt users [-- Attachment #1.1: Type: text/plain, Size: 5351 bytes --] Hi Thomas, I am very sorry. As a beginner with ConTeXt, I surely make mistakes, even in the way to show which issues I am confronting to. Maybe I ought to give the whole code where some errors occured, but I thought that the code was too long to be mailed to this list. That's why I have mailed a piece of the code concerning a colored framed but not the whole stuff. Thinking the issue occured with this special frame (and not with any other kind of frame), I have given this particular code. BTW, in order to make understandable what kind of issue occured by this particular frame, I didn't want to give a sample too huge (I place this colored frame at the end of each section of my book). Anyway, I try to understand how manage the place of THIS colored frame just after a text (with no rejection of the frame to the following page); and I will be very pleased to understand how to resize the text font inside the frame. At last, how to manage footnotes within this framed text (the footnote numbering appears, but the text doesn't appear inside nor outside the framed text). Thank you very much for your help. JP See below the whole sample code : \setuplanguage[fr][patterns={fr,agr}] \mainlanguage[fr] \setcharacterspacing[frenchpunctuation] \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] \definefallbackfamily[mainface][serif][Theano Didot][preset=range:greek, it={Old Standard Italic}, force=yes] \definefallbackfamily [mainface] [rm] [ipaexmincho] [range=cjkunifiedideographs] \definefallbackfamily[mainface] [serif] [nafeesnastaleeq] [range=arabic] \definefontfamily [mainface] [serif] [GaramondNo8][sc=NewG8 Regular SC] \definefontfamily [mainface] [sans] [FreeSans] [rscale=0.7] \definefontfamily[mainface] [serif] [GFS Didot] \setupbodyfont[mainface] \setupcolors[state=start] \setupindenting[1.5em] \setupindenting[yes] \setupwhitespace[medium] \setupinterlinespace[line=3.2ex] \setupitemize[each][margin=yes] \setuphead[title][header=empty] \setupheader[style={\sc}] \setupfooter[style={\itxx}] \setupheadertexts[Cours de Philosophie][][][{\getmarking[section]}] \setupfootertexts[][][][© Jean-Pierre Delange, 2016 — La reproduction de ce texte est soumise à autorisation.] \setupsymbolset[text] % Début de la définition d'un texte encadré en rouge \defineframedtext [MyFrame] [before={\blank}, after={\blank}, frame=off, background=MyFrame, %width=\textwidth, width=max, height=fit, style=regular] \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 \dorecurse{4} \input ward \startMyFrame[Title=Avertissement] La plupart des termes et des expressions qui doivent attirer l'attention du lecteur sont soulignés ici par des {\em italiques}. On trouvera {\em dans la marge} du texte de brèves indications biographiques et bibliographiques, tandis que les explications plus développées sont renvoyées en {\em notes de bas de page}. On trouvera à la fin de cet ouvrage une bibliographie des textes cités\footnote{Seuls les références aux textes classiques sont données, à l'exception des textes spécialisés}. \stopMyFrame \stoptext Le 17/08/2016 à 17:14, Thomas A. Schmitz a écrit : >> On 17 Aug 2016, at 16:36, Jean-Pierre Delange <adeimantos@free.fr> wrote: >> >> Dear list, >> >> I use for one of my own projects some code given by Wolfgang to Fabrice (see below), which is working fine : at the end of each chapter, I've placed a framed text as a summary (25 lines with few footnotes). I have 2 questions : > You’ve been told before: please make minimal compilable examples. Yours is neither minimal (contains lots of completely extraneous stuff) nor does it compile. This is considered rude because it is taken to mean: I value my time so much more than yours. Please don’t do this. > > Thomas > ___________________________________________________________________________________ > If your question is of interest to others as well, please add an entry to the Wiki! > > maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context > webpage : http://www.pragma-ade.nl / http://tex.aanhet.net > archive : http://foundry.supelec.fr/projects/contextrev/ > wiki : http://contextgarden.net > ___________________________________________________________________________________ [-- Attachment #1.2: Type: text/html, Size: 17271 bytes --] [-- Attachment #2: Type: text/plain, Size: 485 bytes --] ___________________________________________________________________________________ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context webpage : http://www.pragma-ade.nl / http://tex.aanhet.net archive : http://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___________________________________________________________________________________ ^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: space before/after colored framed text 2016-08-17 15:57 ` Jean-Pierre Delange @ 2016-08-17 17:02 ` Pablo Rodriguez 2016-08-17 21:59 ` Jean-Pierre Delange 0 siblings, 1 reply; 9+ messages in thread From: Pablo Rodriguez @ 2016-08-17 17:02 UTC (permalink / raw) To: mailing list for ConTeXt users Hi Jean-Pierre, sorry, for top-posting, but I think this way the reply will be clearer. In your previous sample you had two questions. This sample shows the answer: \defineframedtext [MyFrame] [before={\blank[6*big]}, after={\blank[6*big]}, style={\setupbodyfont[5pt]}] \starttext \dorecurse{3}{\input zapf \startMyFrame\input knuth\stopMyFrame} \stoptext 1. before and after control distance in elements. 2. \setupbodyfont[dimension] or \switchtobodyfont[dimension] as values for the "style" key modify the size (as shown above). Other ways of doing it are \tfx, \itx and so on. Your sample isn’t minimal and it doesn’t compile. \dorecurse needs two arguments (two pair of braces: {}). The second is missing. BTW, serif for mainface is defined twice. GFS Didot is selected after Garamond. Please compile the following: 8<-------------------------------------------------------------------- \showframe\showgrid \setuplanguage[fr][patterns={fr,agr}] \mainlanguage[fr] \setcharacterspacing[frenchpunctuation] \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] \definefontfamily[mainface] [serif] [GFS Didot] \setupbodyfont[mainface] \setupindenting[1.5em] \setupindenting[yes] \setupwhitespace[medium] \setupinterlinespace[line=3.2ex] \setuphead[title][header=empty] \setupheader[style={\sc}] \setupfooter[style={\itxx}] \setupheadertexts[Cours de Philosophie][][][{\getmarking[section]}] \setupfootertexts[][][][© Jean-Pierre Delange, 2016 — La reproduction de ce texte est soumise à autorisation.] %~ \setupsymbolset[text] % Début de la définition d'un texte encadré en rouge \defineframedtext [MyFrame] [before={\blank}, after={\blank}, frame=off, background=MyFrame, %width=\textwidth, width=max, height=fit] \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 \dorecurse{4}{ \input ward \startMyFrame[Title=Avertissement] La plupart des termes et des expressions qui doivent attirer l'attention du lecteur sont soulignés ici par des {\em italiques}. On trouvera {\em dans la marge} du texte de brèves indications biographiques et bibliographiques, tandis que les explications plus développées sont renvoyées en {\em notes de bas de page}. On trouvera à la fin de cet ouvrage une bibliographie des textes cités\footnote{Seuls les références aux textes classiques sont données, à l'exception des textes spécialisés}. \stopMyFrame} \stoptext -------------------------------------------------------------------->8 AfaIk, frames cannot be split, so the whole frame is moved to the next page. It needs 8 lines and it only has 6 in the first page. I hope it is clear now. Pablo On 08/17/2016 05:57 PM, Jean-Pierre Delange wrote: > Hi Thomas, > > I am very sorry. As a beginner with ConTeXt, I surely make mistakes, > even in the way to show which issues I am confronting to. Maybe I ought > to give the whole code where some errors occured, but I thought that the > code was too long to be mailed to this list. That's why I have mailed a > piece of the code concerning a colored framed but not the whole stuff. > Thinking the issue occured with this special frame (and not with any > other kind of frame), I have given this particular code. > > BTW, in order to make understandable what kind of issue occured by this > particular frame, I didn't want to give a sample too huge (I place this > colored frame at the end of each section of my book). Anyway, I try to > understand how manage the place of THIS colored frame just after a text > (with no rejection of the frame to the following page); and I will be > very pleased to understand how to resize the text font inside the frame. > At last, how to manage footnotes within this framed text (the footnote > numbering appears, but the text doesn't appear inside nor outside the > framed text). > > Thank you very much for your help. > > JP > > See below the whole sample code : > > \setuplanguage[fr][patterns={fr,agr}] > > \mainlanguage[fr] > > \setcharacterspacing[frenchpunctuation] > > \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] > > \definefallbackfamily[mainface][serif][Theano Didot][preset=range:greek, > it={Old Standard Italic}, force=yes] > > \definefallbackfamily [mainface] [rm] [ipaexmincho] > [range=cjkunifiedideographs] > > \definefallbackfamily[mainface] [serif] [nafeesnastaleeq] [range=arabic] > > \definefontfamily [mainface] [serif] [GaramondNo8][sc=NewG8 Regular SC] > > \definefontfamily [mainface] [sans] [FreeSans] [rscale=0.7] > > \definefontfamily[mainface] [serif] [GFS Didot] > > \setupbodyfont[mainface] > > \setupcolors[state=start] > > \setupindenting[1.5em] > > \setupindenting[yes] > > > \setupwhitespace[medium] > > \setupinterlinespace[line=3.2ex] > > > \setupitemize[each][margin=yes] > > > \setuphead[title][header=empty] > > > \setupheader[style={\sc}] > > \setupfooter[style={\itxx}] > > \setupheadertexts[Cours de Philosophie][][][{\getmarking[section]}] > > \setupfootertexts[][][][© Jean-Pierre Delange, 2016 — La reproduction de > ce texte est soumise à autorisation.] > > \setupsymbolset[text] > > > % Début de la définition d'un texte encadré en rouge > > \defineframedtext > > [MyFrame] > > [before={\blank}, > > after={\blank}, > > frame=off, > > background=MyFrame, > > %width=\textwidth, > > width=max, > > height=fit, > > style=regular] > > > \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 > > \dorecurse{4} > > \input ward > > > \startMyFrame[Title=Avertissement] > > La plupart des termes et des expressions qui doivent attirer l'attention > du lecteur sont soulignés ici par des {\em italiques}. On trouvera {\em > dans la marge} du texte de brèves indications biographiques et > bibliographiques, tandis que les explications plus développées sont > renvoyées en {\em notes de bas de page}. On trouvera à la fin de cet > ouvrage une bibliographie des textes cités\footnote{Seuls les références > aux textes classiques sont données, à l'exception des textes spécialisés}. > > \stopMyFrame > > \stoptext -- 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://tex.aanhet.net archive : http://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___________________________________________________________________________________ ^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: space before/after colored framed text 2016-08-17 17:02 ` Pablo Rodriguez @ 2016-08-17 21:59 ` Jean-Pierre Delange 2016-08-18 18:58 ` Pablo Rodriguez 0 siblings, 1 reply; 9+ messages in thread From: Jean-Pierre Delange @ 2016-08-17 21:59 UTC (permalink / raw) To: mailing list for ConTeXt users Thank you very much Pablo ! As a beginner I don't understand very well the complete meaning of "minimal" working sample, perhaps because my own code is full of mistakes and compiles sometimes with somes issues. The way of making space before and after the frame is now very clear to me, aswell as the way to resize the font size inside a frame. For my own text between \starttext and \stoptext is not an automatic false text, I didn't understand why the code provides this huge blank space before the frame. Either didn't I understand why sometimes a frame completely disappears when I supprime a footnote previously written inside the frame (but it is another topic...). JP Le 17/08/2016 à 19:02, Pablo Rodriguez a écrit : > Hi Jean-Pierre, > > sorry, for top-posting, but I think this way the reply will be clearer. > > In your previous sample you had two questions. > > This sample shows the answer: > > \defineframedtext > [MyFrame] > [before={\blank[6*big]}, > after={\blank[6*big]}, > style={\setupbodyfont[5pt]}] > > \starttext > \dorecurse{3}{\input zapf \startMyFrame\input knuth\stopMyFrame} > \stoptext > > 1. before and after control distance in elements. > > 2. \setupbodyfont[dimension] or \switchtobodyfont[dimension] as values > for the "style" key modify the size (as shown above). Other ways of > doing it are \tfx, \itx and so on. > > Your sample isn’t minimal and it doesn’t compile. > > \dorecurse needs two arguments (two pair of braces: {}). The second is > missing. > > BTW, serif for mainface is defined twice. GFS Didot is selected after > Garamond. > > Please compile the following: > > 8<-------------------------------------------------------------------- > \showframe\showgrid > \setuplanguage[fr][patterns={fr,agr}] > \mainlanguage[fr] > \setcharacterspacing[frenchpunctuation] > \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] > \definefontfamily[mainface] [serif] [GFS Didot] > \setupbodyfont[mainface] > \setupindenting[1.5em] > \setupindenting[yes] > \setupwhitespace[medium] > \setupinterlinespace[line=3.2ex] > \setuphead[title][header=empty] > > \setupheader[style={\sc}] > \setupfooter[style={\itxx}] > \setupheadertexts[Cours de Philosophie][][][{\getmarking[section]}] > \setupfootertexts[][][][© Jean-Pierre Delange, 2016 — La reproduction de > ce texte est soumise à autorisation.] > %~ \setupsymbolset[text] > > % Début de la définition d'un texte encadré en rouge > \defineframedtext > [MyFrame] > [before={\blank}, > after={\blank}, > frame=off, > background=MyFrame, > %width=\textwidth, > width=max, > height=fit] > > \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 > \dorecurse{4}{ > \input ward > > \startMyFrame[Title=Avertissement] > La plupart des termes et des expressions qui doivent attirer l'attention > du lecteur sont soulignés ici par des {\em italiques}. On trouvera {\em > dans la marge} du texte de brèves indications biographiques et > bibliographiques, tandis que les explications plus développées sont > renvoyées en {\em notes de bas de page}. On trouvera à la fin de cet > ouvrage une bibliographie des textes cités\footnote{Seuls les références > aux textes classiques sont données, à l'exception des textes spécialisés}. > \stopMyFrame} > \stoptext > -------------------------------------------------------------------->8 > > AfaIk, frames cannot be split, so the whole frame is moved to the next > page. It needs 8 lines and it only has 6 in the first page. > > I hope it is clear now. > > Pablo > > > > On 08/17/2016 05:57 PM, Jean-Pierre Delange wrote: >> Hi Thomas, >> >> I am very sorry. As a beginner with ConTeXt, I surely make mistakes, >> even in the way to show which issues I am confronting to. Maybe I ought >> to give the whole code where some errors occured, but I thought that the >> code was too long to be mailed to this list. That's why I have mailed a >> piece of the code concerning a colored framed but not the whole stuff. >> Thinking the issue occured with this special frame (and not with any >> other kind of frame), I have given this particular code. >> >> BTW, in order to make understandable what kind of issue occured by this >> particular frame, I didn't want to give a sample too huge (I place this >> colored frame at the end of each section of my book). Anyway, I try to >> understand how manage the place of THIS colored frame just after a text >> (with no rejection of the frame to the following page); and I will be >> very pleased to understand how to resize the text font inside the frame. >> At last, how to manage footnotes within this framed text (the footnote >> numbering appears, but the text doesn't appear inside nor outside the >> framed text). >> >> Thank you very much for your help. >> >> JP >> >> See below the whole sample code : >> >> \setuplanguage[fr][patterns={fr,agr}] >> >> \mainlanguage[fr] >> >> \setcharacterspacing[frenchpunctuation] >> >> \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] >> >> \definefallbackfamily[mainface][serif][Theano Didot][preset=range:greek, >> it={Old Standard Italic}, force=yes] >> >> \definefallbackfamily [mainface] [rm] [ipaexmincho] >> [range=cjkunifiedideographs] >> >> \definefallbackfamily[mainface] [serif] [nafeesnastaleeq] [range=arabic] >> >> \definefontfamily [mainface] [serif] [GaramondNo8][sc=NewG8 Regular SC] >> >> \definefontfamily [mainface] [sans] [FreeSans] [rscale=0.7] >> >> \definefontfamily[mainface] [serif] [GFS Didot] >> >> \setupbodyfont[mainface] >> >> \setupcolors[state=start] >> >> \setupindenting[1.5em] >> >> \setupindenting[yes] >> >> >> \setupwhitespace[medium] >> >> \setupinterlinespace[line=3.2ex] >> >> >> \setupitemize[each][margin=yes] >> >> >> \setuphead[title][header=empty] >> >> >> \setupheader[style={\sc}] >> >> \setupfooter[style={\itxx}] >> >> \setupheadertexts[Cours de Philosophie][][][{\getmarking[section]}] >> >> \setupfootertexts[][][][© Jean-Pierre Delange, 2016 — La reproduction de >> ce texte est soumise à autorisation.] >> >> \setupsymbolset[text] >> >> >> % Début de la définition d'un texte encadré en rouge >> >> \defineframedtext >> >> [MyFrame] >> >> [before={\blank}, >> >> after={\blank}, >> >> frame=off, >> >> background=MyFrame, >> >> %width=\textwidth, >> >> width=max, >> >> height=fit, >> >> style=regular] >> >> >> \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 >> >> \dorecurse{4} >> >> \input ward >> >> >> \startMyFrame[Title=Avertissement] >> >> La plupart des termes et des expressions qui doivent attirer l'attention >> du lecteur sont soulignés ici par des {\em italiques}. On trouvera {\em >> dans la marge} du texte de brèves indications biographiques et >> bibliographiques, tandis que les explications plus développées sont >> renvoyées en {\em notes de bas de page}. On trouvera à la fin de cet >> ouvrage une bibliographie des textes cités\footnote{Seuls les références >> aux textes classiques sont données, à l'exception des textes spécialisés}. >> >> \stopMyFrame >> >> \stoptext > ___________________________________________________________________________________ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context webpage : http://www.pragma-ade.nl / http://tex.aanhet.net archive : http://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___________________________________________________________________________________ ^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: space before/after colored framed text 2016-08-17 21:59 ` Jean-Pierre Delange @ 2016-08-18 18:58 ` Pablo Rodriguez 0 siblings, 0 replies; 9+ messages in thread From: Pablo Rodriguez @ 2016-08-18 18:58 UTC (permalink / raw) To: mailing list for ConTeXt users On 08/17/2016 11:59 PM, Jean-Pierre Delange wrote: > Thank you very much Pablo ! > > As a beginner I don't understand very well the complete meaning of > "minimal" working sample, perhaps because my own code is full of > mistakes and compiles sometimes with somes issues. Hi Jean-Pierre, a minimal sample is the code that contains only the commands with arguments and text required to reproduce the issue you experience. It is also a working sample, which means anyone should be able to compile it only by copying and pasting your code in a text file and hitting the compilation button (keystroke or simply the compilation command). Compilation should run automatically, with no compilation error (unless you hit a bug in ConTeXt). But the way of doing minimal working samples is to copy your source in another file. Ask yourself what do you want to achieve or show to other users in the mailing list. And remove what isn’t required for that. Start thinking that you may be doing it wrong if it takes more than 20 lines. Be sure that it should be another way with a sample of more than 50 lines. (Well, it isn’t a immutable law, but in ConTeXt “small is beautiful” :-).) My own experience is that elaborating minimal working samples takes time. Especially when (you think) you found a bug in ConTeXt. Since we use ConTeXt for books (or larger projects than papers), the issue is always to remove all unnecessary code and text. As you know far better than myself: we all learn to do things by doing them («ἃ γὰρ δεῖ μαθόντας ποιεῖν, ταῦτα ποιοῦντες μανθάνομεν»). Don’t worry, just start doing ;-). > The way of making space before and after the frame is now very clear to > me, as well as the way to resize the font size inside a frame. Sometimes, setting a bit smaller interline space solves the problem. Especially, when the frame contains many lines of text. > For my own text between \starttext and \stoptext is not an automatic > false text, I didn't understand why the code provides this huge blank > space before the frame. Either didn't I understand why sometimes a frame > completely disappears when I supprime a footnote previously written > inside the frame (but it is another topic...). But now it is clear that frames aren’t split across pages, isn’t it? The issue with the frame disappearance after a footnote removal seems weird. Are you sure that only the footnote has been removed? (But start a new thread for that [a brand new message]). I hope it helps, Pablo -- http://www.ousia.tk ___________________________________________________________________________________ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context webpage : http://www.pragma-ade.nl / http://tex.aanhet.net archive : http://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___________________________________________________________________________________ ^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: \startalign \stopalign equation number placement seems wrong 2016-08-17 13:23 ` Otared Kavian 2016-08-17 14:36 ` space before/after colored framed text Jean-Pierre Delange @ 2016-08-28 15:08 ` Mikael P. Sundqvist 1 sibling, 0 replies; 9+ messages in thread From: Mikael P. Sundqvist @ 2016-08-28 15:08 UTC (permalink / raw) To: mailing list for ConTeXt users [-- Attachment #1: Type: text/plain, Size: 2406 bytes --] On Wed, Aug 17, 2016 at 3:23 PM, Otared Kavian <otared@gmail.com> wrote: > Hi Mikael, > > I confirm that the latest beta (ConTeXt version 2016.08.11 13:56 MKIV beta) has the issue you are reporting. > This bug is absent from the current version from TeXLive2016, that is ConTeXt version 2016.05.17 19:20 MKIV current. > > Some time ago I reported an analogous issue with startalign, and it seemed to me that Hans fixed it. But it appeared again with the beta 2016.08.11 13:56. > > Best regards: OK > >> On 17 Aug 2016, at 14:20, Mikael P. Sundqvist <mickep@gmail.com> wrote: >> >> Hi, >> >> The test file >> >> \starttext >> \placeformula >> \startformula >> \startalign >> \NC \exp(t_1)\exp(t_2)\NC =x_1x_2=\exp(\ln(x_1x_2))\NR >> \NC \NC =\exp(\ln x_1+\ln x_2)=\exp(t_1+t_2).\NR[eq:explag1] >> \stopalign >> \stopformula >> >> \placeformula >> \startformula >> 1+1=2 >> \stopformula >> \stoptext >> >> gives the attached pdf. In the first formula, the location of the >> equation number seems to be wrong (I would have expected it to be to >> the right, like in the second example). In the (nice, but rather old >> now) My Way by Aditya, this does not seem to happen. >> >> /Mikael >> <ctx-example3.pdf>___________________________________________________________________________________ >> If your question is of interest to others as well, please add an entry to the Wiki! >> >> maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context >> webpage : http://www.pragma-ade.nl / http://tex.aanhet.net >> archive : http://foundry.supelec.fr/projects/contextrev/ >> wiki : http://contextgarden.net >> ___________________________________________________________________________________ > > ___________________________________________________________________________________ > If your question is of interest to others as well, please add an entry to the Wiki! > > maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context > webpage : http://www.pragma-ade.nl / http://tex.aanhet.net > archive : http://foundry.supelec.fr/projects/contextrev/ > wiki : http://contextgarden.net > ___________________________________________________________________________________ With the latest beta, it looks better, but not perfect (I'd expect the (1) and the (2) to be aligned). Same input file as in the first email in this thread gives the attached pdf. /Mikael [-- Attachment #2: ctx-listexample8.pdf --] [-- Type: application/pdf, Size: 9329 bytes --] [-- Attachment #3: Type: text/plain, Size: 485 bytes --] ___________________________________________________________________________________ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context webpage : http://www.pragma-ade.nl / http://tex.aanhet.net archive : http://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___________________________________________________________________________________ ^ permalink raw reply [flat|nested] 9+ messages in thread
end of thread, other threads:[~2016-08-28 15:08 UTC | newest] Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed) -- links below jump to the message on this page -- 2016-08-17 12:20 \startalign \stopalign equation number placement seems wrong Mikael P. Sundqvist 2016-08-17 13:23 ` Otared Kavian 2016-08-17 14:36 ` space before/after colored framed text Jean-Pierre Delange 2016-08-17 15:14 ` Thomas A. Schmitz 2016-08-17 15:57 ` Jean-Pierre Delange 2016-08-17 17:02 ` Pablo Rodriguez 2016-08-17 21:59 ` Jean-Pierre Delange 2016-08-18 18:58 ` Pablo Rodriguez 2016-08-28 15:08 ` \startalign \stopalign equation number placement seems wrong Mikael P. Sundqvist
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox; as well as URLs for NNTP newsgroup(s).