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>
Cc: Marco <netuse@lavabit.com>
Subject: Re: Include section number in reference
Date: Sat, 15 Oct 2011 17:03:31 +0200	[thread overview]
Message-ID: <59A6BCF2-10EC-4019-9A72-A8DC10C37703@googlemail.com> (raw)
In-Reply-To: <2341794D-96AF-4512-AC58-046D4A9DB9EE@googlemail.com>


Am 14.10.2011 um 13:28 schrieb Wolfgang Schuster:

> 
> Am 14.10.2011 um 13:18 schrieb Marco:
> 
>> On 2011-10-13 Wolfgang Schuster <schuster.wolfgang@googlemail.com> wrote:
>> 
>>> \setupreferencestructureprefix[default][prefixsegments=2:*]
>> 
>> Thanks.
>> 
>> Wikified. (Although without explanations, just an example)
> 
> 
> I can also provide the entry from my command reference (no yet in the PDF):
> 
> \setupreferencestructureprefix[.1.][.2.][..,.3.,..]
>                             optional
> 
> 1. IDENTIFIER (float, formula, figure, SECTION (e.g. section, subsection, …), …)
> 2. number, page, title, text or default
> 3. prefix              = yes (default), no
>   prefixseparatorset  = IDENTIFIER
>   prefixconversionset = IDENTIFIER
>   prefixset           = IDENTIFIER
>   prefixsegments      = SEGMENTS
>   prefixconnector     = TEXT

Below I describe the values of the three arguments.


The first (and optional) argument can be used to specify the element,
where you want to customize the reference. When you use “float” the setting
affects all kind of floats which are created with \definefloat but you
also change only certain float type when you use the name of the float,
e.g. figure or table. When you want to change the layout for a heading you
need the name of it, e.g. chapter or section (not sure about this because
I haven’t checked this).


The second argument specifies the reference type, you can the values
of these types in the following example. When you refer to a section
or float with \in context uses the “default” type and when you use
\at it uses the “page” type.

\startsetups[reference:table]

	\starttabulate
	\NC \bf key  \EQ \bf value                 \NC\NR
	\NC number   \EQ \currentreferencenumber   \NC\NR
	\NC page     \EQ \currentreferencepage     \NC\NR
	\NC title    \EQ \currentreferencetitle    \NC\NR
	\NC text     \EQ\currentreferencetext      \NC\NR
	\NC default  \EQ \currentreferencedefault  \NC\NR
	\NC realpage \EQ \currentreferencerealpage \NC\NR
	\stoptabulate

\stopsetups

\definereferenceformat[referencetable][setups=reference:table]

\starttext

\section[sec:table]{Values for the reference command}

\starttyping
\startsection[reference=sec:table,title={Values for the reference command}]
\stoptyping

\referencetable[sec:table]

\startbuffer
\reference[ref:test]{Is this the text or the title?}
\stopbuffer

\getbuffer \typebuffer

\referencetable[ref:test]

\stoptext


With the third argument you can control which prefixes (section numbers
which are shown in front of a floats own counter value) are shown and
how they should be formatted.

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-10-15 15:03 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-10-12 13:49 Marco
2011-10-13 20:36 ` Marco
2011-10-13 20:48   ` Wolfgang Schuster
2011-10-14 11:18     ` Marco
2011-10-14 11:28       ` Wolfgang Schuster
2011-10-15 15:03         ` Wolfgang Schuster [this message]
2011-10-16 17:00           ` Marco
2013-03-16 17:37     ` Steffen Wolfrum

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=59A6BCF2-10EC-4019-9A72-A8DC10C37703@googlemail.com \
    --to=schuster.wolfgang@googlemail.com \
    --cc=netuse@lavabit.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).