ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
From: Wolfgang Schuster <schuster.wolfgang@googlemail.com>
To: mailing list for ConTeXt users <ntg-context@ntg.nl>
Subject: Re: referencing
Date: Sun, 20 Nov 2011 21:37:05 +0100	[thread overview]
Message-ID: <3851FA3E-027F-4618-8E49-732BF3722856@googlemail.com> (raw)
In-Reply-To: <40618C2C-86AE-4ED1-AD5D-3B8AE0732149@uva.nl>


Am 20.11.2011 um 21:26 schrieb Meer, H. van der:

> Thanks Wolfgang for the code. 
> 
> Just in case it is of use I concocted my variation on this theme. Now this simply replaces the \in, \at and \about macro's with one that does not show on the page where the link originates, but behaves as of old everywhere else. I introduced the unskip in order to remove the space that ruins the end of a line when there is nothing to display. For example from \in{see there}[ref]. <--this period would otherwise acquire a space before it.

Instead of \unskip you should use \removeunwantedspaces which does a check before it calls \unskip.

> \def\SamePageDo#1[#2]%
> {\doifreferencefoundelse{#2}
>    {\ifnum\referencepagestate=1
>       \unskip%\unknown % reference is on the same page
>      \else
>        #1[#2]%
>     \fi}
>    {\unskip}} % reference not found
> \let\oldin=\in
> \let\oldat=\at
> \let\oldabout=\about
> \def\in{\SamePageDo\oldin}
> \def\at{\SamePageDo\oldat}
> \def\about{\SamePageDo\oldabout}

Don’t redefine \in, at and \about because all three commands can also be used in math mode where they have a different meaning but with your redefinition they can’t be used anymore for math.

Wolfgang
___________________________________________________________________________________
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:[~2011-11-20 20:37 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-11-20 17:46 referencing Hans van der Meer
2011-11-20 18:42 ` referencing Wolfgang Schuster
2011-11-20 20:26   ` referencing Meer, H. van der
2011-11-20 20:37     ` Wolfgang Schuster [this message]
  -- strict thread matches above, loose matches on Subject: below --
2010-01-05 13:46 Referencing Willi Egger
2010-01-05 15:59 ` Referencing Hans Hagen
2002-02-06 14:38 Referencing Giuseppe Bilotta

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=3851FA3E-027F-4618-8E49-732BF3722856@googlemail.com \
    --to=schuster.wolfgang@googlemail.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).