[NTG-context] \setupmathematics with stylealternative not working

2019-02-21 Thread Mikael P. Sundqvist
Hi,

It seems that, with the latest beta, the \setupmathematics with
stylealternative is not working.

I tried

\setupbodyfont[lucidaot]
\setupmathematics[stylealternative={calligraphic}]
\starttext
\startTEXpage[offset=3bp]
$\mathcal A$
\stopTEXpage
\stoptext

and got the attached output lcm.png. This is not the curly A I would
expect. The one I expect is the one that can be seen on top of page 9
in https://tug.org/store/lucida/lucida-amsmath.pdf.

I also noticed that the example file that I have seen earlier on this
list, pasted below, does not seem to change anything.

Has anything changed?

/Mikael

% second example
\setupbodyfont[lucidaot]

\starttext

$x
^{i \leftarrow 0 = ∅}
_{\setmathfontalternate{arrow}
  \setmathfontalternate{dotless}
  \setmathfontalternate{zero}
  i \leftarrow 0 = ∅}
$

$x
^{i \leftarrow 0 = ∅}
_{\setmathfontalternate{arrow,dotless,zero}
  i \leftarrow 0 = ∅}
$

\setupmathematics[stylealternative={arrow,dotless,zero}]

$x
^{i \leftarrow 0 = ∅}
_{i \leftarrow 0 = ∅}
$

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


[NTG-context] Latest changes in some size registers

2019-02-21 Thread Martin Bruchanov

Hi all,

I have some very condensed documents which should fit on one page:

http://gnulinux.guru/bash_cheatsheet.pdf

Without any major change in style definition, there is more space around 
sections or itemize:


http://gnulinux.guru/bash_cheatsheet_diff.pdf

Source code is here:

https://github.com/BruXy/gnulinux.guru/tree/master/bash_tahak

Did I miss some update which has introduced some different length settings?

I have version: 2019.02.14 16:57

Regards,

BruXy

___
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] markdown module vs pandoc

2019-02-21 Thread Gour
On Thu, 21 Feb 2019 18:50:41 +0100
Pablo Rodriguez  wrote:

> sorry for my delayed reply.

No problem - there is no rush here. ;)

> I’m still behind the environment itself, although I realized that
> these may not be relevant to everybody. I store the new commits in a
> private repository.

Aha...I believe I might be interested. :-)

> I use the XML handling (generating the XHTML with pandoc) in ConTeXt
> for almost all the documents I compile with ConTeXt. I think this is
> the way to go.

I admit it sounds/looks very good. Morever, it could allow me to e.g. use
org-mode for my original markup which I use anyway with Emacs and then do
org-mode --> XHTML.

> My environment is only an example. You may write another one for your
> own needs, you don’t have to use mine.

Heh, for that I must learn some things first. :-)
 
> There are other options, but LaTeX is a real problem for the
> development of pandoc, because many times users expect pandoc as a
> layer that spares them the actual dealing with LaTeX.

ConTeXt is certainly more appealing..

> But this is only my personal opinion. I hope it might help.

Thanks you very much!


Sincerely,
Gour

-- 
It is far better to discharge one's prescribed duties, even though
faultily, than another's duties perfectly. Destruction in the course
of performing one's own duty is better than engaging in another's
duties, for to follow another's path is dangerous.


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

2019-02-21 Thread Marco Patzer
On Thu, 21 Feb 2019 18:24:29 +0100
Wolfgang Schuster  wrote:

> > \startprettyblock
> >\noindentation  
> 
> You don’t need \noindentation when you add “next” to the indenting
> options.

That's even better (meaning cleaner source). I didn't know that
option.

Marco
___
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] markdown module vs pandoc

2019-02-21 Thread Pablo Rodriguez
On 2/19/19 2:22 PM, Gour wrote:
> On Mon, 18 Feb 2019 17:08:44 +0100 Pablo Rodriguez wrote:
> [...] 
>> I convert Markdown to XHTML and then I compile the XML sources with
>> ConTeXt.
> 
> I've tried it and it works nicely. The possibility to have one-source-does-all
> is tempting. ;)
> 
> Now I wonder if you're still behind the tool and/or whether it is still
> actively used by you?

Hi Gour,

sorry for my delayed reply.

I’m still behind the environment itself, although I realized that these
may not be relevant to everybody. I store the new commits in a private
repository.

