All, I have: \page \subject{Plotting} With preliminaries completed, plotting is a simple matter. \starttyping
x=linspace(-2,4); y=x.^2-2*x-3; plot(x,y) xlabel('x') ylabel('y') title('y = x^2 -2x -3') grid on \stoptyping
\placefigure[none]{}{\externalfigure[slide1.png]} I'd like to arrange this on my slide side-by-side, the code to the left, the image to the right. If I we're doing this in Latex, I would probably use minipage environments for this. Can someone hint at the Context Way of doing this? I'd like my code vertically centered on the left, the image on the right. Thanks.
Hi David, [...]
I'd like to arrange this on my slide side-by-side, the code to the left, the image to the right. If I we're doing this in Latex, I would probably use minipage environments for this.
Can someone hint at the Context Way of doing this? I'd like my code vertically centered on the left, the image on the right.
Is this what you want? \starttext \startbuffer
x=linspace(-2,4); y=x.^2-2*x-3; plot(x,y) xlabel('x') ylabel('y') title('y = x^2 -2x -3') grid on \stopbuffer
\placesidebyside{% \framed[align={lohi,right},frame=off]% {\typebuffer}} {\externalfigure [cow] [width=.5\textwidth]} \stoptext Patrick -- ConTeXt wiki: http://contextgarden.net
Patrick,
Is this what you want?
\starttext \startbuffer
x=linspace(-2,4); y=x.^2-2*x-3; plot(x,y) xlabel('x') ylabel('y') title('y = x^2 -2x -3') grid on \stopbuffer
\placesidebyside{% \framed[align={lohi,right},frame=off]% {\typebuffer}} {\externalfigure [cow] [width=.5\textwidth]} \stoptext
Patrick, this would be what I want, but in my preamble I have: \setuptyping [before={\startframedtext[width=\makeupwidth, background=screen, backgroundscreen=0.8]}, after={\stopframedtext}, color=darkred] Which seems to be getting in the way of your idea functioning properly.
Patrick et al, I got around my last problem by defining a new typing environment, so the idea below is almost working the way I want. I have: \startbuffer
x=linspace(-2,4); y=x.^2-2*x-3; plot(x,y) xlabel('x') ylabel('y') title('y = x^2 -2x -3') grid on \stopbuffer
\placesidebyside{% \framed[align={lohi,right}, frame=on, offset=10pt, background=screen, screen=0.8, foregroundcolor=darkred]{\typebuffer}} {\externalfigure[slide1.pdf]} My graphic slide1.pdf is about the right size, so I didn't have to adjust its width. However, I'd like the graphic to be centered in the remaining room available. Anyway of doing that? I lieu of centering, is there some way I can get a little bit of space between the typebuffer and my graphic? At 10:06 AM 10/31/04 -0800, you wrote:
Patrick,
Is this what you want?
\starttext \startbuffer
x=linspace(-2,4); y=x.^2-2*x-3; plot(x,y) xlabel('x') ylabel('y') title('y = x^2 -2x -3') grid on \stopbuffer
\placesidebyside{% \framed[align={lohi,right},frame=off]% {\typebuffer}} {\externalfigure [cow] [width=.5\textwidth]} \stoptext
Patrick, this would be what I want, but in my preamble I have:
\setuptyping [before={\startframedtext[width=\makeupwidth, background=screen, backgroundscreen=0.8]}, after={\stopframedtext}, color=darkred]
Which seems to be getting in the way of your idea functioning properly. _______________________________________________ ntg-context mailing list ntg-context@ntg.nl http://www.ntg.nl/mailman/listinfo/ntg-context
Hello David, this is far from perfect, but perhaps worth a tryout: -------------------------------------------------- \setupcolors[state=start] \setuptyping [before={\startframedtext[width=\localhsize,background=screen, backgroundscreen=0.8]}, after={\stopframedtext}, color=darkred] \starttext \startbuffer
x=linspace(-2,4); y=x.^2-2*x-3; plot(x,y) xlabel('x') ylabel('y') title('y = x^2 -2x -3') grid on \stopbuffer
\typebuffer % test \placesidebyside{% \framed[align={lohi,right}, frame=on, offset=10pt, background=screen, screen=0.8, width=.5\textwidth, strut=no, foregroundcolor=darkred]{\typebuffer}} {\framed[frame=off,width=.5\textwidth]{\externalfigure[cow.pdf][width=4cm,height=4cm]}} \stoptext -------------------------------------------------- Patrick -- ConTeXt wiki: http://contextgarden.net
participants (2)
-
David Arnold
-
Patrick Gundlach