ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* referencing
@ 2011-11-20 17:46 Hans van der Meer
  2011-11-20 18:42 ` referencing Wolfgang Schuster
  0 siblings, 1 reply; 7+ messages in thread
From: Hans van der Meer @ 2011-11-20 17:46 UTC (permalink / raw)
  To: ConTeXt NTG

I have the following question about references.

Using for example \at one can say somehting like "see on \at{page}[ref] for the figure..
But when the figure is one the same page it seems a bit superfluous to reference to it. In the same manner it is a bit of an overkill to put a hyperlink to the page where this link resides itself.

It is clear that ConTeXt knows if it is on the same page as is referenced, because then a link is coloured with contrastcolor instead of color.

Now the question: how easy/difficult is it to either suppress such an \at-reference or switch between chosen alternate texts for links on or off the same page as the referenced item?

Hans van der Meer



___________________________________________________________________________________
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] 7+ messages in thread

* Re: referencing
  2011-11-20 17:46 referencing Hans van der Meer
@ 2011-11-20 18:42 ` Wolfgang Schuster
  2011-11-20 20:26   ` referencing Meer, H. van der
  0 siblings, 1 reply; 7+ messages in thread
From: Wolfgang Schuster @ 2011-11-20 18:42 UTC (permalink / raw)
  To: mailing list for ConTeXt users


Am 20.11.2011 um 18:46 schrieb Hans van der Meer:

> I have the following question about references.
> 
> Using for example \at one can say somehting like "see on \at{page}[ref] for the figure..
> But when the figure is one the same page it seems a bit superfluous to reference to it. In the same manner it is a bit of an overkill to put a hyperlink to the page where this link resides itself.
> 
> It is clear that ConTeXt knows if it is on the same page as is referenced, because then a link is coloured with contrastcolor instead of color.
> 
> Now the question: how easy/difficult is it to either suppress such an \at-reference or switch between chosen alternate texts for links on or off the same page as the referenced item?

\def\SamePage[#1]%
  {\doifreferencefoundelse{#1}
     {\ifnum\referencepagestate=1
        \unknown % reference is on the same page
       \else
         \at[#1]%
      \fi}
     {\donothing}}

\starttext

\pagereference[one]
\pagereference[two]

One: \SamePage[one]

\page

Two: \SamePage[one]

\stoptext

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
___________________________________________________________________________________


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

* Re: referencing
  2011-11-20 18:42 ` referencing Wolfgang Schuster
@ 2011-11-20 20:26   ` Meer, H. van der
  2011-11-20 20:37     ` referencing Wolfgang Schuster
  0 siblings, 1 reply; 7+ messages in thread
From: Meer, H. van der @ 2011-11-20 20:26 UTC (permalink / raw)
  To: mailing list for ConTeXt users

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.

\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}

Hans van der Meer

On 20 nov. 2011, at 19:42, Wolfgang Schuster wrote:

