[NTG-context] Changing default rule thickness (globally)

2020-03-25 Thread Benjamin Buchmuller
Hi!

I would like to change the rule thickness that is used by default in ConTeXt. 
However, from the  command documentation 
(http://www.pragma-ade.nl/general/qrcs/setup-en.pdf), I see that I would need 
to basically change this for

\basegrid[rulethickness=...]
\setupbar[rulethickness=...]
\setupchemical[rulethickness=...]
\setupeffect[rulethickness=...]
\setupfillinlines[rulethickness=...]
\setupfillinrules[rulethickness=...]
\setupframed[rulethickness=...]
\setuplinefillers[rulethickness=...]
\setupmarginrules[rulethickness=...]
\setupmixedcolumns[rulethickness=...]
\setupnote[rulethickness=...]
\setupparagraphs[rulethickness=...]
\setupsidebar[rulethickness=...]
\setuptables[rulethickness=...]
\setuptabulation[rulethickness=...]
\setuptextbackground[rulethickness=...]
\setuptextrules[rulethickness=...]
\setupthinrules[rulethickness=...]
\setupxtable[rulethickness=...]

(And for \setupbackgrounds for [top header text footer bottom].) I’m sure there 
is a more elegant way to do this. But how?

Cheers


Benjamin
___
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] \basegrid ignores color

2018-03-23 Thread Hans Hagen

On 3/22/2018 11:22 PM, Henri Menke wrote:

Bump!

I attached the updated core file to make it easier for you.


juct check the beta when i upload a new one (you might learn a few extra 
tricks)




On Wed, 2018-03-21 at 09:51 +1300, Henri Menke wrote:

Dear devs,

The \basegrid macro ignores its color option.  That's kind of obvious because
as
I look at the code I don't see the color being communicated to Metapost at any
point.  When you're at it, could you please also add a rulethickness
parameters?
  Thanks!

Reproducible in TL2018 pertest and latest beta.  MWE is below (as always).

Cheers, Henri

---

\starttext

\basegrid[color=red]

\color[red]{\basegrid}

\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
___



--

-
  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 / 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] \basegrid ignores color

2018-03-22 Thread Henri Menke
Bump!

I attached the updated core file to make it easier for you.

On Wed, 2018-03-21 at 09:51 +1300, Henri Menke wrote:
> Dear devs,
> 
> The \basegrid macro ignores its color option.  That's kind of obvious because
> as
> I look at the code I don't see the color being communicated to Metapost at any
> point.  When you're at it, could you please also add a rulethickness
> parameters?
>  Thanks!
> 
> Reproducible in TL2018 pertest and latest beta.  MWE is below (as always).
> 
> Cheers, Henri
> 
> ---
> 
> \starttext
> 
> \basegrid[color=red]
> 
> \color[red]{\basegrid}
> 
> \stoptext
> %D \module
%D   [   file=meta-grd,
%Dversion=2012.06.28,
%D  title=\METAPOST\ Graphics,
%D   subtitle=grids,
%D author=Hans Hagen,
%D   date=\currentdate,
%D  copyright={PRAGMA ADE \& \CONTEXT\ Development Team}]
%C
%C This module is part of the \CONTEXT\ macro||package and is
%C therefore copyrighted by \PRAGMA. See mreadme.pdf for
%C details.

\writestatus{loading}{MetaPost Graphics / Grids}

%D This used to be a \TEX\ method, and a rather old one too. We keep it around but
%D in a more modern way.
%D
%D \startbuffer
%D \basegrid
%D   [nx=8,ny=5,
%Ddx=.5,dy=.25,
%Dunit=cm,scale=2,factor=1,
%Doffset=1ex,xstep=2,ystep=1,
%Dalign=middle,style=\tt\tx]
%D \stopbuffer
%D
%D \typebuffer
%D
%D \placefigure
%D   {An example of a grid.}
%D   {\getbuffer}

\startuseMPgraphic{grid}{nx,ny,dx,dy,factor,scale,xstep,ystep,xoffset,yoffset,align,rulecolor,rulethickness}
begingroup ;

save nx, ny, dx, dy, wd, ht, xstep, ystep, xoffset, yoffset, align, xalign, yalign, rulecolor, rulethickness ;

