ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* Formatting in the toc
@ 2019-11-09 21:03 Calum MacLeod
  0 siblings, 0 replies; 3+ messages in thread
From: Calum MacLeod @ 2019-11-09 21:03 UTC (permalink / raw)
  To: ntg-context


[-- Attachment #1.1: Type: text/plain, Size: 1731 bytes --]

I have now found time to see if I could work out how to apply
\structurelistuservariable. In short, I  have to admit that I could not.

I am grateful to Hraban for his encouraging response, but though I could
see it was related, it seems to me not quite what I seek.

The more I thought about the answer, I realised I had not explained my
question in a precise manner.

I am retired, and produce a weekly A5 booklet from material with which my
wife (a church minister), supplies to me. I call it a pulpit manuscript. It
is the entire script for her service. Included are the numbers and first
line of five hymns, that are different each week.

Until I gain a better understanding of ConTeXt, I shall continue to use
LaTeX koma-script package for the weekly booklet. In order to make life
easier for myself, I have created commands of my own.

One of these commands enables me to have a template which has five
instances of \hymn{} {}. If I put with the first braces pair '387', and in
the second pair, 'The Lord's my shepherd' --- when LaTeX koma-script
outputs the PDF, 'Hymn 387' is in bold and 'The Lord's my shepherd' is
italicised. For the next hymn, it would be a different number, and
different first line, but it would auto-formatted the way I want.

That command is constructed in the preamble in the following way:

\newcommand{\hymn}[3][Hymn]{\addsec{\rlap{\textbf{#1
#2}}\hspace}{7em}{\normalfont\small\textit{#3} }}}

This places a specific gap between the hymn number and the first line as
well. Not only does it format the section heading (\addsec) to have bold
and italics (without bold), it formats the corresponding entry in the toc
in exactly the same way.

How can I make a similar command for ConTeXt, please?

[-- Attachment #1.2: Type: text/html, Size: 2239 bytes --]

[-- Attachment #2: Type: text/plain, Size: 493 bytes --]

___________________________________________________________________________________
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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki     : http://contextgarden.net
___________________________________________________________________________________

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

* Re: Formatting in the toc
  2019-11-04 21:07 Calum MacLeod
@ 2019-11-04 21:17 ` Henning Hraban Ramm
  0 siblings, 0 replies; 3+ messages in thread
From: Henning Hraban Ramm @ 2019-11-04 21:17 UTC (permalink / raw)
  To: mailing list for ConTeXt users

I’d suggest to use something like (untested)

\startsubject[title={The Lord’s my Shepherd}][biblepart={Hymn 387}]

and

\setuphead[subject][command=\MyBibleSection]

\define[2]\MyBibleSection{{\bf #1}\hfill{\it\structureuservariable{biblepart}}}

You’d need to setup your ToC useing \structurelistuservariable,
similar to https://wiki.contextgarden.net/Generate_Authorlist_from_Head_Content


Greetlings, Hraban
---
https://www.fiee.net
http://wiki.contextgarden.net
https://www.dreiviertelhaus.de
GPG Key ID 1C9B22FD


> Am 2019-11-04 um 22:07 schrieb Calum MacLeod <pabbay@gmail.com>:
> 
> In the body of document, I often have a heading such as this:
> 
> \subject{{\bf Hymn 387} \hfill {\it The Lord's my Shepherd}}
> 
> When it arrives in the Table of Contents, the bold and italic have been stripped off.
> 
> My question is: How do I copy to ToC the formatting as well as the content of the text?
> 
> I would be grateful for an answer, or to be pointed to where I could learn more. 
> 
> Thanks in advance,
> Calum MacLeod
> ___________________________________________________________________________________
> 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://context.aanhet.net
> archive  : https://bitbucket.org/phg/context-mirror/commits/
> wiki     : http://contextgarden.net
> ___________________________________________________________________________________


___________________________________________________________________________________
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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki     : http://contextgarden.net
___________________________________________________________________________________

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

* Formatting in the toc
@ 2019-11-04 21:07 Calum MacLeod
  2019-11-04 21:17 ` Henning Hraban Ramm
  0 siblings, 1 reply; 3+ messages in thread
From: Calum MacLeod @ 2019-11-04 21:07 UTC (permalink / raw)
  To: ntg-context


[-- Attachment #1.1: Type: text/plain, Size: 416 bytes --]

In the body of document, I often have a heading such as this:

\subject{{\bf Hymn 387} \hfill {\it The Lord's my Shepherd}}

When it arrives in the Table of Contents, the bold and italic have been
stripped off.

My question is: How do I copy to ToC the formatting as well as the content
of the text?

I would be grateful for an answer, or to be pointed to where I could learn
more.

Thanks in advance,
Calum MacLeod

[-- Attachment #1.2: Type: text/html, Size: 698 bytes --]

[-- Attachment #2: Type: text/plain, Size: 493 bytes --]

___________________________________________________________________________________
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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki     : http://contextgarden.net
___________________________________________________________________________________

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

end of thread, other threads:[~2019-11-09 21:03 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-11-09 21:03 Formatting in the toc Calum MacLeod
  -- strict thread matches above, loose matches on Subject: below --
2019-11-04 21:07 Calum MacLeod
2019-11-04 21:17 ` Henning Hraban Ramm

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