> 
> Am 20.11.2011 um 18:46 schrieb Hans van der Meer:
> 
>> I have the following question about references.
>> 
>> Using for example \at one can say somehting like "see on \at{page}[ref] for the figure..
>> But when the figure is one the same page it seems a bit superfluous to reference to it. In the same manner it is a bit of an overkill to put a hyperlink to the page where this link resides itself.
>> 
>> It is clear that ConTeXt knows if it is on the same page as is referenced, because then a link is coloured with contrastcolor instead of color.
>> 
>> Now the question: how easy/difficult is it to either suppress such an \at-reference or switch between chosen alternate texts for links on or off the same page as the referenced item?
> 
> \def\SamePage[#1]%
>  {\doifreferencefoundelse{#1}
>     {\ifnum\referencepagestate=1
>        \unknown % reference is on the same page
>       \else
>         \at[#1]%
>      \fi}
>     {\donothing}}
> 
> \starttext
> 
> \pagereference[one]
> \pagereference[two]
> 
> One: \SamePage[one]
> 
> \page
> 
> Two: \SamePage[one]
> 
> \stoptext
> 
> 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
___________________________________________________________________________________


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

* Re: referencing
  2011-11-20 20:26   ` referencing Meer, H. van der
@ 2011-11-20 20:37     ` Wolfgang Schuster
  0 siblings, 0 replies; 7+ messages in thread
From: Wolfgang Schuster @ 2011-11-20 20:37 UTC (permalink / raw)
  To: mailing list for ConTeXt users


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
___________________________________________________________________________________


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

* Re: Referencing...
  2010-01-05 13:46 Referencing Willi Egger
@ 2010-01-05 15:59 ` Hans Hagen
  0 siblings, 0 replies; 7+ messages in thread
From: Hans Hagen @ 2010-01-05 15:59 UTC (permalink / raw)
  To: mailing list for ConTeXt users; +Cc: Willi Egger

On 5-1-2010 14:46, Willi Egger wrote:

> Is there something changed in the approach in MKIV?

sure, no common note code in mkii and mkiv

fixed,

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
___________________________________________________________________________________


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

* Referencing...
@ 2010-01-05 13:46 Willi Egger
  2010-01-05 15:59 ` Referencing Hans Hagen
  0 siblings, 1 reply; 7+ messages in thread
From: Willi Egger @ 2010-01-05 13:46 UTC (permalink / raw)
  To: NTG-Context ConTeXt users

Hi,

I have small tabulations which contain references to footnotes in the  
header line. - The footnotes are placed correctly, how ever if I  
refer to the references I get in 2 out of the three cases ?? i.e.  
ConTeXt does not know the reference. I am puzzled because it works  
for the third reference... When extending the list of footnotes again  
the referencing works only for the last reference.
Is there something changed in the approach in MKIV?

\starttext
\starttabulate[|l|c|r|r|r|]
\NC Issue \NC Time \NC Avg.\footnote[av]{Average log\low{10} values}  
\NC s\footnote[stdv]{Standard deviation} \NC se\footnote[se]{Standard  
error of the mean} \NC\NR
\NC A \EQ 1       \NC 3.85 \NC 1.06 \NC 0.31 \NC\NR
\stoptabulate

\starttabulate[|l|c|r|r|r|]
\NC Issue \NC Time \NC Avg.\note[av] \NC s\note[stdv] \NC se\note[se] 
\NC\NR
\NC B \EQ 1       \NC 1.18 \NC 0.8  \NC  0.23 \NC\NR
\stoptabulate

Look at s\note[av]
\stoptext

I am using:
This is LuaTeX, Version beta-0.50.0-2009122422
ConTeXt  ver: 2010.01.03 12:54 MKIV  fmt: 2010.1.4  int: english/english

Kind regards

Willi
___________________________________________________________________________________
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] 7+ messages in thread

* Referencing
@ 2002-02-06 14:38 Giuseppe Bilotta
  0 siblings, 0 replies; 7+ messages in thread
From: Giuseppe Bilotta @ 2002-02-06 14:38 UTC (permalink / raw)


Hello,

I start with a small documentation bug:

in core-ref.tex there is a figure whose handle is [three calls]
which is later referenced by [fig:three calls]. This of course
means that the references remains unknown.

While this is (currently) a bug, it gives ground to an interesting
idea, connected to reference prefix: it should be possible to
allow different kind of stuff to have different automatic
prefixes, in such a way that [three calls] would be automatically
prefixed by fig: for a picture, tab: for a table and so on and so
forth (of course, customizable autoprefixes).

Of course, if such a feature is implemented (or even if it is not
implemented, actually) \definereferenceformat should include an
option to automatically add a particular prefix; so, if tab is
the prefix for tables, I could do the following:

=====================================================================
\setupfloat[table][interactionprefix=tab]

\placetable[here][handle]
{Caption}
\starttable
...
\stoptable

As seen in~\in Table[tab:handle], we have such and so.

\definereferenceformat[intable][text=Table,prefix=tab]

As seen in~\intable[handle], we have such and so.
=====================================================================

(hope this is clear).

While we're at it, I'd ask one more thing: how do I extract the
part/chapter/section/subsection/etc number of a reference?

--
Giuseppe "Oblomov" Bilotta


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

end of thread, other threads:[~2011-11-20 20:37 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
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     ` referencing Wolfgang Schuster
  -- 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

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