ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* value-copy - e.g. in \textreference
@ 2007-08-30 19:55 Peter Schorsch
  2007-08-31  5:43 ` Wolfgang Schuster
  0 siblings, 1 reply; 3+ messages in thread
From: Peter Schorsch @ 2007-08-30 19:55 UTC (permalink / raw)
  To: ntg-context

Hi,

during my first tries of context-programming I bounced a couple of times
against a problem I am calling myself my value-copy-border.

E.g. number is a register/variable that helps numbering some paragraphs.
Some of these paragraphs also should be cross-linked. But the pointer gets
always the value, number has at the point of the pointer - and not at the
point of the marked paragraph.

How can I get just the value of a variable? - like currentsection in the
example:


\definenumber[number]

\setuphead[chapter,section,subsection,subsubsection
[after={\resetnumber[number]}]

\def\MyMark[#1]
        {\textreference[#1]{Para. \currentheadnumber / \getnumber[number]}}

\definestartstop[MyPara]
  [before=
        {\blank[medium]\incrementnumber[number]%
        \inothermargin{\getnumber[number]~}},
   after={\blank[medium]}]

\starttext

\section
\startMyPara
blabla blabla blabla blabla blabla blabla blabla blabla blabla blabla blabla
blabla blabla blabla blabla 
\stopMyPara

\subsection
\startMyPara
blabla blabla blabla blabla blabla blabla blabla blabla blabla blabla blabla
blabla blabla blabla blabla 
\stopMyPara

\startMyPara\MyMark[testmark]
blabla blabla blabla blabla blabla blabla blabla blabla blabla blabla blabla
blabla blabla blabla blabla 
\stopMyPara

\section
The Link should be [Abs. 1.1/2] but is \in[testmark] 
%unluckily it is [Abs. 1.1/0]

\stoptext

___________________________________________________________________________________
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  : https://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________


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

* Re: value-copy - e.g. in \textreference
  2007-08-30 19:55 value-copy - e.g. in \textreference Peter Schorsch
@ 2007-08-31  5:43 ` Wolfgang Schuster
  2007-08-31 18:28   ` Peter Schorsch
  0 siblings, 1 reply; 3+ messages in thread
From: Wolfgang Schuster @ 2007-08-31  5:43 UTC (permalink / raw)
  To: mailing list for ConTeXt users

2007/8/30, Peter Schorsch <tralalas@freenet.de>:
> Hi,
>
> during my first tries of context-programming I bounced a couple of times
> against a problem I am calling myself my value-copy-border.
>
> E.g. number is a register/variable that helps numbering some paragraphs.
> Some of these paragraphs also should be cross-linked. But the pointer gets
> always the value, number has at the point of the pointer - and not at the
> point of the marked paragraph.
>
> How can I get just the value of a variable? - like currentsection in the
> example:
>
>
> \definenumber[number]
>
> \setuphead[chapter,section,subsection,subsubsection
> [after={\resetnumber[number]}]
>
> \def\MyMark[#1]
>         {\textreference[#1]{Para. \currentheadnumber / \getnumber[number]}}

\def\MyMark[#1]%
  {\expanded{\textreference[#1]{Para. \currentheadnumber / \getnumber[number]}}}

> \definestartstop[MyPara]
>   [before=
>         {\blank[medium]\incrementnumber[number]%
>         \inothermargin{\getnumber[number]~}},
>    after={\blank[medium]}]
>
> \starttext
>
> \section

\section{...}

> \startMyPara
> blabla blabla blabla blabla blabla blabla blabla blabla blabla blabla blabla
> blabla blabla blabla blabla
> \stopMyPara
>
> \subsection

\subsection{...}

> \startMyPara
> blabla blabla blabla blabla blabla blabla blabla blabla blabla blabla blabla
> blabla blabla blabla blabla
> \stopMyPara
>
> \startMyPara\MyMark[testmark]
> blabla blabla blabla blabla blabla blabla blabla blabla blabla blabla blabla
> blabla blabla blabla blabla
> \stopMyPara
>
> \section
> The Link should be [Abs. 1.1/2] but is \in[testmark]
> %unluckily it is [Abs. 1.1/0]
>
> \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  : https://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________


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

* Re: value-copy - e.g. in \textreference
  2007-08-31  5:43 ` Wolfgang Schuster
@ 2007-08-31 18:28   ` Peter Schorsch
  0 siblings, 0 replies; 3+ messages in thread
From: Peter Schorsch @ 2007-08-31 18:28 UTC (permalink / raw)
  To: ntg-context

Wolfgang Schuster wrote:

> 
> \def\MyMark[#1]%
>   {\expanded{\textreference[#1]{Para. \currentheadnumber /
>   {\getnumber[number]}}}
> 

Thanks, it works with the expanded...

___________________________________________________________________________________
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  : https://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________


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

end of thread, other threads:[~2007-08-31 18:28 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-08-30 19:55 value-copy - e.g. in \textreference Peter Schorsch
2007-08-31  5:43 ` Wolfgang Schuster
2007-08-31 18:28   ` Peter Schorsch

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