I use the XML handling (generating the XHTML with pandoc) in ConTeXt for
almost all the documents I compile with ConTeXt. I think this is the way
to go.

My environment is only an example. You may write another one for your
own needs, you don’t have to use mine.

> Another question for both you and Aditya in regard to the point made by Mojca
> (suggesting to use Asciidoc markup) is whether you find that Pandoc's
> (extended) Markdown is semantically rich-enough to cover more complex 
> documents
> or in such cases it would be better to use richer markup like Asciidoc or 
> simpy
> to directly use ConTeXt?

I use extended Markdown even for typesetting a ConTeXt introduction in
Spanish (http://www.aprender-context.tk/).

But there are some basic features that I miss from extended Markdown:

- A lightweight syntax for language (such as [Deutsch]{:de}).
- The ability to place the table of contents.
- The ability to place the footnotes/endnotes.

There may be others, but these are the three ones that first came to my
mind.

> So far, one thing is clear: ConTeXt is the way to go instead of LaTeX and 
> other
> options, but now have to resolve whether to use pandoc's markdown, AsciiDoc or
> just ConTeXt...

There are other options, but LaTeX is a real problem for the development
of pandoc, because many times users expect pandoc as a layer that spares
them the actual dealing with LaTeX.

(La)TeX input sources and XML markup are diverse, this is why I think
that pandoc should generate PDF documents from XML sources (and forget
about (La)TeX support).

But this is only my personal opinion. I hope it might help.

Cheers,

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

2019-02-21 Thread Wolfgang Schuster

Marco Patzer schrieb am 21.02.19 um 12:19:

On Thu, 21 Feb 2019 10:50:21 +
Ursula Hermann  wrote:


Here is my example:

\setuppapersize[A5]
\setupcolors[state=start]

This is the default, no need to start the colours any longer.


{\framed
[width=10cm,
background=color,backgroundcolor=darkblue,
foreground=color,foregroundcolor=white,
align={flushleft}]
{The Earth, as a habitat for animal life, is in old age and has a
fatal illness. Several, in fact.\par \setupindenting[yes, small]
It would be happening whether humans had ever evolved or not.

\externalfigure[cow.pdf][width=1cm]}

\setupwhitespace[small]
\starttext
Below, we have two separate columns; but up here, for the nonce, we
have but the one.

\startcolumns[n=2]  % Two columns, please
 Text, text, text \dots
 all in the first column
\column
 Words, words, words \dots
all in the second column.
 And look ye here! Even more words!
\stopcolumns
\stoptext
Why can‘t I see the cow?

You're missing

   \setupexternalfigures
 [location=default]

Without setting the location context doesn't check the system
directories for the sample images.

Furthermore, you're typesetting before \starttext. That's why your
font is monospaced.

And I try to separate content from style. That's why I move all
style information before \starttext and after \starttext comes only
content and markup (if possible). Nothing wrong with mixing it, but
it's easier to read and easier to change the layout after the fact.
I'd write your example as follows.

\setuppapersize
   [A5]

\setupexternalfigures
   [location=default]

\setupindenting
   [yes, small]

\setupwhitespace
   [small]

\defineframedtext
   [prettyblock]
   [width=10cm,
indenting={yes, small},
background=color, backgroundcolor=darkblue,
foreground=color, foregroundcolor=white,
offset=2mm,
align=flushleft]

\starttext

\startprettyblock
   \noindentation


You don’t need \noindentation when you add “next” to the indenting options.

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] Pretty printer for matlab

2019-02-21 Thread Otared Kavian
Hi Marco,

Thanks! I hadn't tries [syntax=scilab], but I just did it and it works exactly 
as expected!
However I could not edit the file scilab.vim which sits (on my machine) in
/usr/share/vim/vim80/syntax/scilab.vim

Meanwhile, out of curiosity I modified the two files 
buff-imp-lua.mkiv
buff-imp-lua.lua
written by Hans, by naming them (temporarily)
buff-imp-scilab.mkiv
buff-imp-scilab.lua
and then by saying 
\usemodule[buff-imp-scilab]
 \definetyping[scilab][option=SCILAB]
I could obtain an approximate good result… But since the keywords in Lua and 
Scilab are quite different, I could not change some of the settings (for 
instance in Lua the cosine function is called math.cos while in Scilab it is 
cos: I could not change appropriately the list of such keywords…).

I think for the time being it is simpler for me to use your solution with 
\usemodule[vim]
\definevimtyping[scilab][syntax=scilab]

Thanks again,
Best regards: OK

> On 21 Feb 2019, at 15:31, Marco Patzer  wrote:
> 
> On Thu, 21 Feb 2019 15:10:27 +0100
> Otared Kavian  wrote:
> 
>> Thanks for pointing to that module, which I didn't know because I
>> never use vim… I just tested it and seems fine, but I would need to
>> modify some of the keywords of Matlab in order to adapt them to
>> Scilab. However I didn't find where those keywords are defined in the
>> vim module.
> 
> They're not defined in the vim module. The vim module is just a way
> to use vim's syntax highlighting in context. The syntax should be
> defined in the vim files .vim in the vim directory, e.g.
> /usr/share/vim/vim81/syntax/.vim if I'm not mistaken.
> 
> Have you tried using “syntax=scilab”?
> 
> Marco
> ___
> 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] Pretty printer for matlab

