Re: [NTG-context] Repeat backgrounds on slides

2020-02-14 Thread Wolfgang Schuster
On Fri, 14 Feb 2020 09:10:22 +0100
"Jan U. Hasecke"  wrote:

> Am 13.02.20 um 20:39 schrieb Wolfgang Schuster:
> 
> > 
> > This is normal behaviour for layers but you can repeat it on every page with
> > 
> > \definelayer [bg:...] [state=repeat]
> 
> Thanks. There was a dark idea of this in the back of my brain.
> 
> > 
> > In your case a simple overlay is the simpler solution to get repeated 
> > images on every page, i.e.
> > 
> >   \defineoverlay [bg:hs2020-mond] 
> > [{\externalfigure[background.jpg][height=\paperheight]}]
> > 
> > or
> > 
> >   \defineoverlay [bg:hs2020-mond] [\overlayfigure{background.jpg}]
> 
> Is this defining and setting in one command?

You can also pass a variable as argument in the second argument,
e.g. in the following example I set the background image with
the start of each new slide.

\setupexternalfigures[location=default]

\defineoverlay
  [SlideBackground]
  [\doifsomething
 {\structureuservariable{background}}
 {\externalfigure[\structureuservariable{background}][factor=max]}]

\setuppapersize[S6]
\setupbackgrounds[page][background=SlideBackground]

%\setuppapersize[S6][S6,oversized]
%\setupbackgrounds[paper][background=SlideBackground]
%\setuplayout[location=middle]

\definehead[Slide][chapter]

\starttext

\startSlide[title=Cow][background=cow]
\dorecurse{3}{\dontleavehmode\page}
\stopSlide

\startSlide[title=Hacker][background=hacker]
\dorecurse{3}{\dontleavehmode\page}
\stopSlide

\stoptext

> Can I set the offset in this way, too?

It depends on your requirements, to get equal bleed on all
four sides you can just increase the width/height of the image
with the offset value.

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] mtxrun

2020-02-14 Thread Luca Donetti
> > So I run explicitly the second one:
> >   ~/context-lmtx/bin/mtxrun --generate
> > but I got the same error.
>
> This is the wrong binary. As Hans said (and also what I wrote in my
> message) is that you have to run the one in
> ~/context-lmtx/tex/texmf-linux-64/bin/
>
>


> This shows that the wrong binary is being used. You are using the binary
> in /home/sam/context-lmtx/bin when you should use
> /home/sam/context-lmtx/tex/texmf-linux-64/bin.
>
>
I ran into a similar problem in the past because the installation script
install.sh says the following, among other things:
"If you want to run ConTeXt everywhere, you need to adapt the path, like:

  [lmtx path]/bin:[lmtx path]/tex/texmf-linux-64/bin:[the rest of my path]"

Doing as suggested, when mtxrun is launched the first binary is used
because  [lmtx path]/bin comes first in the PATH. My question is then how
do you usually run mtxrun:
1) always writing the full path of the correct executable,
2) avoid putting [lmtx path]/bin in PATH,
3) putting [lmtx path]/bin _after_ [lmtx path]/tex/texmf-linux-64/bin in
the PATH

I'm asking here because option 1 is correct but not very handy, while 2)
and 3) are different from what the installer says and they seemed to give
other problems when I tried them.

Thank you in advance,
LD
___
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] Metapost and TikZ color code equivalent

2020-02-14 Thread Fabrice Couvreur
Hi,
Hi,
I have corrected for the dimensions of the ellipse but I cannot achieve the
same effect for the red color.
Thank you.
Fabrice
\startMPcode
  def match (expr pos) =
fill unitsquare xscaled 4cm  yscaled 0.2cm shifted pos withcolor yellow;
fill origin -- (4cm,0) -- (4.1cm,-0.05cm) --  (0.1cm,-0.05cm) -- cycle
 withcolor(.6yellow + black);
