ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* Strange backgroundcolors with showgrid and luacode
@ 2019-04-26 12:10 Otared Kavian
  2019-04-26 12:28 ` Wolfgang Schuster
  0 siblings, 1 reply; 10+ messages in thread
From: Otared Kavian @ 2019-04-26 12:10 UTC (permalink / raw)
  To: mailing list for ConTeXt users

[-- Attachment #1: Type: text/plain, Size: 1405 bytes --]

Dear all,

When typesetting an old list of exercises, I noticed that when \showgrid is active and a luafunction is called, there is some unwanted and strange background colors (gray and blue, or yellow and blue). Thes background colors seems to show up on an unfilled page when a lua function is used, and I could come up with the following minimal example which gives the attached PDF.

Could someone, please, tell me what I am doing wrong?

Best regards: OK

%%%% begin test-strange.tex

 \showgrid
%\setuplayout[grid=yes]

\startluacode
AdditionTest = function(nn)
	local a = {}
	local b = {}
	for i = 1,nn do
		a[i] = i 
		b[i] = nn - i 
	end
	context.midaligned("\\bfa Exercises")
	context.blank()
	context.startcolumns { n = 3 }
	context.starttabulate { "|r|c|r|c|r|" }
	for i=1,nn do
		context.NC()
			context(a[i])
		context.NC()
			context.mathematics("*")
		context.NC()
			context(b[i])
		context.NC()
			context("=")
		context.NR()
	end
	context.stoptabulate()
	context.stopcolumns()
	context.page()
end
\stopluacode

\starttext
\ctxlua{AdditionTest(12)} % the background colors, gray and blue, show up when a lua function is called

% \ctxlua{AdditionTest(120)} % the background colors, yellow and blue, show up when a lua function is called

% \input knuth % the background colors do not show up here

\stoptext
%%%% end test-strange.tex


[-- Attachment #2: test-strange.pdf --]
[-- Type: application/pdf, Size: 14371 bytes --]

[-- Attachment #3: Type: text/plain, Size: 493 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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki     : http://contextgarden.net
___________________________________________________________________________________

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: Strange backgroundcolors with showgrid and luacode
  2019-04-26 12:10 Strange backgroundcolors with showgrid and luacode Otared Kavian
@ 2019-04-26 12:28 ` Wolfgang Schuster
  2019-04-27 10:04   ` Pablo Rodriguez
  0 siblings, 1 reply; 10+ messages in thread
From: Wolfgang Schuster @ 2019-04-26 12:28 UTC (permalink / raw)
  To: mailing list for ConTeXt users, Otared Kavian

Otared Kavian schrieb am 26.04.2019 um 14:10:
> Dear all,
>
> When typesetting an old list of exercises, I noticed that when \showgrid is active and a luafunction is called, there is some unwanted and strange background colors (gray and blue, or yellow and blue). Thes background colors seems to show up on an unfilled page when a lua function is used, and I could come up with the following minimal example which gives the attached PDF.
>
> Could someone, please, tell me what I am doing wrong?

\showgrid highlights different page elements with colors but you can 
change the output

https://www.mail-archive.com/ntg-context@ntg.nl/msg90312.html

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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki     : http://contextgarden.net
___________________________________________________________________________________

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: Strange backgroundcolors with showgrid and luacode
  2019-04-26 12:28 ` Wolfgang Schuster
@ 2019-04-27 10:04   ` Pablo Rodriguez
  2019-04-27 10:18     ` Marcus Vinicius Mesquita
  0 siblings, 1 reply; 10+ messages in thread
From: Pablo Rodriguez @ 2019-04-27 10:04 UTC (permalink / raw)
  To: ntg-context

On 4/26/19 2:28 PM, Wolfgang Schuster wrote:
> [...]
> \showgrid highlights different page elements with colors but you can
> change the output
>
> https://www.mail-archive.com/ntg-context@ntg.nl/msg90312.html

Hi Wolfgang,

is there any way to get the lines from \showgrid in black instead of red?

Many thanks for your help,

