ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* Re: Formatting Indexed Words Within the Text
       [not found] <mailman.204.1332507708.3819.ntg-context@ntg.nl>
@ 2012-03-24  4:19 ` Malte Stien
  0 siblings, 0 replies; 7+ messages in thread
From: Malte Stien @ 2012-03-24  4:19 UTC (permalink / raw)
  To: ntg-context

Hi,

I got a few responses for this. Thank you to all of you. I ended up using the code below. Works a treat. And yes, apologies. The square brackets were a typo; of course they should have been curly.

Thank you again.
Malte.


On 24/03/2012, at 0:01, ntg-context-request@ntg.nl wrote:

> One way is to use your own macro:
> 
> \def\MyIndex#1{\index{#1}{\sc #1}}
> \starttext
> There are some \MyIndex{ducks} in the zoo.
> \stoptext
> 
> By the way, your \index[ducks] didn't work for me the way I thought you wanted; I changed the [] to {} and added the word to the text body.  As far as I can tell, \index only adds entries to the index register and not to the text.

___________________________________________________________________________________
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: Formatting Indexed Words Within the Text
  2012-03-24 10:20   ` Alan Braslau
@ 2012-03-24 10:28     ` Hans Hagen
  0 siblings, 0 replies; 7+ messages in thread
From: Hans Hagen @ 2012-03-24 10:28 UTC (permalink / raw)
  To: Alan Braslau; +Cc: mailing list for ConTeXt users

On 24-3-2012 11:20, Alan Braslau wrote:
> On Fri, 23 Mar 2012 19:42:38 +0100
> Hans Hagen<pragma@wxs.nl>  wrote:
>
>> in the test suite: registers/processors-001.tex
>>
>> \defineprocessor[bf][style=bold]
>> \defineprocessor[it][style=italic]
>>
>> \starttext
>>
>>       \index{it->italic}\index{normal}
>>       This is a \index[bf->bold]{test with bold number}test.
>>       This is a less important \index{test}test.
>>
>>       \placeindex
>>
>> \stoptext
>>
>> so the magic word is 'processors'
>
> Magic indeed!
>
> So processors can be used *wherever* text is to be typeset,
> as a prefix: name->text
>
> \defineprocessor[name][...,...=...,...]
> with keys: style=, color=, left=, right=, command=
>
> I'm not sure that I understand, but once I do,
> I'll have to add a wiki page...

not yet but they will be used for cases like this

Hans

-----------------------------------------------------------------
                                           Hans Hagen | PRAGMA ADE
               Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
     tel: 038 477 53 69 | voip: 087 875 68 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

* Re: Formatting Indexed Words Within the Text
  2012-03-23 18:42 ` Hans Hagen
@ 2012-03-24 10:20   ` Alan Braslau
  2012-03-24 10:28     ` Hans Hagen
  0 siblings, 1 reply; 7+ messages in thread
From: Alan Braslau @ 2012-03-24 10:20 UTC (permalink / raw)
  To: pragma; +Cc: mailing list for ConTeXt users

On Fri, 23 Mar 2012 19:42:38 +0100
Hans Hagen <pragma@wxs.nl> wrote:

> in the test suite: registers/processors-001.tex
> 
> \defineprocessor[bf][style=bold]
> \defineprocessor[it][style=italic]
> 
> \starttext
> 
>      \index{it->italic}\index{normal}
>      This is a \index[bf->bold]{test with bold number}test.
>      This is a less important \index{test}test.
> 
>      \placeindex
> 
> \stoptext
> 
> so the magic word is 'processors'

Magic indeed!

So processors can be used *wherever* text is to be typeset,
as a prefix: name->text

\defineprocessor[name][...,...=...,...]
with keys: style=, color=, left=, right=, command=

I'm not sure that I understand, but once I do,
I'll have to add a wiki page...

Alan



___________________________________________________________________________________
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: Formatting Indexed Words Within the Text
  2012-03-23 10:57 Malte Stien
  2012-03-23 11:30 ` Rogers, Michael K
  2012-03-23 13:04 ` Alan BRASLAU
@ 2012-03-23 18:42 ` Hans Hagen
  2012-03-24 10:20   ` Alan Braslau
  2 siblings, 1 reply; 7+ messages in thread
From: Hans Hagen @ 2012-03-23 18:42 UTC (permalink / raw)
  To: mailing list for ConTeXt users

On 23-3-2012 11:57, Malte Stien wrote:
> s it possible to format indexed words in a particular style within the text more or less automatically. For example, if I write
>
>    There are some \index[ducks] in the zoo.
>
> ....I would like the term "ducks" to appear in small-capitals to indicate the that term can be found in the index. Ideally, I'd like to do that without explicit manual formatting. Is that possible?

in the test suite: registers/processors-001.tex

\defineprocessor[bf][style=bold]
\defineprocessor[it][style=italic]

