Re: [NTG-context] Define color with calculations

2019-02-17 Thread Henri Menke
Use Lua.


\def\eval#1{\ctxlua{%
local context = context
local _ENV = math
context(#1)
}}

\definecolor[mycolor][r=\eval{0.5*0.7}]

\starttext

\color[mycolor]{Hello!}

\stoptext



On 18/02/19 4:37 PM, Mohammad Hossein Bateni wrote:
> Hi,
> 
> When I use definecolor, (how) can I use computations in setting the value
> of a component?  Something like the following...
> 
> \definecolor[mycolor][r=0.5*0.7]
> 
> Thanks,
> ~MHB
> 
> 
> ___
> 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
> ___
> 

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


[NTG-context] Define color with calculations

2019-02-17 Thread Mohammad Hossein Bateni
Hi,

When I use definecolor, (how) can I use computations in setting the value
of a component?  Something like the following...

\definecolor[mycolor][r=0.5*0.7]

Thanks,
~MHB
___
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] Article on: How to install a font in ConTeXt?

2019-02-17 Thread Henning Hraban Ramm
Am 2019-02-17 um 12:14 schrieb Rudolf Bahr :

> Yesterday I got dante's revue and read Taco Hoekwater's
> article translated into German by Henning Hraban Ramm:
> "dante, Die TEXnische Komödie, 1/2019: 'Wie installiere 
> ich eine Schrift für ConTeXt?'"
> 
> Many thanks to both, its really good and thoroughly 
> written!


I’m happy it pleases you!

I told them to delay it until after we published it in our CG journal (its 
delay is my fault this time), but they forgot... (I can understand they are 
happy about every article they receive.)

Greetlings, Hraban
---
https://www.fiee.net
http://wiki.contextgarden.net
https://www.dreiviertelhaus.de
GPG Key ID 1C9B22FD

___
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] Lines in \showbodyfontenvironment

2019-02-17 Thread Tomas Hala

I have tested it on this code:

\definebodyfontenvironment
  [default] % or size
  [text=10pt,a=2,d=5,   % or other values 
]

\starttext
  ahoj {\bfa ahoj} {\bfd ahoj} ahoj

  \showbodyfontenvironment
\stoptext

Tomáš


Sun, Feb 17, 2019 ve 06:02:53PM +0100 Wolfgang Schuster napsal(a):
# Tomas Hala schrieb am 17.02.19 um 16:07:
# >Hi all,
# >
# >I played with \definebodyfontenvironment and found the command
# >\showbodyfontenvironment.
# >
# >Experimentally I changed parameters at \definebodyfontenvironment
# >and I am not able to understand the logic of the table generated
# >by the \showbodyfontenvironment.
# >
# >What is the meaning of lines in the table? Or is this published somewhere?
# 
# Do you have a minimal example?
# 
# 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
___


Re: [NTG-context] Lines in \showbodyfontenvironment

2019-02-17 Thread Wolfgang Schuster

Tomas Hala schrieb am 17.02.19 um 16:07:

Hi all,

I played with \definebodyfontenvironment and found the command
\showbodyfontenvironment.

Experimentally I changed parameters at \definebodyfontenvironment
and I am not able to understand the logic of the table generated
by the \showbodyfontenvironment.

What is the meaning of lines in the table? Or is this published somewhere?


Do you have a minimal example?

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
___


[NTG-context] Lines in \showbodyfontenvironment

2019-02-17 Thread Tomas Hala
Hi all,

I played with \definebodyfontenvironment and found the command 
\showbodyfontenvironment.

Experimentally I changed parameters at \definebodyfontenvironment
and I am not able to understand the logic of the table generated 
by the \showbodyfontenvironment.

What is the meaning of lines in the table? Or is this published somewhere?

Best wishes,

Tomáš
___
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] t-downsample.lua

2019-02-17 Thread Hans Hagen

On 2/17/2019 11:32 AM, Peter Münster wrote:

Hi,

Please find attached a new version of the module, with some ideas
from Marco. Later, I'll upload it to modules.contextgarden.net.

