Re: [NTG-context] Store images and text in the right margin

2020-07-06 Thread Fabrice Couvreur
Hi Taco,
Thank you for your help. What I want to do is write a course for my
students, and the definitions, theorems ... will be illustrated by graphs,
examples, remarks ... placed in the right margin. The idea is to consider
that a text or a graphic is an element to place in the right margin without
worrying about the nature and that a single command does the job. What you
are proposing goes in the right direction. However, I noticed a little
problem with the hyphenation.
Fabrice

Le lun. 6 juil. 2020 à 16:35, Taco Hoekwater  a écrit :

> Hi Fabrice,
>
> Like this maybe? It depends on what you want to achieve exactly, I think
>
> \useMPlibrary[dum]
>
> \setuppapersize[A4]
>
> \setuplayout
>   [width=12cm,
>rightmargin=5cm]
>
> \defineuserdata [margintext] [alternative=margintext]
>
> \defineuserdataalternative [margintext]
> [renderingsetup=userdata:margintext]
>
> \startsetups [userdata:margintext]
>   \margindata
> [inright]
> [style={\switchtobodyfont[9pt]},
>  width=\rightmarginwidth,
>  align={flushleft,broad},
>  stack=yes]
> {\startframedtext[before=,after=,offset=0pt,width=max,frame=off]
>  \getinlineuserdata
>  \stopframedtext}
> \stopsetups
>
> \showframe
> \starttext
> \startuserdata[margintext]
>  {\bf Remarque — }\input ward
> \stopuserdata
> \startuserdata[margintext]
>  \externalfigure[dummy][width=\rightmarginwidth]
> \stopuserdata
> \startchapter[title=First chapter]
> \dorecurse{2}{\input knuth}
> \stopchapter
> \stoptext
>
>
> > On 6 Jul 2020, at 16:18, Fabrice Couvreur 
> wrote:
> >
> >
> >
> > -- Forwarded message -
> > De : Fabrice Couvreur 
> > Date: lun. 6 juil. 2020 à 12:10
> > Subject: Re: [NTG-context] Store images and text in the right margin
> > To: Marco 
> >
> >
> > Hello,
> > What has been proposed by Wolfgang and Marco works correctly but is it
> possible to define a single environment margintext which would allow to
> include both text and figures ?
> > Thank you
> > Fabrice
>
> ___
> If your question is of interest to others as well, please add an entry to
> the Wiki!
>
> maillist : ntg-context@ntg.nl /
> http://www.ntg.nl/mailman/listinfo/ntg-context
> webpage  : http://www.pragma-ade.nl / http://context.aanhet.net
> archive  : https://bitbucket.org/phg/context-mirror/commits/
> wiki : http://contextgarden.net
>
> ___
>
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___


Re: [NTG-context] Store images and text in the right margin

2020-07-06 Thread Taco Hoekwater
Hi Fabrice,

Like this maybe? It depends on what you want to achieve exactly, I think

\useMPlibrary[dum]

\setuppapersize[A4]

\setuplayout
  [width=12cm,
   rightmargin=5cm]

\defineuserdata [margintext] [alternative=margintext]

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

\startsetups [userdata:margintext]
  \margindata
[inright]
[style={\switchtobodyfont[9pt]},
 width=\rightmarginwidth,
 align={flushleft,broad},
 stack=yes]
{\startframedtext[before=,after=,offset=0pt,width=max,frame=off]
 \getinlineuserdata
 \stopframedtext}
\stopsetups

\showframe
\starttext
\startuserdata[margintext]
 {\bf Remarque — }\input ward
\stopuserdata
\startuserdata[margintext]
 \externalfigure[dummy][width=\rightmarginwidth]
\stopuserdata
\startchapter[title=First chapter]
\dorecurse{2}{\input knuth}
\stopchapter
\stoptext


> On 6 Jul 2020, at 16:18, Fabrice Couvreur  wrote:
> 
> 
> 
> -- Forwarded message -
> De : Fabrice Couvreur 
> Date: lun. 6 juil. 2020 à 12:10
> Subject: Re: [NTG-context] Store images and text in the right margin
> To: Marco 
> 
> 
> Hello,
> What has been proposed by Wolfgang and Marco works correctly but is it 
> possible to define a single environment margintext which would allow to 
> include both text and figures ?
> Thank you
> Fabrice
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___


Re: [NTG-context] Store images and text in the right margin

2020-07-03 Thread Marco Patzer
On Fri, 3 Jul 2020 08:40:22 +0200
Fabrice Couvreur  wrote:

> Thanks, it works but only for a comment and a picture. Indeed, if I
> add a comment and an image, the first image is placed on the second
> comment. Fabrice
> 
> \starttext
> \startuserdata[margintext]
>  \input ward
> \stopuserdata
> \marginfigure{\externalfigure[dummy][width=\rightmarginwidth,location=high]}