draw origin -- (0,0.2cm) -- (4cm,0.2cm) -- (4cm,0) -- (4.1cm,-0.05cm)
-- (0.1cm,-0.05cm) -- cycle;
fill fullcircle xscaled 0.50cm yscaled 0.44cm shifted (4.125cm,0.1cm)
withcolor red;
draw fullcircle xscaled 0.50cm yscaled 0.44cm shifted (4.125cm,0.1cm);
draw fullcircle xscaled 0.50cm yscaled 0.44cm shifted (4.125cm,0.1cm)
 withshademethod "circular"
 withshadevector (0,1)
 withshadecolors (red,white)
  enddef;
  match((0,0));

\stopMPcode



Le ven. 14 févr. 2020 à 16:43, Fabrice L  a écrit :

> Hi,
>
> Le 13 févr. 2020 à 16:45, Fabrice Couvreur 
> a écrit :
>
>
> How to have the color defined by {yellow!60!black} with Metapost ?
>
>
> color MyColor ; MyColor := .6[yellow,black] ;
>
> See metafun manual, section 1.13.
>
> Thank you.
> Fabrice
>
>
> Fabrice (another one !).
>
>
> ___
> 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
>
> ___
>
___
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] attachments working again (issue with /EmbeddedFiles)

2020-02-14 Thread Pablo Rodriguez
On 2/14/20 3:43 AM, Rik Kabel wrote:
> [...]
> The further I look into bookmark, annotation, and attachment handling by
> a number of viewers, the more confusing things appear.

Hi Rik,

this is why following the prescription (the PDF spec) is better in order
to check the standard than gathering information in different viewers.

> And Acrobat still shows attachments twice under some circumstances,
> with the helpful flyover for one entry giving the location as the
> associated page number, and for the other giving it as the
> attachments tab.

That practice is explictly discouraged by the PDF Association, citing
the behaviour of some viewers (but not naming Acrobat). See
https://www.pdfa.org/wp-content/uploads/2018/10/PDF20_AN002-AF.pdf#search=usability.

> What is more troublesome on the ConTeXt side is the validation issue
> with the appearance dictionary for visible attachments.

This is my (educated?) guess: appearance dictionaries are required to
print annotation icons. This isn’t especially directed to attachments,
but to all annotation types (excepting popups and links).

> The difference between validators when looking at the hidden attachment
> in my example hinges on the handling of the attachment mime type. I have
> filed a defect report with VeraPDF, which appears to be rejecting valid
> mime type that includes a charset clause.

If this is a bug, they should fix it. They may have missed a valid MIME
type.

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
___


Re: [NTG-context] Label in externalfigures

2020-02-14 Thread Jan-Erik Hägglöf
Now finally after consulting the luametafun and the MetaFun manual I’ve found what I was looking for:The code:\startMPcode picture p; p := lmt_svg [ filename = "steguppgift.svg", width = 400 ] ;draw p;path linje ; linje := (15,-330) -- (280,-90); % adding a missing line in the .svg filedrawarrow linje withcolor black ;draw thelabel("37°",(160,-330));draw thelabel("$5,0$m",(150,-160));\stopMPcodeThis was a fun learning experience so thanks again13 feb. 2020 kl. 10:35 skrev Jan-Erik Hägglöf :I’ve tested this but it appears outside, not as an layer over the picture.\startMPcode draw lmt_svg [	filename = "steguppgift.svg",	height = 5cm,	width = 10cm,	] ;label(\sometxt{5,0m},(63.936298,129.563995));label(\sometxt{37°},(95.652702,27.367201));	\stopMPcodeThanks /Janne12 feb. 2020 kl. 20:10 skrev Hans Hagen :On 2/12/2020 6:01 PM, Jan-Erik Hägglöf wrote:The expected output should be like this, see example in the link belowhttps://drive.google.com/file/d/13pCuUvNeL7T_Hs7-qrKZclkadcJ7_jVV/view?usp=sharingSo that I have a picture so I can change the label text inside according to different needs e.g change from 37° to 41° without reediting it in Inkscape.A similar properties like latex export picture.pdf_tex which is a function in InkscapeI investigate the details manual tip you provided, thanks a lot.you might want to peek into the luametafun manual as svg is discussed there, including label stuffwhat you can also try (with lmtx) is this (no real interface yet):\starttext\hbox\bgroup  \ctxlua{metapost.startsvghashing()}%  \includesvgfile[labels-004.svg]%  \ctxlua{metapost.stopsvghashing()}%\egroup\stoptextwhich should turn your labels into tex, so you can typeset them as tex (so $\\sin(x)$ comes out as math) it's no big deal to add a remap option there but then i'd rather go for symbolic namesHans-  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-contextwebpage  : http://www.pragma-ade.nl / http://context.aanhet.netarchive  : 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
___