2019-02-21 Thread Marco Patzer
On Thu, 21 Feb 2019 15:10:27 +0100
Otared Kavian  wrote:

> Thanks for pointing to that module, which I didn't know because I
> never use vim… I just tested it and seems fine, but I would need to
> modify some of the keywords of Matlab in order to adapt them to
> Scilab. However I didn't find where those keywords are defined in the
> vim module.

They're not defined in the vim module. The vim module is just a way
to use vim's syntax highlighting in context. The syntax should be
defined in the vim files .vim in the vim directory, e.g.
/usr/share/vim/vim81/syntax/.vim if I'm not mistaken.

Have you tried using “syntax=scilab”?

Marco
___
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] Pretty printer for matlab

2019-02-21 Thread Otared Kavian
Hi Marco,

Thanks for pointing to that module, which I didn't know because I never use vim…
I just tested it and seems fine, but I would need to modify some of the 
keywords of Matlab in order to adapt them to Scilab.
However I didn't find where those keywords are defined in the vim module.

Best regards: OK

> On 21 Feb 2019, at 14:43, Marco Patzer  wrote:
> 
> On Thu, 21 Feb 2019 14:25:03 +0100
> Otared Kavian  wrote:
> 
>> Is there a pretty printer file to typeset Matlab codes?
> 
> How about Aditya's vim module? It supports Matlab:
> 
> \usemodule [vim]
> \definevimtyping [matlab] [syntax=matlab]
> \starttext
> \startmatlab
>  …
> \stopmatlab
> \stoptext
> 
> Marco
> ___
> 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] Pretty printer for matlab

2019-02-21 Thread Marco Patzer
On Thu, 21 Feb 2019 14:25:03 +0100
Otared Kavian  wrote:

> Is there a pretty printer file to typeset Matlab codes?

How about Aditya's vim module? It supports Matlab:

\usemodule [vim]
\definevimtyping [matlab] [syntax=matlab]
\starttext
\startmatlab
  …
\stopmatlab
\stoptext

Marco
___
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] Pretty printer for matlab

2019-02-21 Thread Otared Kavian
Hi all,

Is there a pretty printer file to typeset Matlab codes?
Actually I would like to modify such a file in order to define a typing 
environment to typeset portions of codes written for Scilab, which is a sort of 
free version of Matlab.

Thanks for any comment and help: OK
___
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] Frame

2019-02-21 Thread Ursula Hermann
Hello Marco!

Thanks a lot, that worked. 

Many regards
Uschi 

-Ursprüngliche Nachricht-
Von: ntg-context  Im Auftrag von Marco Patzer
Gesendet: Donnerstag, 21. Februar 2019 12:19
An: ntg-context@ntg.nl
Betreff: Re: [NTG-context] Frame

On Thu, 21 Feb 2019 10:50:21 +
Ursula Hermann  wrote:

> Here is my example:
> 
> \setuppapersize[A5]
> \setupcolors[state=start]

This is the default, no need to start the colours any longer.

