[NTG-context] A question about whatever (Metapost)

2020-01-25 Thread Fabrice Couvreur
Hi,
The point M is such that the line (CM) is perpendicular to the line (NP).
I do not understand the error of this code.
Thank you
Fabrice

\usecolors[xwi]
\starttext
\startMPcode
  path carre, p;
  carre = unitsquare scaled 138;

  pair a, b, c, d, N, P, M;
  a = point 0 of carre;
  b = point 1 of carre;
  c = point 2 of carre;
  d = point 3 of carre;

  p = b -- d;
  N = whatever[a,d];
  P = whatever[a,b];
  M = whatever[b,d];
 (M - c) dotprod (P - N) = 0;

  draw M -- c;

  draw p  withcolor \MPcolor{navy};
  draw carre withcolor \MPcolor{firebrick};

  label.lft("$A$", point 0 of carre);
  label.lrt("$B$", point 1 of carre);
  label.urt("$C$", point 2 of carre);
  label.ulft("$D$", point 3 of carre);
\stopMPcode
\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
___


Re: [NTG-context] Fonts/Layouts in ConTeXt books

2020-01-25 Thread Floris van Manen


On 25-01-2020 21:50, Saša Janiška wrote:
> There are plenty of free font but here

also free:

ibm plex
https://www.ibm.com/plex/

.F


pEpkey.asc
Description: application/pgp-keys
___
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] Using the separate ConTeXt on macOS (Mojave)

2020-01-25 Thread Hans Åberg

> On 25 Jan 2020, at 21:17, Gerben Wierda  wrote:
> 
> I’m installing a clear separate ConTeXt. I’ve installed it in 
> /Applications/context/. According to 
> https://wiki.contextgarden.net/Mac_Installation:
…
> open -a TeXShop $HOME/Library/TeXShop/Engines/ConTeXt\ \(LuaTeX\).engine
…
> But this .engine file does not exist. There are no .engine files at all (just 
> an Inactive directory). So, what should I do?

The scripts in this directory are not updated, as they may be user modified. 
They are are stored in the subdirectory Inactive/ConTeXt/. Copy one there, 
rename, and modify it so that it points the of context you want to use.


___
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] Fonts/Layouts in ConTeXt books

2020-01-25 Thread Saša Janiška
On Fri, 24 Jan 2020 16:31:08 +0100
Hans Hagen  wrote:

> There are plenty of free font but here are my commercial favourites:

> - lucida (very cheap via tug.org and a full set with math)

I do not have need for the math, do you still recommend them?

>- optima nova(quite expensive but a treat for the eye)
> - palatino nova  (idem)

Beautiful, indeed!

Btw, I was thinking whether Fonts in ConTeXt book is still relevant (from the
ToC I conclude it deals with MkIV) aand/or provides enough info so that in case
I buy some 3prd party fonts (I am considering something from
https://mbtype.com/) I'll be able to configure ConTeXt to use them?

Similar concern in regard to layouts and the other book...but, I believe that
both are very useful in any case and ordering them is a small appreciation for
the work done for ConTeXt.


Sincerely,
Gour

-- 
Perform your prescribed duty, for doing so is better than not
working. One cannot even maintain one's physical body without work.


___
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] Using the separate ConTeXt on macOS (Mojave)

2020-01-25 Thread Gerben Wierda
I’m installing a clear separate ConTeXt. I’ve installed it in 
/Applications/context/. According to 
https://wiki.contextgarden.net/Mac_Installation 
:
Creating an Engine for TeXShop
Actually, engine is somewhat misleading. In TeXShop an engine is a script that 
contains commands that are use to typeset your documents. TeXShop comes with 
many engines set up to run TeX, LaTeX, Xe(La)TeX and ConTeXt MKII and MKIV that 
have been installed via MacTeX.
If you want to use ConTeXt Suite you will have to create an TeXShop-engine.
If you have not run TeXShop start it so that the support files for TeXShop are 
installed for you. 
Since in the newer versions of MacOS the users Library-folder is hidden and not 
accessible from within TeXShop we will use the terminal for simplicity reasons. 
If you wish you can access the your Library-folder from the Finder and navigate 
to the Engines-folder inside of the TeXShop-folder inside your Library-folder 
and choose a ConTeXt-engine.
Start the Terminal you will find it in the Utility-folder in the 
Applications-folder
Find your username is, if you do not know it already.
The command whoami will output your user name.
Open the standard MKIV engine for TeXShop enter
open -a TeXShop $HOME/Library/TeXShop/Engines/ConTeXt\ \(LuaTeX\).engine
This will open the file in TeXShop and switch to TeXShop

