Re: [NTG-context] Page Numbering using IncludePicture from simple slides

2012-04-23 Thread Aditya Mahajan
On Mon, 23 Apr 2012, Steffen Fritzsche wrote:

> Hi,
>
> I love the IncludePicture command from simple slides but now I've got a 
> picture which I want to show stepwise. Therefore I created two pictures a 
> simplified version and the full version. I just place them right one after 
> the other.
>
> Now it would be perfect if I could force context not to increase the page 
> number counter for the second image because in my handout I will only include 
> the full picture and at the moment the additional slide is messing up my page 
> numbers.
>
> Any suggestions?

I just manually decrement the userpage. Below is the current version of my 
experimental stepping macros.

\startmodule complexslides-step-yes
\unprotect

% This module defines two macros:
% \ONLT{count}{...} which displays text on a particular page
% \STEP{count}{...} which displays text from a particular page
% There is also \StartStep {count} ... \StopStep and
% \StartOnly {count} ... \StopOnly version.

% Everything must be nested in a \StartStepping {iterations} ... \StopStepping

\def\complexslides_only#1{\csname complexslides_steps_only_#1\endcsname}
\def\complexslides_step#1{\csname complexslides_steps_step_#1\endcsname}

\def\StartStep#1#2\StopStep{\complexslides_step{#1}{#2}}
\def\StartOnly#1#2\StopOnly{\complexslides_only{#1}{#2}}

\long\def\gobble#1{}
\long\def\oneofone#1{#1}

% TODO: Allow nesting of \StartStepping ... \StopStepping

\def\StartStepping#1#2\StopStepping%
  