> {\framed
>[width=10cm,
>background=color,backgroundcolor=darkblue,
>foreground=color,foregroundcolor=white,
>align={flushleft}]
> {The Earth, as a habitat for animal life, is in old age and has a 
> fatal illness. Several, in fact.\par \setupindenting[yes, small] It 
> would be happening whether humans had ever evolved or not.
> 
> \externalfigure[cow.pdf][width=1cm]}
> 
> \setupwhitespace[small]
> \starttext
> Below, we have two separate columns; but up here, for the nonce, we 
> have but the one.
> 
> \startcolumns[n=2]  % Two columns, please
> Text, text, text \dots
> all in the first column
> \column
> Words, words, words \dots
>all in the second column.
> And look ye here! Even more words!
> \stopcolumns
> \stoptext
> Why can‘t I see the cow?

You're missing

  \setupexternalfigures
[location=default]

Without setting the location context doesn't check the system directories for 
the sample images.

Furthermore, you're typesetting before \starttext. That's why your font is 
monospaced.

And I try to separate content from style. That's why I move all style 
information before \starttext and after \starttext comes only content and 
markup (if possible). Nothing wrong with mixing it, but it's easier to read and 
easier to change the layout after the fact.
I'd write your example as follows.

\setuppapersize
  [A5]

\setupexternalfigures
  [location=default]

\setupindenting
  [yes, small]

\setupwhitespace
  [small]

\defineframedtext
  [prettyblock]
  [width=10cm,
   indenting={yes, small},
   background=color, backgroundcolor=darkblue,
   foreground=color, foregroundcolor=white,
   offset=2mm,
   align=flushleft]

\starttext

\startprettyblock
  \noindentation
  The Earth, as a habitat for animal life, is in old age and has a fatal
  illness. Several, in fact.

  It would be happening whether humans had ever evolved or not.

  \externalfigure[cow][width=1cm]
\stopprettyblock

Below, we have two separate columns; but up here, for the nonce, we have but 
the one.

\startcolumns [n=2]
  Text, text, text \dots
  all in the first column
\column
  Words, words, words \dots
  all in the second column.
  And look ye here! Even more words!
\stopcolumns

\stoptext

Marco
___
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] troubles with \MPinclusions (Taco Hoekwater)

2019-02-21 Thread Damien Thiriet
Thanks for your answers, I could significantly reduce my long 
timeline code.

 
> 1. Variable names x and y are special and cleared before
>every graphic. This is related to the fact that “z" is 
>defined as a shortcut for "(x,y)”. Both of these are
>traditional. 
> 
>Every metapost graphic does at least this at its start:
> 
>save x,y;
>currentpicture := nullpicture;
>currentpen:=defaultpen;
>   
>so pair xx[]; would have worked just fine.
> 
>In general, I would advice to stay away from single-letter
>variable names inside MPinclusions, and use CamelCase
>to avoid clashes with metafun internals.
> 

So, got one more z-related error in Metapost. I bet this is
absolutely the n.1 on help-lists. Btw, if I were a scientist, 
I'd realized that defining x as a pair is quite heretic…
And that sounds much familiar to an historian.

Damien Thiriet
___
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] Frame

2019-02-21 Thread Marco Patzer
On Thu, 21 Feb 2019 10:50:21 +
Ursula Hermann  wrote:

> Here is my example:
> 
> \setuppapersize[A5]
> \setupcolors[state=start]

This is the default, no need to start the colours any longer.

> {\framed
>[width=10cm,
>background=color,backgroundcolor=darkblue,
>foreground=color,foregroundcolor=white,
>align={flushleft}]
> {The Earth, as a habitat for animal life, is in old age and has a
> fatal illness. Several, in fact.\par \setupindenting[yes, small]
> It would be happening whether humans had ever evolved or not.
> 
> \externalfigure[cow.pdf][width=1cm]}
> 
> \setupwhitespace[small]
> \starttext
> Below, we have two separate columns; but up here, for the nonce, we
> have but the one.
> 
> \startcolumns[n=2]  % Two columns, please
> Text, text, text \dots
> all in the first column
> \column
> Words, words, words \dots
>all in the second column.
> And look ye here! Even more words!
> \stopcolumns
> \stoptext
> Why can‘t I see the cow?

You're missing

  \setupexternalfigures
[location=default]

Without setting the location context doesn't check the system
directories for the sample images.

Furthermore, you're typesetting before \starttext. That's why your
font is monospaced.

And I try to separate content from style. That's why I move all
style information before \starttext and after \starttext comes only
content and markup (if possible). Nothing wrong with mixing it, but
it's easier to read and easier to change the layout after the fact.
I'd write your example as follows.

\setuppapersize
  [A5]

\setupexternalfigures
  [location=default]

\setupindenting
  [yes, small]

\setupwhitespace
  [small]

\defineframedtext
  [prettyblock]
  [width=10cm,
   indenting={yes, small},
   background=color, backgroundcolor=darkblue,
   foreground=color, foregroundcolor=white,
   offset=2mm,
   align=flushleft]

\starttext

\startprettyblock
  \noindentation
  The Earth, as a habitat for animal life, is in old age and has a fatal
  illness. Several, in fact.

  It would be happening whether humans had ever evolved or not.

  \externalfigure[cow][width=1cm]
\stopprettyblock

Below, we have two separate columns; but up here, for the nonce, we have but
the one.

\startcolumns [n=2]
  Text, text, text \dots
  all in the first column
\column
  Words, words, words \dots
  all in the second column.
  And look ye here! Even more words!
\stopcolumns

\stoptext

Marco
___
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] Frame

