ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
From: Wolfgang Schuster <wolfgang.schuster@gmail.com>
To: mailing list for ConTeXt users <ntg-context@ntg.nl>
Subject: Re: New module: pararef
Date: Sat, 13 Oct 2012 19:27:54 +0200	[thread overview]
Message-ID: <95F7CB04-7D3D-410D-AC55-3779EFE3FF8D@gmail.com> (raw)
In-Reply-To: <20121013185355.4cf37a3e@zenlima.eu>


Am 13.10.2012 um 18:53 schrieb Zenlima <post@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	other threads:[~2012-10-13 17:27 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-10-12 23:44 Zenlima
2012-10-13  9:57 ` Wolfgang Schuster
2012-10-13 10:55 ` Sietse Brouwer
2012-10-13 11:13   ` Wolfgang Schuster
2012-10-13 16:53     ` Zenlima
2012-10-13 17:27       ` Wolfgang Schuster [this message]
2012-10-13 22:46       ` Mojca Miklavec
2012-10-13 15:25 ` Philipp Gesang
2012-10-14  8:19   ` Wolfgang Schuster
2012-10-16 14:04 ` Procházka Lukáš Ing. - Pontex s. r. o.

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=95F7CB04-7D3D-410D-AC55-3779EFE3FF8D@gmail.com \
    --to=wolfgang.schuster@gmail.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).