ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* Chapter cover page
@ 2023-02-23 10:21 Alex Leray via ntg-context
  2023-02-23 13:24 ` Bruce Horrocks via ntg-context
  0 siblings, 1 reply; 3+ messages in thread
From: Alex Leray via ntg-context @ 2023-02-23 10:21 UTC (permalink / raw)
  To: Denis Maier via ntg-context; +Cc: Alex Leray

Hello,

I'm trying to figure out how to design a chapter page for a custom head 
section with uservariables defined.

I'd like to have the chapter page start on a right page. I'd like this 
page to feature the title of the chapter (here: an interview) along with 
some other info like the interviewee name and bio. All in a "fancy" layout.

I'm having issue putting it all together. The command parameter allow me 
to override the content of the title but has some drawbacks (it seems to 
be stuck in horizontal mode for instance).

I'm open to any solution but would find it nice to keep the 
\startstopinterview structure.

Here is my code at the moment:

%%%

\define[2]\MyChapter{
         \starttabulate[|p(\layoutcolumnwidth)|p(\layoutcolumnwidth)|]
         \NC \structureuservariable{author} \NC 
\structureuservariable{bio} \NR
         \stoptabulate
}

\definehead[interview][chapter]
\setuphead[interview][
     page=right,
     command=\MyChapter,
     % insidesection={\page},
     style={\tfa},
]


\starttext
\startinterview[title={My Interview}][
     author={Jane Doe},
     year={2022},
     month={Decembre},
     bio={\input ward}
]

\dorecurse{10}{\input ward \crlf}
\stopinterview
\stoptext

%%%

Many thanks

___________________________________________________________________________________
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
___________________________________________________________________________________

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

* Re: Chapter cover page
  2023-02-23 10:21 Chapter cover page Alex Leray via ntg-context
@ 2023-02-23 13:24 ` Bruce Horrocks via ntg-context
  2023-02-23 21:14   ` Alex Leray via ntg-context
  0 siblings, 1 reply; 3+ messages in thread
From: Bruce Horrocks via ntg-context @ 2023-02-23 13:24 UTC (permalink / raw)
  To: ntg-context mailing list; +Cc: Bruce Horrocks, Alex Leray

Hi Alex,

I couldn't get it to work with \tabulate so I switched to TABLE instead. The workaround for the horizontal mode problem is to put the chapter title into row two of the table. Hopefully this works with your actual text. Also I'm not sure where \layoutcolumnwidth is coming from so I just hard-coded a width for now. Lastly there are neater ways (using \setuptable) to define the table but it's just an example...

\define[2]\MyChapter{
       \bTABLE[frame=off]
       \bTR
         \bTD[width=4cm] \structureuservariable{author} \eTD
         \bTD \structureuservariable{bio} \eTD
       \eTR
       \bTR
         \bTD[nc=2] #1 #2 \eTD
       \eTR
       \eTABLE
}

\definehead[interview][chapter]
\setuphead[interview][
   page=right,
   command=\MyChapter,
   % insidesection={\page},
   style={\tfa},
]

\starttext
\startinterview[title={My Interview}][
   author={Jane Doe},
   year={2022},
   month={Decembre},
   bio={\input ward}
]

\dorecurse{10}{\input ward \crlf}
\stopinterview
\stoptext


> On 23 Feb 2023, at 10:21, Alex Leray via ntg-context <ntg-context@ntg.nl> wrote:
> 
> Hello,
> 
> I'm trying to figure out how to design a chapter page for a custom head section with uservariables defined.
> 
> I'd like to have the chapter page start on a right page. I'd like this page to feature the title of the chapter (here: an interview) along with some other info like the interviewee name and bio. All in a "fancy" layout.
> 
> I'm having issue putting it all together. The command parameter allow me to override the content of the title but has some drawbacks (it seems to be stuck in horizontal mode for instance).
> 
> I'm open to any solution but would find it nice to keep the \startstopinterview structure.
> 
> Here is my code at the moment:
> 
> %%%
> 
> \define[2]\MyChapter{
>        \starttabulate[|p(\layoutcolumnwidth)|p(\layoutcolumnwidth)|]
>        \NC \structureuservariable{author} \NC \structureuservariable{bio} \NR
>        \stoptabulate
> }
> 
> \definehead[interview][chapter]
> \setuphead[interview][
>    page=right,
>    command=\MyChapter,
>    % insidesection={\page},
>    style={\tfa},
> ]
> 
> 
> \starttext
> \startinterview[title={My Interview}][
>    author={Jane Doe},
>    year={2022},
>    month={Decembre},
>    bio={\input ward}
> ]
> 
> \dorecurse{10}{\input ward \crlf}
> \stopinterview
> \stoptext
> 
> %%%
> 
> Many thanks
> 
> ___________________________________________________________________________________
> 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
> ___________________________________________________________________________________

—
Bruce Horrocks
Hampshire, UK

___________________________________________________________________________________
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
___________________________________________________________________________________

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

* Re: Chapter cover page
  2023-02-23 13:24 ` Bruce Horrocks via ntg-context
