ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
From: Hans Hagen via ntg-context <ntg-context@ntg.nl>
To: ntg-context@ntg.nl
Cc: Hans Hagen <j.hagen@freedom.nl>
Subject: [NTG-context] Re: Combine \setupdelimitedtext with an author (define custom variable?)
Date: Thu, 6 Jun 2024 13:51:53 +0200	[thread overview]
Message-ID: <4a0c2c0c-da25-4468-ab47-e0a4420a84a8@freedom.nl> (raw)
In-Reply-To: <3021354.tIAgqjz4sF@falbala>

On 6/6/2024 12:30 PM, Gerion Entrup wrote:
> Hi,
> 
> I like to achieve something that looks like this:
> ```
> \definedelimitedtext[extract][blockquote]
> \setupdelimitedtext
>    [extract]
>    [leftmargin=1.5pc,
>     style={\italic},
>     before={\setupindenting[next]},
>     after={\blank[1ex] \hrule \blank[1ex] \startalignment[flushright] \tfx\italic{René Descartes} \stopalignment}]
> 
> \starttext
> \startextract
>      Cogito ergo sum.
> \stopextract
> \stoptext
> ```
> 
> So it should setup a quotation and mentions the author.
> However, here the author is hardcoded within the blockquote. I would like it to use like this:
> ```
> \definedelimitedtext[extract][blockquote]
> \setupdelimitedtext
>    [extract]
>    [leftmargin=1.5pc,
>     style={\italic},
>     before={\setupindenting[next]},
>     after={\blank[1ex] \hrule \blank[1ex] \startalignment[flushright] \tfx\italic{\getcustomvariable{author}} \stopalignment}]
> 
> \starttext
> \startextract[author=René Descartes]
>      Cogito ergo sum.
> \stopextract
> \stoptext
> ```
> 
> Is there an easy way to achieve that?
> I tried with \structureuservariable (like possible in \startchapter) but it does not work.

not all constructs hav ethese user variables (yet)

i'll add an option for arguments tostart/stop so that you can do

\starttext

\definedelimitedtext
   [dextract]
   [blockquote]
   [leftmargin=1.5pc,
    style=italic,
    before=\setupindenting[next],
    after=\setups{extract:whatever}]

\definestartstop
   [extract]
   [arguments=yes,
    before=\setups{extract:start},
    after=\setups{extract:stop}]

\startsetups extract:start
     \startdextract
\stopsetups

\startsetups extract:stop
     \startstopparameter{author}
     \stopdextract
     \blank[1ex,samepage]
     \hrule
     \blank[1ex,samepage]
     \dontleavehmode
     \wordright{\itx\startstopparameter{author}}
\stopsetups

\starttext

\startextract[author=René Descartes]
     Cogito ergo sum.
\stopextract

\stoptext

but first i want Wolfgang to check the patch,

Hans

-----------------------------------------------------------------
                                           Hans Hagen | PRAGMA ADE
               Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
        tel: 038 477 53 69 | www.pragma-ade.nl | www.pragma-pod.nl
-----------------------------------------------------------------

___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!

maillist : ntg-context@ntg.nl / https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl
webpage  : https://www.pragma-ade.nl / https://context.aanhet.net (mirror)
archive  : https://github.com/contextgarden/context
wiki     : https://wiki.contextgarden.net
___________________________________________________________________________________

  reply	other threads:[~2024-06-06 11:52 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-06-06 10:30 [NTG-context] " Gerion Entrup
2024-06-06 11:51 ` Hans Hagen via ntg-context [this message]
2024-06-06 22:36   ` [NTG-context] " Gerion Entrup
2024-06-06 14:34 ` Wolfgang Schuster
2024-06-06 14:50   ` Hans Hagen via ntg-context
2024-06-06 20:07   ` Gerion Entrup
2024-06-17 11:04   ` Gerion Entrup
2024-06-17 19:20     ` Wolfgang Schuster
2024-06-18  7:57       ` Gerion Entrup

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=4a0c2c0c-da25-4468-ab47-e0a4420a84a8@freedom.nl \
    --to=ntg-context@ntg.nl \
    --cc=j.hagen@freedom.nl \
    /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).