[NTG-context] Re: Large unwanted white space

2023-10-21 Thread Hans Hagen

On 10/21/2023 9:43 PM, Fabrice Couvreur wrote:

Hi,
I don't know if I will explain my problem clearly but I will try. For my
students' tests, I use a master file. If I insert this piece of code, there
is a large white space that is created between the horizontal line of the
header and the first exercise.


\startMPcode makes an image so it will take space

for definitions use \startMPdefinitions



\startMPcode
   def suite (expr n, t) =
   begingroup
numeric u;
u := 5mm;
pickup pencircle scaled 5pt;
for i=0 upto n:
  for j=0 upto n:
  drawdot (i*u,j*u) shifted(t*u,0) withcolor \MPcolor{darkred};
  endfor
endfor
   endgroup
   enddef;

   def Suite (expr n, t) =
   begingroup
   numeric u;
   u := 5mm;
   pickup pencircle scaled 5pt;
   for i=0 upto n:
  drawdot(i*u,0) shifted(t*u,0) withcolor \MPcolor{blue};
   endfor
   endgroup
   enddef;

   def cross (expr n, t) =
   begingroup
   numeric u;
   u := 5mm;
   pickup pencircle scaled 5pt;
   for i=-n upto n:
  drawdot(0,i*u) shifted(t*u,0) withcolor \MPcolor{blue};
   endfor
   endgroup
   enddef;
\stopMPcode
__ %horizontal line
% big unwanted white space
\starttext
% \startex First exercise
\startlinecorrection[blank]
 \startmidaligned
   \startcombination[1*2]
 {\startMPcode
   Suite(2,0);
   cross(1,1);
   Suite(4,4);
   cross(2,6);
   Suite(6,10);
   cross(3,13);
   \stopMPcode
 }{\tfx \bf Suite 1}
{\startMPcode
   suite(0,0);
   suite(1,2);
   suite(2,5);
   \stopMPcode
 }{\tfx \bf Suite 2}
 \stopcombination
\stopmidaligned
  \stoplinecorrection
   %\stopex
\stoptext


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

maillist : ntg-context@ntg.nl / 
https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl
webpage  : https://www.pragma-ade.nl / https://context.aanhet.net (mirror)
archive  : https://github.com/contextgarden/context
wiki : https://wiki.contextgarden.net
___


--

-
  Hans Hagen | PRAGMA ADE
  Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
   tel: 038 477 53 69 | www.pragma-ade.nl | www.pragma-pod.nl
-

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

maillist : ntg-context@ntg.nl / 
https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl
webpage  : https://www.pragma-ade.nl / https://context.aanhet.net (mirror)
archive  : https://github.com/contextgarden/context
wiki : https://wiki.contextgarden.net
___


[NTG-context] Re: Large unwanted white space

2023-10-21 Thread Henning Hraban Ramm

Am 21.10.23 um 21:43 schrieb Fabrice Couvreur:

Hi,
I don't know if I will explain my problem clearly but I will try. For my 
students' tests, I use a master file. If I insert this piece of code, 
there is a large white space that is created between the horizontal line 
of the header and the first exercise.

Thanks for your help.
Fabrice

\startMPcode


If I’m not wrong, \startMPcode immediately executes the code.
I don’t know why it does if it only contains definitions.

Try \startMPinitializations (executed for every MP instance) or 
\startMPdefinitions (only once).


Hraban

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

maillist : ntg-context@ntg.nl / 
https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl
webpage  : https://www.pragma-ade.nl / https://context.aanhet.net (mirror)
archive  : https://github.com/contextgarden/context
wiki : https://wiki.contextgarden.net
___


[NTG-context] Large unwanted white space

2023-10-21 Thread Fabrice Couvreur
Hi,
I don't know if I will explain my problem clearly but I will try. For my
students' tests, I use a master file. If I insert this piece of code, there
is a large white space that is created between the horizontal line of the
header and the first exercise.
Thanks for your help.
Fabrice

\startMPcode
  def suite (expr n, t) =
  begingroup
   numeric u;
   u := 5mm;
   pickup pencircle scaled 5pt;
   for i=0 upto n:
 for j=0 upto n:
 drawdot (i*u,j*u) shifted(t*u,0) withcolor \MPcolor{darkred};
 endfor
   endfor
  endgroup
  enddef;

  def Suite (expr n, t) =
  begingroup
  numeric u;
  u := 5mm;
  pickup pencircle scaled 5pt;
  for i=0 upto n:
 drawdot(i*u,0) shifted(t*u,0) withcolor \MPcolor{blue};
  endfor
  endgroup
  enddef;

  def cross (expr n, t) =
  begingroup
  numeric u;
  u := 5mm;
  pickup pencircle scaled 5pt;
  for i=-n upto n:
 drawdot(0,i*u) shifted(t*u,0) withcolor \MPcolor{blue};
  endfor
  endgroup
  enddef;
\stopMPcode
__ %horizontal line
   % big unwanted white space
   \starttext
   % \startex First exercise
\startlinecorrection[blank]
\startmidaligned
  \startcombination[1*2]
{\startMPcode
  Suite(2,0);
  cross(1,1);
  Suite(4,4);
  cross(2,6);
  Suite(6,10);
  cross(3,13);
  \stopMPcode
}{\tfx \bf Suite 1}
   {\startMPcode
  suite(0,0);
  suite(1,2);
  suite(2,5);
  \stopMPcode
}{\tfx \bf Suite 2}
\stopcombination
   \stopmidaligned
 \stoplinecorrection
  %\stopex
\stoptext
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / 
https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl
webpage  : https://www.pragma-ade.nl / https://context.aanhet.net (mirror)
archive  : https://github.com/contextgarden/context
wiki : https://wiki.contextgarden.net
___


[NTG-context] overprinting black

2023-10-21 Thread Henning Hraban Ramm

Hi, esp. Hans,

while finalizing the PDF for our latest book, I recognized a color problem:
The general black color is rendered not 100% black in CMYK mode, but in 
all channels (converted RGB, I guess).


With

\definecolor[cmykblack][k=1]
\setupcolors[textcolor=cmykblack]

this is ok, but the color mode is knockout instead of overprint (as it 
would be usual for CMYK black). That means, black text on a photo is 
white in the other plates.


If I define

\definecolor[cmykblack][k=1,a=multiply,t=1]
\setupcolors[textcolor=cmykblack]

it’s ok in some places, but it messes up many unrelated places, e.g. 
most images then also use this transparency mode.


\setupcolors[intent=overprint]
has no effect, as far as could find (while we have a warning in the 
wiki, that you should use this only for grayscale works).


What can I do?

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

maillist : ntg-context@ntg.nl / 
https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl
webpage  : https://www.pragma-ade.nl / https://context.aanhet.net (mirror)
archive  : https://github.com/contextgarden/context
wiki : https://wiki.contextgarden.net
___