@ 2023-02-23 21:14   ` Alex Leray via ntg-context
  0 siblings, 0 replies; 3+ messages in thread
From: Alex Leray via ntg-context @ 2023-02-23 21:14 UTC (permalink / raw)
  To: ntg-context; +Cc: Alex Leray

Hi Bruce, and thanks for your answer.

In the end, I think a combination of `insidesection` and `placehead` 
does what I want:

###

\setuphead[interview][
     placehead=hidden,
     insidesection={\setup{interview:cover}},
]

###

I'll test it harder in the coming days!

Alex

Le 23/02/23 à 14:24, Bruce Horrocks via ntg-context a écrit :
> Hi Alex,
> 
> I couldn't get it to work with \tabulate so I switched to TABLE instead. The workaround for the horizontal mode problem is to put the chapter title into row two of the table. Hopefully this works with your actual text. Also I'm not sure where \layoutcolumnwidth is coming from so I just hard-coded a width for now. Lastly there are neater ways (using \setuptable) to define the table but it's just an example...
> 
> \define[2]\MyChapter{
>         \bTABLE[frame=off]
>         \bTR
>           \bTD[width=4cm] \structureuservariable{author} \eTD
>           \bTD \structureuservariable{bio} \eTD
>         \eTR
>         \bTR
>           \bTD[nc=2] #1 #2 \eTD
>         \eTR
>         \eTABLE
> }
> 
> \definehead[interview][chapter]
> \setuphead[interview][
>     page=right,
>     command=\MyChapter,
>     % insidesection={\page},
>     style={\tfa},
> ]
> 
> \starttext
> \startinterview[title={My Interview}][
>     author={Jane Doe},
>     year={2022},
>     month={Decembre},
>     bio={\input ward}
> ]
> 
> \dorecurse{10}{\input ward \crlf}
> \stopinterview
> \stoptext
> 
> 
>> On 23 Feb 2023, at 10:21, Alex Leray via ntg-context <ntg-context@ntg.nl> wrote:
>>
>> Hello,
>>
>> I'm trying to figure out how to design a chapter page for a custom head section with uservariables defined.
>>
>> I'd like to have the chapter page start on a right page. I'd like this page to feature the title of the chapter (here: an interview) along with some other info like the interviewee name and bio. All in a "fancy" layout.
>>
>> I'm having issue putting it all together. The command parameter allow me to override the content of the title but has some drawbacks (it seems to be stuck in horizontal mode for instance).
>>
>> I'm open to any solution but would find it nice to keep the \startstopinterview structure.
>>
>> Here is my code at the moment:
>>
>> %%%
>>
>> \define[2]\MyChapter{
>>         \starttabulate[|p(\layoutcolumnwidth)|p(\layoutcolumnwidth)|]
>>         \NC \structureuservariable{author} \NC \structureuservariable{bio} \NR
>>         \stoptabulate
>> }
>>
>> \definehead[interview][chapter]
>> \setuphead[interview][
>>     page=right,
>>     command=\MyChapter,
>>     % insidesection={\page},
>>     style={\tfa},
>> ]
>>
>>
>> \starttext
>> \startinterview[title={My Interview}][
>>     author={Jane Doe},
>>     year={2022},
>>     month={Decembre},
>>     bio={\input ward}
>> ]
>>
>> \dorecurse{10}{\input ward \crlf}
>> \stopinterview
>> \stoptext
>>
>> %%%
>>
>> Many thanks
>>
>> ___________________________________________________________________________________
>> 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
>> ___________________________________________________________________________________
> 
> —
> Bruce Horrocks
> Hampshire, UK
> 
> ___________________________________________________________________________________
> 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
> ___________________________________________________________________________________

-- 
Alexandre Leray
+32 487 947 030

Avez-vous pensé à (vous) offrir Médor ?
https://medor.coop/ideescadeau
___________________________________________________________________________________
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
___________________________________________________________________________________

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

end of thread, other threads:[~2023-02-23 21:14 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-02-23 10:21 Chapter cover page Alex Leray via ntg-context
2023-02-23 13:24 ` Bruce Horrocks via ntg-context
2023-02-23 21:14   ` Alex Leray via ntg-context

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