Hello, If I put any image, there is no problem : the title of the section is in color and the text in black. With a graphic made with TikZ, the title and the text are in color. Thank you for your help. Fabrice \usemodule[tikz] \usemodule [graph] \usemodule[pgfplots] \pgfplotsset{compat=newest} \definecolor[Mycolor][c=.6,m=0.8,y=0,k=0] \unexpanded\def\interff#1#2{\math{\left[#1\,;#2\right]}} \setuphead [section] [textcommand=, color=magenta, style=] \starttext \startsection[title={Résoudre graphiquement une équation \math{f(x)=g(x)}},sectionsegments=section,color=magenta] \placefigure[none,right]{}{ \hbox{\switchtobodyfont[8pt] \starttikzpicture[/pgf/declare function={f(\x)=\x^2-3;},/pgf/declare function={g(\x)=-\x^2+2*\x+1;}] \startaxis[ restrict x to domain=-3:3, xmax=3, xmin=-3, restrict y to domain=-5:4, ymax=4, ymin=-5, x=1cm, y=0.5cm, axis x line = middle, axis y line = middle, axis line style = thick, major grid style=Mycolor, minor grid style=Mycolor, grid=both, xtick={-2,...,2}, ytick={-4,...,3}, extra x ticks={-3,3}, extra x tick label={\null}, extra y ticks={-5,4}, extra y tick label={\null}, extra tick style={tick style={draw=none}}, every tick/.style={ black, thick, }, y tick label style={ /pgf/number format/1000 sep={} }, xlabel=$x$,ylabel=$y$, every axis x label/.style={ at={(ticklabel* cs:1.01)}, anchor=west, }, every axis y label/.style={ at={(ticklabel* cs:1.01)}, anchor=south, }, samples=2000,
=stealth, ] \addplot[only marks,mark=x,color=black,mark options={scale=1.5}, thick] table[x=Nombre,y=Valeur]{ Nombre Valeur -1 -2 2 1 } ; \addplot [smooth,domain=-1.5:2.5, thick,magenta] {f(x)} ; \addplot [smooth,domain=-1.5:2.5, thick,green] {g(x)} ;
\node[above left,green] at (2,2) {\math{{\cal C}_g}} ; \node[below right,magenta] at (1.5,-1) {\math{{\cal C}_f}} ; \node[below left ] at (-0.1,-0.1) {\math{0}} ; \node[fill=black,circle,scale=0.4,magenta] at (-1.5,{f(-1.5)}){} ; \node[fill=black,circle,scale=0.4,magenta] at (2.5,{f(2.5)}){} ; \node[fill=black,circle,scale=0.4,green] at (-1.5,{g(-1.5)}){} ; \node[fill=black,circle,scale=0.4,green] at (2.5,{g(2.5)}){} ; \stopaxis \stoptikzpicture}} \input knuth \stopsection \stoptext
On 10/5/2017 7:26 PM, Fabrice Couvreur wrote:
If I put any image, there is no problem : the title of the section is in color and the text in black. With a graphic made with TikZ, the title and the text are in color.
looks ok here
\placefigure[none,right]{}{ \hbox{\switchtobodyfont[8pt]
add a % after the above line (otherwise you get a space) ----------------------------------------------------------------- Hans Hagen | PRAGMA ADE Ridderstraat 27 | 8061 GH Hasselt | The Netherlands tel: 038 477 53 69 | www.pragma-ade.nl | www.pragma-pod.nl -----------------------------------------------------------------
HI Hans,
like this ?
\placefigure[none,right]{}{
\hbox{\switchtobodyfont[8pt]%
Fabrice
2017-10-05 22:35 GMT+02:00 Hans Hagen
On 10/5/2017 7:26 PM, Fabrice Couvreur wrote:
If I put any image, there is no problem : the title of the section is in
color and the text in black. With a graphic made with TikZ, the title and the text are in color.
looks ok here
\placefigure[none,right]{}{
\hbox{\switchtobodyfont[8pt]
add a % after the above line (otherwise you get a space)
----------------------------------------------------------------- Hans Hagen | PRAGMA ADE Ridderstraat 27 | 8061 GH Hasselt | The N https://maps.google.com/?q=Ridderstraat+27+%7C+8061+GH+Hasselt+%7C+The+N&entry=gmail&source=g etherlands tel: 038 477 53 69 | www.pragma-ade.nl | www.pragma-pod.nl ----------------------------------------------------------------- ____________________________________________________________ _______________________ If your question is of interest to others as well, please add an entry to the Wiki!
maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/list info/ntg-context webpage : http://www.pragma-ade.nl / http://context.aanhet.net archive : https://bitbucket.org/phg/context-mirror/commits/ wiki : http://contextgarden.net ____________________________________________________________ _______________________
Hi Hans
Sorry to insist, but I need to correct this anomaly for my documents that I
give to students. If I compile with Context Standalone, it does not work,
but maybe I do not do what you are suggesting :
\placefigure[none,right]{}{%
\hbox{\switchtobodyfont[8pt]
Thanks
Fabrice
2017-10-05 22:51 GMT+02:00 Fabrice Couvreur
HI Hans,
like this ?
\placefigure[none,right]{}{ \hbox{\switchtobodyfont[8pt]%
Fabrice
2017-10-05 22:35 GMT+02:00 Hans Hagen
: On 10/5/2017 7:26 PM, Fabrice Couvreur wrote:
If I put any image, there is no problem : the title of the section is in
color and the text in black. With a graphic made with TikZ, the title and the text are in color.
looks ok here
\placefigure[none,right]{}{
\hbox{\switchtobodyfont[8pt]
add a % after the above line (otherwise you get a space)
----------------------------------------------------------------- Hans Hagen | PRAGMA ADE Ridderstraat 27 | 8061 GH Hasselt | The N https://maps.google.com/?q=Ridderstraat+27+%7C+8061+GH+Hasselt+%7C+The+N&entry=gmail&source=g etherlands tel: 038 477 53 69 | www.pragma-ade.nl | www.pragma-pod.nl ----------------------------------------------------------------- ____________________________________________________________ _______________________ If your question is of interest to others as well, please add an entry to the Wiki!
maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/list info/ntg-context webpage : http://www.pragma-ade.nl / http://context.aanhet.net archive : https://bitbucket.org/phg/context-mirror/commits/ wiki : http://contextgarden.net ____________________________________________________________ _______________________
On Sat, 7 Oct 2017, Fabrice Couvreur wrote:
Hi Hans Sorry to insist, but I need to correct this anomaly for my documents that I give to students. If I compile with Context Standalone, it does not work, but maybe I do not do what you are suggesting :
I can confirm that color leakage. It happens due to pgfplots (and not tikz). Here is the smallest example I could come up with that shows the color leakage (the text is also colored magenta). \usemodule[pgfplots] \setuphead [section] [color=magenta] \starttext \startsection[title={Test}] \startplacefigure[location={none,right}] \hbox{\starttikzpicture \startaxis [ xmax=3, xmin=-3, ymax=4, ymin=-5, ] \stopaxis \stoptikzpicture} \stopplacefigure \input knuth \stopsection \stoptext Aditya
On Sat, 7 Oct 2017, Aditya Mahajan wrote:
On Sat, 7 Oct 2017, Fabrice Couvreur wrote:
Hi Hans Sorry to insist, but I need to correct this anomaly for my documents that I give to students. If I compile with Context Standalone, it does not work, but maybe I do not do what you are suggesting :
I can confirm that color leakage. It happens due to pgfplots (and not tikz).
I use tikz/pgfplots extensively and started wondering why I don't see this error. Then I realized that I use a modified definition of starttikzpicture in my code: \define\starttikzpicture {\hbox\bgroup\forcecolorhack\tikzpicture} \define\stoptikzpicture {\endtikzpicture\egroup} With this definition, you code works correctly. Aditya
On Sat, 7 Oct 2017, Aditya Mahajan wrote:
On Sat, 7 Oct 2017, Fabrice Couvreur wrote:
Hi Hans Sorry to insist, but I need to correct this anomaly for my documents that I give to students. If I compile with Context Standalone, it does not work, but maybe I do not do what you are suggesting :
I can confirm that color leakage. It happens due to pgfplots (and not tikz).
I use tikz/pgfplots extensively and started wondering why I don't see this error. Then I realized that I use a modified definition of starttikzpicture in my code:
\define\starttikzpicture {\hbox\bgroup\forcecolorhack\tikzpicture}
\define\stoptikzpicture {\endtikzpicture\egroup}
With this definition, you code works correctly. yes, i thought that was already done so someone needs to get that into
On 10/7/2017 2:44 PM, Aditya Mahajan wrote: the official code base (btw, it seems that there is also a \stopmodule done without \startmodule when tikz is loaded) 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 -----------------------------------------------------------------
Hi,
Thank you so much for this help, I would not have found it.
Fabrice
2017-10-07 15:59 GMT+02:00 Hans Hagen
On 10/7/2017 2:44 PM, Aditya Mahajan wrote:
On Sat, 7 Oct 2017, Aditya Mahajan wrote:
On Sat, 7 Oct 2017, Fabrice Couvreur wrote:
Hi Hans
Sorry to insist, but I need to correct this anomaly for my documents that
I
give to students. If I compile with Context Standalone, it does not work, but maybe I do not do what you are suggesting :
I can confirm that color leakage. It happens due to pgfplots (and not tikz).
I use tikz/pgfplots extensively and started wondering why I don't see this error. Then I realized that I use a modified definition of starttikzpicture in my code:
\define\starttikzpicture {\hbox\bgroup\forcecolorhack\tikzpicture}
\define\stoptikzpicture {\endtikzpicture\egroup}
With this definition, you code works correctly.
yes, i thought that was already done so someone needs to get that into the official code base
(btw, it seems that there is also a \stopmodule done without \startmodule when tikz is loaded)
Hans
----------------------------------------------------------------- Hans Hagen | PRAGMA AD https://maps.google.com/?q=Hans+Hagen+%7C+PRAGMA+AD&entry=gmail&source=g E Ridderstraat 27 | 8061 GH Hasselt | The Netherlands tel: 038 477 53 69 | www.pragma-ade.nl | www.pragma-pod.nl ----------------------------------------------------------------- ____________________________________________________________ _______________________ If your question is of interest to others as well, please add an entry to the Wiki!
maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/list info/ntg-context webpage : http://www.pragma-ade.nl / http://context.aanhet.net archive : https://bitbucket.org/phg/context-mirror/commits/ wiki : http://contextgarden.net ____________________________________________________________ _______________________
On Sat, Oct 7, 2017 at 3:59 PM, Hans Hagen
(btw, it seems that there is also a \stopmodule done without \startmodule when tikz is loaded)
Hans
I am surprised that \loggingall before \starttext produces 2.3GByte of log. \usemodule[tikz] \usemodule [graph] \usemodule[pgfplots] \pgfplotsset{compat=newest} \definecolor[Mycolor][c=.6,m=0.8,y=0,k=0] \unexpanded\def\interff#1#2{\math{\left[#1\,;#2\right]}} \setuphead [section] [textcommand=, color=red, %magenta, style=] \loggingall \starttext \startsection[title={Résoudre graphiquement une équation \math{f(x)=g(x)}},sectionsegments=section,color=magenta] \placefigure[none,right]{}{ : : \stopsection \stoptext -- luigi
participants (4)
-
Aditya Mahajan
-
Fabrice Couvreur
-
Hans Hagen
-
luigi scarso