ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
From: Gerion Entrup <gerion.entrup@flump.de>
To: Wolfgang Schuster <wolfgang.schuster.lists@gmail.com>
Cc: mailing list for ConTeXt users <ntg-context@ntg.nl>
Subject: [NTG-context] Re: Prefix the text in an enumeration.
Date: Fri, 14 Jun 2024 15:59:29 +0200	[thread overview]
Message-ID: <3220336.AiC22s8V5E@falbala> (raw)
In-Reply-To: <8fb10c26-cf4b-e660-eff5-6c6e4a858a16@gmail.com>


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

Am Freitag, 14. Juni 2024, 11:51:28 MESZ schrieb Wolfgang Schuster:
> Gerion Entrup schrieb am 14.06.2024 um 11:01:
> > Am Donnerstag, 13. Juni 2024, 16:31:58 MESZ schrieb Wolfgang Schuster:
> >> \startsetups[question:intro]
> >>     \setupparagraphintro[first][\bold{Answer:} ]
> >>     \blank
> >> \stopsetups
> >>
> >> \defineenumeration[question][
> >>          alternative=top,
> >>          text=Question,
> >>          title=yes,
> >>          titleleft=,
> >>          titleright=,
> >>          right={:},
> >>          headstyle=bold,
> >>     inbetween=\setup{question:intro},
> >> ]
> >>
> >> \starttext
> >>
> >> Some text:
> >>
> >> \startquestion[title={How long does a loop last?}]
> >> For a while.
> >> \stopquestion
> >>
> >> \stoptext
> > 
> > Thank you. That works well for this case.
> > 
> > I have a follow up question. I tried to additionally set a titledistance and reproduce that for the "Answer:"-part.
> > ConTeXt then introduces a mysterious newline.
> > 
> > See this example:
> > 
> > \definehspace[dist][1em]
> > \startsetups[question:intro]
> >     \setupparagraphintro[first][\bold{Answer:}\hspace[1em]]
> >     \blank
> > \stopsetups
> 
> You need 2 changes for \setupparagraphintro:
> 
> 1. Change the argument of \hspace to "dist" because the commands accepts 
> only keywords and everything else (even a valid length) is ignored and 
> results in a horizontal skip of 0pt.

Hrmm, this was a typo.

> 
> 2. You have to add curly braces around the content when the content 
> includes square brackets because nesting of optional arguments isn't 
> supported yet.

Thanks for the help, that was the missing part.

> 
> The correct version of the one above is:
> 
> \startsetups[question:intro]
>     \setupparagraphintro[first][{\bold{Answer:}\hspace[dist]}]
>     \blank
> \stopsetups
> 
> Wolfgang
> 

Gerion


[-- Attachment #1.2: This is a digitally signed message part. --]
[-- Type: application/pgp-signature, Size: 659 bytes --]

[-- Attachment #2: Type: text/plain, Size: 511 bytes --]

___________________________________________________________________________________
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-14 14:02 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-06-13 11:41 [NTG-context] " Gerion Entrup
2024-06-13 14:31 ` [NTG-context] " Wolfgang Schuster
2024-06-14  9:01   ` Gerion Entrup
2024-06-14  9:51     ` Wolfgang Schuster
2024-06-14 13:59       ` Gerion Entrup [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=3220336.AiC22s8V5E@falbala \
    --to=gerion.entrup@flump.de \
    --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).