ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
From: Hans Hagen <pragma@wxs.nl>
To: mailing list for ConTeXt users <ntg-context@ntg.nl>
Cc: Andreas Schneider <aksdb@gmx.de>
Subject: Re: \everyaftershipout isn't "called"	for	every	pagebreak
Date: Sun, 17 Jan 2010 23:59:29 +0100	[thread overview]
Message-ID: <4B539651.8010503@wxs.nl> (raw)
In-Reply-To: <hj021o$ceq$1@ger.gmane.org>

On 17-1-2010 23:13, Andreas Schneider wrote:
>> dealing with multipass data in mkiv is completely different from mkii
>> and at some point there will be a proper api for users (makes no sense
>> now as i might as well change internals along with luatex developments)
>>
>> in mkiv we store info in tables and much is available during a document
>> run anyway (in mkii we filter data from the tuo file) so the question
>> is, what info do you need? it's probably easier to provide it as core
>> functionality
>>
>> so i need speccs and a small test file
>>
>> Hans
>
> Thanks for that info!
> I think for specs my "plan" is too vague. I will explain what my goal is
> then you either see a good solution and/or tell me that this is out of scope
> for now :-)
>
> The test file to demonstrate the problem is in my initial newsgroup post for
> this thread. I will re-attach it here.
>
> What I need would be a precise page break handling. Currently ConTeXt seems
> to process a whole paragraph as one object, and then breaks it down to
> individual pages. That leads to a problem however:
> I want to refine my citation style. All bibliography is inserted into
> footnotes. If two (or more) consecutive citations _on the same page_ refer
> to the same bib entry, the footnote for that citation should read "Ibidem".
> Therefore I have to remember the last cited entry. Currently I use
> \appendtoks...\to\everyaftershipout to reset/clear the variable I use for
> storing that last entry. That works fine as long as the paragraphs are
> small. If however several citations within one (possibly large) paragraph
> are separated by a page break, the output will be wrong, since the event to
> reset the variable occurs too late (see above).
>
> The problem can be demonstrated with this example - the first footnote on
> each page should be "New".
>
> \define\test{\doifelse{\getvalue{testvar}}{page}{%
>    \footnote{Repeat}%
> }{%
>    \footnote{New}%
>    \setvalue{testvar}{page}%
> }}
>
> \appendtoks
>    \global\setvalue{testvar}{}
> \to\everyaftershipout
>
> \starttext
>    \dorecurse{10}{\dorecurse{250}{text }\test}
>
>    \dorecurse{10}{\dorecurse{250}{text }\test}
> \stoptext

as it takes less time wrting a helper than explaining how to do it i 
just added it as feature (a few years from probably only wolfgang 
remembers that it's there)

i'll upload a beta to the website that provides ...

\starttext

\dorecurse {100} {
     test \footnote{\doifnoteonsamepageelse[footnote]{ibidem}{aaa}}
}

\stoptext

keep in mind that such features, depending on multiple passes, might 
result in a few more as it will never get things right the first time

actually, in some cases it might make sense to delete the tuc file 
before a run

Hans

-----------------------------------------------------------------
                                           Hans Hagen | PRAGMA ADE
               Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
      tel: 038 477 53 69 | fax: 038 477 53 74 | www.pragma-ade.com
                                              | www.pragma-pod.nl
-----------------------------------------------------------------
___________________________________________________________________________________
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
___________________________________________________________________________________


  parent reply	other threads:[~2010-01-17 22:59 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-01-16 16:53 Andreas Schneider
2010-01-16 20:00 ` Wolfgang Schuster
2010-01-16 21:58   ` Andreas Schneider
2010-01-17 20:42     ` Hans Hagen
2010-01-17 21:16       ` Andreas Schneider
2010-01-17 21:45         ` Hans Hagen
2010-01-17 22:13           ` Andreas Schneider
2010-01-17 22:25             ` Martin Schröder
2010-01-17 22:59             ` Hans Hagen [this message]
2010-01-18 12:12               ` Andreas Schneider

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=4B539651.8010503@wxs.nl \
    --to=pragma@wxs.nl \
    --cc=aksdb@gmx.de \
    --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).