ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
From: Wolfgang Schuster <wolfgang.schuster@gmail.com>
To: mailing list for ConTeXt users <ntg-context@ntg.nl>
Subject: Re: flashcards
Date: Sun, 20 Jan 2013 18:36:12 +0100	[thread overview]
Message-ID: <EE6721DF-F253-455E-9F49-12FF0DD416E4@gmail.com> (raw)
In-Reply-To: <20130119191333.68786d9zbzvzlcnh@webmail.uni-koeln.de>

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

      reply	other threads:[~2013-01-20 17:36 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-01-19 18:13 flashcards aik01
2013-01-20 17:36 ` Wolfgang Schuster [this message]

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=EE6721DF-F253-455E-9F49-12FF0DD416E4@gmail.com \
    --to=wolfgang.schuster@gmail.com \
    --cc=ntg-context@ntg.nl \
    /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).