Here a usage example:

\usemodule[downsample]
\setupexternalfigures[
   location=default,  % find hacker.jpg and mill.png
   cache=/tmp,% where to put the low resolution images
   resolution=50, % resolution in DPI
   conversion=downsample.pdf] % use this module
\starttext
\externalfigure[hacker][width=0.4\textwidth]
\setupexternalfigures[resolution=20]
\externalfigure[mill][width=4in, height=3in]
\setupexternalfigures[resolution=200]
\externalfigure[mill][width=4in, height=3in]
\stoptext

Hans, it would be nice, to apply this patch, to trigger new conversion,
when figure dimensions change:

--- grph-inc.lua~   2019-02-14 17:04:12.0 +0100
+++ grph-inc.lua2019-02-17 08:45:38.129971581 +0100
@@ -864,6 +864,14 @@
  newbase = prefix .. newbase
  end
  local hash = ""
+local width  = figures.current().request.width
+local height = figures.current().request.height
+if width then
+hash = hash .. "[w:" .. width .. "]"
+end
+if height then
+hash = hash .. "[h:" .. height .. "]"
+end
  if resolution then
  hash = hash .. "[r:" .. resolution .. "]"
  end
hm that needs a bit of thinking because here we have cases where we 
downsample from say 600 to 150 dpi but then use that same one for all 
kind of sizes (and then a different wd/ht should not trigger an extra 
downsample)


Hans

-
  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] degrade module

2019-02-17 Thread Peter Münster
On Fri, Feb 15 2019, Marco Patzer wrote:

> - It's 99% Peter's code, he's the maintainer of the module and
>   probably he should just fix his code.

Done.


> - My modification contains an ugly hack that just renames all files
>   to pdf, regardless of the actual file type because I have no clue
>   how to do that properly.

I've included your hack, because I don't have any better idea...


> That code shouldn't make it into the distribution.

Why not? Just because of the hack?

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


[NTG-context] Article on: How to install a font in ConTeXt?

2019-02-17 Thread Rudolf Bahr
Yesterday I got dante's revue and read Taco Hoekwater's
article translated into German by Henning Hraban Ramm:
"dante, Die TEXnische Komödie, 1/2019: 'Wie installiere 
ich eine Schrift für ConTeXt?'"

Many thanks to both, its really good and thoroughly 
written!

Rudolf

___
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] t-downsample.lua

2019-02-17 Thread Peter Münster
On Sun, Feb 17 2019, Peter Münster wrote:

> Later, I'll upload it to modules.contextgarden.net.

Ok, done.

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


[NTG-context] t-downsample.lua

2019-02-17 Thread Peter Münster
Hi,

Please find attached a new version of the module, with some ideas
from Marco. Later, I'll upload it to modules.contextgarden.net.

Here a usage example:

\usemodule[downsample]
\setupexternalfigures[
  location=default,  % find hacker.jpg and mill.png
  cache=/tmp,% where to put the low resolution images
  resolution=50, % resolution in DPI
  conversion=downsample.pdf] % use this module
\starttext
\externalfigure[hacker][width=0.4\textwidth]
\setupexternalfigures[resolution=20]
\externalfigure[mill][width=4in, height=3in]
\setupexternalfigures[resolution=200]
\externalfigure[mill][width=4in, height=3in]
\stoptext

Hans, it would be nice, to apply this patch, to trigger new conversion,
when figure dimensions change:

--- grph-inc.lua~   2019-02-14 17:04:12.0 +0100
+++ grph-inc.lua2019-02-17 08:45:38.129971581 +0100
@@ -864,6 +864,14 @@
 newbase = prefix .. newbase
 end
 local hash = ""
+local width  = figures.current().request.width
+local height = figures.current().request.height
+if width then
+hash = hash .. "[w:" .. width .. "]"
+end
+if height then
+hash = hash .. "[h:" .. height .. "]"
+end
 if resolution then
 hash = hash .. "[r:" .. resolution .. "]"
 end

TIA,
-- 
   Peter


t-downsample.lua
Description: Binary data
___
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
___