But this .engine file does not exist. There are no .engine files at all (just 
an Inactive directory). So, what should I do?

G___
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] line numbering within frame

2020-01-25 Thread Wolfgang Schuster
On Thu, 23 Jan 2020 22:53:42 +0100
"Thomas A. Schmitz"  wrote:

> > On 23. Jan 2020, at 22:32, Wolfgang Schuster 
> >  wrote:
> > 
> > Bonus question: Why is it necessary to put \definelinenumbering before 
> > \framed?
> > 
> > Wolfgang
> 
> I would be grateful for an answer because I have no clue ;-) In my real life 
> case, I fetch the content of the frame from an xml file. Since not every 
> frame has line numbering, I am already inside the frame when I have to define 
> and set up the line numbering environment. I can probably code around it, but 
> it makes my life definitely more difficult…


Before I give the answer to the question we have to go back to a few 
TeX/ConTeXt basics.


# Grouping

When you create a new command it is normally local to the current group level 
and after you end the group the command no longer exists.

In the following example I redefine the value for the color red in a group, 
when the group ends the new value is forgotten and the previous one is used. 
When you now create a new command or environment in the group and try to use it 
after its end you will get a error message (something I tried to avoid with the 
example) about an undefined command.

 begin example
\starttext

\color[red]{Red}

\start

\definecolor[red][b=1]

\color[red]{Red}

\stop

\color[red]{Red}

\stoptext
 end example


# Inheritance

When you create a new command or environment with \define... the new instance 
inherits most of its values from a parent instance.

You can overwrite individual values for your new instance but all other values 
are taken from the parent.

 begin example
\setupframed[foregroundstyle=bold]

\defineframed[customframe][framecolor=red]

\starttext

\framed{Framed text!}

\placeframed[customframe]{Framed text!}

\stoptext
 end example

When you can combine this with the previous section which explained grouping 
and overwrite values within the group. After the group has ended the new values 
are forgotten and the instance uses what was set before the group.

 begin example
\defineframed[customframe][framecolor=red]

\starttext

\placeframed[customframe]{Framed text!}

\start

\setupframed[customframe][foregroundstyle=bold]

\placeframed[customframe]{Framed text!}

\stop

\placeframed[customframe]{Framed text!}

\stoptext
 end example


# Line numbering

Line numbering in MkIV happens at a different point as it did in MkII. When you 
use line numbers for \framed (or \startframedtext) ConTeXt adds the numbers to 
the frame after the framed box is completed.

When the framed content is put in the box you're always within a group which 
means the numbers are added after the group has ended and as explained in the 
two sections above settings within a group normally are forgotten afterwards.

The first and bigger problem is that you try to create a new line numbering 
instance in each frame which no longer exists when the numbers are added and 
when ConTeXt tries to access values of this no longer existing instance in 
fails to get them which results in the error message.

 begin example
\starttext

\startframedtext

\definelinenumbering[example]

\startlinenumbering[example]

\samplefile{klein}

\stoplinenumbering

\stopframedtext

\stoptext
 end example

The minor problem is that you local changes for each instance (e.g. the color 
for the numbers) are also forgotten because you set them within the group. Only 
a limited numbers of values can be set in a group (e.g. the starting number) 
and they have to bet set with \startlinenumbering, this is possible because 
they are passed to Lua which ignores TeX groups.

While new linenumbering instances outside of frames are save in most cases you 
should try to avoid this and do it at the begin of the document because even 
here you can run into problems. Below is a example where I show that you can 
get the same error as in your example with line numbers for the whole page.

 begin example
\setupsectionblock[bodypart][page=no]

\starttext

\startbodymatter

\definelinenumbering[example]

\startlinenumbering[example]

\samplefile{klein}

\stoplinenumbering

\stopbodymatter

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