Re: [NTG-context] mtxrun

2020-02-14 Thread Rudolf Bahr
On Fri, Feb 14, 2020 at 08:59:57PM +0100, Luca Donetti wrote:
> > > So I run explicitly the second one:
> > >   ~/context-lmtx/bin/mtxrun --generate
> > > but I got the same error.
> >
> > This is the wrong binary. As Hans said (and also what I wrote in my
> > message) is that you have to run the one in
> > ~/context-lmtx/tex/texmf-linux-64/bin/



Hi Luca,

> 1) always writing the full path of the correct executable,

I don't know which operating system you're using. On linux instead of writing
the full path I'm using the command "alias" in my ".bashrc" file. So, Adityas
proposal on mtxrun (Date: Wed, 12 Feb 2020 00:24:21 -0500 (EST)) becomes:

alias context='~/context-lmtx/tex/texmf-linux-64/bin/mtxrun --autogenerate 
--script
  context'
with 'context-lmtx' being the directory, where I installed context.
With this you invoke your context file with "context your-file.tex"
I cancelled all context stuff in my PATH variable. Don't forget to 'source 
~/.bashrc'
afterwards. 

> 2) avoid putting [lmtx path]/bin in PATH,

Yes, this could be a solution too, in my opinion.

> 3) putting [lmtx path]/bin _after_ [lmtx path]/tex/texmf-linux-64/bin in
> the PATH
> 
> I'm asking here because option 1 is correct but not very handy, while 2)
> and 3) are different from what the installer says and they seemed to give
> other problems when I tried them.

I hope this helps you! At least in the case you're using linux.

Best wishes,

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] mtxrun

2020-02-14 Thread Aditya Mahajan

On Fri, 14 Feb 2020, Luca Donetti wrote:


So I run explicitly the second one:
  ~/context-lmtx/bin/mtxrun --generate
but I got the same error.


This is the wrong binary. As Hans said (and also what I wrote in my
message) is that you have to run the one in
~/context-lmtx/tex/texmf-linux-64/bin/






This shows that the wrong binary is being used. You are using the binary
in /home/sam/context-lmtx/bin when you should use
/home/sam/context-lmtx/tex/texmf-linux-64/bin.



I ran into a similar problem in the past because the installation script
install.sh says the following, among other things:
"If you want to run ConTeXt everywhere, you need to adapt the path, like:

 [lmtx path]/bin:[lmtx path]/tex/texmf-linux-64/bin:[the rest of my path]"

Doing as suggested, when mtxrun is launched the first binary is used
because  [lmtx path]/bin comes first in the PATH. My question is then how
do you usually run mtxrun:
1) always writing the full path of the correct executable,
2) avoid putting [lmtx path]/bin in PATH,
3) putting [lmtx path]/bin _after_ [lmtx path]/tex/texmf-linux-64/bin in
the PATH

I'm asking here because option 1 is correct but not very handy, while 2)
and 3) are different from what the installer says and they seemed to give
other problems when I tried them.


I always follow 2. I don't think that [lmtx path]/bin should ever be in 
the PATH except when updating the installation.


Aditya
___
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] Metapost and TikZ color code equivalent

2020-02-14 Thread Fabrice L
Hi,

> Le 13 févr. 2020 à 16:45, Fabrice Couvreur  a 
> écrit :

> How to have the color defined by {yellow!60!black} with Metapost ?

