ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
From: Fabrice Couvreur via ntg-context <ntg-context@ntg.nl>
To: mailing list for ConTeXt users <ntg-context@ntg.nl>
Cc: Fabrice Couvreur <fabrice1.couvreur@gmail.com>
Subject: Userdata environment
Date: Mon, 3 Apr 2023 19:42:11 +0000	[thread overview]
Message-ID: <CACyK-ep4NPxRd0XxmTkF56cF7fYWme_F-rNUAaXQR7uQWPTTjQ@mail.gmail.com> (raw)


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

Hi,
I have already created a thread on the subject and Wolgang, Marco and Taco
have replied but the userdata environment is not yet clear to me. I would
like, if possible, to write a definition, a property or a theorem on the
left and illustrate it in the right margin with an example. In the code
below, the second example is on the second page and not next to the second
definition.
Thanks.
Fabrice

############################################################################
\
useMPlibrary[dum]

\setuppapersize[A4]

\mainlanguage
  [fr]

\setuppagenumbering
     [alternative=doublesided]

\setuplayout
  [width=12cm,
   rightmargin=60mm]


\setupenumerations
  [before={\blank},
   after={\blank},
   alternative=serried,
   distance=0.5em,
   title=yes,
   titleleft=,
   titleright=,
   titlestyle=normal,
   headcommand=\groupedcommand{}{.},
   numbercommand=\groupedcommand{}{},
   titlecommand=\groupedcommand{(}{)},
   width=fit]

\defineenumeration
   [definition]
   [text=Définition,
    number=no,
    style=italic]

\defineenumeration
   [exemple]
   [text=Exemple,
    number=no,
    style=normal]

\definemargindata[marginfigure][inright]
\setupmargindata [marginfigure][command=\vbox,align=middle,stack=yes]

\defineuserdata [margintext] [alternative=margintext]

\defineuserdataalternative [margintext] [renderingsetup=userdata:margintext]

\startsetups [userdata:margintext]
  \margindata
    [inright]
    [
     style={\switchtobodyfont[10pt]},
     width=\rightmarginwidth,
     align={flushleft,broad}
    ]
    {\startexemple
     \getinlineuserdata
     \stopexemple}
  \stopsetups

\showframe
\starttext
\startchapter[title={First Chapter},ownnumber=1]
\startdefinition
 \input ward
\stopdefinition
\startuserdata [margintext]
  \input ward
\stopuserdata
\startdefinition
  \input ward
\stopdefinition
\startuserdata [margintext]
  \input knuth
\stopuserdata
\stopchapter
\stoptext

############################################################################

[-- Attachment #1.2: Type: text/html, Size: 2851 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
___________________________________________________________________________________

             reply	other threads:[~2023-04-03 19:42 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-04-03 19:42 Fabrice Couvreur via ntg-context [this message]
2023-04-03 18:59 ` Wolfgang Schuster via ntg-context

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=CACyK-ep4NPxRd0XxmTkF56cF7fYWme_F-rNUAaXQR7uQWPTTjQ@mail.gmail.com \
    --to=ntg-context@ntg.nl \
    --cc=fabrice1.couvreur@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).