\starttext

     \index{it->italic}\index{normal}
     This is a \index[bf->bold]{test with bold number}test.
     This is a less important \index{test}test.

     \placeindex

\stoptext

so the magic word is 'processors'

-----------------------------------------------------------------
                                           Hans Hagen | PRAGMA ADE
               Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
     tel: 038 477 53 69 | voip: 087 875 68 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

* Re: Formatting Indexed Words Within the Text
  2012-03-23 10:57 Malte Stien
  2012-03-23 11:30 ` Rogers, Michael K
@ 2012-03-23 13:04 ` Alan BRASLAU
  2012-03-23 18:42 ` Hans Hagen
  2 siblings, 0 replies; 7+ messages in thread
From: Alan BRASLAU @ 2012-03-23 13:04 UTC (permalink / raw)
  To: ntg-context

On Fri, 23 Mar 2012 21:57:04 +1100
Malte Stien <malte@stien.de> wrote:

> Hi all,
> 
> Is it possible to format indexed words in a particular style within
> the text more or less automatically. For example, if I write
> 
>   There are some \index[ducks] in the zoo.
> 
> ...I would like the term "ducks" to appear in small-capitals to
> indicate the that term can be found in the index. Ideally, I'd like
> to do that without explicit manual formatting. Is that possible?
> 
> Thank you,
> Malte.

Your example above would not print the word "ducks" at all.


I commonly use:
\def\Index#1{\index{#1}#1}

There are some \Index{ducks} in the zoo.


In ConTeXt, text to be typeset typically appears within {}.
Of course, you can then modify the definition to format the text as you
wish:
\def\Index#1{\index{#1}\sc #1}

I'm sure that there is a more clever way.

Note that the \index{} command appears *before* the word, not after.
Otherwise, the word might get placed at the end of a page and the index
point to the following page. I believe that the \index{} command takes
care to avoid the opposite case.

Alan
___________________________________________________________________________________
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: Formatting Indexed Words Within the Text
  2012-03-23 10:57 Malte Stien
@ 2012-03-23 11:30 ` Rogers, Michael K
  2012-03-23 13:04 ` Alan BRASLAU
  2012-03-23 18:42 ` Hans Hagen
  2 siblings, 0 replies; 7+ messages in thread
From: Rogers, Michael K @ 2012-03-23 11:30 UTC (permalink / raw)
  To: mailing list for ConTeXt users

On Mar 23, 2012, at 6:57 AM, Malte Stien wrote:

> Is it possible to format indexed words in a particular style within the text more or less automatically. For example, if I write
>
>  There are some \index[ducks] in the zoo.
>
> ...I would like the term "ducks" to appear in small-capitals to indicate the that term can be found in the index. Ideally, I'd like to do that without explicit manual formatting. Is that possible?
>
> Thank you,
> Malte.

One way is to use your own macro:

\def\MyIndex#1{\index{#1}{\sc #1}}
\starttext
There are some \MyIndex{ducks} in the zoo.
\stoptext

By the way, your \index[ducks] didn't work for me the way I thought you wanted; I changed the [] to {} and added the word to the text body.  As far as I can tell, \index only adds entries to the index register and not to the text.

________________________________

This e-mail message (including any attachments) is for the sole use of
the intended recipient(s) and may contain confidential and privileged
information. If the reader of this message is not the intended
recipient, you are hereby notified that any dissemination, distribution
or copying of this message (including any attachments) is strictly
prohibited.

If you have received this message in error, please contact
the sender by reply e-mail message and destroy all copies of the
original message (including attachments).
___________________________________________________________________________________
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

* Formatting Indexed Words Within the Text
@ 2012-03-23 10:57 Malte Stien
  2012-03-23 11:30 ` Rogers, Michael K
                   ` (2 more replies)
  0 siblings, 3 replies; 7+ messages in thread
From: Malte Stien @ 2012-03-23 10:57 UTC (permalink / raw)
  To: mailing list for ConTeXt users

Hi all,

Is it possible to format indexed words in a particular style within the text more or less automatically. For example, if I write

  There are some \index[ducks] in the zoo.

...I would like the term "ducks" to appear in small-capitals to indicate the that term can be found in the index. Ideally, I'd like to do that without explicit manual formatting. Is that possible?

Thank you,
Malte.

___________________________________________________________________________________
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

end of thread, other threads:[~2012-03-24 10:28 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <mailman.204.1332507708.3819.ntg-context@ntg.nl>
2012-03-24  4:19 ` Formatting Indexed Words Within the Text Malte Stien
2012-03-23 10:57 Malte Stien
2012-03-23 11:30 ` Rogers, Michael K
2012-03-23 13:04 ` Alan BRASLAU
2012-03-23 18:42 ` Hans Hagen
2012-03-24 10:20   ` Alan Braslau
2012-03-24 10:28     ` Hans Hagen

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