ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* Defineenumeration head offset
@ 2022-11-07 20:04 Alexandre Christe via ntg-context
  2022-11-07 20:47 ` Wolfgang Schuster via ntg-context
  0 siblings, 1 reply; 2+ messages in thread
From: Alexandre Christe via ntg-context @ 2022-11-07 20:04 UTC (permalink / raw)
  To: mailing list for ConTeXt users; +Cc: Alexandre Christe


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

Dear list,

Is there a trick to not apply the leftoffset to the header of a
defineenumeration?

MWE:

\definetextbackground
  [textFrameEx]
  [
    frame=off,
    framecolor=darkgreen,
    rulethickness=2ex,
    background=,
    location=paragraph,
    leftoffset=2.25ex,
    rightoffset=2.25ex,
    after={\hrule}
  ]

\defineenumeration
  [example]
  [
    text=Example,
    headalign=middle,
    headcolor=white,

headcommand={\inframed[background=color,backgroundcolor=darkgreen,width=\textwidth]},
    number=no,
    before={%
      \starttextbackground[textFrameEx]
    },
    after={%
      \stoptextbackground%
    },
  ]

\starttext

\startexample
    Blablabla
\stopexample

\stoptext

[-- Attachment #1.2: Type: text/html, Size: 954 bytes --]

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

___________________________________________________________________________________
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] 2+ messages in thread

* Re: Defineenumeration head offset
  2022-11-07 20:04 Defineenumeration head offset Alexandre Christe via ntg-context
@ 2022-11-07 20:47 ` Wolfgang Schuster via ntg-context
  0 siblings, 0 replies; 2+ messages in thread
From: Wolfgang Schuster via ntg-context @ 2022-11-07 20:47 UTC (permalink / raw)
  To: mailing list for ConTeXt users, Alexandre Christe via ntg-context
  Cc: Wolfgang Schuster

Alexandre Christe via ntg-context schrieb am 07.11.2022 um 21:04:
> Dear list,
>
> Is there a trick to not apply the leftoffset to the header of a 
> defineenumeration?
>
> MWE:
>
> [...]

You can use \offset to shift the enumeration title.

\defineframed
   [ExampleHeadFrame]
   [location=low,
    background=color,
    backgroundcolor=darkgreen,
    width=\textwidth]

\define[1]\ExampleHeadCommand
   {\offset[leftoffset=-2.25ex]{\ExampleHeadFrame{#1}}}

\defineenumeration
   [example]
   [...,
    headcommand=\ExampleHeadCommand,
    ...]

Wolfgang

___________________________________________________________________________________
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] 2+ messages in thread

end of thread, other threads:[~2022-11-07 20:47 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-11-07 20:04 Defineenumeration head offset Alexandre Christe via ntg-context
2022-11-07 20:47 ` Wolfgang Schuster 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).