ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* flashcards
@ 2013-01-19 18:13 aik01
  2013-01-20 17:36 ` flashcards Wolfgang Schuster
  0 siblings, 1 reply; 2+ messages in thread
From: aik01 @ 2013-01-19 18:13 UTC (permalink / raw)
  To: ntg-context

migrating Wolfgang's flashcard example from mkii to mkiv, I changed  
all @@pp to v_page_target_
It was foreseeable that this is not sufficient:
pages           > flushing realpage 16, userpage 1
pages           > flushing realpage 16, userpage 1
! You can't use a prefix with `the character 1'.

system          > tex > error on line 58 in file testiv.tex: You can't  
use a prefix with ` ...

48     \setupbackgrounds[page][frame=on]
49
50     \starttext
51
52     \dorecurse{20}
53       {\startstandardmakeup[align=middle]
54        Front side \recurselevel
55        \stopstandardmakeup
56        \startstandardmakeup[align=middle]
57        Back side \recurselevel
58 >>     \stopstandardmakeup}
59
60     \stoptext
61

<to be read again>
                    1
\arrangedpageN ->1
                   6
now I'm stuck. any help?

code see http://wiki.contextgarden.net/User:Wolfgang_Schuster

thanks
Peter Herkenrath

___________________________________________________________________________________
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
___________________________________________________________________________________


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

* Re: flashcards
  2013-01-19 18:13 flashcards aik01
@ 2013-01-20 17:36 ` Wolfgang Schuster
  0 siblings, 0 replies; 2+ messages in thread
From: Wolfgang Schuster @ 2013-01-20 17:36 UTC (permalink / raw)
  To: mailing list for ConTeXt users

[-- Attachment #1: Type: text/plain, Size: 1101 bytes --]


Am 19.01.2013 um 19:13 schrieb aik01@uni-koeln.de:

> migrating Wolfgang's flashcard example from mkii to mkiv, I changed all @@pp to v_page_target_
> It was foreseeable that this is not sufficient:
> pages           > flushing realpage 16, userpage 1
> pages           > flushing realpage 16, userpage 1
> ! You can't use a prefix with `the character 1'.
> 
> system          > tex > error on line 58 in file testiv.tex: You can't use a prefix with ` ...
> 
> 48     \setupbackgrounds[page][frame=on]
> 49
> 50     \starttext
> 51
> 52     \dorecurse{20}
> 53       {\startstandardmakeup[align=middle]
> 54        Front side \recurselevel
> 55        \stopstandardmakeup
> 56        \startstandardmakeup[align=middle]
> 57        Back side \recurselevel
> 58 >>     \stopstandardmakeup}
> 59
> 60     \stoptext
> 61
> 
> <to be read again>
>                   1
> \arrangedpageN ->1
>                  6
> now I'm stuck. any help?
> 
> code see http://wiki.contextgarden.net/User:Wolfgang_Schuster

Hi Peter,

I attached a fixed version of the code.

Wolfgang

[-- Attachment #2: flashcard.tex --]
[-- Type: application/octet-stream, Size: 1664 bytes --]

\unprotect

\installpagearrangement FLASHCARD
  {\dosetuparrangement
     \v_page_target_nx
     \v_page_target_ny
     {\numexpr\v_page_target_ny*2\relax}%
     {\numexpr\v_page_target_nx+\plusone\relax}%
     {\numexpr\v_page_target_ny+\plusone\relax}%
   \pusharrangedpageFLASHCARD\poparrangedpagesAB\relax}

\newcount\arrangedpageshiftX
\newcount\arrangedpageshiftY

\def\dopusharrangedpageFLASHCARD#1%
  {\ifnum\arrangedpageshiftX<\arrangedpageX
     \ifodd\arrangedpageN
       \handlearrangedpageXandY{#1}0\arrangedpageshiftX\arrangedpageshiftY\arrangedpageA
     \else
       \handlearrangedpageXandY{#1}0{\numexpr\v_page_target_nx-\arrangedpageshiftX-1\relax}\arrangedpageshiftY\arrangedpageB
       \global\advance\arrangedpageshiftX\plusone
     \fi
   \fi
   \ifnum\arrangedpageshiftX=\v_page_target_nx
     \global\arrangedpageshiftX\zerocount
     \global\advance\arrangedpageshiftY\plusone
   \fi}

\def\pusharrangedpageFLASHCARD#1%
  {\advancearrangedpageN
   \reportarrangedpage\arrangedpageN
   \ifnum\arrangedpageN=\numexpr\v_page_target_xy*2\relax
     \dopusharrangedpageFLASHCARD{#1}%
     \global\arrangedpageshiftX\zerocount
     \global\arrangedpageshiftY\zerocount
     \poparrangedpages
   \else
     \dopusharrangedpageFLASHCARD{#1}%
   \fi}

\protect

\setuppapersize[A7][A3,landscape]
\setuppaper    [nx=4,ny=2]
\setuparranging[FLASHCARD]
\setuplayout   [location=middle,marking=on]

\setupbackgrounds[page][frame=on]

\starttext

\dorecurse{20}
  {\startstandardmakeup[align=middle]
   Front side \recurselevel
   \stopstandardmakeup
   \startstandardmakeup[align=middle]
   Back side \recurselevel
   \stopstandardmakeup}

\stoptext

[-- Attachment #3: Type: text/plain, Size: 485 bytes --]

___________________________________________________________________________________
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
___________________________________________________________________________________

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

end of thread, other threads:[~2013-01-20 17:36 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-01-19 18:13 flashcards aik01
2013-01-20 17:36 ` flashcards Wolfgang Schuster

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