{\dorecurse{#1}{\long\setvalue{complexslides_steps_step_\recurselevel}{\gobble}}%
   
\dorecurse{#1}{\long\setvalue{complexslides_steps_only_\recurselevel}{\gobble}}%
   \pushmacro\ONLY
   \pushmacro\STEP
   \def\ONLY{\complexslides_only}%
   \def\STEP{\complexslides_step}%
   \dorecurse{#1}{%
   \edef\currentStepLevel{\recurselevel}%
   \long\setvalue{complexslides_steps_step_\currentStepLevel}{\oneofone}%
   \long\setvalue{complexslides_steps_only_\currentStepLevel}{\oneofone}%
   #2%
   \setvalue{complexslides_steps_only_\currentStepLevel}{\gobble}%
   \page\decrementnumber[userpage]}%
   \incrementnumber[userpage]%
   \popmacro\ONLY
   \popmacro\STEP
  }

\def\doifStepelse%
{\doifelse\currentStepLevel}

% To be used in a group
\unexpanded\def\disablesteps
{\def\complexslides_only##1{\gobble}% ##2
 \def\complexslides_step##1{\oneofone}%##2
}

\unexpanded\def\SetStep#1#2% i of n

{\dorecurse{#2}{\long\setvalue{complexslides_steps_step_\recurselevel}{\gobble}}%
 
\dorecurse{#2}{\long\setvalue{complexslides_steps_only_\recurselevel}{\gobble}}%
 \edef\currentStepLevel{#1}%
 \long\setvalue{complexslides_steps_step_\currentStepLevel}{\oneofone}%
 \long\setvalue{complexslides_steps_only_\currentStepLevel}{\oneofone}%
}

\protect
\stopmodule

___
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/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___


[NTG-context] Page Numbering using IncludePicture from simple slides

2012-04-23 Thread Steffen Fritzsche
Hi,

I love the IncludePicture command from simple slides but now I've got a picture 
which I want to show stepwise. Therefore I created two pictures a simplified 
version and the full version. I just place them right one after the other.

Now it would be perfect if I could force context not to increase the page 
number counter for the second image because in my handout I will only include 
the full picture and at the moment the additional slide is messing up my page 
numbers.

Any suggestions?

Thanks!
Steffen

smime.p7s
Description: S/MIME cryptographic signature
___
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/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___

Re: [NTG-context] imposition 2UP = empty pages

2012-04-23 Thread Henning Hraban Ramm


Am 2012-04-20 um 17:58 schrieb Henning Hraban Ramm:


Hi there,

like in January (see mail by Mari), the latest beta produces only  
empty pages with 2UP imposition schema; others work (tested 2SIDE  
and 2DOWN).


e.g.

\setuppapersize [A5][A4,landscape]
\setuppagenumbering [alternative=doublesided,location=footer]
\setuplayout [margin=0pt,width=fit]
\setupbackgrounds [text][text][background=screen,backgroundscreen=0.7]
\setupcolors [state=start]
\setuplayout [location=middle,marking=on]
\setuparranging [2UP] %[2*2*4,doublesided]

\startbuffer[Fakepage]
\strut
\blank[force]
\midaligned{2UP}
\vfill
\midaligned{This is page \recurselevel}
\vfill
\stopbuffer

\setupheadertexts[\CONTEXT]

\starttext

\dorecurse{16}{\getbuffer[Fakepage]\page}

\stoptext





Greetlings, Hraban
---
http://www.fiee.net/texnique/
http://wiki.contextgarden.net
https://www.cacert.org (I'm an assurer)



PING
Any news on that? Today's beta still is buggy.
Unfortunately I need 2UP imposition urgently.


Greetlings, Hraban
___
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/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___


Re: [NTG-context] Metapost/Metafun Q: using variables and "building blocks"?

2012-04-23 Thread Hans Hagen

On 23-4-2012 19:34, Mari Voipio wrote:

Hello all,

any graphic experts around who can bump me past a stupid hinder on my
way to understanding MPgraphics?


I'm trying to create a system of describing certain type of braiding
patterns (fingerloop braiding), based on what has been used in the
field before me - but they did it all manually either by pen or
computer, and I just do not fancy doing 40+ patterns by hand in
Inkscape, especially as my pattern recipe book keeps expanding and I'm
planning on that, too.

I think Metapost could be the solution, because I need simple shapes
and sometimes complicated but well-regulated paths/arrows to go
between them; I'm just being a clueless newbie, too much in the
WYSIWYG vector graphics mode to really know what to do.


Mostly with the examples in the Metafun manual I've managed to get as
far as to my basic building block, two circles joined by a curve:


\startMPpage
path p, q, r ;

p := fullcircle scaled 8mm ;
q := p shifted (0cm,24mm) ;
r := center p .. (12mm,12mm) .. center q ;

pair pr, qr ;

pr := p intersectionpoint r ;
qr := q intersectionpoint r ;

r := r cutbefore pr cutafter qr ;
r := r cutends 0.2mm ;

draw r withpen pencircle scaled 0.2mm withcolor black ;
draw p withpen pencircle scaled 0.2mm withcolor black ; fill p withcolor white;
draw q withpen pencircle scaled 0.2mm withcolor black ; fill q withcolor black;
\stopMPpage



However, I don't seem to be able to find the answers to the next questions:

a) I need to be able to stack four of these on top of each other and
then four mirrored ones next to them (all-in-all a 2 x 4 grid/block),
and probably a 1-block space between the two columns. I realize I can
do that with "shift", but should I make my single 'building block' a
group, a buffer or overlay or something else? Keeping in mind that I
will have to be able to draw a path/arrow on top, so I need to know
where they are.
(At some point I need to expand to more columns, but the number of
rows is still 4 as we have humans have just four aligned fingers per
hand - thumbs aren't counted - but one can add hands i.e. people to
work wider braids.)


b) The circles p and q can be filled with the same colour or two
different colours, and each of the blocks in a pattern can have
different fill colour (e.g. two totally black, two totally white, two
half-and-half with either black or white on top). The pen/outline
colour should stay as black, which means that I can't implement the
symbol example in the Metafun manual (the smiley that is totally
switched from black to red).
I don't mind having different blocks for monocoloured and bicoloured
versions, but it would be nice to be able to say something like
\usesloop[lh,blue] for 'take a single-coloured left-hand loop in blue'
instead of having to dig deeper into the MP code every time.

I assume the answer is "use variables", but how?


something:

\startMPpage

def MyShape =
image (
path p, q, r ;

p := fullcircle scaled 8mm ;
q := p shifted (0cm,24mm) ;
r := center p .. (12mm,12mm) .. center q ;

pair pr, qr ;

pr := p intersectionpoint r ;
qr := q intersectionpoint r ;

r := r cutbefore pr cutafter qr ;
r := r cutends 0.2mm ;

draw r withpen pencircle scaled 0.2mm withcolor black ;
draw p withpen pencircle scaled 0.2mm withcolor black ; fill p 
withcolor white;
draw q withpen pencircle scaled 0.2mm withcolor black ; fill q 
withcolor black;

)
enddef ;

for i=0 step 2cm until 8cm :
for j=0 step 4cm until 12cm :
draw MyShape shifted (i,j) ;
endfor ;
endfor ;

\stopMPpage


there are picture variables, so

picture pp ; pp := image(...) ;

can be used


I used millimeters here because it just feels more natural to me,
that's what textile crafts does (when not based on inches like
quilting and scrapbooking...). The measurements won't be shown
anywhere - these are graphs or pictograms, not real pictures - so I
can still switch to using something else. Besides, if the "building
block" approach works, there isn't that much to be changed, get the
first block right and the rest can be calculated from there.


mm are okay, alternative use no dimension, just numbers and scale 
afterwards:


currentpicture := currentpicture xsized 10cm ;

or so.


PS. Today's craft related metaphor: I feel just like I was staring at
a messed up skein of yarn: I know  that I'm now holding one of the
ends, I thus can start to untangle the knot - and the more I pry
loose, the less there's left to sort out. However, in the beginning
the process tends to be very slow and awkward...


beware, metapost is addictive once you get better in it,

(btw, a talk about this will fit nicely in the upcoming eurotex theme)

Hans

-
  Hans Hagen | PRAGMA ADE
  Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
tel: 038 

[NTG-context] Metapost/Metafun Q: using variables and "building blocks"?

2012-04-23 Thread Mari Voipio
Hello all,

any graphic experts around who can bump me past a stupid hinder on my
way to understanding MPgraphics?


I'm trying to create a system of describing certain type of braiding
patterns (fingerloop braiding), based on what has been used in the
field before me - but they did it all manually either by pen or
computer, and I just do not fancy doing 40+ patterns by hand in
Inkscape, especially as my pattern recipe book keeps expanding and I'm
planning on that, too.

I think Metapost could be the solution, because I need simple shapes
and sometimes complicated but well-regulated paths/arrows to go
between them; I'm just being a clueless newbie, too much in the
WYSIWYG vector graphics mode to really know what to do.


Mostly with the examples in the Metafun manual I've managed to get as
far as to my basic building block, two circles joined by a curve:


\startMPpage
path p, q, r ;

p := fullcircle scaled 8mm ;
q := p shifted (0cm,24mm) ;
r := center p .. (12mm,12mm) .. center q ;

pair pr, qr ;

pr := p intersectionpoint r ;
qr := q intersectionpoint r ;

r := r cutbefore pr cutafter qr ;
r := r cutends 0.2mm ;

draw r withpen pencircle scaled 0.2mm withcolor black ;
draw p withpen pencircle scaled 0.2mm withcolor black ; fill p withcolor white;
draw q withpen pencircle scaled 0.2mm withcolor black ; fill q withcolor black;
\stopMPpage



However, I don't seem to be able to find the answers to the next questions:

a) I need to be able to stack four of these on top of each other and
then four mirrored ones next to them (all-in-all a 2 x 4 grid/block),
and probably a 1-block space between the two columns. I realize I can
do that with "shift", but should I make my single 'building block' a
group, a buffer or overlay or something else? Keeping in mind that I
will have to be able to draw a path/arrow on top, so I need to know
where they are.
(At some point I need to expand to more columns, but the number of
rows is still 4 as we have humans have just four aligned fingers per
hand - thumbs aren't counted - but one can add hands i.e. people to
work wider braids.)


b) The circles p and q can be filled with the same colour or two
different colours, and each of the blocks in a pattern can have
different fill colour (e.g. two totally black, two totally white, two
half-and-half with either black or white on top). The pen/outline
colour should stay as black, which means that I can't implement the
symbol example in the Metafun manual (the smiley that is totally
switched from black to red).
I don't mind having different blocks for monocoloured and bicoloured
versions, but it would be nice to be able to say something like
\usesloop[lh,blue] for 'take a single-coloured left-hand loop in blue'
instead of having to dig deeper into the MP code every time.

I assume the answer is "use variables", but how?



I used millimeters here because it just feels more natural to me,
that's what textile crafts does (when not based on inches like
quilting and scrapbooking...). The measurements won't be shown
anywhere - these are graphs or pictograms, not real pictures - so I
can still switch to using something else. Besides, if the "building
block" approach works, there isn't that much to be changed, get the
first block right and the rest can be calculated from there.



Any ideas on how I can achieve the ease that surely exists somewhere there?
I'll take plain Metapost or a combination of Metapost and Metafun +
ConTeXt as I'll use ConTeXt anyway to achieve multi-format output with
a minimum of fuss.



Help thankfully received, as always,

Mari



PS. Today's craft related metaphor: I feel just like I was staring at
a messed up skein of yarn: I know  that I'm now holding one of the
ends, I thus can start to untangle the knot - and the more I pry
loose, the less there's left to sort out. However, in the beginning
the process tends to be very slow and awkward...
___
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/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___