numeric nx  ; nx  := \MPvar{nx} ;
numeric ny  ; ny  := \MPvar{ny} ;
numeric dx  ; dx  := \MPvar{factor} * \MPvar{scale} * \MPvar{dx} ;
numeric dy  ; dy  := \MPvar{factor} * \MPvar{scale} * \MPvar{dy} ;
numeric wd  ; wd  := nx * dx ;
numeric ht  ; ht  := ny * dy ;
numeric xstep   ; xstep   := \MPvar{xstep} ;
numeric ystep   ; ystep   := \MPvar{ystep} ;
numeric xoffset ; xoffset := \MPvar{xoffset} ;
numeric yoffset ; yoffset := \MPvar{yoffset} ;
numeric align   ; align   := \MPvar{align} ;
color rulecolor ; rulecolor := \MPvar{rulecolor} ;
numeric rulethickness ; rulethickness := \MPvar{rulethickness} ;
numeric xalign  ; xalign  := 0 ;
numeric yalign  ; yalign  := 0 ;

if align = 1 :
xalign := dx/2 ;
yalign := dy/2 ;
fi ;

for i=0 step dx until wd :
draw (i,0) -- (i,ht)
withpen pencircle scaled rulethickness
withcolor rulecolor ;
endfor ;
for i=0 step dy until ht :
draw (0,i) -- (wd,i)
withpen pencircle scaled rulethickness
withcolor rulecolor ;
endfor ;

if xstep > 0 :
for i=1 step xstep until nx :
draw thetextext.bot(decimal i,(i*dx-xalign,-xoffset));
endfor ;
fi ;
if ystep > 0 :
for i=1 step ystep until ny :
draw thetextext.lft(decimal i,(-yoffset,i*dy-yalign)) ;
endfor ;
    fi ;

endgroup ;
\stopuseMPgraphic

\unprotect

\unexpanded\def\basegrid
  {\dosingleempty\typo_grid_base}

\def\typo_grid_base[#1]%
  {\hbox\bgroup
   \getdummyparameters
 [\c!nx=10,\c!ny=10,\c!dx=.5,\c!dy=.5,\c!xstep=0,\c!ystep=0,
  \c!unit=\s!cm,\c!scale=1,\c!factor=1,
  \c!offset=.25ex,\c!xoffset=\directdummyparameter\c!offset,\c!yoffset=\directdummyparameter\c!offset,
  \c!align=,
  \c!rulecolor=\s!black,
  \c!rulethickness=\linewidth,
  #1]%
   \usedummystyleandcolor\c!style\c!color
   \edef\p_align{\directdummyparameter\c!align}%
   \ifx\p_align\v!middle
  \let\p_align\!!plusone
   \else
  \let\p_align\!!zerocount
   \fi
   \useMPgraphic
{grid}%
{nx=\directdummyparameter\c!nx,%
 ny=\directdummyparameter\c!ny,%
 dx=\directdummyparameter\c!dx\directdummyparameter\c!unit,%
 dy=\directdummyparameter\c!dy\directdummyparameter\c!unit,%
 factor=\directdummyparameter\c!factor,%
 scale=\directdummyparameter\c!scale,%
 xstep=\directdummyparameter\c!xstep,%
 ystep=\directdummyparameter\c!ystep,%
 xoffset=\directdummyparameter\c!xoffset,%
 yoffset=\directdummyparameter\c!yoffset,%
 align=\p_align,%
 rulecolor=\directdummyparameter\c!rulecolor,%
 rulethickness=\directdummyparameter\c!rulethickness,%
}%
  \egroup}

\let\grid\basegrid

\protect \endinput
\loadmarkfile{meta-grd}
\starttext
\basegrid[rulecolor=gray,rulethickness=.1pt]
\stoptext
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

[NTG-context] \basegrid ignores color

2018-03-20 Thread Henri Menke
Dear devs,

The \basegrid macro ignores its color option.  That's kind of obvious because as
I look at the code I don't see the color being communicated to Metapost at any
point.  When you're at it, could you please also add a rulethickness parameters?
 Thanks!

Reproducible in TL2018 pertest and latest beta.  MWE is below (as always).

Cheers, Henri

---

\starttext

\basegrid[color=red]

\color[red]{\basegrid}

\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
___