ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
From: David Arnold <darnold@northcoast.com>
Subject: Environment
Date: Sat, 23 Sep 2000 12:04:32 -0700	[thread overview]
Message-ID: <3.0.5.32.20000923120432.00a187c0@mail.northcoast.com> (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


             reply	other threads:[~2000-09-23 19:04 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2000-09-23 19:04 David Arnold [this message]
2000-09-24 14:50 ` Environment Hans Hagen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=3.0.5.32.20000923120432.00a187c0@mail.northcoast.com \
    --to=darnold@northcoast.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).