* anchor points for \inmargin
@ 2015-11-11 18:01 DesdeChaves
2015-11-12 18:14 ` Wolfgang Schuster
0 siblings, 1 reply; 3+ messages in thread
From: DesdeChaves @ 2015-11-11 18:01 UTC (permalink / raw)
To: mailing list for ConTeXt users
[-- Attachment #1.1: Type: text/plain, Size: 947 bytes --]
Dear Sirs,
I'm trying to make a exam for my students. After the question I should
provide a blank space for the answer. In the margin I want write the
partial scores for the answer. The problem occurs when I force a new page.
In this case the text in the margin is flushed to the next page. I don't
want this behavior. How can I can this?
Another question: How can I anchor the scores in the middle of the vertical
blank space? This \vskip4cm\Info{scores}\vskip4cm don't make the job.
Thanks in advance.
Jorge
Code:
\setupmargindata[inmargin][style={\ss\tfx},location=outer,align=middle]
\setupmarginframed[inmargin][align=middle,location=outer]
\def\Info#1{\margindata[inmargin]{\rotate{#1}\ignorespaces}}
\starttext
\startitemize[n]
\item Question 1
\vskip8cm
\Info{20 \periods[3] 15 \periods[3] 10}
\vskip1cm
\item Question 2
\vskip8cm
\Info{20 \periods[3] 15 \periods[3] 10}
\page %%% --> problematic
\item Question 3
\stoptext
[-- Attachment #1.2: Type: text/html, Size: 1467 bytes --]
[-- Attachment #2: Type: text/plain, Size: 485 bytes --]
___________________________________________________________________________________
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://tex.aanhet.net
archive : http://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___________________________________________________________________________________
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: anchor points for \inmargin
2015-11-11 18:01 anchor points for \inmargin DesdeChaves
@ 2015-11-12 18:14 ` Wolfgang Schuster
2015-11-12 21:24 ` DesdeChaves
0 siblings, 1 reply; 3+ messages in thread
From: Wolfgang Schuster @ 2015-11-12 18:14 UTC (permalink / raw)
To: mailing list for ConTeXt users
[-- Attachment #1.1: Type: text/plain, Size: 1789 bytes --]
> DesdeChaves <mailto:desdechaves@gmail.com>
> 11. November 2015 um 19:01
> Dear Sirs,
>
> I'm trying to make a exam for my students. After the question I should
> provide a blank space for the answer. In the margin I want write the
> partial scores for the answer. The problem occurs when I force a new
> page. In this case the text in the margin is flushed to the next page.
> I don't want this behavior. How can I can this?
Margin texts are flushed with the next paragraph but you can start one
for the points only with the \dontleavehmode command.
\define[1]\Info
{\dontleavehmode\margindata[inmargin]{\rotate{#1}}}
> Another question: How can I anchor the scores in the middle of the
> vertical blank space? This \vskip4cm\Info{scores}\vskip4cm don't
> make the job.
You can use the \framed command to reserve the space for the answer and
place with the score with a layer as background for the frame.
\setupmargindata[inmargin][style={\ss\tfx},location=outer,align=middle]
\setupmarginframed[inmargin][align=middle,location=outer]
\definelayer[infolayer][width=\framedwidth,height=\framedheight]
\startsetups[infolayer:place]
\setlayer[infolayer][preset=middleright]{\rotate{\getvariable{infotext}{points}}}
\stopsetups
\defineframed[infobox][frame=off,width=max,background=infolayer,setups=infolayer:place]
\define[2]\Info
{\par
\setvariable{infotext}{points}{#2}%
\infobox[height=#1]{}}
\starttext
\startitemize[n]
\starthead{Question 1}
\Info{9cm}{20 \periods[3] 15 \periods[3] 10}
\stophead
\starthead{Question 2}
\Info{8cm}{20 \periods[3] 15 \periods[3] 10}
\stophead
\starthead{Question 3}
\Info{6cm}{20 \periods[3] 15 \periods[3] 10}
\stophead
\stopitemize
\stoptext
Wolfgang
[-- Attachment #1.2: Type: text/html, Size: 3389 bytes --]
[-- Attachment #2: Type: text/plain, Size: 485 bytes --]
___________________________________________________________________________________
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://tex.aanhet.net
archive : http://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___________________________________________________________________________________
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: anchor points for \inmargin
2015-11-12 18:14 ` Wolfgang Schuster
@ 2015-11-12 21:24 ` DesdeChaves
0 siblings, 0 replies; 3+ messages in thread
From: DesdeChaves @ 2015-11-12 21:24 UTC (permalink / raw)
To: mailing list for ConTeXt users
[-- Attachment #1.1: Type: text/plain, Size: 2497 bytes --]
Thanks a lot for this great solution.
2015-11-12 18:14 GMT+00:00 Wolfgang Schuster <schuster.wolfgang@gmail.com>:
> DesdeChaves <desdechaves@gmail.com>
> 11. November 2015 um 19:01
> Dear Sirs,
>
> I'm trying to make a exam for my students. After the question I should
> provide a blank space for the answer. In the margin I want write the
> partial scores for the answer. The problem occurs when I force a new page.
> In this case the text in the margin is flushed to the next page. I don't
> want this behavior. How can I can this?
>
> Margin texts are flushed with the next paragraph but you can start one for
> the points only with the \dontleavehmode command.
>
> \define[1]\Info
> {\dontleavehmode\margindata[inmargin]{\rotate{#1}}}
>
> Another question: How can I anchor the scores in the middle of the
> vertical blank space? This \vskip4cm\Info{scores}\vskip4cm don't make the
> job.
>
> You can use the \framed command to reserve the space for the answer and
> place with the score with a layer as background for the frame.
>
> \setupmargindata[inmargin][style={\ss\tfx},location=outer,align=middle]
> \setupmarginframed[inmargin][align=middle,location=outer]
>
> \definelayer[infolayer][width=\framedwidth,height=\framedheight]
>
> \startsetups[infolayer:place]
>
> \setlayer[infolayer][preset=middleright]{\rotate{\getvariable{infotext}{points}}}
> \stopsetups
>
>
> \defineframed[infobox][frame=off,width=max,background=infolayer,setups=infolayer:place]
>
> \define[2]\Info
> {\par
> \setvariable{infotext}{points}{#2}%
> \infobox[height=#1]{}}
>
> \starttext
>
> \startitemize[n]
> \starthead{Question 1}
> \Info{9cm}{20 \periods[3] 15 \periods[3] 10}
> \stophead
> \starthead{Question 2}
> \Info{8cm}{20 \periods[3] 15 \periods[3] 10}
> \stophead
> \starthead{Question 3}
> \Info{6cm}{20 \periods[3] 15 \periods[3] 10}
> \stophead
> \stopitemize
>
> \stoptext
>
> Wolfgang
>
>
> ___________________________________________________________________________________
> 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://tex.aanhet.net
> archive : http://foundry.supelec.fr/projects/contextrev/
> wiki : http://contextgarden.net
>
> ___________________________________________________________________________________
>
--
Atentamente
DesdeChaves
[-- Attachment #1.2: Type: text/html, Size: 4607 bytes --]
[-- Attachment #2: Type: text/plain, Size: 485 bytes --]
___________________________________________________________________________________
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://tex.aanhet.net
archive : http://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___________________________________________________________________________________
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2015-11-12 21:24 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-11-11 18:01 anchor points for \inmargin DesdeChaves
2015-11-12 18:14 ` Wolfgang Schuster
2015-11-12 21:24 ` DesdeChaves
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).