ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* Environment
@ 2000-09-23 19:04 David Arnold
  2000-09-24 14:50 ` Environment Hans Hagen
  0 siblings, 1 reply; 2+ messages in thread
From: David Arnold @ 2000-09-23 19:04 UTC (permalink / raw)


All,

Here is my environment file, used to produce, for example, the print and
screen documents on the interpolating polynomial found at:

http://online.redwoods.cc.ca.us/instruct/darnold/LinAlg/activity.htm#poly

Here is the environment file. Enjoy. Suggestions are welcome.

\startenvironment environment1

\let\\=\endgraf

\useURL [home] [http://online.redwoods.cc.ca.us/instruct/darnold]
\useURL [darnold] [mailto:darnold@northcoast.com] [] [darnold@northcoast.com]
\useURL [David-Arnold] [mailto:David-Arnold@Eureka.redwoods.cc.ca.us]
        [] [David-Arnold@Eureka.redwoods.cc.ca.us]

\setupurl[style=type]

\setupbodyfont
 [lbr,10pt]

\startmode[letter]

\setuppapersize[letter][letter]

\setuplayout
  [topspace=1.5cm,
   backspace=2cm,
   width=middle,
   footer=1.5cm,
   header=1.5cm,
   height=middle]

\setupwhitespace[medium]

\setupindenting[medium]

\setuptyping[margin=standard]

\setupheads[alternative=margin]

\setupheadertexts[\myTitle]

\setupfootertexts[pagenumber]

\setupheader[state=empty]

 \start
 \startalignment[middle]
 \tfc\setupinterlinespace
 \vskip20pt
 \myTitle
 \tfa\setupinterlinespace
 \vskip2ex
 \myClass
 \vskip2ex
 \myAuthor\par
 \from[David-Arnold]
 \stopalignment
 \stop
 \vskip2ex
 \midaligned{\bf Abstract}
 \startnarrower[3*middle]
  \noindenting\getmyAbstract
 \stopnarrower

\setupinteraction
 [state=start]

\coupledocument
 [alternative]
 [\jobname-s]
 [section,subsection]
 [The Alternative Version]

\setuphead
 [section,subsection]
 [file=alternative]
\stopmode

%Screen mode begins here
\startmode[screen]

\definecolor[darkred][r=0.5]
\definecolor[darkgreen][r=0.1,g=0.5,b=0.0]
\definecolor[brown][r=.5,g=.5]

\setupcolors
 [state=start]

\setuppapersize[S6][S6]

\setuplayout
 [backspace=10pt,
  topspace=10pt,
  margin=0pt,
  rightedge=100pt,
  rightedgedistance=20pt,
  width=460pt,
  header=0pt,
  footer=0pt,
  height=middle]

\startreusableMPgraphic{squares}
 path squares[];
 numeric side;
 side=10cm;
 squares0:=unitsquare scaled side;
 draw squares0 withcolor .95white;
 y1=0;x2=side;
 x1=side/25;y2=x1;
 d=angle(z2-z1);
 r=abs(z2-z1)/side;
 for i:=1 upto 80:
  squares[i]:=squares[i-1] shifted (-side/2,-side/2)
  rotated d scaled r shifted (side/2,side/2);
  draw squares[i] withcolor .95white;
 endfor;
 picture pic;
 pic:=currentpicture;
 currentpicture:=nullpicture;
 draw pic xscaled (\overlaywidth/side) yscaled (\overlayheight/side);
\stopreusableMPgraphic

\defineoverlay[squares][\reuseMPgraphic{squares}]

\setupbackgrounds
 [text][text]
 [background=squares]

\setupbackgrounds
 [text][rightedge]
 [background=color,
  backgroundcolor=darkgreen,
  backgroundoffset=10pt]

\setupinteraction
 [state=start,
  page=yes,
  menu=on,
  style=\ssbf,
  color=darkred,
  contrastcolor=]

\defineinteractionmenu
 [first][right]
 [state=start,
  frame=off,
  color=white,
  style=\ssbfb,
  distance=overlay]

\setupinteractionmenu
 [right]
 [before=\vskip5pt,
  inbetween=\vskip2.5pt,
  after=\vfill,
  distance=overlay]

\useexternalfigure[logo][../crlogo-green.jpg][width=\rightedgewidth]

\startinteractionmenu
 [first]
 \boxofsize \vbox \textheight \bottomdistance \bottomheight
 \bgroup
 \startcolor[white]
 \ssbfb\setupinterlinespace
 \externalfigure[logo]
 \stopcolor
 \vfill
 \but[contents] contents\\
 \but[nextpage] next page\\
 \but[CloseDocument] close\\
 \but[ExitViewer] exit\\
 \unskip
 \egroup
\stopinteractionmenu

\startstandardmakeup
 \start
 \startcolor[darkgreen]
 \startalignment[middle]
 \vskip1in
 \tfc\setupinterlinespace
 \myTitle
 \vskip 4ex
 \tfa\setupinterlinespace
 \myClass
 \vskip4ex
 \color[darkred]{\myAuthor}
 \vskip2ex
 \from[David-Arnold]
 \vskip 4ex
 \stopcolor
 \stopalignment
 \stop
 \vfil
 \midaligned{\bf \color[darkgreen]{Abstract}}
 \startnarrower[3*middle]
  \getmyAbstract
 \stopnarrower
 \vfill
\stopstandardmakeup

\setupinteractionmenu
 [first]
 [state=stop]

\setupinteractionmenu
 [right]
 [before=\vskip5pt,
  inbetween=\vskip2.5pt,
  after=\vfill,
  state=start,
  frame=off,
  color=white,
  style=\ssbfb,
  distance=overlay]

\definereference[printme][\jobname-p::]

\startinteractionmenu
 [right]
 \boxofsize \vbox \textheight \bottomdistance \bottomheight
 \bgroup
 \startcolor[white]
 \ssbfb\setupinterlinespace
 \midaligned{\myTitle}
 \stopcolor
 \vfill
 \but[firstpage] title page\\
 \but[content] contents\\
 \but[previouspage] previous page\\
 \but[nextpage] next page\\
 \but[PreviousJump] back\\
 \but[printme] print doc\\
 \but[CloseDocument] close\\
 \but[ExitViewer] exit\\
 \unskip
 \egroup
\stopinteractionmenu

\setupcontent
 [alternative=g,
  interaction=all]

\setuplist
 [section]
 [color=darkgreen,
  style=\ssbfb]

\setuplist
 [subsection]
 [color=brown,
  style=\ssa]

\setupwhitespace[medium]

\setupindenting[medium]

\setuptyping
 [margin=standard]

\setuphead
 [section]
 [color=darkgreen,
  style=\ssbfb,
  number=no]

\setuphead
 [subsection]
 [color=brown,
  style=\ssa]

\coupledocument
 [alternative]
 [\jobname-p]
 [section,subsection]
 [The Alternative Version]

\setuphead
 [section,subsection]
 [file=alternative]

\definehead
 [myContents]
 [title]

\setuphead
 [myContents]
 [alternative=middle,
  color=darkred,
  style=\ssbfc]

\startfrontmatter
 \myContents{Table of Contents}
 \pagereference[content]
 \placecontent
\stopfrontmatter

\stopmode

%\showsetups

\stopenvironment


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: Environment
  2000-09-23 19:04 Environment David Arnold
@ 2000-09-24 14:50 ` Hans Hagen
  0 siblings, 0 replies; 2+ messages in thread
From: Hans Hagen @ 2000-09-24 14:50 UTC (permalink / raw)
  Cc: ntg-context

At 12:04 PM 9/23/00 -0700, David Arnold wrote:
>All,

>Here is my environment file, used to produce, for example, the print and
>screen documents on the interpolating polynomial found at:
>
>http://online.redwoods.cc.ca.us/instruct/darnold/LinAlg/activity.htm#poly
>
>Here is the environment file. Enjoy. Suggestions are welcome.

We may consider an extended third party corner with styles + results, since
I suppose that there are more users willing to share code. Something: 

[description] [questions] [remarks] [styles] [samples]

>\let\\=\endgraf

That's always a dangerous one. 

Hans
-------------------------------------------------------------------------
                                                  Hans Hagen | PRAGMA ADE
                      Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
 tel: +31 (0)38 477 53 69 | fax: +31 (0)38 477 53 74 | www.pragma-ade.com
-------------------------------------------------------------------------


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2000-09-24 14:50 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2000-09-23 19:04 Environment David Arnold
2000-09-24 14:50 ` Environment Hans Hagen

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).