From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on inbox.vuxu.org X-Spam-Level: X-Spam-Status: No, score=-0.7 required=5.0 tests=DKIM_ADSP_CUSTOM_MED, DKIM_INVALID,DKIM_SIGNED,FREEMAIL_FROM,HTML_MESSAGE,MAILING_LIST_MULTI, T_KAM_HTML_FONT_INVALID,URIBL_SBL_A autolearn=ham autolearn_force=no version=3.4.4 Received: (qmail 27085 invoked from network); 12 Sep 2023 21:17:26 -0000 Received: from cgl.ntg.nl (5.39.185.202) by inbox.vuxu.org with ESMTPUTF8; 12 Sep 2023 21:17:26 -0000 Received: from localhost (localhost [127.0.0.1]) by cgl.ntg.nl (Postfix) with ESMTP id 51A8A482F7B for ; Tue, 12 Sep 2023 23:17:01 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at cgl.ntg.nl Received: from cgl.ntg.nl ([127.0.0.1]) by localhost (cgl.ntg.nl [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id H2P-12YiUXfX for ; Tue, 12 Sep 2023 23:17:00 +0200 (CEST) Received: from cgl.ntg.nl (localhost [127.0.0.1]) by cgl.ntg.nl (Postfix) with ESMTP id 3FF85482F0A for ; Tue, 12 Sep 2023 23:16:16 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by cgl.ntg.nl (Postfix) with ESMTP id 076204823D7 for ; Tue, 12 Sep 2023 23:15:58 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at cgl.ntg.nl Received: from cgl.ntg.nl ([127.0.0.1]) by localhost (cgl.ntg.nl [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id UpdU3UihZZJA for ; Tue, 12 Sep 2023 23:15:57 +0200 (CEST) Received: from mail-lj1-f181.google.com (mail-lj1-f181.google.com [209.85.208.181]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by cgl.ntg.nl (Postfix) with ESMTPS id 806974823B1 for ; Tue, 12 Sep 2023 23:15:57 +0200 (CEST) Received: by mail-lj1-f181.google.com with SMTP id 38308e7fff4ca-2bfb17435e4so7071111fa.0 for ; Tue, 12 Sep 2023 14:15:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1694553356; x=1695158156; darn=ntg.nl; h=content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject:from:to:cc:subject:date :message-id:reply-to; bh=uzdkQqDNoKOqPyJs1F64tm96hllcYM7GDBAUcpXHouQ=; b=lxjmoOEoQAfYnDPzYudaiM/o0xYZ1smCfap41xJhYj9eC428fmyQI3eZZDerbE9ir4 39dy0K0jQa7DmW/Jb0bA9JnNyJP60ju5tkGpC0S+IsOuVm1DRzeKQIc7pKNdzD0/aQ9Y RRHmUW6ANyjZ6Q/keiaanA7KQf0jIsrQegwuGZEhHzxbNNRgedUeUMFV8vPMDBJ8vrJm 4OU/gC1ZfI4pA6bOkFCG2BG3nauhyuyu0RmiW/RFSse2+5YJ1zQshwtmDExQ4HOeiRt0 Z1LdhnfTFxZJWGoTzvTVGLxO4uYWAFq4ipIBmK+iMSLSditVsSu9x1BU1ZwVgCFFw5Ia Takg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1694553356; x=1695158156; h=content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject:x-gm-message-state:from:to :cc:subject:date:message-id:reply-to; bh=uzdkQqDNoKOqPyJs1F64tm96hllcYM7GDBAUcpXHouQ=; b=JuEdyTMtPh+5oa88WqohscYnCgVtFVZLo2d6mCUg2+1yvTbBPRHOwY/K07o0r+cMKh /1NG/2f9sY9dpKYvwxoSmRpf+NDOnJc4OrvDxbECu6LXfQZAPvWJPcPaxqw5M+8+T0GX FOAonfbb4kGfM0o0N49EIt60ssqQ4XCH9UB2SQKPDazw7EPdMZrL4OJsctIM3EKMGWqf PTKvncoIB+jLIH0mrOO0mvv4Afj+sgZwMpXL2noDaYhQ6+kHRi47cKpsurRkPLjoBc90 rZcu1kBugg6eIc9es9nZA+ZIaNmPfnKzMrHE50B7SNylIaNjtn4uOBkHK5viLnQJra8x RRcQ== X-Gm-Message-State: AOJu0YwlOGSi+EIkoCLgGJKen2vJ1VPwzUYkxE1688QPXTqOhVg6C4CJ gk3rJGHDLneBLzlu+3aIMKtc0Isk1wFqlruZ X-Google-Smtp-Source: AGHT+IHb6oeuWCweG7rM1iVbsLa0EIAtOFr7eIgZMA37pwgw1WGHDb3X58ZGY7WjWz9JsDVutKBefg== X-Received: by 2002:a2e:9e81:0:b0:2bc:d5f1:b9cf with SMTP id f1-20020a2e9e81000000b002bcd5f1b9cfmr704899ljk.27.1694553356346; Tue, 12 Sep 2023 14:15:56 -0700 (PDT) Received: from ?IPv6:2a00:11b1:1061:7138:8196:1d3:518c:e6b5? ([2a00:11b1:1061:7138:8196:1d3:518c:e6b5]) by smtp.gmail.com with ESMTPSA id d10-20020a170906344a00b00977cad140a8sm7296207ejb.218.2023.09.12.14.15.54 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Tue, 12 Sep 2023 14:15:55 -0700 (PDT) To: denis.maier@unibe.ch References: <005bc695-fac3-18d0-f903-81f7720506d7@gmail.com> From: Wolfgang Schuster Message-ID: <76b371c6-6560-e2ff-80c3-d2d29ef3915f@gmail.com> Date: Tue, 12 Sep 2023 23:15:52 +0200 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:52.0) Gecko/20100101 PostboxApp/7.0.60 MIME-Version: 1.0 In-Reply-To: Content-Language: en-US Message-ID-Hash: X5MXEQ5Z3BCK7TV6DB53GT3AJ6ONECGB X-Message-ID-Hash: X5MXEQ5Z3BCK7TV6DB53GT3AJ6ONECGB X-MailFrom: wolfgang.schuster.lists@gmail.com X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header CC: ntg-context@ntg.nl X-Mailman-Version: 3.3.8 Precedence: list Reply-To: mailing list for ConTeXt users Subject: [NTG-context] Re: Using structureuservariables before the heading List-Id: mailing list for ConTeXt users Archived-At: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: Content-Type: multipart/mixed; boundary="===============5518152351899024971==" This is a multi-part message in MIME format. --===============5518152351899024971== Content-Type: multipart/alternative; boundary="------------D824E0F621E964D0538220E2" Content-Language: en-US This is a multi-part message in MIME format. --------------D824E0F621E964D0538220E2 Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 8bit denis.maier@unibe.ch schrieb am 12.09.2023 um 21:38: > > *Von:*Wolfgang Schuster > *Gesendet:* Dienstag, 12. September 2023 21:30 > *An:* Maier, Denis Christian (UB) > *Cc:* ntg-context@ntg.nl > *Betreff:* Re: [NTG-context] Using structureuservariables before the > heading > > denis.maier@unibe.ch schrieb am > 12.09.2023 um 21:24: > > *Von:*Wolfgang Schuster > > *Gesendet:* Dienstag, 12. September 2023 20:41 > *An:* mailing list for ConTeXt users > ; Maier, Denis Christian (UB) > > *Betreff:* Re: [NTG-context] Using structureuservariables before > the heading > > denis.maier@unibe.ch schrieb am > 12.09.2023 um 17:47: > > > Hi, > > is it possible to access a structureuservariable before the > heading’s title ? > > Using the «before» key does not seem to work. > > > There are ways but not in a general way because you try to access > the values > before they are known to ConTeXt. To provide a proper solution you > have > to tell what you're trying to achieve. > > I’m just trying to output the author’s name above a chapter > heading. Do you need more information? > > > You can create a custom header for the chapter page and show the value > of the author key > which works without problems because the header is added after to the > finished page > after the value is available. > > Another option when the name should appear in the same space as the > chapter title > is a custom layout for the title. > > Yes, I’ve tried that in the original MWE: > > %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% > > \setuphead[chapter][ > >     before={Before: \structureuservariable{author}\blank}, > >     beforesection={Beforesection: \structureuservariable{author}\blank}, > >     insidesection={Insidesection: \structureuservariable{author}\blank}, > >     after={After: \structureuservariable{author}\blank}, > >     ] > > \def\myChapterCommand#1#2{\structureuservariable{author}\space\blank} > > \define[2]\myChapterCommand{\structureuservariable{author}\blank > #1\space#2} > > %\def\myChapterCommand#1#2{\structureuservariable{author}\blank > #1\space#2} % does not work > > % \starttexdefinition myChapterCommand #1 #2 % doesn't work either, > but at least blanks should work > > %   \structureuservariable{author} > > %   Test > > %   \blank > > %   #1\space#2 > > % \stoptexdefinition > > \starttext > > \myChapterCommand{1}{asdf} > > \startchapter[title=First][author=First Author] > > \input knuth > > \stopchapter > > \startchapter[title=Second][author=Second Author] > > \input knuth > > \stopchapter > > \setuphead[chapter] > >     [ > >     before=,after=,beforesection=,insidesection=, > >     command=\myChapterCommand, > > ] > > \startchapter[title=Third][author={Third Author}] > > \input knuth > > \stopchapter > > \stoptext > > %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% > > Here, I’m getting «Third author» just before «3 Third». So I guess > this goes in the right direction, but \define doesn’t allow for blanks > etc. \starttexdefinition and \def on the other hand gave me erros. > You need a box to get the author on a separate line. % \define[2]\ChapterCommand %   {\vbox %      {\structureuservariable{author} %      \blank %      #1\space#2}} \starttexdefinition protected ChapterCommand #1#2   \vbox\bgroup     \structureuservariable{author}     \blank     #1\space#2   \egroup \stoptexdefinition \setuphead   [chapter]   [command=\ChapterCommand] \starttext \startchapter[title=First][author=First Author] \input knuth \stopchapter \startchapter[title=Second][author=Second Author] \input knuth \stopchapter \startchapter[title=Third][author={Third Author}] \input knuth \stopchapter \stoptext Wolfgang --------------D824E0F621E964D0538220E2 Content-Type: text/html; charset=windows-1252 Content-Transfer-Encoding: 8bit denis.maier@unibe.ch schrieb am 12.09.2023 um 21:38:

Von: Wolfgang Schuster <wolfgang.schuster.lists@gmail.com>
Gesendet: Dienstag, 12. September 2023 21:30
An: Maier, Denis Christian (UB) <denis.maier@unibe.ch>
Cc: ntg-context@ntg.nl
Betreff: Re: [NTG-context] Using structureuservariables before the heading

 

denis.maier@unibe.ch schrieb am 12.09.2023 um 21:24:

 

Von: Wolfgang Schuster <wolfgang.schuster.lists@gmail.com>
Gesendet: Dienstag, 12.
September 2023 20:41
An: mailing list for ConTeXt users <ntg-context@ntg.nl>; Maier, Denis Christian (UB) <denis.maier@unibe.ch>
Betreff: Re: [NTG-context] Using structureuservariables before the heading

 

denis.maier@unibe.ch schrieb am 12.09.2023 um 17:47:


Hi,

 

is it possible to access a structureuservariable before the heading’s title ?

Using the «before» key does not seem to work.


There are ways but not in a general way because you try to access the values
before they are known to ConTeXt. To provide a proper solution you have
to tell what you're trying to achieve.

 

I’m just trying to output the author’s name above a chapter heading. Do you need more information?


You can create a custom header for the chapter page and show the value of the author key
which works without problems because the header is added after to the finished page
after the value is available.

Another option when the name should appear in the same space as the chapter title
is a custom layout for the title.

Yes, I’ve tried that in the original MWE:

 

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\setuphead[chapter][

    before={Before: \structureuservariable{author}\blank},

    beforesection={Beforesection: \structureuservariable{author}\blank},

    insidesection={Insidesection: \structureuservariable{author}\blank},

    after={After: \structureuservariable{author}\blank},

    ]

 

\def\myChapterCommand#1#2{\structureuservariable{author}\space\blank}

\define[2]\myChapterCommand{\structureuservariable{author}\blank #1\space#2}

%\def\myChapterCommand#1#2{\structureuservariable{author}\blank #1\space#2} % does not work

 

% \starttexdefinition myChapterCommand #1 #2 % doesn't work either, but at least blanks should work

%   \structureuservariable{author}

%   Test

%   \blank

%   #1\space#2

% \stoptexdefinition

 

\starttext

 

\myChapterCommand{1}{asdf}

 

\startchapter[title=First][author=First Author]

\input knuth

\stopchapter

 

\startchapter[title=Second][author=Second Author]

\input knuth

\stopchapter

 

\setuphead[chapter]

    [

    before=,after=,beforesection=,insidesection=,

    command=\myChapterCommand,

    ]

 

\startchapter[title=Third][author={Third Author}]

\input knuth

\stopchapter

 

\stoptext

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

 

Here, I’m getting «Third author» just before «3 Third». So I guess this goes in the right direction, but \define doesn’t allow for blanks etc. \starttexdefinition and \def on the other hand gave me erros.


You need a box to get the author on a separate line.

% \define[2]\ChapterCommand
%   {\vbox
%      {\structureuservariable{author}
%      \blank
%      #1\space#2}}

\starttexdefinition protected ChapterCommand #1#2
  \vbox\bgroup
    \structureuservariable{author}
    \blank
    #1\space#2
  \egroup
\stoptexdefinition

\setuphead
  [chapter]
  [command=\ChapterCommand]

\starttext

\startchapter[title=First][author=First Author]
\input knuth
\stopchapter

\startchapter[title=Second][author=Second Author]
\input knuth
\stopchapter

\startchapter[title=Third][author={Third Author}]
\input knuth
\stopchapter

\stoptext

Wolfgang

--------------D824E0F621E964D0538220E2-- --===============5518152351899024971== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline ___________________________________________________________________________________ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / https://www.ntg.nl/mailman/listinfo/ntg-context webpage : https://www.pragma-ade.nl / http://context.aanhet.net archive : https://bitbucket.org/phg/context-mirror/commits/ wiki : https://contextgarden.net ___________________________________________________________________________________ --===============5518152351899024971==--