Thanks so much for such a quick reply Wolfgang

Virus-free. www.avast.com

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