Re: [NTG-context] Problem with special first page of chapter setup

2005-10-28 Thread Peter Rolf
Gerben Wierda wrote:
 I have this setup in my environment file:
 
 =
 \setuphead
   [chapter]
   [page=,
before=\setups{chapter:before},
after=\setups{chapter:after}]
 
 \startsetups chapter:before
 
 \page[left]
 
 \noheaderandfooterlines
 
 \startalignment[left,nothyphenated]
 \startnarrower[4*left]
 \noindent \em \setups[chapter:quote]
 \stopnarrower
 \stopalignment
 
 \resetsetups[quote:text]
 
 \page[right]
 
 \noheaderandfooterlines
 
 \blank[force,2*big]
 
 \stopsetups
 
 \startsetups [chapter:after]
 
 \blank[3*big]
 
 \stopsetups
 ===
 
 But when I call it
 
 ===
 \starttext
 \startsetups [chapter:quote]
 Lee Chong's is to the right of the vacant lot (although why
 it is called vacant when it is piled high with old boilers, with rusting
 pipes, with great square timbers, and stacks of five-gallon cans, no 
 one can
 say).\crlf
 {\tf John Steinbeck} --- Cannery Row\crlf
 \crlf
 Doc explained patiently, ``Both players know exactly the same
 things. The game is played in the mind.''\crlf
 ``I don't get it.''\crlf
 ``Well, look! You can't cheat in mathematics or poetry or music because
 they're based on truth. Untruth or cheating is just foreign, it has  no
 place.
 You can't cheat in arithmetic.\crlf
 {\tf John Steinbeck} --- Sweet Thursday
 \stopsetups

\startbuffer
Lee Chong's is to the right of the vacant lot (although why
it is called vacant when it is piled high with old boilers, with rusting
pipes, with great square timbers, and stacks of five-gallon cans, no
one can
say).\crlf
{\tf John Steinbeck} --- Cannery Row\crlf
\crlf
Doc explained patiently, ``Both players know exactly the same
things. The game is played in the mind.''\crlf
``I don't get it.''\crlf
``Well, look! You can't cheat in mathematics or poetry or music because
they're based on truth. Untruth or cheating is just foreign, it has  no
place.
You can't cheat in arithmetic.\crlf
{\tf John Steinbeck} --- Sweet Thursday
\stopbuffer

\startsetups chapter:quote
  \getbuffer
\stopsetups


This works for me. But you better give the buffer a name :)

Gretings,

Peter

 \chapter[h:foo]{Foo}
 ===
 
 I get that every word that is in the input file at th eend of a line  is
 glued (no whitespace) to the word that is on the next line of the  input
 line.
 
 How can I solve this?
 
 Thanks
 
 G
 ___
 ntg-context mailing list
 ntg-context@ntg.nl
 http://www.ntg.nl/mailman/listinfo/ntg-context
 
 

___
ntg-context mailing list
ntg-context@ntg.nl
http://www.ntg.nl/mailman/listinfo/ntg-context


Re: [NTG-context] learning path

2005-10-28 Thread Mojca Miklavec
olivier Turlier wrote:
 
 Hi everybody,
 
 I wish to set up kind of a learning path (= pedagogic progression
 bar, like in http://www.dokeos.com/scorm_compliant_course_content.php)

/.../

 Sorry for not being clear enough.

 learning path is an acronym I've found while using Dokeos elearning
 platform, as an equivalent to a course i guess. For creating a
 course/learning path  you assemble differents documents in a l.p.. When
 the alumni/trainee reads this course, he will be able what he have to
 read next after the fisrt doc, and so on. I've made a graphic capture of
 the webpage for showing what elements are making a learning path in the
 Dokeos vision : list of doc allready readen, docs to read, progression
 bar, plus the breadcrumb trail;

for lists of already learnt documents: you can make a list of
chapters/sections/subsections somewhere on the page if you have enough
place. If you would like to get the chapter/section/subsection name,
you can get them with something like
\getmarking[chapter] $$ \getmarking[section] $$ \getmarking[subsection]
Perhaps some ifs are missing to check if a section/subsection is
defined, but someone else has to help you with it.

 i don't want to put so much stuff in the pdfs made wit Context(apart
 putting an A4 text on an A3 page!) because i keep a printable A4 format
 for my courses, even i there interaction in it, for screen usage.

I'm not sure if I understood it properly, but if you need two
different versions of your documents with the same content, but
different layout, you can use modes
(http://wiki.contextgarden.net/Modes).

 So i wish to have only vertical progression bars + percentage in the
 inner margin. s-pre-01 original style show a bottom interaction bar
 filled with pagenumbers drawn as little rectangles. Maybe it's possible
 to draw a continuous bar with metapost, but for percentage ?

 Ideally, i wish to have 2 progression bars : one for project progression
 and second for product prog.

How would you calculate the project progression? The example below
calculates the percentage out of the number of pages in the current
document.

Here's an example how to make an extremely simple and ugly progression
bar at the bottom of the page. Take a look into the .mp file produced.
You'll find many other variables thay you may use to position your
progression bar properly.

\defineoverlay
  [ProgressBar A]
  [\useMPgraphic{ProgressBarA}]
\setupbackgrounds
  [text]
  [background={ProgressBar A}]

\startuseMPgraphic{ProgressBarA}
barW = 5cm;
barH = .7cm;

StartPage;
   fill unitsquare xyscaled(barW*(PageNumber/NOfPages),barH)
  withcolor .625red;
   draw unitsquare xyscaled(barW,barH);
   label.rt(textext($  decimal(round(100*PageNumber/NOfPages)) 
  \,\%$), (barW,.5barH));
   currentpicture := currentpicture shifted
(LeftMarginWidth+LeftMarginDistance,2cm);
StopPage;
\stopuseMPgraphic

\starttext

first page\page
second page\page
third page

\stoptext


I would suggest you to get familiar with metapost/metafun (learning
metapost by doing, the metapost manual, metafun manual, ...) if
you aren't yet. It's a simple and great programming/drawing language
and you can do amazing things with it.

Mojca


PS: just a note. Trying to execute the code written above under MikTeX
(on the old ;) ConTeXt version, 2005.08.31) leads to distrous
results and nothing worked as expected. It claims
\loadfontfileoncetrue to be undefined command, it complains about file
endings (it doesn't create .mpx files, so the label(textext ...)
doesn't work) ... and so on. It may be that something is wrongly
configured here, but I'm glad that I'm able to use the minimal ConTeXt
distr. as an alternative when something fails under MikTeX.
___
ntg-context mailing list
ntg-context@ntg.nl
http://www.ntg.nl/mailman/listinfo/ntg-context