\marginfigure{\externalfigure[dummy][width=\rightmarginwidth,location=top]}

> \startuserdata[margintext]
>  \input ward
> \stopuserdata
> \marginfigure{\externalfigure[dummy][width=\rightmarginwidth,location=high]}

\marginfigure{\externalfigure[dummy][width=\rightmarginwidth,location=top]}

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

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___


Re: [NTG-context] Store images and text in the right margin

2020-07-03 Thread Fabrice Couvreur
Hi Marco,
Thanks, it works but only for a comment and a picture. Indeed, if I add a
comment and an image, the first image is placed on the second comment.
Fabrice

\starttext
\startuserdata[margintext]
 \input ward
\stopuserdata
\marginfigure{\externalfigure[dummy][width=\rightmarginwidth,location=high]}
\startuserdata[margintext]
 \input ward
\stopuserdata
\marginfigure{\externalfigure[dummy][width=\rightmarginwidth,location=high]}
\startchapter[title=First chapter]
\dorecurse{2}{\input knuth}
\stopchapter
\stoptext

Le jeu. 2 juil. 2020 à 19:04, Marco Patzer  a écrit :

> On Thu, 2 Jul 2020 17:20:07 +0200
> Fabrice Couvreur  wrote:
>
> Try:
>
> > \useMPlibrary[dum]
> >
> > \setuppapersize[A4]
> >
> > \setuplayout
> >   [width=12cm,
> >rightmargin=5cm]
> >
> > \definemargindata[marginfigure][inright]
> > \setupmargindata [marginfigure][command=\vbox,align=middle]
>
> \setupmargindata [marginfigure][command=\vbox,align=middle,stack=yes]
>
> > \startsetups [userdata:margintext]
> >   \margindata
> > [inright]
> > [%style=\smallbodyfont,
> >  style={\switchtobodyfont[9pt]},
> >  width=\rightmarginwidth,
>
>   stack=yes,
>
> >  align={flushleft,broad}]
> > {{\bf Remarque — }\getinlineuserdata}
> > \stopsetups
>
> > \marginfigure{\externalfigure[dummy][width=\rightmarginwidth]}
>
>
> \marginfigure{\externalfigure[dummy][width=\rightmarginwidth,location=high]}
>
> Marco
>
> ___
> If your question is of interest to others as well, please add an entry to
> the Wiki!
>
> maillist : ntg-context@ntg.nl /
> http://www.ntg.nl/mailman/listinfo/ntg-context
> webpage  : http://www.pragma-ade.nl / http://context.aanhet.net
> archive  : https://bitbucket.org/phg/context-mirror/commits/
> wiki : http://contextgarden.net
>
> ___
>
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___


Re: [NTG-context] Store images and text in the right margin

2020-07-02 Thread Marco Patzer
On Thu, 2 Jul 2020 17:20:07 +0200
Fabrice Couvreur  wrote:

Try:

> \useMPlibrary[dum]
> 
> \setuppapersize[A4]
> 
> \setuplayout
>   [width=12cm,
>rightmargin=5cm]
> 
> \definemargindata[marginfigure][inright]
> \setupmargindata [marginfigure][command=\vbox,align=middle]

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

> \startsetups [userdata:margintext]
>   \margindata
> [inright]
> [%style=\smallbodyfont,
>  style={\switchtobodyfont[9pt]},
>  width=\rightmarginwidth,

  stack=yes,

>  align={flushleft,broad}]
> {{\bf Remarque — }\getinlineuserdata}
> \stopsetups

> \marginfigure{\externalfigure[dummy][width=\rightmarginwidth]}

\marginfigure{\externalfigure[dummy][width=\rightmarginwidth,location=high]}

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

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___


[NTG-context] Store images and text in the right margin

2020-07-02 Thread Fabrice Couvreur
Hello everyone and in particular to Wolfgang who has already provided me
with the solution below. I will have to write a Mathematics book for my
students and the remarks and graphics should be in the right margin. I got
the code written by Wolfgang and tried to include the graphics in it. The
result is not as expected because the graphic overflows on the text.
The course will be written in A4 format with an 11 pts font.
Thanks for your help.
Fabrice

\useMPlibrary[dum]

\setuppapersize[A4]

\setuplayout
  [width=12cm,
   rightmargin=5cm]

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

\defineuserdata [margintext] [alternative=margintext]

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

\startsetups [userdata:margintext]
  \margindata
[inright]
[%style=\smallbodyfont,
 style={\switchtobodyfont[9pt]},
 width=\rightmarginwidth,
 align={flushleft,broad}]
{{\bf Remarque — }\getinlineuserdata}
\stopsetups

\showframe
\starttext
\startuserdata[margintext]
 \input ward
\stopuserdata
\marginfigure{\externalfigure[dummy][width=\rightmarginwidth]}
\startchapter[title=First chapter]
\dorecurse{2}{\input knuth}
\stopchapter
\stoptext
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___