ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
From: James Withers <james.o.withers@gmail.com>
To: Wolfgang Schuster <wolfgang.schuster.lists@gmail.com>
Cc: mailing list for ConTeXt users <ntg-context@ntg.nl>
Subject: Re: Using variables and macros for styling of section title and line in table of contents
Date: Wed, 22 Jul 2020 20:45:11 +0100	[thread overview]
Message-ID: <CAE8093XUCVd2Erz_8fcJy9=-eAKDFjEww33RqWK==NQHMCaT4A@mail.gmail.com> (raw)
In-Reply-To: <b1859c17-1bb8-76e5-9b7d-746b1307d8cc@gmail.com>


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

Thanks so much for such a quick reply Wolfgang

<https://www.avast.com/sig-email?utm_medium=email&utm_source=link&utm_campaign=sig-email&utm_content=webmail>
Virus-free.
www.avast.com
<https://www.avast.com/sig-email?utm_medium=email&utm_source=link&utm_campaign=sig-email&utm_content=webmail>
<#DAB4FAD8-2DD7-40BB-A1B8-4E2AA1F9FDF2>

On Wed, 22 Jul 2020 at 20:38, Wolfgang Schuster <
wolfgang.schuster.lists@gmail.com> wrote:

> James Withers schrieb am 22.07.2020 um 21:20:
> > Dear list
> >
> > I have a document with section headings which include a title, date and
> > reference spread over two lines with different font style and
> > justification, plus a slightly different text for the table of contents.
> >
> > So that I can alter the styling of the section headings without having
> > to recode each \startsection command, I have used variables and a macro
> > command for the style.
> >
> > This works for section 'title' and 'marking', but not for the 'list'
> > attribute.
>
> The title argument works only because it is placed in the text but it
> won't work when you try to show the argument in the ToC like the list
> argument.
>
> > The minimal working example below shows what I'm trying to do.
> >
> > Best wishes and many thanks in advance.
> >
> > James
> >
> >
> \define\mytitle{\getvariable{myvar}{title}\crlf{\tfx\getvariable{myvar}{date}\hfill\getvariable{myvar}{ref}}}
> > \define\mylist{\getvariable{myvar}{list}---{\bf
> \getvariable{myvar}{date}}}
>
> In this case you have to use \defineexpandable to create your commands
> and enable expansion for sections.
>
> \defineexpandable\mytitle{...}
> \defineexpandable\mylist {...}
>
> \setuphead[section][expansion=yes]
>
> Wolfgang
>

[-- Attachment #1.2: Type: text/html, Size: 2845 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
___________________________________________________________________________________

      reply	other threads:[~2020-07-22 19:45 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-07-22 19:20 James Withers
2020-07-22 19:38 ` Wolfgang Schuster
2020-07-22 19:45   ` James Withers [this message]

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='CAE8093XUCVd2Erz_8fcJy9=-eAKDFjEww33RqWK==NQHMCaT4A@mail.gmail.com' \
    --to=james.o.withers@gmail.com \
    --cc=ntg-context@ntg.nl \
    --cc=wolfgang.schuster.lists@gmail.com \
    /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).