Am 13.10.2012 um 18:53 schrieb Zenlima <p...@zenlima.eu>:

> Hi Sietse, hi Wolfgang,
> 
> thanks for your first feedback. Right now I am working on your
> suggestions.
> 
> @Wolfgang: I don't understand your suggestion: "add a label key to
> disable/enable the label text". Can you describe it more detaily or in
> other words? I am not sure how to implement it with the refs to a
> paragraph.


Here is a example where I used a few helpers, e.g. \installdirectcommandhandler 
creates \setupreferencecommand and \referencecommandparameter.

\unprotect

\installnamespace                                  {referencecommand}
\installdirectcommandhandler \????referencecommand {referencecommand}

\def\referencecommand
  {\dodoubleempty\referencecommand_direct}

\def\referencecommand_direct[#1][#2]%
  {\begingroup
   \ifsecondargument
     \setupreferencecommand[#1]%
     \edef\m_reference{#2}%
   \else
     \edef\m_reference{#1}%
   \fi
   \usereferencecommandstyleandcolor\c!style\c!color
   \getreference[title][\m_reference]%
   \doif{\referencecommandparameter\c!label}\v!yes{\referencetext\v!page}%
   \referencecommandparameter\c!left
   \getreference [page][\m_reference]%
   \referencecommandparameter\c!right
   \endgroup}

\definelabelclass[reference]

\setupreferencetext[\s!en][page={ on page }]
\setupreferencetext[\s!de][page={ auf Seite }]

\setupreferencecommand
  [\c!label=\v!yes,
    \c!left=(,
   \c!right=)]

\protect

\starttext

\dontleavehmode\reference[knuth]{Donald E. Knuth}%
\input knuth

\blank

\referencecommand[knuth]

\blank

\referencecommand[left={[},right={]}][knuth]

\blank

\referencecommand[style=italic,color=red][knuth]

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

Reply via email to