Pablo
--
http://www.ousia.tk
___________________________________________________________________________________
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
___________________________________________________________________________________

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: Strange backgroundcolors with showgrid and luacode
  2019-04-27 10:04   ` Pablo Rodriguez
@ 2019-04-27 10:18     ` Marcus Vinicius Mesquita
  2019-04-27 10:21       ` Wolfgang Schuster
  0 siblings, 1 reply; 10+ messages in thread
From: Marcus Vinicius Mesquita @ 2019-04-27 10:18 UTC (permalink / raw)
  To: mailing list for ConTeXt users


[-- Attachment #1.1: Type: text/plain, Size: 1004 bytes --]

\definepalet[layout][grid=black]

On Sat, Apr 27, 2019, 07:04 Pablo Rodriguez <oinos@gmx.es> wrote:

> On 4/26/19 2:28 PM, Wolfgang Schuster wrote:
> > [...]
> > \showgrid highlights different page elements with colors but you can
> > change the output
> >
> > https://www.mail-archive.com/ntg-context@ntg.nl/msg90312.html
>
> Hi Wolfgang,
>
> is there any way to get the lines from \showgrid in black instead of red?
>
> Many thanks for your help,
>
> Pablo
> --
> http://www.ousia.tk
>
> ___________________________________________________________________________________
> 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
>
> ___________________________________________________________________________________
>

[-- Attachment #1.2: Type: text/html, Size: 2079 bytes --]

[-- Attachment #2: Type: text/plain, Size: 493 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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki     : http://contextgarden.net
___________________________________________________________________________________

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: Strange backgroundcolors with showgrid and luacode
  2019-04-27 10:18     ` Marcus Vinicius Mesquita
@ 2019-04-27 10:21       ` Wolfgang Schuster
  2019-04-27 11:25         ` Pablo Rodriguez
  0 siblings, 1 reply; 10+ messages in thread
From: Wolfgang Schuster @ 2019-04-27 10:21 UTC (permalink / raw)
  To: mailing list for ConTeXt users, Marcus Vinicius Mesquita

Marcus Vinicius Mesquita schrieb am 27.04.2019 um 12:18:
> \definepalet[layout][grid=black]
\setuppalet
   [layout]
   [grid=black]

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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki     : http://contextgarden.net
___________________________________________________________________________________

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: Strange backgroundcolors with showgrid and luacode
  2019-04-27 10:21       ` Wolfgang Schuster
@ 2019-04-27 11:25         ` Pablo Rodriguez
  2019-04-27 12:03           ` Wolfgang Schuster
  0 siblings, 1 reply; 10+ messages in thread
From: Pablo Rodriguez @ 2019-04-27 11:25 UTC (permalink / raw)
  To: ntg-context

On 4/27/19 12:21 PM, Wolfgang Schuster wrote:
> Marcus Vinicius Mesquita schrieb am 27.04.2019 um 12:18:
>> \definepalet[layout][grid=black]
> \setuppalet
>    [layout]
>    [grid=black]

Many thanks, Marcus Vinicius and Wolfgang, for your replies.

This is the only way it works:

    \definepalet[layout][grid=black]
    %~ \setuppalet[layout] [grid=black]
    \showgrid
    \starttext
        \ConTeXt\ is awesome!
    \stoptext

I don’t know whether I’m missing something, but \showsetups{setuppalet}
only shows this:

    \setuppalet [.*.]

    * NAME

Many thanks for your help,

Pablo
--
http://www.ousia.tk
___________________________________________________________________________________
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
___________________________________________________________________________________

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: Strange backgroundcolors with showgrid and luacode
  2019-04-27 11:25         ` Pablo Rodriguez
@ 2019-04-27 12:03           ` Wolfgang Schuster
  2019-04-27 14:07             ` Pablo Rodriguez
  0 siblings, 1 reply; 10+ messages in thread
From: Wolfgang Schuster @ 2019-04-27 12:03 UTC (permalink / raw)
  To: mailing list for ConTeXt users, Pablo Rodriguez

Pablo Rodriguez schrieb am 27.04.2019 um 13:25:
> On 4/27/19 12:21 PM, Wolfgang Schuster wrote:
>> Marcus Vinicius Mesquita schrieb am 27.04.2019 um 12:18:
>>> \definepalet[layout][grid=black]
>> \setuppalet
>>     [layout]
>>     [grid=black]
> Many thanks, Marcus Vinicius and Wolfgang, for your replies.
>
> This is the only way it works:
>
>      \definepalet[layout][grid=black]
>      %~ \setuppalet[layout] [grid=black]
>      \showgrid
>      \starttext
>          \ConTeXt\ is awesome!
>      \stoptext
>
> I don’t know whether I’m missing something, but \showsetups{setuppalet}
> only shows this:
>
>      \setuppalet [.*.]
>
>      * NAME
>
> Many thanks for your help,