2019-02-21 Thread Ursula Hermann
Hello Lars!

Here is my example:

\setuppapersize[A5]
\setupcolors[state=start]
{\framed
   [width=10cm,
   background=color,backgroundcolor=darkblue,
   foreground=color,foregroundcolor=white,
   align={flushleft}]
{The Earth, as a habitat for animal life, is in old age and has a fatal 
illness. Several, in fact.\par
\setupindenting[yes, small]
It would be happening whether humans had ever evolved or not.

\externalfigure[cow.pdf][width=1cm]}

\setupwhitespace[small]
\starttext
Below, we have two separate columns; but up here, for the nonce, we have but 
the one.

\startcolumns[n=2]  % Two columns, please
Text, text, text \dots
all in the first column
\column
Words, words, words \dots
   all in the second column.
And look ye here! Even more words!
\stopcolumns
\stoptext
Why can‘t I see the cow?
Many Regards
Uschi
Von: ntg-context  Im Auftrag von Lars
Gesendet: Mittwoch, 20. Februar 2019 15:38
An: ntg-context@ntg.nl
Betreff: Re: [NTG-context] Frame


It's the same as with text, but instead of text you put

\externalfigure[path/to-figure.pdf][setup=value]

inside the parenthesis { }:

\setuppapersize[A5]

\starttext

{\framed
   [width=10cm,
   background=color,backgroundcolor=darkblue,
   foreground=color,foregroundcolor=white,
   align={flushleft}]
{The Earth, as a habitat for animal life, is
in old age and has a fatal illness. Several,
in fact.\par
\setupindenting[yes, small]
It would be happening whether humans had ever evolved or not.}

\blank

{\framed
   [width=10cm,
   background=color,backgroundcolor=darkblue,
   foreground=color,foregroundcolor=white,
   align=middle]
{\externalfigure[path/to-figure.pdf][width=.8\textwidth]}

\stoptext



You don't need the \setupcolors[state=start] command in ConTeXt mkiv by the way.


Am 20/02/2019 um 12:31 schrieb Ursula Hermann:

Hi Marco!



I have another question to Frame. How is the process, if i have to take Figures 
in a Frame? Sorry, here I have no example, because I dont know, how to write it.



Many thanks



Uschi







-Ursprüngliche Nachricht-

Von: Ursula Hermann

Gesendet: Mittwoch, 20. Februar 2019 11:10

An: 'mailing list for ConTeXt users' 


Betreff: AW: [NTG-context] Frame





Hi, Marco!



With colour:



\setuppapersize[A5]

\setupcolors[state=start]

{\framed

   [width=10cm,

   background=color,backgroundcolor=darkblue,

   foreground=color,foregroundcolor=white,

   align={flushleft}]

{The Earth, as a habitat for animal life, is in old age and has a fatal 
illness. Several, in fact.\par \setupindenting[yes, small] It would be 
happening whether humans had ever evolved or not.}



Many Regards



Uschi

-Ursprüngliche Nachricht-

Von: Ursula Hermann

Gesendet: Mittwoch, 20. Februar 2019 10:44

An: 'mailing list for ConTeXt users' 


Betreff: AW: [NTG-context] Frame



Hello Marco!



It works, like I wanted:



\setuppapersize[A5]

{\framed

   [width=10cm,

align={flushleft}]

{The Earth, as a habitat for animal life, is in old age and has a fatal 
illness. Several, in fact.\par \setupindenting[yes, small] It would be 
happening whether humans had ever evolved or not.}



Thank you for helping

Uschi



-Ursprüngliche Nachricht-

Von: ntg-context 
 Im Auftrag von 
Ursula Hermann

Gesendet: Dienstag, 19. Februar 2019 14:17

An: mailing list for ConTeXt users 


Betreff: Re: [NTG-context] Frame



Hi Marco!



Thanks a lot.



Best regards



Uschi



-Ursprüngliche Nachricht-

Von: ntg-context 
 Im Auftrag von 
Marco Patzer

Gesendet: Dienstag, 19. Februar 2019 14:11

An: ntg-context@ntg.nl

Betreff: Re: [NTG-context] Frame



On Tue, 19 Feb 2019 13:01:35 +

Ursula Hermann 
 wrote:



I have:

\framed

  [height=3em,

   width=.5\textwidth,

   foregroundcolor=red,

   framecolor=blue,

   rulethickness=2pt,

   background=color,

   backgroundcolor=green]

\starttext

{Ich bin da.\par Du auch}

\stoptext



Move the \starttext to the beginning:



\starttext

\framed

  [height=3em,

   width=.5\textwidth,

   foregroundcolor=red,

   framecolor=blue,

   rulethickness=2pt,

   background=color,

   backgroundcolor=green]

{Ich bin da.\par Du auch}

\stoptext



Marco

___

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] troubles with \MPinclusions

2019-02-21 Thread Taco Hoekwater


> On 21 Feb 2019, at 10:03, Damien Thiriet  wrote:
> 
> Hi,
> 
> 
> Why does (1) compile, whereas (2) doesn’t?

For me, both compile. However (2) does not work.

1. Variable names x and y are special and cleared before
   every graphic. This is related to the fact that “z" is 
   defined as a shortcut for "(x,y)”. Both of these are
   traditional. 

   Every metapost graphic does at least this at its start:

   save x,y;
   currentpicture := nullpicture;
   currentpen:=defaultpen;
  
   so pair xx[]; would have worked just fine.

   In general, I would advice to stay away from single-letter
   variable names inside MPinclusions, and use CamelCase
   to avoid clashes with metafun internals.

2. You need a bigger pen to actually see the dots even if
   you change the variable name. :)

Best wishes,
Taco

> I can't understand why can MPinclusions store path and not pairs.  
> 
> 
>  (1) %%
> \setuppapersize[A4,landscape]
> 
> \startMPinclusions
> u:=1mm ;
> %fond
> path p ;
> p:= (0,0) -- (150u,0) -- (150u,95u) -- (0,95u) -- cycle ;
> pair x[] ;
> x[0]:= (20u,90u) ;
> x[1]:= (40u,90u) ;
> x[2]:= (90u,90u) ;
> x[3]:= (140u,90u) ;
> \stopMPinclusions
> 
> \startreusableMPgraphic{test}
> draw p ;
> \stopreusableMPgraphic
> 
> \starttext 
>\reuseMPgraphic{test}
> \stoptext
> 
>  (1) %%
> \setuppapersize[A4,landscape]
> 
> \startMPinclusions
> u:=1mm ;
> %fond
> path p ;
> p:= (0,0) -- (150u,0) -- (150u,95u) -- (0,95u) -- cycle ;
> pair x[] ;
> x[0]:= (20u,90u) ;
> x[1]:= (40u,90u) ;
> x[2]:= (90u,90u) ;
> x[3]:= (140u,90u) ;
> \stopMPinclusions
> 
> \startreusableMPgraphic{test}
> draw p ;
> for i=0 step 1 until 3 :
>drawdot x[i] ;
> endfor ;
> \stopreusableMPgraphic
> 
> \starttext 
>\reuseMPgraphic{test}
> 
> 
> More generaly, which kind of variables cannot be stored in
> \startMPinclusions ?
> 
> Thanks,
> 
> 
> Damien Thiriet
> ___
> 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
> ___

Taco Hoekwater
Elvenkind BV




___
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] troubles with \MPinclusions

2019-02-21 Thread Hans Hagen

On 2/21/2019 10:03 AM, Damien Thiriet wrote:

Hi,


Why does (1) compile, whereas (2) doesn't?
I can't understand why can MPinclusions store path and not pairs.


 (1) %%
\setuppapersize[A4,landscape]

\startMPinclusions
u:=1mm ;
%fond
path p ;
p:= (0,0) -- (150u,0) -- (150u,95u) -- (0,95u) -- cycle ;
pair x[] ;
x[0]:= (20u,90u) ;
x[1]:= (40u,90u) ;
x[2]:= (90u,90u) ;
x[3]:= (140u,90u) ;
\stopMPinclusions

\startreusableMPgraphic{test}
draw p ;
\stopreusableMPgraphic

\starttext
 \reuseMPgraphic{test}
\stoptext

 (1) %%
\setuppapersize[A4,landscape]

\startMPinclusions
u:=1mm ;
%fond
path p ;
p:= (0,0) -- (150u,0) -- (150u,95u) -- (0,95u) -- cycle ;
pair x[] ;
x[0]:= (20u,90u) ;
x[1]:= (40u,90u) ;
x[2]:= (90u,90u) ;
x[3]:= (140u,90u) ;
\stopMPinclusions

\startreusableMPgraphic{test}
draw p ;
for i=0 step 1 until 3 :
 drawdot x[i] ;
endfor ;
\stopreusableMPgraphic

\starttext
 \reuseMPgraphic{test}


More generaly, which kind of variables cannot be stored in
\startMPinclusions ?


those that are likely to clash later

\startMPinclusions
vardef MyStuff =
numeric u;
u:=1mm ;
path p ;
p:= (0,0) -- (150u,0) -- (150u,95u) -- (0,95u) -- cycle ;
pair x[] ;
x[0]:= (20u,90u) ;
x[1]:= (40u,90u) ;
x[2]:= (90u,90u) ;
x[3]:= (140u,90u) ;
enddef ;
\stopMPinclusions

\startreusableMPgraphic{test}
save p, u, x ;
MyStuff ;
draw p ;
for i=0 step 1 until 3 :
drawdot x[i] ;
endfor ;
\stopreusableMPgraphic

\starttext
\reuseMPgraphic{test}
\stoptext

but in your case you could as well put the inclusions in the test 
graphic itself


\startreusableMPgraphic{test}
save p, u, x ;
numeric u;
u:=1mm ;
path p ;
p:= (0,0) -- (150u,0) -- (150u,95u) -- (0,95u) -- cycle ;
pair x[] ;
x[0]:= (20u,90u) ;
x[1]:= (40u,90u) ;
x[2]:= (90u,90u) ;
x[3]:= (140u,90u) ;
draw p ;
for i=0 step 1 until 3 :
drawdot x[i] ;
endfor ;
\stopreusableMPgraphic

\starttext
\reuseMPgraphic{test}
\stoptext


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


[NTG-context] troubles with \MPinclusions

2019-02-21 Thread Damien Thiriet
Hi,


Why does (1) compile, whereas (2) doesn't?
I can't understand why can MPinclusions store path and not pairs.  


 (1) %%
\setuppapersize[A4,landscape]

\startMPinclusions
u:=1mm ;
%fond
path p ;
p:= (0,0) -- (150u,0) -- (150u,95u) -- (0,95u) -- cycle ;
pair x[] ;
x[0]:= (20u,90u) ;
x[1]:= (40u,90u) ;
x[2]:= (90u,90u) ;
x[3]:= (140u,90u) ;
\stopMPinclusions

\startreusableMPgraphic{test}
draw p ;
\stopreusableMPgraphic

\starttext 
\reuseMPgraphic{test}
\stoptext

 (1) %%
\setuppapersize[A4,landscape]

\startMPinclusions
u:=1mm ;
%fond
path p ;
p:= (0,0) -- (150u,0) -- (150u,95u) -- (0,95u) -- cycle ;
pair x[] ;
x[0]:= (20u,90u) ;
x[1]:= (40u,90u) ;
x[2]:= (90u,90u) ;
x[3]:= (140u,90u) ;
\stopMPinclusions

\startreusableMPgraphic{test}
draw p ;
for i=0 step 1 until 3 :
drawdot x[i] ;
endfor ;
\stopreusableMPgraphic

\starttext 
\reuseMPgraphic{test}


More generaly, which kind of variables cannot be stored in
\startMPinclusions ?

Thanks,


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