Store images and text in the right margin
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
On Thu, 2 Jul 2020 17:20:07 +0200
Fabrice Couvreur
\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
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
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
___________________________________________________________________________________
On Fri, 3 Jul 2020 08:40:22 +0200
Fabrice Couvreur
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
participants (2)
-
Fabrice Couvreur
-
Marco Patzer