color MyColor ; MyColor := .6[yellow,black] ;

See metafun manual, section 1.13.

> Thank you.
> Fabrice

Fabrice (another one !).
> ___
> 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
___


Re: [NTG-context] Repeat backgrounds on slides

2020-02-14 Thread Jan U. Hasecke
Am 13.02.20 um 20:39 schrieb Wolfgang Schuster:

> 
> This is normal behaviour for layers but you can repeat it on every page with
> 
> \definelayer [bg:...] [state=repeat]

Thanks. There was a dark idea of this in the back of my brain.

> 
> In your case a simple overlay is the simpler solution to get repeated images 
> on every page, i.e.
> 
>   \defineoverlay [bg:hs2020-mond] 
> [{\externalfigure[background.jpg][height=\paperheight]}]
> 
> or
> 
>   \defineoverlay [bg:hs2020-mond] [\overlayfigure{background.jpg}]

Is this defining and setting in one command? Can I set the offset in
this way, too?

juh

___
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] Metapost and TikZ color code equivalent

2020-02-14 Thread Fabrice Couvreur
i Henri,
Thank you for your answer. The idea is to make the graph as an attachment. I
converted to Metapost but the road is still long!
The code is from percusse on StackExchange. As you can see, there is a
problem with the ellipse. How do I fix this ?
Thank you
Fabrice

\usemodule[tikz]
\starttext
\startMPcode
  def match (expr pos) =
fill unitsquare xscaled 4cm  yscaled 0.2cm shifted pos withcolor yellow;
fill origin -- (4cm,0) -- (4.1cm,-0.05cm) --  (0.1cm,-0.05cm) -- cycle
 withcolor(.6yellow + black);
draw origin -- (0,0.2cm) -- (4cm,0.2cm) -- (4cm,0) -- (4.1cm,-0.05cm)
-- (0.1cm,-0.05cm) -- cycle;
fill fullcircle xscaled 0.25cm yscaled 0.22cm shifted (4.125cm,0.1cm)
withcolor red;
draw fullcircle xscaled 0.25cm yscaled 0.22cm shifted (4.125cm,0.1cm)
 withshademethod "circular"
 withshadevector (0,1)
 withshadecolors (red,white)
  enddef;
  match((0,0));

\stopMPcode

\starttikzpicture
\define[2]\allumette{
\fill [yellow] (#1,#2) rectangle (#1+4,#2+0.2);
\fill [yellow!60!black] (#1,#2) -- ++(4,0)-- ++(0.1,-0.05) -- ++(-4,0)
-- ++(-0.1,0.05);
\draw (#1,#2) -- ++(0,0.2) -- ++(4,0) -- ++(0,-0.2) -- ++(0.1,-0.05) --
++(-4,0) -- ++(-0.1,0.05);
\shade[ball color=red] (#1+4,#2+0.1) ellipse (0.25cm and 0.22cm);
\draw (#1+4,#2+0.1) ellipse (0.25cm and 0.22cm);
}
\allumette{0.1}{0.2}
\filldraw[orange,scale=0.5,shift={(8.2,1.2)}]  (0,0) .. controls
(-1.5,1.25) and (.5,2) .. (-.2,4) .. controls (1,2.5) and (1,.5) .. (0,0);
\stoptikzpicture
\stoptext

Le ven. 14 févr. 2020 à 02:49, Henri Menke  a écrit :

> On 2/14/20 10:45 AM, Fabrice Couvreur wrote:
> > Hi,
> > How to have the color defined by {yellow!60!black} with Metapost ?
>
> \usemodule[tikz]
> \starttext
> \startMPcode
> fill fullsquare scaled 1cm withcolor (.6yellow + black) ;
> \stopMPcode
>
> \starttikzpicture
> \fill[yellow!60!black] (0,0) rectangle (1,1);
> \stoptikzpicture
> \stoptext
>
>
> > Thank you.
> > Fabrice
> >
> >
> >
> ___
> > 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
>
> ___
>
___
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
___