It's my fault, in this case there is only a single command to create and 
change palet values.

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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki     : http://contextgarden.net
___________________________________________________________________________________

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: Strange backgroundcolors with showgrid and luacode
  2019-04-27 12:03           ` Wolfgang Schuster
@ 2019-04-27 14:07             ` Pablo Rodriguez
  2019-04-27 14:34               ` Wolfgang Schuster
  0 siblings, 1 reply; 10+ messages in thread
From: Pablo Rodriguez @ 2019-04-27 14:07 UTC (permalink / raw)
  To: ntg-context

On 4/27/19 2:03 PM, Wolfgang Schuster wrote:
> [...]
> It's my fault, in this case there is only a single command to create and
> change palet values.

Many thanks for your explanation, Wolfgang.

I found this code in ConTeXt (syst-aux.mkiv):

    \starttext
    \doloopoverlist {red,green,blue} {
         \setuppalet[\recursestring]
         \doloopoverlist {light,normal,dark} {
             \blackrule[color=\recursestring, width=\textwidth]\par
         }
     }
    \stoptext

Is it intended that all nine lines are black?

Many thanks for your help,

Pablo
--
http://www.ousia.tk
___________________________________________________________________________________
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
___________________________________________________________________________________

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: Strange backgroundcolors with showgrid and luacode
  2019-04-27 14:07             ` Pablo Rodriguez
@ 2019-04-27 14:34               ` Wolfgang Schuster
  2019-04-27 15:51                 ` Pablo Rodriguez
  0 siblings, 1 reply; 10+ messages in thread
From: Wolfgang Schuster @ 2019-04-27 14:34 UTC (permalink / raw)
  To: mailing list for ConTeXt users, Pablo Rodriguez

Pablo Rodriguez schrieb am 27.04.2019 um 16:07:
> I found this code in ConTeXt (syst-aux.mkiv):
>      \starttext
>      \doloopoverlist {red,green,blue} {
>           \setuppalet[\recursestring]
>           \doloopoverlist {light,normal,dark} {
>               \blackrule[color=\recursestring, width=\textwidth]\par
>           }
>       }
>      \stoptext
>
> Is it intended that all nine lines are black?

Yes, because there are no predefined palets with the names red, green or 
blue.

\definepalet
   [red]
   [ light=lightred,
    normal=middlered,
      dark=darkred]

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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki     : http://contextgarden.net
___________________________________________________________________________________

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: Strange backgroundcolors with showgrid and luacode
  2019-04-27 14:34               ` Wolfgang Schuster
@ 2019-04-27 15:51                 ` Pablo Rodriguez
  0 siblings, 0 replies; 10+ messages in thread
From: Pablo Rodriguez @ 2019-04-27 15:51 UTC (permalink / raw)
  To: ntg-context

On 4/27/19 4:34 PM, Wolfgang Schuster wrote:
>> [...]
>> Is it intended that all nine lines are black?
>
> Yes, because there are no predefined palets with the names red, green or
> blue.
>
> \definepalet
>    [red]
>    [ light=lightred,
>     normal=middlered,
>       dark=darkred]
Wolfgang,

many thanks for the explanation.

Pablo
--
http://www.ousia.tk
___________________________________________________________________________________
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
___________________________________________________________________________________

^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2019-04-27 15:51 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-04-26 12:10 Strange backgroundcolors with showgrid and luacode Otared Kavian
2019-04-26 12:28 ` Wolfgang Schuster
2019-04-27 10:04   ` Pablo Rodriguez
2019-04-27 10:18     ` Marcus Vinicius Mesquita
2019-04-27 10:21       ` Wolfgang Schuster
2019-04-27 11:25         ` Pablo Rodriguez
2019-04-27 12:03           ` Wolfgang Schuster
2019-04-27 14:07             ` Pablo Rodriguez
2019-04-27 14:34               ` Wolfgang Schuster
2019-04-27 15:51                 ` Pablo Rodriguez

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).