[NTG-context] Re: \m vs $ for math mode

2024-09-11 Thread Mikael Sundqvist
Hi,

you do not need to change the $ into \m. With \m, you can use some
arguments, like \m[color=red]{x+y}.

/Mikael

On Thu, Sep 12, 2024 at 4:44 AM Shiv Shankar Dayal
 wrote:
>
> Hi all,
>
> I had been using $ for math mode. Then I read the new manual that \m
> is better for math mode. Can you please give some examples to see this
> in action? BTW, I have started using \m but changing all existing
> formulas is very tedious.
>
> --
> Respect,
> Shiv Shankar Dayal
> ___
> If your question is of interest to others as well, please add an entry to the 
> Wiki!
>
> maillist : ntg-context@ntg.nl / 
> https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl
> webpage  : https://www.pragma-ade.nl / https://context.aanhet.net (mirror)
> archive  : https://github.com/contextgarden/context
> wiki : https://wiki.contextgarden.net
> ___
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / 
https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl
webpage  : https://www.pragma-ade.nl / https://context.aanhet.net (mirror)
archive  : https://github.com/contextgarden/context
wiki : https://wiki.contextgarden.net
___


[NTG-context] \m vs $ for math mode

2024-09-11 Thread Shiv Shankar Dayal
Hi all,

I had been using $ for math mode. Then I read the new manual that \m
is better for math mode. Can you please give some examples to see this
in action? BTW, I have started using \m but changing all existing
formulas is very tedious.

-- 
Respect,
Shiv Shankar Dayal
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / 
https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl
webpage  : https://www.pragma-ade.nl / https://context.aanhet.net (mirror)
archive  : https://github.com/contextgarden/context
wiki : https://wiki.contextgarden.net
___


[NTG-context] Re: \unit{mercury} renders as m (meter) and \unit{millimetermercury} doesn't work as expected

2023-12-05 Thread Marco Patzer
On Tue, 5 Dec 2023 20:06:46 +0100
Wolfgang Schuster  wrote:

> > That doesn't make sense, inch and mm are different units. I'd rather
> > add:
> >
> >\registerunit
> >  [inHg=inchmercury]
> >
> >\setupunittext
> >  [en]
> >  [inchmercury=inHg]  
> 
> It's just a stupid example to show how to set the label value.

Ok, got it. Thanks for your quick help, as usual!

Marco
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / 
https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl
webpage  : https://www.pragma-ade.nl / https://context.aanhet.net (mirror)
archive  : https://github.com/contextgarden/context
wiki : https://wiki.contextgarden.net
___


[NTG-context] Re: \unit{mercury} renders as m (meter) and \unit{millimetermercury} doesn't work as expected

2023-12-05 Thread Wolfgang Schuster

Marco Patzer schrieb am 05.12.2023 um 19:58:

\setupunittext[en][millimetermercury=inHg]
That doesn't make sense, inch and mm are different units. I'd rather
add:

   \registerunit
 [inHg=inchmercury]

   \setupunittext
 [en]
 [inchmercury=inHg]


It's just a stupid example to show how to set the label value.

Wolfgang

___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / 
https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl
webpage  : https://www.pragma-ade.nl / https://context.aanhet.net (mirror)
archive  : https://github.com/contextgarden/context
wiki : https://wiki.contextgarden.net
___


[NTG-context] Re: \unit{mercury} renders as m (meter) and \unit{millimetermercury} doesn't work as expected

2023-12-05 Thread Marco Patzer
On Tue, 5 Dec 2023 17:27:59 +0100
Wolfgang Schuster  wrote:

> None of your examples work because millimetermercury and mercury are
> the names for the labels
> and the units are accessed with hg and mmhg.

Ok, that makes sense. And it works, thanks for the explanation and
the quick reply.

> \setupunittext[en][millimetermercury=inHg]

That doesn't make sense, inch and mm are different units. I'd rather
add:

  \registerunit
[inHg=inchmercury]

  \setupunittext
[en]
[inchmercury=inHg]

Marco
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / 
https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl
webpage  : https://www.pragma-ade.nl / https://context.aanhet.net (mirror)
archive  : https://github.com/contextgarden/context
wiki : https://wiki.contextgarden.net
___


[NTG-context] Re: \unit{mercury} renders as m (meter) and \unit{millimetermercury} doesn't work as expected

2023-12-05 Thread Wolfgang Schuster

Marco Patzer schrieb am 05.12.2023 um 15:19:

Hi!

I'm struggling with the rendering of a particular liquid metal:

   %% renders as m (meter), not as Hg
   \unit{mercury}

   %% renders as mm·m, not as mmHg
   \unit{millimetermercury}

This is strange, since both “mercury” and “millimetermercury” are
defined in phys-dim.lua. To get mercury recognised as a unit this
can be used:

   \registerunitshortcut [mercury=mercury]

Now \unit{mercury} renders correctly as Hg.

Why is that \registerunitshortcut necessary? Is it even correct to
use it like this? However, even then millimetermercury doesn't
render correctly:

   %% renders as mm·Hg, not as mmHg
   \unit{millimetermercury}

How to get millimetermercury render as mmHg? And “inch mercury”
render as inHg? I can't find “inchmercury” in phys-dim.lua, only
“millimetermercury”, should it be added?

Example:

%% \enabletrackers [physics.units]

%% inch should render as “in”
%% \setupunittext [inch=in]

\starttext
   \unit{mercury}\crlf  %% renders: mm · m

   \unit{12 millimetermercury}\crlf  %% renders: mm · m
   \unit{12 inchmercury}\crlf%% renders: in · m

   %% why is this necessary to get mercury rendered as Hg?
   \registerunitshortcut [mercury=mercury]

   \unit{12 millimetermercury}\crlf  %% renders: mm · Hg
   \unit{12 inch mercury}\crlf   %% renders: in · Hg
\stoptext

Questions:

1) Why is \unit{mercury} not working, although it's listed in
phys-dim.lua?
2) Is the call \registerunitshortcut [mercury=mercury]
necessary/correct?
3) How to make \unit{millimetermercury} render as mmHg and
\unit{inch mercury} render as inHg?


None of your examples work because millimetermercury and mercury are the 
names for the labels

and the units are accessed with hg and mmhg.

\setupunittext[en][millimetermercury=inHg]

\starttext

\unit{mmhg}

\stoptext

Wolfgang

___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / 
https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl
webpage  : https://www.pragma-ade.nl / https://context.aanhet.net (mirror)
archive  : https://github.com/contextgarden/context
wiki : https://wiki.contextgarden.net
___


[NTG-context] \unit{mercury} renders as m (meter) and \unit{millimetermercury} doesn't work as expected

2023-12-05 Thread Marco Patzer
Hi!

I'm struggling with the rendering of a particular liquid metal:

  %% renders as m (meter), not as Hg
  \unit{mercury}

  %% renders as mm·m, not as mmHg
  \unit{millimetermercury}

This is strange, since both “mercury” and “millimetermercury” are
defined in phys-dim.lua. To get mercury recognised as a unit this
can be used:

  \registerunitshortcut [mercury=mercury]

Now \unit{mercury} renders correctly as Hg.

Why is that \registerunitshortcut necessary? Is it even correct to
use it like this? However, even then millimetermercury doesn't
render correctly:

  %% renders as mm·Hg, not as mmHg
  \unit{millimetermercury}

How to get millimetermercury render as mmHg? And “inch mercury”
render as inHg? I can't find “inchmercury” in phys-dim.lua, only
“millimetermercury”, should it be added?

Example:

%% \enabletrackers [physics.units]

%% inch should render as “in”
%% \setupunittext [inch=in]

\starttext
  \unit{mercury}\crlf  %% renders: mm · m

  \unit{12 millimetermercury}\crlf  %% renders: mm · m
  \unit{12 inchmercury}\crlf%% renders: in · m

  %% why is this necessary to get mercury rendered as Hg?
  \registerunitshortcut [mercury=mercury]

  \unit{12 millimetermercury}\crlf  %% renders: mm · Hg
  \unit{12 inch mercury}\crlf   %% renders: in · Hg
\stoptext

Questions:

1) Why is \unit{mercury} not working, although it's listed in
   phys-dim.lua?
2) Is the call \registerunitshortcut [mercury=mercury]
   necessary/correct?
3) How to make \unit{millimetermercury} render as mmHg and
   \unit{inch mercury} render as inHg?

Marco
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / 
https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl
webpage  : https://www.pragma-ade.nl / https://context.aanhet.net (mirror)
archive  : https://github.com/contextgarden/context
wiki : https://wiki.contextgarden.net
___


Re: [NTG-context] [m-database] How to properly add module arguments?

2023-03-04 Thread Paul Mazaitis via ntg-context
On 26 Feb 2023, at 5:36, Max Chernoff via ntg-context wrote:

> I'd recommend completely ignoring the interface i-*.xml files. They
> don't do anything particularly useful for a third-party module.

It's good to know there's no dependency there (but I do like to keep things 
updated :) ).

> This line is your issue. Inside \unprotect...\protect, "!" is treated as
> a letter, so you're trying to expand the value of the macro
> "\c!skipheader". The problem is that that macro isn't defined anywhere.

A ha! Many thanks; I've gotten it working, along with this hint:

>   skipheader=\v!no, % <-- HERE

...so I think I'm okay.

(I don't mind doing the translations, but that's probably outside the scope of 
this project.)

> Backing up a little further, the \c!... commands are all string
> *C*onstants. If you see a command with a name like \c!blah, it almost
> certain expands to exactly the string "blah". Why is this useful? Well,
> if you run ConTeXt in another language, then the \c!... commands will
> instead contain that string but in the other language. So something like
> \c!left would be "left" in English, "gauche" in French, "links" in
> German, "vlevo" in Czech, etc.

This, too, was useful - as per the Scratch Variables page in the System Macros 
section of the garden 
(https://wiki.contextgarden.net/System_Macros/Scratch_Variables) I've updated 
my tree-sitter parser (https://github.com/pmazaitis/tree-sitter-context_en) to 
put these in the parse tree; I don't know how useful that is, but it seems to 
me that being able to call these out might help.

> As a more general suggestion, it is usually a really bad idea to modify the
> standard ConTeXt files since any changes will be overwritten on updates.
> Probably the best solution is to make a new file called "t-xdatabase.mkiv"
> stored in your texmf-local/, start the file with "\usemodule[database]"
> then add any changes after that. Or, just copy and paste the original file
> into your new file. (Maybe you were doing this already though)

Oh! Indeed: my working ConTeXt environment is under version control;  
experimental nonsense like this gets safely tucked away in a branch (my 
thinking is that I want to try to change as few new variables as possible - 
still learning!).

> Hope this helps,

Absolutely; many thanks!

> -- Max

-Paul

___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / https://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : https://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : https://contextgarden.net
___


Re: [NTG-context] [m-database] How to properly add module arguments?

2023-02-26 Thread Max Chernoff via ntg-context
Hi Paul,

> I added a stanza to the appropriate interface file:
> 
> --- begin stanza added to i-database.xml ---
> 
> I modeled that after the stanza for the argument `strip`. I think
> that's the only thing I need to do in the interface file.

I'd recommend completely ignoring the interface i-*.xml files. They
don't do anything particularly useful for a third-party module.

>\c!skipheader=\v!no, % <- Added, following the pattern with strip

This line is your issue. Inside \unprotect...\protect, "!" is treated as
a letter, so you're trying to expand the value of the macro
"\c!skipheader". The problem is that that macro isn't defined anywhere. 

Backing up a little further, the \c!... commands are all string
*C*onstants. If you see a command with a name like \c!blah, it almost
certain expands to exactly the string "blah". Why is this useful? Well,
if you run ConTeXt in another language, then the \c!... commands will
instead contain that string but in the other language. So something like
\c!left would be "left" in English, "gauche" in French, "links" in
German, "vlevo" in Czech, etc. 

You could define \c!skipheader to just be "skipheader", or you could
give it a translated value for 10 or so languages. But the easier
solution is to just use the string "skipheader" directly:

   \setupdatabase
 [\c!separator={,},
  \c!quotechar=,
  \c!commentchar=,
  \c!strip=\v!no,
  skipheader=\v!no, % <-- HERE
  \c!before=,
  \c!after=,
  \c!first=,
  \c!last=,
  \c!left=,
  \c!right=]
   
As a more general suggestion, it is usually a really bad idea to modify the
standard ConTeXt files since any changes will be overwritten on updates.
Probably the best solution is to make a new file called "t-xdatabase.mkiv"
stored in your texmf-local/, start the file with "\usemodule[database]"
then add any changes after that. Or, just copy and paste the original file
into your new file. (Maybe you were doing this already though)
   
Hope this helps,
-- Max
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / https://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : https://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : https://contextgarden.net
___


[NTG-context] [m-database] How to properly add module arguments?

2023-02-25 Thread Paul Mazaitis via ntg-context
Dear list,

## The Incredibly Short Version

I am trying to extend m-database, and I want to add a flag to control behavior. 
I can get it to work, but I am having trouble understanding how to do it 
properly.

## The Short Version

I have a project where I wish to incorporate many CSV files as Natural Tables.

I want to keep the headers in the CSV files so they're useful in other contexts.

The `m-database` module doesn't have a feature to suppress the header row, from 
what I can see.

(I know `handlecsv` can do this, but I'm having troubles with that; if the 
`m-database` line of inquiry doesn't work out, I'll go back it, but I figure 
I'll focus on this solution for now.)

Looking at the module sources, I can implement the functionality I need in the 
Lua part of the module, but:

I seem to only be able to bodge in additional arguments for the commands in the 
module.

On first try, I got the error: `tex error   > tex error on line 30 in file 
/Users/pmazaitis/Opt/context/tex/texmf-context/tex/context/modules/mkiv/m-databaseplus.mkiv:
 ! Undefined control sequence`

And then: `The control sequence at the end of the top line of your error 
message was never
\def'ed.`

Looking at the docs points me to a solution using  `\def`, but it's not clear 
to me how that's working in the case of the database module (the database 
module seems to be initializing these values someplace else?).

If I \def the settings variable in m-database.mkiv,  I can get it to work, but 
I don't think that's the correct way to go about this.

Question: how do I properly define new module arguments for the database module?

## The Long Version, With MWE

### Files Associated With the MWE

Apologies for all of the file inclusions, but I want to be complete.


Here's the .csv file I'm using for the MWE:

--- begin database-mwe.csv ---

Ref. No.,Part No.,Description,Remarks
,RD14C82E000J,Carbon 000𝝮 ±5% 1/4W,

---  end database-mwe.csv  ---

Some notes on database-mwe.csv:

I'd like to keep the header row in place to make this file useful for other 
tools.

These are lists of electronic parts, so I'd like to include uppercase omega, 
lower case mu, and percent sign characters in the CSV file.


Here's the .tex file I'm using for the MWE:

--- begin database-mwe.tex ---

\usemodule[database]

\setupdatabase[quotechar={"},separator={,}]

\defineseparatedlist
  [PartsTable]
  [separator=comma,left=\bTD,right=\eTD,first=\bTR,last=\eTR,before={
\bTABLE[split=repeat,option=stretch]
  \bTABLEhead
  \bTR
\bTH Ref. No. \eTH \bTH Part No. \eTH \bTH Description \eTH \bTH Remarks 
\eTH
  \eTR
  \eTABLEhead
  \bTABLEbody
   },
   after={
  \eTABLEbody
  \eTABLE
   }]

\starttext

test

\startasciimode
\processdatabasefile[PartsTable][parts_list-test.csv]
\stopasciimode

\stoptext

---  end database-mwe.tex  ---

Some notes on database-mwe.tex:

This actually works pretty well with the distributed m-database module!

Some of these lists are quite long, so I want to use a TABLEhead to replicate 
the headings at the top of a new page. I don't think there's a way to automate 
this with `m-database`, so I'm okay with hard-coding the headers. This does 
mean I get a double header row at the top of the table. I want to suppress the 
header row; I'd like to implement this behavior in the module behind a switch.

(I'm using the `asciimode` environment to dodge problems with unescaped `%` 
characters and Greek letters. I tried adding the startasciimode/stopasciimode 
commands to various keys in the \defineseparatedlist command, but I didn't get 
anywhere with it - I got errors. A problem for another time...)

I think I've got a good handle on how to do this in Lua, but I'm struggling 
with what to add to the switch appropriately.

In attempting to add a switch, I tried the following.

Based off of https://wiki.contextgarden.net/Modules#Modules_writing_guidelines,
I added a stanza to the appropriate interface file:

--- begin stanza added to i-database.xml ---






---  end stanza added to i-database.xml  ---

I modeled that after the stanza for the argument `strip`. I think that's the 
only thing I need to do in the interface file.

Changing the i-database.xml file does not break the build.

However, as soon as I add the skipheader argument to the m-database.mkiv file:

--- begin definition in m-database.mkiv ---

\setupdatabase
  [\c!separator={,},
   \c!quotechar=,
   \c!commentchar=,
   \c!strip=\v!no,
   \c!skipheader=\v!no, % <- Added, following the pattern with strip
   \c!before=,
   \c!after=,
   \c!first=,
   \c!last=,
   \c!left=,
   \c!right=]

---  end definition in m-database.mkiv  ---


...the build fails (with the error from the Short Version section).

If I then add the following \def to m-database.mkiv before the \setu

Re: [NTG-context] m-graph label

2022-07-30 Thread John Kitzmiller via ntg-context
On Tue, Jul 26, 2022 at 2:10 PM Alan  wrote:

> On Thu, 21 Jul 2022 17:56:45 -0400
> John Kitzmiller  wrote:
>
> > (Apologies for double-dipping, but usage direction for the
> > least-squares fit extension in m-graph would be a gift.)
>
> The least-squares fit (to a polynomial) is a deterministic calculation,
> not an arbitrary non-linear search. As such, it is very robust.
>
> Certain (useful) functions, a Gaussian peak for example, can be
> suitably transformed to a polynomial function, so these are handled as
> well, robustly.
>
> Examples are given as comments in mp-grap.mpiv that you can follow.
> Also attached is an adapted version of the original John Hobby
> documentation, with extensions described.
>
> Note that the m-graph module is simply a re-write of the John Hobby
> graph macros, taking advantage of floating-point MetaPost (thus
> simplified).
>
> 
>
> I have been working on a completely new luagraph module that does much
> in lua. It has, notably, arbitrary coordinate systems.
>
> This has been a moving target as I put more and more into lua
> and less and less in Metapost. I have also been playing chase with the
> development of luametatex (and have fallen behind).
>
> Alan
>

Thanks for the modified documentation of the graph macros. It has been a
great help. Is it in the lmtx distribution somewhere?

I read about the upcoming luagraph in mag-1104-mkiv.pdf (This Way
11/11/2019) and have also played a bit with LuaMetaFun and Aditya's blog
post. Looking forward to that development, thank you!

John
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / https://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : https://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : https://contextgarden.net
___


Re: [NTG-context] m-graph label

2022-07-30 Thread John Kitzmiller via ntg-context
On Tue, Jul 26, 2022 at 1:51 PM Alan  wrote:

> On Thu, 21 Jul 2022 17:56:45 -0400
> John Kitzmiller  wrote:
>
> > > On Wed, Jul 20, 2022 at 9:48 AM Alan 
> > > wrote: % Autoform   is the format string used
> > > by autogrid % Autoform_X, Autoform_Y if defined, are used
> > > instead
> > >
> > > string Autoform ; Autoform = "%g";
> > >
> > > % string Autoform_X ; Autoform_X := "@.0e" ;
> > > % string Autoform_Y ; Autoform_Y := "@.0e" ;
> >
> >
> > Thanks Alan. I see those lines in the module listing, but could you
> > provide some guidance on usage? Can the (re)formatting be done from
> > my input file, or do I need to modify mp-grap.mpiv, or some other way?
> >
> > (Apologies for double-dipping, but usage direction for the
> > least-squares fit extension in m-graph would be a gift.)
>
> You can set these strings in your source file, no need to have a
> private copy of mp-grap.mpiv
>
> Autoform := "@.0e" ;
>
> or, if you want different formats for the X and Y axes:
>
> string Autoform_X ; Autoform_X := "@.0e" ; % or whatever you want ...
> string Autoform_Y ; Autoform_Y := "@.0e" ;
>
> A few notes:
>
> Autoform_X and Autoform_Y are used if known, otherwise it falls back
> on the string Autoform.
>
> The format string uses "@" rather then "%", as % is normally scanned as
> a comment.
>

Thank you again, but the "0.0" remains unchanged. The only way I've been
able to succeed is with a for loop to label explicitly. See mwe below for
things I've attempted. The last two for lines seems to be what it takes
(with the other Auto lines commented out of course.)

% 0 0
% 1 1
% 2 3
% 3 5

\enabletrackers[metapost.showlog]
\usemodule[m-graph]

\startMPpage[instance=graph, offset=5mm]
  draw begingraph(160, 100);
gdraw "mwe-2.tex" plot circles(0);

Autoform := "@0.g" ;
autogrid(otick.bot,otick.lft);

% for x=auto.x: otick.bot(format("@g",x),x); endfor;
% for y=auto.y: otick.lft(format("@g",y),y); endfor;

% for x = 0 upto 3: otick.bot(x,x); endfor;
% for y = 0 upto 5: otick.lft(y,y); endfor;
  endgraph;
\stopMPpage
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / https://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : https://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : https://contextgarden.net
___


Re: [NTG-context] m-graph label

2022-07-26 Thread Alan via ntg-context
On Thu, 21 Jul 2022 17:56:45 -0400
John Kitzmiller  wrote:

> (Apologies for double-dipping, but usage direction for the
> least-squares fit extension in m-graph would be a gift.)

The least-squares fit (to a polynomial) is a deterministic calculation,
not an arbitrary non-linear search. As such, it is very robust.

Certain (useful) functions, a Gaussian peak for example, can be
suitably transformed to a polynomial function, so these are handled as
well, robustly.

Examples are given as comments in mp-grap.mpiv that you can follow.
I can send you off-list an adapted version of the original John Hobby
documentation, with extensions described.

Note that the m-graph module is simply a re-write of the John Hobby
graph macros, taking advantage of floating-point MetaPost (thus
simplified).



I have been working on a completely new luagraph module that does much
in lua. It has, notably, arbitrary coordinate systems.

This has been a moving target as I put more and more into lua
and less and less in Metapost. I have also been playing chase with the
development of luametatex (and have fallen behind).

Alan
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / https://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : https://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : https://contextgarden.net
___


Re: [NTG-context] m-graph label

2022-07-26 Thread Alan via ntg-context
On Thu, 21 Jul 2022 17:56:45 -0400
John Kitzmiller  wrote:

> > On Wed, Jul 20, 2022 at 9:48 AM Alan 
> > wrote: % Autoform   is the format string used
> > by autogrid % Autoform_X, Autoform_Y if defined, are used
> > instead
> >
> > string Autoform ; Autoform = "%g";
> >
> > % string Autoform_X ; Autoform_X := "@.0e" ;
> > % string Autoform_Y ; Autoform_Y := "@.0e" ;
> 
> 
> Thanks Alan. I see those lines in the module listing, but could you
> provide some guidance on usage? Can the (re)formatting be done from
> my input file, or do I need to modify mp-grap.mpiv, or some other way?
> 
> (Apologies for double-dipping, but usage direction for the
> least-squares fit extension in m-graph would be a gift.)

You can set these strings in your source file, no need to have a
private copy of mp-grap.mpiv

Autoform := "@.0e" ;

or, if you want different formats for the X and Y axes:

string Autoform_X ; Autoform_X := "@.0e" ; % or whatever you want ...
string Autoform_Y ; Autoform_Y := "@.0e" ; 

A few notes:

Autoform_X and Autoform_Y are used if known, otherwise it falls back
on the string Autoform.

The format string uses "@" rather then "%", as % is normally scanned as
a comment.

Alan
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / https://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : https://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : https://contextgarden.net
___


Re: [NTG-context] m-graph label

2022-07-21 Thread John Kitzmiller via ntg-context
> On Sat, 16 Jul 2022 13:21:06 -0400
> John Kitzmiller via ntg-context  wrote:
>
> > The horizontal axis label of mwe below has 0.0 (showing tenths; pdf
> > attached; filename is mwe.tex).
> >
> > I expected it to show -1, 0, 1, 2, 3, (integers only). Can this be
> > formatted?
> >
> > % -1 1
> > % 0 1
> > % 0 2
> > % 1 1
> > % 2 1
> > % 2 2
> > % 2 3
> > % 2 4
> > % 3 1
> > % 3 2
> >
> > \usemodule[m-graph]
> > \startMPpage[instance=graph, offset=5mm]
> > labeloffset:=3mm;
> > draw begingraph(8cm,4cm);
> >   setrange(-1.5,0.5,3.5,5);
> >   picture symbol ;
> >   symbol := image(draw fullcircle scaled 5mm withcolor red;);
> >   gdata("mwe.tex", v,
> >   clearxy;
> > glabel(symbol,v1,v2) ;
> >);
> > frame.bot shifted(0,-2mm) ;
> > autogrid(otick.bot,) shifted(0,-2mm);
> > endgraph;
> > \stopMPpage
> >
> > Thanks! John
>


> On Wed, Jul 20, 2022 at 9:48 AM Alan  wrote:
> % Autoform   is the format string used by autogrid
> % Autoform_X, Autoform_Y if defined, are used instead
>
> string Autoform ; Autoform = "%g";
>
> % string Autoform_X ; Autoform_X := "@.0e" ;
> % string Autoform_Y ; Autoform_Y := "@.0e" ;


Thanks Alan. I see those lines in the module listing, but could you provide
some guidance on usage? Can the (re)formatting be done from my input file,
or do I need to modify mp-grap.mpiv, or some other way?

(Apologies for double-dipping, but usage direction for the least-squares
fit extension in m-graph would be a gift.)
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / https://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : https://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : https://contextgarden.net
___


Re: [NTG-context] m-graph label

2022-07-20 Thread Alan via ntg-context
On Sat, 16 Jul 2022 13:21:06 -0400
John Kitzmiller via ntg-context  wrote:

> The horizontal axis label of mwe below has 0.0 (showing tenths; pdf
> attached; filename is mwe.tex).
> 
> I expected it to show -1, 0, 1, 2, 3, (integers only). Can this be
> formatted?
> 
> % -1 1
> % 0 1
> % 0 2
> % 1 1
> % 2 1
> % 2 2
> % 2 3
> % 2 4
> % 3 1
> % 3 2
> 
> \usemodule[m-graph]
> \startMPpage[instance=graph, offset=5mm]
> labeloffset:=3mm;
> draw begingraph(8cm,4cm);
>   setrange(-1.5,0.5,3.5,5);
>   picture symbol ;
>   symbol := image(draw fullcircle scaled 5mm withcolor red;);
>   gdata("mwe.tex", v,
>   clearxy;
> glabel(symbol,v1,v2) ;
>);
> frame.bot shifted(0,-2mm) ;
> autogrid(otick.bot,) shifted(0,-2mm);
> endgraph;
> \stopMPpage
> 
> Thanks! John

% Autoform   is the format string used by autogrid
% Autoform_X, Autoform_Y if defined, are used instead 

string Autoform ; Autoform = "%g";

% string Autoform_X ; Autoform_X := "@.0e" ;
% string Autoform_Y ; Autoform_Y := "@.0e" ; 
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / https://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : https://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : https://contextgarden.net
___


[NTG-context] m-graph label

2022-07-16 Thread John Kitzmiller via ntg-context
The horizontal axis label of mwe below has 0.0 (showing tenths; pdf
attached; filename is mwe.tex).

I expected it to show -1, 0, 1, 2, 3, (integers only). Can this be
formatted?

% -1 1
% 0 1
% 0 2
% 1 1
% 2 1
% 2 2
% 2 3
% 2 4
% 3 1
% 3 2

\usemodule[m-graph]
\startMPpage[instance=graph, offset=5mm]
labeloffset:=3mm;
draw begingraph(8cm,4cm);
  setrange(-1.5,0.5,3.5,5);
  picture symbol ;
  symbol := image(draw fullcircle scaled 5mm withcolor red;);
  gdata("mwe.tex", v,
  clearxy;
glabel(symbol,v1,v2) ;
   );
frame.bot shifted(0,-2mm) ;
autogrid(otick.bot,) shifted(0,-2mm);
endgraph;
\stopMPpage

Thanks! John


mwe.pdf
Description: Adobe PDF document
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / https://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : https://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : https://contextgarden.net
___


Re: [NTG-context] Typo in m-tikz

2021-12-13 Thread Aditya Mahajan via ntg-context
On Mon, 13 Dec 2021, Hans Hagen wrote:

> On 12/13/2021 7:19 PM, Aditya Mahajan via ntg-context wrote:
> > On Mon, 13 Dec 2021, Aditya Mahajan via ntg-context wrote:
> > 
> > > Hi,
> > > 
> > > There is a typo in m-tikz.mkxl (possibly a carry-over from t-tikz.tex).
> > > The module ends with a spurious `\stopmodule`:
> > > 
> > > https://github.com/contextgarden/context-mirror/blob/fe714093ebb95e4a870282782e2124cff2e546e5/tex/context/modules/mkxl/m-tikz.mkxl#L113
> > > 
> > > (Or rather, the corresponding `\startmodule` is missing).
> > > [...]
> > > And since tikz is a latex module, in the true LaTeX spirit, the error goes
> > > away (for obvious reasons) if I move the \usemodule[tikz] to after the
> > > font definitions. It took quite a while to figure out what is happening.
> > 
> > Actually, the missing \startmodule is not a culprit for this error. Even
> > after fixing that, something goes wrong. Here is a minimal example:
> > 
> > \permanent\protected\def\starttikzinput
> >{\pushoverloadmode
> > \pushcatcodetable
> > \setcatcodetable\texcatcodes
> > \unprotect
> > \catcode`\@=11
> > \catcode`\|=12
> > \catcode`\!=12
> > \autoparagraphmode\zerocount}
> > 
> > \permanent\protected\def\stoptikzinput
> >{\autoparagraphmode\plusone
> > \protect
> > \popcatcodetable
> > \popoverloadmode}
> > 
> > \starttikzinput
> > \input t-pgf
> > \stoptikzinput
> > 
> > 
> > \usetypescriptfile[euler]
> > \definetypeface[mainfont][rm][serif][pagella][default]
> > \definetypeface[mainfont][mm][math] [pagellaovereuler][default]
> > \definetypeface[mainfont][tt][mono] [dejavu][default] [rscale=0.8,
> > features=none]
> > \setupbodyfont[mainfont,11pt]
> > 
> > \starttext
> > $\dfrac{1}{2}$
> > \stoptext
> > 
> > which gives the same error: parameter 'fractionrule' in style 2 is not set
> > 
> > Not sure what is happening here.
> 
> can you test with the \protect \unprotect removed from these definitions?

That fixes the issue, both in the test file and in my bigger document.

Thanks,
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] Typo in m-tikz

2021-12-13 Thread Hans Hagen via ntg-context

On 12/13/2021 7:19 PM, Aditya Mahajan via ntg-context wrote:

On Mon, 13 Dec 2021, Aditya Mahajan via ntg-context wrote:


Hi,

There is a typo in m-tikz.mkxl (possibly a carry-over from t-tikz.tex). The 
module ends with a spurious `\stopmodule`:

https://github.com/contextgarden/context-mirror/blob/fe714093ebb95e4a870282782e2124cff2e546e5/tex/context/modules/mkxl/m-tikz.mkxl#L113

(Or rather, the corresponding `\startmodule` is missing).
[...]
And since tikz is a latex module, in the true LaTeX spirit, the error goes away 
(for obvious reasons) if I move the \usemodule[tikz] to after the font 
definitions. It took quite a while to figure out what is happening.


Actually, the missing \startmodule is not a culprit for this error. Even after 
fixing that, something goes wrong. Here is a minimal example:

\permanent\protected\def\starttikzinput
   {\pushoverloadmode
\pushcatcodetable
\setcatcodetable\texcatcodes
\unprotect
\catcode`\@=11
\catcode`\|=12
\catcode`\!=12
\autoparagraphmode\zerocount}

\permanent\protected\def\stoptikzinput
   {\autoparagraphmode\plusone
\protect
\popcatcodetable
\popoverloadmode}

\starttikzinput
\input t-pgf
\stoptikzinput


\usetypescriptfile[euler]
\definetypeface[mainfont][rm][serif][pagella][default]
\definetypeface[mainfont][mm][math] [pagellaovereuler][default]
\definetypeface[mainfont][tt][mono] [dejavu][default] [rscale=0.8, 
features=none]
\setupbodyfont[mainfont,11pt]

\starttext
$\dfrac{1}{2}$
\stoptext

which gives the same error: parameter 'fractionrule' in style 2 is not set

Not sure what is happening here.


can you test with the \protect \unprotect removed from these definitions?



--

-
  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] Typo in m-tikz

2021-12-13 Thread Aditya Mahajan via ntg-context
On Mon, 13 Dec 2021, Aditya Mahajan via ntg-context wrote:

> Hi,
> 
> There is a typo in m-tikz.mkxl (possibly a carry-over from t-tikz.tex). The 
> module ends with a spurious `\stopmodule`:
> 
> https://github.com/contextgarden/context-mirror/blob/fe714093ebb95e4a870282782e2124cff2e546e5/tex/context/modules/mkxl/m-tikz.mkxl#L113
> 
> (Or rather, the corresponding `\startmodule` is missing). 
> [...]
> And since tikz is a latex module, in the true LaTeX spirit, the error goes 
> away (for obvious reasons) if I move the \usemodule[tikz] to after the font 
> definitions. It took quite a while to figure out what is happening.

Actually, the missing \startmodule is not a culprit for this error. Even after 
fixing that, something goes wrong. Here is a minimal example:

\permanent\protected\def\starttikzinput
  {\pushoverloadmode
   \pushcatcodetable
   \setcatcodetable\texcatcodes
   \unprotect
   \catcode`\@=11
   \catcode`\|=12
   \catcode`\!=12
   \autoparagraphmode\zerocount}

\permanent\protected\def\stoptikzinput
  {\autoparagraphmode\plusone
   \protect
   \popcatcodetable
   \popoverloadmode}

\starttikzinput
\input t-pgf
\stoptikzinput


\usetypescriptfile[euler]
\definetypeface[mainfont][rm][serif][pagella][default]
\definetypeface[mainfont][mm][math] [pagellaovereuler][default]
\definetypeface[mainfont][tt][mono] [dejavu][default] [rscale=0.8, 
features=none]
\setupbodyfont[mainfont,11pt]

\starttext
$\dfrac{1}{2}$
\stoptext

which gives the same error: parameter 'fractionrule' in style 2 is not set

Not sure what is happening here.

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
___


[NTG-context] Typo in m-tikz

2021-12-13 Thread Aditya Mahajan via ntg-context
Hi,

There is a typo in m-tikz.mkxl (possibly a carry-over from t-tikz.tex). The 
module ends with a spurious `\stopmodule`:

https://github.com/contextgarden/context-mirror/blob/fe714093ebb95e4a870282782e2124cff2e546e5/tex/context/modules/mkxl/m-tikz.mkxl#L113

(Or rather, the corresponding `\startmodule` is missing). 

This causes an interesting error message on the following test file:

\usemodule[tikz]

\usetypescriptfile[euler]
\definetypeface[mainfont][rm][serif][pagella][default]
\definetypeface[mainfont][mm][math] [pagellaovereuler][default]
\definetypeface[mainfont][tt][mono] [dejavu][default] [rscale=0.8, 
features=none]
\setupbodyfont[mainfont,11pt]

\starttext
$\dfrac{1}{2}$
\stoptext

which gives:

system  > module wrapping error in 'tikz'
close source> level 2, order 67, name 
'/opt/luametatex/texmf-context/tex/context/modules/mkxl/m-tikz.mkxl'
open source > level 2, order 68, name 
'/opt/luametatex/texmf-context/tex/context/fonts/mkiv/type-imp-euler.mkiv'
open source > level 3, order 69, name 
'/opt/luametatex/texmf-context/tex/context/fonts/mkiv/type-imp-texgyre.mkiv'
close source> level 3, order 69, name 
'/opt/luametatex/texmf-context/tex/context/fonts/mkiv/type-imp-texgyre.mkiv'
open source > level 3, order 70, name 
'/opt/luametatex/texmf-context/tex/context/fonts/mkiv/type-imp-dejavu.mkiv'
close source> level 3, order 70, name 
'/opt/luametatex/texmf-context/tex/context/fonts/mkiv/type-imp-dejavu.mkiv'
suggestion  > use \withcedilla instead of \c
suggestion  > use \withcaron instead of \v
close source> level 2, order 70, name 
'/opt/luametatex/texmf-context/tex/context/fonts/mkiv/type-imp-euler.mkiv'
open source > level 2, order 71, name 
'/opt/luametatex/texmf-context/tex/context/fonts/mkiv/type-imp-texgyre.mkiv'
close source> level 2, order 71, name 
'/opt/luametatex/texmf-context/tex/context/fonts/mkiv/type-imp-texgyre.mkiv'
fonts   > typescripts > unknown library 'pagellaovereuler'
open source > level 2, order 72, name 
'/opt/luametatex/texmf-context/tex/context/fonts/mkiv/type-imp-dejavu.mkiv'
close source> level 2, order 72, name 
'/opt/luametatex/texmf-context/tex/context/fonts/mkiv/type-imp-dejavu.mkiv'
fonts   > defining > font with asked name 'unknown' is not found using 
lookup 'file'
fonts   > defining > unable to define 'unknown' as 
'mainfont-11pt-rm-tf-0--0'
fonts   > defining > unable to define 'unknown' as 
'mainfont-11pt-mm-mr--3'
fonts   > defining > unable to define 'unknown' as 
'mainfont-11pt-mm-mr--2'
fonts   > defining > unable to define 'unknown' as 
'mainfont-11pt-mm-mr--1'
fonts   > defining > unable to define 'unknown' as 
'mainfont-11pt-mm-mb--3'
fonts   > defining > unable to define 'unknown' as 
'mainfont-11pt-mm-mb--2'
fonts   > defining > unable to define 'unknown' as 
'mainfont-11pt-mm-mb--1'
tex error   > tex error on line 10 in file ./test.tex: Math error: 
parameter 'fractionrule' in style 2 is not set

 
$\dfrac{1}{2}$

And since tikz is a latex module, in the true LaTeX spirit, the error goes away 
(for obvious reasons) if I move the \usemodule[tikz] to after the font 
definitions. It took quite a while to figure out what is happening.

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
___


[NTG-context] m-database module error since update

2021-12-05 Thread Jan-Erik Hägglöf via ntg-context
Since my update to LMTX 2021-12-03 the following error occured:

tex error   > tex error on line 41 in file 
/Users/jan-erikhagglof/context/context-osx-64/tex/texmf-context/tex/context/modules/mkiv/m-database.mkiv:
 Missing \endcsname inserted

 

   \endlocalcontrol 
 
   \c 
   !separator
 \mult_interfaces_get_parameters_item_okay 
   #1=#2,->\ifarguments \or \mult_interfaces_get_parameters_item_error \else 
\defcsname \m_mult_interfaces_namespace #1
   \endcsname {#2}\fi 
 \mult_interfaces_get_parameters_item 
   #*#1,->\ifarguments \else \mult_interfaces_get_parameters_item_okay #1,
   \ignorearguments \expandafter \mult_interfaces_get_parameters_item \fi 
 
   \c !separator={,},
\c !quotechar=, \c !commentchar=, \c !strip=\v !no, \c !before=, \c 
!after=, \c !first=, \c !last=, \c !left=, \c !right=
 \mult_interfaces_get_parameters_indeed 
   #1]->\mult_interfaces_get_parameters_item #1
   \ignorearguments \ignorearguments 
...

 


31   [\c!separator={,},
32\c!quotechar=,
33\c!commentchar=,
34\c!strip=\v!no,
35\c!before=,
36\c!after=,
37\c!first=,
38\c!last=,
39\c!left=,
40\c!right=]
41 >>  
42 % \let\currentdatabase\empty \the\everypresetdatabase % or just:
43 
44 \setupdatabase
45   [\c!separator={,}]
46 
47 \def\module_database_process#1#2#3%
48   {\edef\currentdatabasetype{#1}%
49\edef\currentdatabase{#2}%
50\edef\currentdatabasename{#3}%
51\ifx\currentdatabasename\empty
The control sequence marked  should not appear between \csname
and \endcsname.

I have an older version of LMTX 2021-08-10 on my laptop that works fine on same 
document.

Thanks in advance

Jan-Erik Hägglöf
___
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] m-ipsum broken

2021-01-24 Thread Hans Hagen

On 1/24/2021 2:10 AM, Jairo A. del Rio wrote:

Hi, list

Compiling m-ipsum yields an error in latest LMTX (2021.01.22 09:41)
not only the latest i think ... lua became more strict on escapes over 
time ... i'll update the interface


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
___


[NTG-context] m-ipsum broken

2021-01-23 Thread Jairo A. del Rio
Hi, list

Compiling m-ipsum yields an error in latest LMTX (2021.01.22 09:41)

Jairo
___
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] Fwd: Janus M. Nowacki

2020-06-15 Thread Henning Hraban Ramm
Quoted from: lilypond-u...@gnu.org

I just wanted to let you know that Janus Nowacki, one of the founders
of the TeX Gyre font suite, has recently died:
http://www.gust.org.pl/news/jmn-obit-en
And his personal website (in Polish): https://jmn.pl/

The TeX Gyre font project was started in 2006 to provide high-quality,
free-licensed replacements for existing URW fonts:
http://www.gust.org.pl/projects/e-foundry/tex-gyre/nfp11.pdf

___
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] Specifying the cell column: are \TD[n] and \TD[m] broken?

2017-02-19 Thread Akira Kakuto

(Context Standalone, ver. 2017.01.27, ver.
2017.02.19) and in context from TeX Live 2016 (ver. 2016.05.17) these
two examples give identical tables that differ from results on
the wiki page.


Confirmed.
ConTeXt mkii gives results on the wiki page.

Best,
Akira

___
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] Specifying the cell column: are \TD[n] and \TD[m] broken?

2017-02-19 Thread Vladimir Lomov
Hello,

on wiki page
[[http://wiki.contextgarden.net/TABLE#Specifying_the_cell_column]] there
are two examples (also I found them in tabl-ntb.mkiv) to "skip" empty
cells:

 8< -
\bTABLE[width=3em]
\bTR\bTD d1 \eTD\bTD[n=2] d2 \eTD\bTD[n=5] d5 \eTD\bTD[n=7] d7 \eTD\eTR
\bTR\bTD f1 \eTD\bTD[n=4] f4 \eTD\bTD[n=5] f5 \eTD\bTD[n=7] f7 \eTD\eTR
\eTABLE
 8< -

and

 8< -
\bTABLE[width=3em]
\bTR\bTD d1 \eTD\bTD[m=2] d2 \eTD\bTD[m=5] d5 \eTD\bTD[m=7] d7 \eTD\eTR
\bTR\bTD f1 \eTD\bTD[m=4] f4 \eTD\bTD[m=5] f5 \eTD\bTD[m=7] f7 \eTD\eTR
\eTABLE
 8< -

but in current context (Context Standalone, ver. 2017.01.27, ver.
2017.02.19) and in context from TeX Live 2016 (ver. 2016.05.17) these
two examples give identical tables that differ from results on the wiki
page.

P.S. I don't use this feature but find it very interesting and sometimes
useful.

---
WBR, Vladimir Lomov

-- 
Start every day off with a smile and get it over with.
-- W.C. Fields
___
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] Overfull boxes using m-cweb

2016-01-26 Thread Ibn Saeed
Hans Hagen  wxs.nl> writes:


> it may be a result of many unbreakable (key)words, so in that case try:
> 
> \setuptolerance[verytolerant,stretch]
> 
> Hans
> 


Thanks Hans, I was having some issue with overfull boxe in one paragraph, i
applied your command and it solved the issue.



___
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://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___

Re: [NTG-context] m-graph read data and plot

2015-08-21 Thread Hans Hagen

On 8/14/2015 4:39 AM, Alan BRASLAU wrote:

On Thu, 13 Aug 2015 22:31:23 +0200
Hans Hagen  wrote:


an apetizer:

\usemodule[graph]

\startluacode


No such juicy appetizers except for those who will be attending the
ConTeXt meeting!


ok, a temporary embargo on neat tricks then

Hans

-
  Hans Hagen | PRAGMA ADE
  Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
tel: 038 477 53 69 | voip: 087 875 68 74 | www.pragma-ade.com
 | 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://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___

Re: [NTG-context] m-graph read data and plot

2015-08-13 Thread Alan BRASLAU
On Thu, 13 Aug 2015 22:31:23 +0200
Hans Hagen  wrote:

> an apetizer:
> 
> \usemodule[graph]
> 
> \startluacode

No such juicy appetizers except for those who will be attending the
ConTeXt meeting!

Alan
___
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://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___

Re: [NTG-context] m-graph read data and plot

2015-08-13 Thread Hans Hagen

On 8/13/2015 9:37 PM, John Kitzmiller wrote:

On Aug 9, 2015, at 8:38 AM, Alan BRASLAU mailto:alan.bras...@cea.fr>> wrote:


One needs to think about closing the data file as ConTeXt opens a single
MP instance that is run throughout the entire document AND over its
multiple runs. If the file is left open, a second run will try to read
on from the point where it left off.

THIS IS A SUBTLE POINT THAT SHOULD BE NOTICED BY ALL MPLIB USERS!


Thank you for this insight Alan! Two results immediately helpful are:
1) data can be put at the top of the .tex file
2) autogrids can be rendered and then drawn over

The following may not be the best way, but it works to read data from
the top of the .tex file and then plot on the autogrid.

% 1 0.5 2.5
% 2 1 3.5

\usemodule[graph]
\startMPpage[instance=graph,offset=2mm]
   draw begingraph(3cm,5cm);
   numeric a[];
 gdata("read1.tex", v,
   setrange(0,0,3,4);
 );
 closefrom "read1.tex";

 autogrid(,grid.lft) withcolor .7white;

 gdata("read1.tex",v,
 for j = 1 upto 3:
 a[j] := scantokens v[j];
   endfor;
   path b;
   augment.b(a1,a2);
   augment.b(a1,a3);
   setrange(0,0,3,4);
   gdraw b;
 );
 closefrom "read1.tex";
   endgraph;
\stopMPpage


an apetizer:

\usemodule[graph]

\startluacode
local d = nil
function MP.set(data)
d = data
end
function MP.n()
mp.print(d and #d or 0)
end
function MP.get(i,j)
mp.print(d and d[i] and d[i][j] or 0)
end
\stopluacode

\startluacode
MP.set {
{ 1, 0.5, 2.5 },
{ 2, 1.0, 3.5 },
}
\stopluacode

\startMPpage[instance=graph,offset=2mm]
draw begingraph(3cm,5cm);
numeric a[];
for j = 1 upto MP.n() :
path b;
augment.b(MP.get(j,1),MP.get(j,2));
augment.b(MP.get(j,1),MP.get(j,3));
setrange(0,0,3,4);
gdraw b;
endfor ;
endgraph ;
\stopMPpage




-
  Hans Hagen | PRAGMA ADE
  Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
tel: 038 477 53 69 | voip: 087 875 68 74 | www.pragma-ade.com
 | 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://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___

Re: [NTG-context] m-graph read data and plot

2015-08-13 Thread Hans Hagen

On 8/13/2015 9:37 PM, John Kitzmiller wrote:

On Aug 9, 2015, at 8:38 AM, Alan BRASLAU mailto:alan.bras...@cea.fr>> wrote:


One needs to think about closing the data file as ConTeXt opens a single
MP instance that is run throughout the entire document AND over its
multiple runs. If the file is left open, a second run will try to read
on from the point where it left off.

THIS IS A SUBTLE POINT THAT SHOULD BE NOTICED BY ALL MPLIB USERS!


one can also start with:

graph_close_file := true ;

which will close files after drawing


Thank you for this insight Alan! Two results immediately helpful are:
1) data can be put at the top of the .tex file
2) autogrids can be rendered and then drawn over

The following may not be the best way, but it works to read data from
the top of the .tex file and then plot on the autogrid.

% 1 0.5 2.5
% 2 1 3.5

\usemodule[graph]
\startMPpage[instance=graph,offset=2mm]
   draw begingraph(3cm,5cm);
   numeric a[];
 gdata("read1.tex", v,
   setrange(0,0,3,4);
 );
 closefrom "read1.tex";

 autogrid(,grid.lft) withcolor .7white;

 gdata("read1.tex",v,
 for j = 1 upto 3:
 a[j] := scantokens v[j];
   endfor;
   path b;
   augment.b(a1,a2);
   augment.b(a1,a3);
   setrange(0,0,3,4);
   gdraw b;
 );
 closefrom "read1.tex";
   endgraph;
\stopMPpage




___
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://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___




--

-
  Hans Hagen | PRAGMA ADE
  Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
tel: 038 477 53 69 | voip: 087 875 68 74 | www.pragma-ade.com
 | 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://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___

Re: [NTG-context] m-graph read data and plot

2015-08-13 Thread John Kitzmiller
On Aug 9, 2015, at 8:38 AM, Alan BRASLAU  wrote:
> 
> One needs to think about closing the data file as ConTeXt opens a single
> MP instance that is run throughout the entire document AND over its
> multiple runs. If the file is left open, a second run will try to read
> on from the point where it left off.
> 
> THIS IS A SUBTLE POINT THAT SHOULD BE NOTICED BY ALL MPLIB USERS!

Thank you for this insight Alan! Two results immediately helpful are:
1) data can be put at the top of the .tex file
2) autogrids can be rendered and then drawn over

The following may not be the best way, but it works to read data from the top 
of the .tex file and then plot on the autogrid.

% 1 0.5 2.5
% 2 1 3.5

\usemodule[graph]
\startMPpage[instance=graph,offset=2mm]
  draw begingraph(3cm,5cm);
  numeric a[];
gdata("read1.tex", v,
  setrange(0,0,3,4);
);
closefrom "read1.tex";

autogrid(,grid.lft) withcolor .7white;

gdata("read1.tex",v,
for j = 1 upto 3:
a[j] := scantokens v[j];
  endfor;
  path b;
  augment.b(a1,a2);
  augment.b(a1,a3);
  setrange(0,0,3,4);
  gdraw b;
);
closefrom "read1.tex";
  endgraph;
\stopMPpage


___
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://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___

Re: [NTG-context] m-graph read data and plot

2015-08-09 Thread Alan BRASLAU
On Fri, 7 Aug 2015 13:00:47 -0400
John Kitzmiller  wrote:

> Thank you Alan. setrange is the key I had not tried and I will be
> more careful with (2).
> 
> This may not be the proper way to ask, but it is related to the
> topic: how to get Hobby’s Figure 9 from the mpgraph manual to work
> using m-graph?
> 
> http://ctan.org/tex-archive/systems/doc/metapost/source-manual
> <http://ctan.org/tex-archive/systems/doc/metapost/source-manual>
> 
> Thanks again,
> John

\usemodule [graph]

\startMPpage [instance=graph]

draw begingraph(3in,2in);
  glabel.lft(btex \vbox{\hbox{Quadrillions}\hbox{of BTU}} etex, OUT);
  path p[];
  numeric t;
  gdata("energy.d", $,
t:=0; augment.p1($1,0);
for j=2 upto 5:
t:=t+scantokens $[j]; augment.p[j]($1,t);
endfor)
  picture lab[];
  lab2=btex coal etex; lab3=btex crude oil etex;
  lab4=btex natural gas etex; lab5=btex hydroelectric etex;
  for j=5 downto 2:
  gfill p[j]--reverse p[j-1]--cycle withcolor .16j*white;
  glabel.lft(image(unfill bbox lab[j]; draw lab[j]), .7+length p[j]);
  endfor
endgraph;
closefrom "energy.d" ;

\stopMPpage



One needs to think about closing the data file as ConTeXt opens a single
MP instance that is run throughout the entire document AND over its
multiple runs. If the file is left open, a second run will try to read
on from the point where it left off.

THIS IS A SUBTLE POINT THAT SHOULD BE NOTICED BY ALL MPLIB USERS!

Alan
-- 
Alan Braslau
CEA DSM-IRAMIS-SPEC
CNRS UMR 3680
Orme des Merisiers
91191 Gif-sur-Yvette cedex FRANCE
tel: +33 1 69 08 73 15
fax: +33 1 69 08 87 86
mailto:alan.bras...@cea.fr
___
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://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___

Re: [NTG-context] m-graph read data and plot

2015-08-07 Thread John Kitzmiller
Thank you Alan. setrange is the key I had not tried and I will be more careful 
with (2).

This may not be the proper way to ask, but it is related to the topic: how to 
get Hobby’s Figure 9 from the mpgraph manual to work using m-graph?

http://ctan.org/tex-archive/systems/doc/metapost/source-manual 
<http://ctan.org/tex-archive/systems/doc/metapost/source-manual>

Thanks again,
John


On Aug 7, 2015, at 6:23 AM, Alan BRASLAU  wrote:
> 
> You have two problems:
> 
> 1) gdraw (4,1)--(7,1);
> has a unique ordinate, so graph will fail in this case if you do not
> explicitly set the range.
> 
> 2) You have to take care with your choice of loop variables in MP not
> to run into conflicts those eventually used in macros. Also, as Hans
> indicated, you do need to declare that a is an array, as in
>   numeric a[];
> 
> Here is a MWE
> 
> \enabletrackers[metapost.showlog]
> \usemodule[graph]
> \startMPpage[instance=graph,offset=3mm]
>  draw begingraph(5cm,5cm);
>numeric a[];
>gdata("data.d", v,
>  for j=1 upto 3:
>a[j]:=scantokens v[j];
>  endfor ;
>  );
> 
>setrange (whatever,0,whatever,2);
>gdraw (a2,a1)--(a3,a1);
>  endgraph;
> \stopMPpage
> 
> 
> Alan
> 
> 
> On Thu, 6 Aug 2015 16:48:51 -0400
> John Kitzmiller mailto:k...@inradius.net>> wrote:
> 
>> On Aug 6, 2015, at 12:59 PM, Hans Hagen mailto:pra...@wxs.nl>
>> <mailto:pra...@wxs.nl <mailto:pra...@wxs.nl>>> wrote:
>>> 
>>> On 8/6/2015 5:30 PM, John Kitzmiller wrote:
>>>> Given a file, data.d, containing 1 4 7
>>>> 
>>>> I expected the following code to draw a line from (4,1) to (7,1)…
>>>> 
>>>> 
>>>> \enabletrackers[metapost.showlog]
>>>> \usemodule[m-graph]
>>>> \startMPpage[instance=graph,offset=3mm]
>>>>  draw begingraph(5cm,5cm);
>>>>gdata("data.d", v,
>>>>  for n = 1 upto 3:
>>>> a[n] = scantokens v[n];
>>>>  endfor;
>>>> 
>>>>  show a1; show a2; show a3; % numeric
>>>>  show v1; show v2; show v3; % string
>>>>  gdraw (a2,a1)—(a3,a1); % same problem in or out of data group
>>>>  );
>>>>  endgraph;
>>>> \stopMPpage
>>>> 
>>>> …the show lines return what I expected, but then come the
>>>> complaints:
>>>> 
>>>> ! Inconsistent equation (off by 0.90002)…
>>>>>> (0,0,1,0,0,yypart S)
>>>> ! Transform components aren't all known…
>>>> 
>>> 
>>>> a[n] = scantokens v[n];
>>> 
>>> is a defined?
>> 
>> Thank you Hans. Do you mean numeric a[n]? It was not explicitly
>> declared; I did not think it needed to be—the show commands write
>> what I expect to the log—anyway, declaring a did not help.
>> 
>>> 
>>> also, use
>>> 
>>> a[n] := scantokens v[n] ;
>> 
>> Done. Still the same error messages and no pdf.
>> 
>>> 
>>> 
>>> 
>>>> My goal is to draw multiple box plots
>>>> https://en.wikipedia.org/wiki/Box_plot 
>>>> <https://en.wikipedia.org/wiki/Box_plot>
>>>> <https://en.wikipedia.org/wiki/Box_plot 
>>>> <https://en.wikipedia.org/wiki/Box_plot>>, either vertical or
>>>> horizontal, from data sets, but I am stuck at this early stage.
>> 
> 

___
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://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___

Re: [NTG-context] m-graph read data and plot

2015-08-07 Thread Alan BRASLAU
You have two problems:

1) gdraw (4,1)--(7,1);
has a unique ordinate, so graph will fail in this case if you do not
explicitly set the range.

2) You have to take care with your choice of loop variables in MP not
to run into conflicts those eventually used in macros. Also, as Hans
indicated, you do need to declare that a is an array, as in
numeric a[];

Here is a MWE

\enabletrackers[metapost.showlog]
\usemodule[graph]
\startMPpage[instance=graph,offset=3mm]
  draw begingraph(5cm,5cm);
numeric a[];
gdata("data.d", v,
  for j=1 upto 3:
a[j]:=scantokens v[j];
  endfor ;
  );

setrange (whatever,0,whatever,2);
gdraw (a2,a1)--(a3,a1);
  endgraph;
\stopMPpage


Alan


On Thu, 6 Aug 2015 16:48:51 -0400
John Kitzmiller  wrote:

> On Aug 6, 2015, at 12:59 PM, Hans Hagen  <mailto:pra...@wxs.nl>> wrote:
> > 
> > On 8/6/2015 5:30 PM, John Kitzmiller wrote:
> >> Given a file, data.d, containing 1 4 7
> >> 
> >> I expected the following code to draw a line from (4,1) to (7,1)…
> >> 
> >> 
> >> \enabletrackers[metapost.showlog]
> >> \usemodule[m-graph]
> >> \startMPpage[instance=graph,offset=3mm]
> >>   draw begingraph(5cm,5cm);
> >> gdata("data.d", v,
> >>   for n = 1 upto 3:
> >> a[n] = scantokens v[n];
> >>   endfor;
> >> 
> >>   show a1; show a2; show a3; % numeric
> >>   show v1; show v2; show v3; % string
> >>   gdraw (a2,a1)—(a3,a1); % same problem in or out of data group
> >>   );
> >>   endgraph;
> >> \stopMPpage
> >> 
> >> …the show lines return what I expected, but then come the
> >> complaints:
> >> 
> >> ! Inconsistent equation (off by 0.90002)…
> >>>> (0,0,1,0,0,yypart S)
> >> ! Transform components aren't all known…
> >> 
> > 
> >> a[n] = scantokens v[n];
> > 
> > is a defined?
> 
> Thank you Hans. Do you mean numeric a[n]? It was not explicitly
> declared; I did not think it needed to be—the show commands write
> what I expect to the log—anyway, declaring a did not help.
> 
> > 
> > also, use
> > 
> > a[n] := scantokens v[n] ;
> 
> Done. Still the same error messages and no pdf.
> 
> > 
> > 
> > 
> >> My goal is to draw multiple box plots
> >> https://en.wikipedia.org/wiki/Box_plot
> >> <https://en.wikipedia.org/wiki/Box_plot>, either vertical or
> >> horizontal, from data sets, but I am stuck at this early stage.
> 



-- 
Alan Braslau
CEA DSM-IRAMIS-SPEC
CNRS UMR 3680
Orme des Merisiers
91191 Gif-sur-Yvette cedex FRANCE
tel: +33 1 69 08 73 15
fax: +33 1 69 08 87 86
mailto:alan.bras...@cea.fr
___
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://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___

Re: [NTG-context] m-graph read data and plot

2015-08-06 Thread John Kitzmiller
On Aug 6, 2015, at 12:59 PM, Hans Hagen mailto:pra...@wxs.nl>> 
wrote:
> 
> On 8/6/2015 5:30 PM, John Kitzmiller wrote:
>> Given a file, data.d, containing 1 4 7
>> 
>> I expected the following code to draw a line from (4,1) to (7,1)…
>> 
>> 
>> \enabletrackers[metapost.showlog]
>> \usemodule[m-graph]
>> \startMPpage[instance=graph,offset=3mm]
>>   draw begingraph(5cm,5cm);
>> gdata("data.d", v,
>>   for n = 1 upto 3:
>> a[n] = scantokens v[n];
>>   endfor;
>> 
>>   show a1; show a2; show a3; % numeric
>>   show v1; show v2; show v3; % string
>>   gdraw (a2,a1)—(a3,a1); % same problem in or out of data group
>>   );
>>   endgraph;
>> \stopMPpage
>> 
>> …the show lines return what I expected, but then come the complaints:
>> 
>> ! Inconsistent equation (off by 0.90002)…
>>>> (0,0,1,0,0,yypart S)
>> ! Transform components aren't all known…
>> 
> 
>> a[n] = scantokens v[n];
> 
> is a defined?

Thank you Hans. Do you mean numeric a[n]? It was not explicitly declared; I did 
not think it needed to be—the show commands write what I expect to the 
log—anyway, declaring a did not help.

> 
> also, use
> 
> a[n] := scantokens v[n] ;

Done. Still the same error messages and no pdf.

> 
> 
> 
>> My goal is to draw multiple box plots
>> https://en.wikipedia.org/wiki/Box_plot 
>> <https://en.wikipedia.org/wiki/Box_plot>, either vertical or horizontal,
>> from data sets, but I am stuck at this early stage.

___
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://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___

Re: [NTG-context] m-graph read data and plot

2015-08-06 Thread Hans Hagen

On 8/6/2015 5:30 PM, John Kitzmiller wrote:

Given a file, data.d, containing 1 4 7

I expected the following code to draw a line from (4,1) to (7,1)…


\enabletrackers[metapost.showlog]
\usemodule[m-graph]
\startMPpage[instance=graph,offset=3mm]
   draw begingraph(5cm,5cm);
 gdata("data.d", v,
   for n = 1 upto 3:
a[n] = scantokens v[n];
   endfor;

   show a1; show a2; show a3; % numeric
   show v1; show v2; show v3; % string
   gdraw (a2,a1)—(a3,a1); % same problem in or out of data group
   );
   endgraph;
\stopMPpage

…the show lines return what I expected, but then come the complaints:

! Inconsistent equation (off by 0.90002)…
 >> (0,0,1,0,0,yypart S)
! Transform components aren't all known…



> a[n] = scantokens v[n];

is a defined?

also, use

a[n] := scantokens v[n] ;




My goal is to draw multiple box plots
https://en.wikipedia.org/wiki/Box_plot, either vertical or horizontal,
from data sets, but I am stuck at this early stage.



___
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://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___




--

-
  Hans Hagen | PRAGMA ADE
  Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
tel: 038 477 53 69 | voip: 087 875 68 74 | www.pragma-ade.com
 | 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://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___

[NTG-context] m-graph read data and plot

2015-08-06 Thread John Kitzmiller
Given a file, data.d, containing 1 4 7

I expected the following code to draw a line from (4,1) to (7,1)…


\enabletrackers[metapost.showlog]
\usemodule[m-graph]
\startMPpage[instance=graph,offset=3mm]
  draw begingraph(5cm,5cm);
gdata("data.d", v,
  for n = 1 upto 3:
a[n] = scantokens v[n];
  endfor;

  show a1; show a2; show a3; % numeric
  show v1; show v2; show v3; % string
  
  gdraw (a2,a1)—(a3,a1); % same problem in or out of data group
  );
  endgraph;
\stopMPpage

…the show lines return what I expected, but then come the complaints:

! Inconsistent equation (off by 0.90002)…
>> (0,0,1,0,0,yypart S)
! Transform components aren't all known…


My goal is to draw multiple box plots https://en.wikipedia.org/wiki/Box_plot 
<https://en.wikipedia.org/wiki/Box_plot>, either vertical or horizontal, from 
data sets, but I am stuck at this early stage. 

___
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://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___

[NTG-context] m-steps on mkiv

2014-01-28 Thread DesdeChaves
Some features of m-steps does not work in mkiv.
For example, I can not change colors and the shapes (first example), add
steps from the cell (n) to the cell (n+m, m=2,3,4...) and reverse steps.


\usemodule[steps,mathml]



\starttext
\startSTEPtable
\setupSTEPcells [alternative=5, framecolor=red]
\setupSTEPtexts [framecolor=green]
\setupSTEPlines [alternative=5]
\cell {initial concentration,  $C_i$}
\text {$\div C_f$, final concentration}
\cell {diluation factor, $f$}
\text {inverse}
\cell {$\frac{1}{f}$}
\text {$\times V_f$, volume of the volumetric flask}
\cell {pipette volume, $V_p$}
\stopSTEPtable


>From the manual:


\startSTEPchart
\cell {A}
\cell {one} \texts{}{+2} \texts{}{+3}
\cell {two}
\cell {three} \texts{+4}{} \texts{+5}{}
\cell {four}
\cell {five}
\stopSTEPchart


\stoptext


Jorge
___
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://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___

[NTG-context] Using input maps for ITRANS to devanagari with context m-iv

2013-12-23 Thread Shree Devi Kumar
Hello All,

Xetex allows the use of input maps such as xetex-itrans for taking input in
ITRANS transliteration and converting to devanagari .

xetex-itrans package is at
   http://tug.ctan.org/tex-archive/macros/xetex/generic/itrans/
.  Information is at
   http://tug.ctan.org/pkg/xetex-itrans

I am planning to use context-m-iv for some Sanskrit documents.

Is it possible to use the input maps with Context m-iv ?

Thanks,
Shree Devi
___
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://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___

Re: [NTG-context] Devanagari in Siddhanta font with Context m-iv

2013-12-11 Thread Shree Devi Kumar
Aditya,

sarvaartha should have the r maatraa on top of va - in case of siddhanta
font when used in ConText the maatraa is not coming instead a dot seems
visible halfway on va (I am assuming that you can read devanagari) - when
you compare with Chandas the maatraa is  clearly visible. so
सर्वार्थ is looking like सवार्थ with a dot on वा

It may be a question of correctly stacking the components for building the
vertically stacked glyph (I do not know much about font design and
rendering - this is just a guess).

Shree Devi Kumar

भजन - कीर्तन - आरती @ http://bhajans.ramparivar.com


On Thu, Dec 12, 2013 at 3:44 AM, Aditya Mahajan  wrote:

> On Tue, 10 Dec 2013, Shree Devi Kumar wrote:
>
>  ​Thanks for your reply.
>>
>>
>> I am using a goodies file for coloring the accents.
>> I am attaching that as well as a MWE tex file and resulting pdf.
>>
>> Chandas is not fully unicode compliant for some of the accents which
>> are encoded in PUA,
>>
>> hence I would like to use Siddhanta which I understand is a completely
>> redesigned version
>> of Chandas fully compartible with Vedic Unicode
>>
>>
>> Fonts are available from:
>> Siddhanta: http://svayambhava.org/index.php/en/fonts
>> Chandas: http://www.sanskritweb.net/cakram/
>>
>
> Can you explain what is wrong in the output?
>
> 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://tex.aanhet.net
> archive  : http://foundry.supelec.fr/projects/contextrev/
> 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://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___

Re: [NTG-context] Devanagari in Siddhanta font with Context m-iv

2013-12-11 Thread Aditya Mahajan

On Tue, 10 Dec 2013, Shree Devi Kumar wrote:


​Thanks for your reply.


I am using a goodies file for coloring the accents.
I am attaching that as well as a MWE tex file and resulting pdf.

Chandas is not fully unicode compliant for some of the accents which
are encoded in PUA,

hence I would like to use Siddhanta which I understand is a completely
redesigned version
of Chandas fully compartible with Vedic Unicode


Fonts are available from:
Siddhanta: http://svayambhava.org/index.php/en/fonts
Chandas: http://www.sanskritweb.net/cakram/


Can you explain what is wrong in the output?

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://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___

Re: [NTG-context] Devanagari in Siddhanta font with Context m-iv

2013-12-09 Thread Wolfgang Schuster

Am 07.12.2013 um 15:21 schrieb Shree Devi Kumar :

> ​I am converting some ITRANS documents with vedic accents to devanagari pdf 
> files using Context. I tried both Chandas and Siddhanta fonts with it, I 
> would prefer to use Siddhanta but in some cases the display is not coming 
> correctly. 
> 
> eg. स॒र्वार्थ॑ in
> स॒र्व॒म॒ङ्ग॒लमा॒ङ्गल्ये॑ शि॒वे स॒र्वार्थ॑ साधिके।
> शर॑ण्ये त्र्यम्ब॑के दे॒वि॒ ना॒राय॑णि न॒मोऽस्तु॑ ते॥
> 
> does not display correctly when using Siddhanta font but it display correctly 
> in Chandas.​
> 
> ​Please let me know if you need more details.

Make a minimal example and provide links for the fonts (if possible).

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://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___

[NTG-context] Devanagari in Siddhanta font with Context m-iv

2013-12-09 Thread Shree Devi Kumar
​I am converting some ITRANS documents with vedic accents to devanagari pdf
files using Context. I tried both Chandas and Siddhanta fonts with it, I
would prefer to use Siddhanta but in some cases the display is not coming
correctly.

eg. स॒र्वार्थ॑ in
स॒र्व॒म॒ङ्ग॒लमा॒ङ्गल्ये॑ शि॒वे स॒र्वार्थ॑ साधिके।
शर॑ण्ये त्र्यम्ब॑के दे॒वि॒ ना॒राय॑णि न॒मोऽस्तु॑ ते॥

does not display correctly when using Siddhanta font but it display
correctly in Chandas.​


​Please let me know if you need more details.

Thanks,
Shree​
___
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://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___

Re: [NTG-context] bar graphs, m-graph, sarith

2013-07-08 Thread John Kitzmiller
Thank you Alan. That was exactly the redirection needed.

John

On Jul 7, 2013, at 9:24 AM, Alan BRASLAU wrote:

> Metapost now has double precision arithmetic, so one no longer needs to
> use the string arithmetic macros. However, it may be necessary to use
> scantokens as in
> 
> clearxy;
> z = (scantokens v1, scantokens v2);
> augment.p(x,0);
> augment.p(x,y);
> x := x + 0.4 ;
> augment.p(x,y);
> augment.p(x,0);
> 
> 
> Alan
> 
> 
> On Sat, 6 Jul 2013 22:01:06 -0400
> John Kitzmiller  wrote:
> 
>> When trying to make a bar graph with m-graph.mkiv and sarith, the
>> command Ssub (string subtract) seems to augment.p(v1 Sadd
>> "0.4",v2);Sadd instead. An mwe of a bar graph:
>> 
>> (data1 is a separate file containing
>>  01 02
>>  02 03)
>> 
>> \usemodule[m-graph]
>> \startMPpage[instance=graph]
>> input sarith;
>> draw begingraph(5cm,5cm);
>> gdata("data1", v,
>>  path p;
>>  augment.p(v1,0);
>>  augment.p(v1,v2)
>>  augment.p(v1 Sadd "0.4",v2);
>>  augment.p(v1 Sadd "0.4",0);
>>  gfill p--cycle withcolor .8white;
>>  gdraw p--cycle;
>>  );
>> endgraph;
>> \stopMPpage
>> 
>> ...which gives bars of width 0.4 starting at abscissa 1 and 2 as
>> expected. To increase the width of the bars to 0.8 and have them
>> centered over 1 and 2, I expect to Ssub from the first two augments:
>> 
>> \usemodule[m-graph]
>> \startMPpage[instance=graph]
>> input sarith;
>> draw begingraph(5cm,5cm);
>> gdata("data1", v,
>>  path p;
>>  augment.p(v1 Ssub "0.4",0);
>>  augment.p(v1 Ssub "0.4",v2);
>>  augment.p(v1 Sadd "0.4",v2);
>>  augment.p(v1 Sadd "0.4",0);
>>  gfill p--cycle withcolor .8white;
>>  gdraw p--cycle;
>>  );
>> endgraph;
>> \stopMPpage
>> 
>> However, the Ssub adds instead and gives a line at 1.4 and 2.4.
>> 
>> Compiling the above with mpost or mptopdf gives the desired
>> result(s), but I am curious if this can be resolved so such bar
>> graphs could be made within ConTeXT/METAFUN.
>> 
>> Thanks! John

___
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://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___


Re: [NTG-context] bar graphs, m-graph, sarith

2013-07-07 Thread Alan BRASLAU
Metapost now has double precision arithmetic, so one no longer needs to
use the string arithmetic macros. However, it may be necessary to use
scantokens as in

clearxy;
z = (scantokens v1, scantokens v2);
augment.p(x,0);
augment.p(x,y);
x := x + 0.4 ;
augment.p(x,y);
augment.p(x,0);


Alan


On Sat, 6 Jul 2013 22:01:06 -0400
John Kitzmiller  wrote:

> When trying to make a bar graph with m-graph.mkiv and sarith, the
> command Ssub (string subtract) seems to augment.p(v1 Sadd
> "0.4",v2);Sadd instead. An mwe of a bar graph:
> 
>  (data1 is a separate file containing
>   01 02
>   02 03)
> 
> \usemodule[m-graph]
> \startMPpage[instance=graph]
> input sarith;
> draw begingraph(5cm,5cm);
>  gdata("data1", v,
>   path p;
>   augment.p(v1,0);
>   augment.p(v1,v2)
>   augment.p(v1 Sadd "0.4",v2);
>   augment.p(v1 Sadd "0.4",0);
>   gfill p--cycle withcolor .8white;
>   gdraw p--cycle;
>   );
> endgraph;
> \stopMPpage
> 
> ...which gives bars of width 0.4 starting at abscissa 1 and 2 as
> expected. To increase the width of the bars to 0.8 and have them
> centered over 1 and 2, I expect to Ssub from the first two augments:
> 
> \usemodule[m-graph]
> \startMPpage[instance=graph]
> input sarith;
> draw begingraph(5cm,5cm);
>  gdata("data1", v,
>   path p;
>   augment.p(v1 Ssub "0.4",0);
>   augment.p(v1 Ssub "0.4",v2);
>   augment.p(v1 Sadd "0.4",v2);
>   augment.p(v1 Sadd "0.4",0);
>   gfill p--cycle withcolor .8white;
>   gdraw p--cycle;
>   );
> endgraph;
> \stopMPpage
> 
> However, the Ssub adds instead and gives a line at 1.4 and 2.4.
> 
> Compiling the above with mpost or mptopdf gives the desired
> result(s), but I am curious if this can be resolved so such bar
> graphs could be made within ConTeXT/METAFUN.
> 
> Thanks! John
___
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://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___


[NTG-context] bar graphs, m-graph, sarith

2013-07-06 Thread John Kitzmiller
When trying to make a bar graph with m-graph.mkiv and sarith, the command Ssub 
(string subtract) seems to Sadd instead. An mwe of a bar graph:

 (data1 is a separate file containing
  01 02
  02 03)

\usemodule[m-graph]
\startMPpage[instance=graph]
input sarith;
draw begingraph(5cm,5cm);
 gdata("data1", v,
  path p;
  augment.p(v1,0);
  augment.p(v1,v2)
  augment.p(v1 Sadd "0.4",v2);
  augment.p(v1 Sadd "0.4",0);
  gfill p--cycle withcolor .8white;
  gdraw p--cycle;
  );
endgraph;
\stopMPpage

...which gives bars of width 0.4 starting at abscissa 1 and 2 as expected. To 
increase the width of the bars to 0.8 and have them centered over 1 and 2, I 
expect to Ssub from the first two augments:

\usemodule[m-graph]
\startMPpage[instance=graph]
input sarith;
draw begingraph(5cm,5cm);
 gdata("data1", v,
  path p;
  augment.p(v1 Ssub "0.4",0);
  augment.p(v1 Ssub "0.4",v2);
  augment.p(v1 Sadd "0.4",v2);
  augment.p(v1 Sadd "0.4",0);
  gfill p--cycle withcolor .8white;
  gdraw p--cycle;
  );
endgraph;
\stopMPpage

However, the Ssub adds instead and gives a line at 1.4 and 2.4.

Compiling the above with mpost or mptopdf gives the desired result(s), but I am 
curious if this can be resolved so such bar graphs could be made within 
ConTeXT/METAFUN.

Thanks! John



___
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://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___


Re: [NTG-context] "Hiding" columns in m-database & TABLE

2012-11-23 Thread Hans Hagen

On 11/23/2012 1:38 PM, Philipp Gesang wrote:


although csv is not a standard per se there is nevertheless an
rfc: . Can we have an
optional rfc-compliant parser as well? That entails interpreting
the first line as field header if it consists entirely of
unquoted fields -- neat feature as one can treat these as column
identifiers to query fields in a more natural fashion.


i patched your version a bit:

local mycsvsplitter = utilities.parsers.rfc4180splitter()

local crap = [[
first,second,third,fourth
"1","2","3","4"
"a","b","c","d"
"foo","bar""baz","boogie","xyzzy"
]]

-- local list, names = mycsvsplitter(crap,true)
-- local list  = mycsvsplitter(crap)

the flag tells to return a header

Hans

-
  Hans Hagen | PRAGMA ADE
  Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
tel: 038 477 53 69 | voip: 087 875 68 74 | www.pragma-ade.com
 | 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://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___


Re: [NTG-context] "Hiding" columns in m-database & TABLE

2012-11-23 Thread Philipp Gesang
·

> On 11/22/2012 3:36 PM, Marcin Borkowski wrote:
> >Dnia 2012-11-22, o godz. 13:26:52
> >Mojca Miklavec  napisał(a):
> >
> >>On Thu, Nov 22, 2012 at 12:57 PM, Marcin Borkowski wrote:
> >>>le) in order to
> >>>typeset a (nice) TABLE. However, I have a few columns I'd like to
> >>>omit.  I can (of course) hand-edit the csv file; but is there a way
> >>>to do it automatically?  Something like
> >>>
> >>>\setupTABLE[column][3,4,5][kill]
> >>>
> >>>I did [empty=yes,width=0pt] in place of [kill], and it worked, but
> >>>it seems like a hack (and I don't know whether it does actually
> >>>process the cells I'm omitting - which in my case wouldn't bother
> >>>me, but might be an additional layer of inelegance;)).  And better
> >>>ideas?
> >>
> >>If you have up to 9 columns, you could use
> >>
> >> \def\ProcessingLine#1#2#3#4#5#6#7{%
> >> \bTR\bTD#1\eTD\bTD#2\eTD\bTD#6\eTD\bTD#7\eTD}
> >>
> >>and then [command=\ProcessingLine]
> >
> >Well, something like 20 columns (on A4 landscape). ;)
> >
> >It turns out that my method somehow doesn't work well without setting
> >also height=0pt; then it's fine, but I'm still wondering about a
> >cleaner way.
> 
> I've added a splutter to the core:
> 
> \startluacode
> 
> local mycsvsplitter = utilities.parsers.csvsplitter {
> separator = ",",
> quote = '"',
> }
> 
> local crap = [[
> "1","2","3","4"
> "a","b","c","d"
> ]]
> 
> local mycrap = mycsvsplitter(crap)
> 
> context.bTABLE()
> for i=1,#mycrap do
> context.bTR()
> local c = mycrap[i]
> for i=1,#c do
> context.bTD()
> context(c[i])
> context.eTD()
> end
> context.eTR()
> end
> context.eTABLE()
> 
> \stopluacode

Hi Hans,

although csv is not a standard per se there is nevertheless an
rfc: . Can we have an
optional rfc-compliant parser as well? That entails interpreting
the first line as field header if it consists entirely of
unquoted fields -- neat feature as one can treat these as column
identifiers to query fields in a more natural fashion.

·

\starttext
\startluacode

local P, R, V, S, C, Ct, Cs, Carg, Cc, Cg, Cf = lpeg.P, lpeg.R, lpeg.V, lpeg.S, 
lpeg.C, lpeg.Ct, lpeg.Cs, lpeg.Carg, lpeg.Cc, lpeg.Cg, lpeg.Cf

local lpegmatch = lpeg.match
local patterns = lpeg.patterns
local newline  = patterns.newline

---
--RFC 4180 csv parser
---

-- based on http://tools.ietf.org/html/rfc4180
-- notable deviations from the RFC grammar:
--   · allow overriding “comma” and “quote” chars in spec
--   · the “textdata” rule is extrapolated to mean, basically,
-- “everything but the quote character”, not just the character
-- range as in the RFC
--   · newline from l-lpeg.lua instead of “crlf”

local rfc4180_spec = { separator = ",", quote = [["]] }

utilities.parsers.rfc4180_splitter = function (specification)
specification = specification or rfc4180_spec
local separator   = specification.separator --> rfc: COMMA
local quotechar   = P(specification.quote)  -->  DQUOTE
local dquotechar  = quotechar * quotechar   -->  2DQUOTE
  / specification.quote

local separator   = S(separator ~= "" and separator or ",")
local escaped = quotechar
  * Cs((dquotechar + (1 - quotechar))^0)
  * quotechar
local non_escaped = C((1 - quotechar - newline - separator)^1)
local field   = escaped + non_escaped
local record  = Ct(field * (separator * field)^0)
local name= field -- sic!
local header  = Cg(Ct(name * (separator * name)^0), "header")
local file= Ct((header * newline)^-1 -- optional header
 * record
 * (newline * record)^0
 * newline^0)
return function (data) return lpegmatch (file, data) end
end

---
--  example writer (natural table)
---

local print_csv_table = function (tab)
  local header = tab.header
  context.setupTABLE({ frame = "off" })
  context.setupTABLE({"header"}, { background  = "screen" })
  context.bTABLE()
if header then
  context.bTABLEhead()
  context.bTR()
  for i=1,#header do
context.bTH()
context(header[i])
context.eTH()
  end
  context.eTR()
  context.eTABLEhead()
end
context.bTABLEbody()
for i=1,#tab do
  context.bTR()
  local c = tab[i]
  for i=1,#c do
context.bTD()
context(c[i])
context.eTD()
  end
  context.eTR()
end
context.eTABLEbody()
  context.eTAB

Re: [NTG-context] "Hiding" columns in m-database & TABLE

2012-11-22 Thread Hans Hagen

On 11/22/2012 3:36 PM, Marcin Borkowski wrote:

Dnia 2012-11-22, o godz. 13:26:52
Mojca Miklavec  napisał(a):


On Thu, Nov 22, 2012 at 12:57 PM, Marcin Borkowski wrote:

le) in order to
typeset a (nice) TABLE. However, I have a few columns I'd like to
omit.  I can (of course) hand-edit the csv file; but is there a way
to do it automatically?  Something like

\setupTABLE[column][3,4,5][kill]

I did [empty=yes,width=0pt] in place of [kill], and it worked, but
it seems like a hack (and I don't know whether it does actually
process the cells I'm omitting - which in my case wouldn't bother
me, but might be an additional layer of inelegance;)).  And better
ideas?


If you have up to 9 columns, you could use

 \def\ProcessingLine#1#2#3#4#5#6#7{%
 \bTR\bTD#1\eTD\bTD#2\eTD\bTD#6\eTD\bTD#7\eTD}

and then [command=\ProcessingLine]


Well, something like 20 columns (on A4 landscape). ;)

It turns out that my method somehow doesn't work well without setting
also height=0pt; then it's fine, but I'm still wondering about a
cleaner way.


I've added a splutter to the core:

\startluacode

local mycsvsplitter = utilities.parsers.csvsplitter {
separator = ",",
quote = '"',
}

local crap = [[
"1","2","3","4"
"a","b","c","d"
]]

local mycrap = mycsvsplitter(crap)

context.bTABLE()
for i=1,#mycrap do
context.bTR()
local c = mycrap[i]
for i=1,#c do
context.bTD()
context(c[i])
context.eTD()
end
context.eTR()
end
context.eTABLE()

\stopluacode

-
  Hans Hagen | PRAGMA ADE
  Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
tel: 038 477 53 69 | voip: 087 875 68 74 | www.pragma-ade.com
 | 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://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___

Re: [NTG-context] "Hiding" columns in m-database & TABLE

2012-11-22 Thread Alan BRASLAU
For example, easily such files are easily manipulated using awk.

awk "{print $1,$2,$3,$5,$7}" data.csv > interesting.csv

and this can be used in a pipeline...

Alan


On Thu, 22 Nov 2012 15:36:45 +0100
Marcin Borkowski  wrote:

> Dnia 2012-11-22, o godz. 13:26:52
> Mojca Miklavec  napisał(a):
> 
> > On Thu, Nov 22, 2012 at 12:57 PM, Marcin Borkowski wrote:
> > > le) in order to
> > > typeset a (nice) TABLE. However, I have a few columns I'd like to
> > > omit.  I can (of course) hand-edit the csv file; but is there a way
> > > to do it automatically?  Something like
> > >
> > > \setupTABLE[column][3,4,5][kill]
> > >
> > > I did [empty=yes,width=0pt] in place of [kill], and it worked, but
> > > it seems like a hack (and I don't know whether it does actually
> > > process the cells I'm omitting - which in my case wouldn't bother
> > > me, but might be an additional layer of inelegance;)).  And better
> > > ideas?
> > 
> > If you have up to 9 columns, you could use
> > 
> > \def\ProcessingLine#1#2#3#4#5#6#7{%
> > \bTR\bTD#1\eTD\bTD#2\eTD\bTD#6\eTD\bTD#7\eTD}
> > 
> > and then [command=\ProcessingLine]
> 
> Well, something like 20 columns (on A4 landscape). ;)
> 
> It turns out that my method somehow doesn't work well without setting
> also height=0pt; then it's fine, but I'm still wondering about a
> cleaner way.
> 
> > Mojca
> 
> Best,
> 



-- 
Alan Braslau
CEA DSM-IRAMIS-SPEC
CNRS URA 2464
Orme des Merisiers
91191 Gif-sur-Yvette cedex FRANCE
tel: +33 1 69 08 73 15
fax: +33 1 69 08 87 86
mailto:alan.bras...@cea.fr
___
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://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___

Re: [NTG-context] "Hiding" columns in m-database & TABLE

2012-11-22 Thread Marcin Borkowski
Dnia 2012-11-22, o godz. 13:26:52
Mojca Miklavec  napisał(a):

> On Thu, Nov 22, 2012 at 12:57 PM, Marcin Borkowski wrote:
> > le) in order to
> > typeset a (nice) TABLE. However, I have a few columns I'd like to
> > omit.  I can (of course) hand-edit the csv file; but is there a way
> > to do it automatically?  Something like
> >
> > \setupTABLE[column][3,4,5][kill]
> >
> > I did [empty=yes,width=0pt] in place of [kill], and it worked, but
> > it seems like a hack (and I don't know whether it does actually
> > process the cells I'm omitting - which in my case wouldn't bother
> > me, but might be an additional layer of inelegance;)).  And better
> > ideas?
> 
> If you have up to 9 columns, you could use
> 
> \def\ProcessingLine#1#2#3#4#5#6#7{%
> \bTR\bTD#1\eTD\bTD#2\eTD\bTD#6\eTD\bTD#7\eTD}
> 
> and then [command=\ProcessingLine]

Well, something like 20 columns (on A4 landscape). ;)

It turns out that my method somehow doesn't work well without setting
also height=0pt; then it's fine, but I'm still wondering about a
cleaner way.

> Mojca

Best,

-- 
Marcin Borkowski
http://octd.wmi.amu.edu.pl/en/Marcin_Borkowski
Adam Mickiewicz University
___
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://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___

Re: [NTG-context] "Hiding" columns in m-database & TABLE

2012-11-22 Thread Mojca Miklavec
On Thu, Nov 22, 2012 at 12:57 PM, Marcin Borkowski wrote:
> le) in order to
> typeset a (nice) TABLE. However, I have a few columns I'd like to
> omit.  I can (of course) hand-edit the csv file; but is there a way to
> do it automatically?  Something like
>
> \setupTABLE[column][3,4,5][kill]
>
> I did [empty=yes,width=0pt] in place of [kill], and it worked, but it
> seems like a hack (and I don't know whether it does actually process
> the cells I'm omitting - which in my case wouldn't bother me, but might
> be an additional layer of inelegance;)).  And better ideas?

If you have up to 9 columns, you could use

\def\ProcessingLine#1#2#3#4#5#6#7{%
\bTR\bTD#1\eTD\bTD#2\eTD\bTD#6\eTD\bTD#7\eTD}

and then [command=\ProcessingLine]

Mojca
___
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://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___


[NTG-context] "Hiding" columns in m-database & TABLE

2012-11-22 Thread Marcin Borkowski
Hi all,

I'd like to process a csv file (with the database module) in order to
typeset a (nice) TABLE. However, I have a few columns I'd like to
omit.  I can (of course) hand-edit the csv file; but is there a way to
do it automatically?  Something like

\setupTABLE[column][3,4,5][kill]

I did [empty=yes,width=0pt] in place of [kill], and it worked, but it
seems like a hack (and I don't know whether it does actually process
the cells I'm omitting - which in my case wouldn't bother me, but might
be an additional layer of inelegance;)).  And better ideas?

Best,

-- 
Marcin Borkowski
http://octd.wmi.amu.edu.pl/en/Marcin_Borkowski
Adam Mickiewicz University
___
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://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___


Re: [NTG-context] m-graph.mkiv format bug

2012-10-15 Thread Alan BRASLAU
On Mon, 15 Oct 2012 13:03:40 +0200
Sietse Brouwer  wrote:

> Alan wrote:
> > Figured it out (and we don't want to strip a leading minus sign):
> >
> > local function strip(s)
> > return "\\times10^{"..(s:gsub("%+*0*([1-9])","%1")).."}"
> > end
> 
> Better to anchor the pattern to the start of the string with `^` (and
> then the nonzerodigitmatching is no longer needed):
> gsub("^%+*0*", "")
> Otherwise, you'll get 805 --> 85.

Thank you for the suggestion. Tried it, but this
doesn't work, so I must be missing something...

Of course, with MetaPost 2.0 we will certainly come across such a case
with numbers like 1e805. :)

Alan
___
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://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___


Re: [NTG-context] m-graph.mkiv format bug

2012-10-15 Thread Sietse Brouwer
Alan wrote:
> Figured it out (and we don't want to strip a leading minus sign):
>
> local function strip(s)
> return "\\times10^{"..(s:gsub("%+*0*([1-9])","%1")).."}"
> end

Better to anchor the pattern to the start of the string with `^` (and
then the nonzerodigitmatching is no longer needed):
gsub("^%+*0*", "")
Otherwise, you'll get 805 --> 85.

--Sietse

On Mon, Oct 15, 2012 at 12:45 PM, Alan BRASLAU  wrote:
> On Mon, 15 Oct 2012 12:27:27 +0200
> Alan BRASLAU  wrote:
>
>> On Mon, 15 Oct 2012 12:08:30 +0200
>> Sietse Brouwer  wrote:
>>
>> > > There is a bug with format() as redefined in m-graph.mkiv
>> > > 1e10 and 1e-10 truncate the tailing 0.
>> >
>> > The function strip() is removing 0 throughout the exponent, and I
>> > don't know what purpose that might serve. If we never want to remove
>> > zeroes, this works:
>> >
>> > local function strip(s)
>> > -return "\\times10^{"..(s:gsub("%+*0*","")).."}"
>> > +return "\\times10^{"..(s:gsub("%+*","")).."}"
>> > end
>> >
>> > Note that if the exponent is zero the "× 10^0" will be left out
>> > completely, in both the old and the new strip() function. This seems
>> > to be by design. Illustration of this behaviour:
>> >
>> > \usemodule[graph]
>> > \starttext
>> > \startMPpage
>> > label(format("@g","1e+0"),(2cm,-1cm)) ;
>> > \stopMPpage
>> > \stoptext
>>
>>
>> Thanks, this "fixes" it for now,
>> but I believe that the strip is intended to remove leading zeros, as
>> in label(format("@g","1e+08"),(2cm,-1cm)) ;
>>
>> I suppose that the correct syntax must be something like the regex
>>   s/[+-]*0*\([1-9]\)/\1/
>> (not sure how to state this in lua gsub()...)
>
>
> Figured it out (and we don't want to strip a leading minus sign):
>
> local function strip(s)
> return "\\times10^{"..(s:gsub("%+*0*([1-9])","%1")).."}"
> end
>
>
> Alan
___
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://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___

Re: [NTG-context] m-graph.mkiv format bug

2012-10-15 Thread Alan BRASLAU
On Mon, 15 Oct 2012 12:27:27 +0200
Alan BRASLAU  wrote:

> On Mon, 15 Oct 2012 12:08:30 +0200
> Sietse Brouwer  wrote:
> 
> > > There is a bug with format() as redefined in m-graph.mkiv
> > > 1e10 and 1e-10 truncate the tailing 0.
> > 
> > The function strip() is removing 0 throughout the exponent, and I
> > don't know what purpose that might serve. If we never want to remove
> > zeroes, this works:
> > 
> > local function strip(s)
> > -return "\\times10^{"..(s:gsub("%+*0*","")).."}"
> > +return "\\times10^{"..(s:gsub("%+*","")).."}"
> > end
> > 
> > Note that if the exponent is zero the "× 10^0" will be left out
> > completely, in both the old and the new strip() function. This seems
> > to be by design. Illustration of this behaviour:
> > 
> > \usemodule[graph]
> > \starttext
> > \startMPpage
> > label(format("@g","1e+0"),(2cm,-1cm)) ;
> > \stopMPpage
> > \stoptext
> 
> 
> Thanks, this "fixes" it for now,
> but I believe that the strip is intended to remove leading zeros, as
> in label(format("@g","1e+08"),(2cm,-1cm)) ;
> 
> I suppose that the correct syntax must be something like the regex
>   s/[+-]*0*\([1-9]\)/\1/
> (not sure how to state this in lua gsub()...)


Figured it out (and we don't want to strip a leading minus sign):

local function strip(s)
return "\\times10^{"..(s:gsub("%+*0*([1-9])","%1")).."}"
end


Alan
___
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://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___

Re: [NTG-context] m-graph.mkiv format bug

2012-10-15 Thread Alan BRASLAU
On Mon, 15 Oct 2012 12:08:30 +0200
Sietse Brouwer  wrote:

> > There is a bug with format() as redefined in m-graph.mkiv
> > 1e10 and 1e-10 truncate the tailing 0.
> 
> The function strip() is removing 0 throughout the exponent, and I
> don't know what purpose that might serve. If we never want to remove
> zeroes, this works:
> 
> local function strip(s)
> -return "\\times10^{"..(s:gsub("%+*0*","")).."}"
> +return "\\times10^{"..(s:gsub("%+*","")).."}"
> end
> 
> Note that if the exponent is zero the "× 10^0" will be left out
> completely, in both the old and the new strip() function. This seems
> to be by design. Illustration of this behaviour:
> 
> \usemodule[graph]
> \starttext
> \startMPpage
> label(format("@g","1e+0"),(2cm,-1cm)) ;
> \stopMPpage
> \stoptext


Thanks, this "fixes" it for now,
but I believe that the strip is intended to remove leading zeros, as in
  label(format("@g","1e+08"),(2cm,-1cm)) ;

I suppose that the correct syntax must be something like the regex
  s/[+-]*0*\([1-9]\)/\1/
(not sure how to state this in lua gsub()...)

Alan
___
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://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___

Re: [NTG-context] m-graph.mkiv format bug

2012-10-15 Thread Sietse Brouwer
> There is a bug with format() as redefined in m-graph.mkiv
> 1e10 and 1e-10 truncate the tailing 0.

The function strip() is removing 0 throughout the exponent, and I
don't know what purpose that might serve. If we never want to remove
zeroes, this works:

local function strip(s)
-return "\\times10^{"..(s:gsub("%+*0*","")).."}"
+return "\\times10^{"..(s:gsub("%+*","")).."}"
end

Note that if the exponent is zero the "× 10^0" will be left out
completely, in both the old and the new strip() function. This seems
to be by design. Illustration of this behaviour:

\usemodule[graph]
\starttext
\startMPpage
label(format("@g","1e+0"),(2cm,-1cm)) ;
\stopMPpage
\stoptext

Cheers,
Sietse


On Mon, Oct 15, 2012 at 11:19 AM, Alan BRASLAU  wrote:
> There is a bug with format() as redefined in m-graph.mkiv
> 1e10 and 1e-10 truncate the tailing 0.
> (I have not been able to fix the code...)
>
> Alan
>
> Minimal example:
>
> \usemodule [graph]
>
> \starttext
> \startMPpage
> label(format("@g","1e-10"),(0,  0)) ;
> label(format("@g","1e+10"),(2cm,0)) ;
> label(format("@g","1e-12"),(0,  -.5cm)) ;
> label(format("@g","1e+12"),(2cm,-.5cm)) ;
> \stopMPpage
> \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://tex.aanhet.net
> archive  : http://foundry.supelec.fr/projects/contextrev/
> 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://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___

[NTG-context] m-graph.mkiv format bug

2012-10-15 Thread Alan BRASLAU
There is a bug with format() as redefined in m-graph.mkiv
1e10 and 1e-10 truncate the tailing 0.
(I have not been able to fix the code...)

Alan

Minimal example:

\usemodule [graph]

\starttext
\startMPpage
label(format("@g","1e-10"),(0,  0)) ;
label(format("@g","1e+10"),(2cm,0)) ;
label(format("@g","1e-12"),(0,  -.5cm)) ;
label(format("@g","1e+12"),(2cm,-.5cm)) ;
\stopMPpage
\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://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___


[NTG-context] m-database: setting text style for every first line of a table, and text/cell style for specific parts of the table?

2012-05-05 Thread Sander Maijers
Hello everyone,

I did manage to get a background color for the first row. This is a snippet 
that I use

\defineseparatedlist
  [CSV]
  [separator=comma,
   
first={\bTR[align=middle,background=color,backgroundcolor=gray]},last=\eTR,
   left=\bTD,right=\eTD,
   before={\bTABLE[align=middle]},after=\eTABLE]

\processseparatedfile[CSV][/tmp/CSV.csv]

Also, can you think of a way to specify the cell and text style for individual 
cells with processseparatedfile?

Regards,
Sander Maijers
___
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://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___


Re: [NTG-context] error with m-database example

2012-02-16 Thread Hans Hagen

On 16-2-2012 12:03, Martin wrote:

Admittedly I feel a bit lost when looking at the various processing
modules...

My goal is to create template based output. I have created a rough
mail-merge example (with LibreOffice) and attached it as PDF for
illustration.

There is a CSV database with currently 8 fields, probably a few more
will be added. These fields need to be placed into a form, in my example
a list of courses. Other forms based on the same data should follow.
These forms/lists will then be printed.

Hope that makes sense. Maybe I'm pushing the database module a bit to
far, but I was just trying to avoid "mail-merges"...


\starttext

\startluacode

-- or: str = io.loaddata(somefile)

local str = [[
1,2,3,4,5,6,7,8
a,b,c,d,e,f,g,h
]]

local list = string.splitlines(str)

for i=1,#list do
local fields = utilities.parsers.settings_to_array(list[i])
if fields[1] then
context("field 1: %s",fields[1])
context.par()
end
end

\stopluacode

\stoptext

so:

- read in the cvs file
- split them into lines
- loop over each line
- split that line
- and mess around with the fields



-
  Hans Hagen | PRAGMA ADE
  Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
tel: 038 477 53 69 | voip: 087 875 68 74 | www.pragma-ade.com
 | 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://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___


Re: [NTG-context] error with m-database example

2012-02-15 Thread Wolfgang Schuster

Am 15.02.2012 um 21:54 schrieb Martin:

> >
> > \unexpanded\def\SendMe#1#2{#1\crlf#2}
> >
> > Wolfgang
> 
> Wolfgang, thanks, that worked for the sample code. However, when extended to 
> three fields (I need 8) the field splitting gets rather messy.

I had to look at the example in the module for this and what I saw is that you 
can only use commands with *one* but this isn’t a real problem, when you 
describe what do you want to do with the entries I can provide you with a 
solution for this.

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://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___


Re: [NTG-context] error with m-database example

2012-02-15 Thread Martin

>
> \unexpanded\def\SendMe#1#2{#1\crlf#2}
>
> Wolfgang


Wolfgang, thanks, that worked for the sample code. However, when 
extended to three fields (I need 8) the field splitting gets rather messy.


Thanks, Martin


Modified code:

\usemodule[database]
\unexpanded\def\SendMe#1#2#3{#1\crlf#2\crlf#3}

\defineseparatedlist
  [Addressen]
  [separator={;},command=\SendMe]

\starttext
\startAddressen
house1;street1;name1
house2;street2;name2
\stopAddressen
\stoptext


Result is in attached PDF (hope that's ok)


csv-test.pdf
Description: Adobe PDF document
___
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://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___

Re: [NTG-context] error with m-database example

2012-02-15 Thread Wolfgang Schuster

Am 15.02.2012 um 16:06 schrieb Martin:

> Sorry to pick up an old topic 
> (http://archive.contextgarden.net/message/20101221.082006.4dc83f26.en.html), 
> but I seem to have the same problem with m-database at mentioned in this old 
> thread.
> 
> I am trying to "freely" use the data fields in a layout other than (natural) 
> Tables.
> 
> An update of context (15.2.2012) doesn't help.
> 
> The example from the CSV MyWay fails as well as the simplified example below 
> with following error:
> 
> 
> \doprocessdatabase ...ameter \c!command \!!es , }}
> l.14 \stopAddressen
> 
> 
> Modifying m-database.lua as suggested in the old thread seems to have no 
> effect on the error... Though I suspect the file has been changed since 
> anyhow.
> 
> Thanks for any input, Martin
> 
> Code used:
> 
> \usemodule[database]
> 
> \def\SendMe#1#2{#1\crlf#2}

\unexpanded\def\SendMe#1#2{#1\crlf#2}

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://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___


[NTG-context] error with m-database example

2012-02-15 Thread Martin
Sorry to pick up an old topic 
(http://archive.contextgarden.net/message/20101221.082006.4dc83f26.en.html), 
but I seem to have the same problem with m-database at mentioned in this 
old thread.


I am trying to "freely" use the data fields in a layout other than 
(natural) Tables.


An update of context (15.2.2012) doesn't help.

The example from the CSV MyWay fails as well as the simplified example 
below with following error:



\doprocessdatabase ...ameter \c!command \!!es , }}
l.14 \stopAddressen


Modifying m-database.lua as suggested in the old thread seems to have no 
effect on the error... Though I suspect the file has been changed since 
anyhow.


Thanks for any input, Martin

Code used:

\usemodule[database]

\def\SendMe#1#2{#1\crlf#2}

\defineseparatedlist
  [Addressen]
  [separator={;},command=\SendMe]

\starttext

\startAddressen
xyz;Maasstraat
abc;sometown
\stopAddressen

\stoptext


using the variant doesn't help:

\startseparatedlist[Addressen]
xyz;Maasstraat
abc;sometown
\stopseparatedlist


___
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://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___


Re: [NTG-context] Why does the oldstyle numerals switch, \os, also switch off m-dashes?

2011-12-01 Thread Pavneet Arora
Just for the sake of completeness, in case someone else stumbles upon this 
thread, it should be noted that \definefontfeature needs to be set before 
\setupbodyfont, i.e.,


\definefontfeature[default][default][onum=yes]
\definefontfeature[smallcaps][smallcaps][onum=yes]
\setupbodyfont[schola,11pt]

rather than:

\setupbodyfont[schola,11pt]
\definefontfeature[default][default][onum=yes]
\definefontfeature[smallcaps][smallcaps][onum=yes]

I made the mistake of using the latter form in one of my tests and was
left wondering why things weren't working.

Regards.

On 11-11-30 04:19 PM, Wolfgang Schuster wrote:


Am 30.11.2011 um 20:19 schrieb Pavneet Arora:


Okay another anomaly:  I used the example in the FAQs to try to set the feature 
across the entire document, which is really what I want.

http://wiki.contextgarden.net/FAQ#How_can_I_get_the_.E2.80.9Coldstyle_numbers.E2.80.9D_.28text_figures.29_in_a_document.3F

In a manuscript length project, I wouldn't want to get {\os } for each local 
instance.  Now, what I have noticed was that the small caps switch, \sc, seems 
to disable old-style numerals.  Is this a typographic convention, i.e., that in 
a run of small caps one should not revert to old-style numerals?  Is there a 
way of avoiding this assumption for a larger project?  I sometimes have text 
set in small caps that as part of a project ID would have some numbers in it.  
In that case, I would like the old-style numerals to be used.


No, the answer is that smallcaps are activated with the “smcp” feature and this 
is applied to the regular style with the “smallcaps” set. To get now old style 
figures when you use smallcaps letters you need also this setup:

\definefontfeature[smallcaps][smallcaps][onum=yes]

Wolfgang


--
-
- Pavneet Arora

Waroc Fine Audio + Custom Home Cinema
www.waroc.com  416.937.WAROC (9276)

___
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://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___


Re: [NTG-context] Why does the oldstyle numerals switch, \os, also switch off m-dashes?

2011-11-30 Thread Hans Hagen

On 30-11-2011 22:19, Wolfgang Schuster wrote:


Am 30.11.2011 um 20:19 schrieb Pavneet Arora:


Okay another anomaly:  I used the example in the FAQs to try to set the feature 
across the entire document, which is really what I want.

http://wiki.contextgarden.net/FAQ#How_can_I_get_the_.E2.80.9Coldstyle_numbers.E2.80.9D_.28text_figures.29_in_a_document.3F

In a manuscript length project, I wouldn't want to get {\os } for each local 
instance.  Now, what I have noticed was that the small caps switch, \sc, seems 
to disable old-style numerals.  Is this a typographic convention, i..e., that 
in a run of small caps one should not revert to old-style numerals?  Is there a 
way of avoiding this assumption for a larger project?  I sometimes have text 
set in small caps that as part of a project ID would have some numbers in it.  
In that case, I would like the old-style numerals to be used.


No, the answer is that smallcaps are activated with the “smcp” feature and this 
is applied to the regular style with the “smallcaps” set. To get now old style 
figures when you use smallcaps letters you need also this setup:

\definefontfeature[smallcaps][smallcaps][onum=yes]


given that the smallcaps feature does not nil oldstyle (happens in some 
fonts)



-
  Hans Hagen | PRAGMA ADE
  Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
tel: 038 477 53 69 | voip: 087 875 68 74 | www.pragma-ade.com
 | 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://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___


Re: [NTG-context] Why does the oldstyle numerals switch, \os, also switch off m-dashes?

2011-11-30 Thread Pavneet Arora

Works a charm, Wolfgang.  Thanks again.

On 11-11-30 04:19 PM, Wolfgang Schuster wrote:


Am 30.11.2011 um 20:19 schrieb Pavneet Arora:


Okay another anomaly:  I used the example in the FAQs to try to set the feature 
across the entire document, which is really what I want.

http://wiki.contextgarden.net/FAQ#How_can_I_get_the_.E2.80.9Coldstyle_numbers.E2.80.9D_.28text_figures.29_in_a_document.3F

In a manuscript length project, I wouldn't want to get {\os } for each local 
instance.  Now, what I have noticed was that the small caps switch, \sc, seems 
to disable old-style numerals.  Is this a typographic convention, i.e., that in 
a run of small caps one should not revert to old-style numerals?  Is there a 
way of avoiding this assumption for a larger project?  I sometimes have text 
set in small caps that as part of a project ID would have some numbers in it.  
In that case, I would like the old-style numerals to be used.


No, the answer is that smallcaps are activated with the “smcp” feature and this 
is applied to the regular style with the “smallcaps” set. To get now old style 
figures when you use smallcaps letters you need also this setup:

\definefontfeature[smallcaps][smallcaps][onum=yes]

Wolfgang


--
-
- Pavneet Arora

Waroc Fine Audio + Custom Home Cinema
www.waroc.com  416.937.WAROC (9276)

___
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://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___


Re: [NTG-context] Why does the oldstyle numerals switch, \os, also switch off m-dashes?

2011-11-30 Thread Wolfgang Schuster

Am 30.11.2011 um 20:19 schrieb Pavneet Arora:

> Okay another anomaly:  I used the example in the FAQs to try to set the 
> feature across the entire document, which is really what I want.
> 
> http://wiki.contextgarden.net/FAQ#How_can_I_get_the_.E2.80.9Coldstyle_numbers.E2.80.9D_.28text_figures.29_in_a_document.3F
> 
> In a manuscript length project, I wouldn't want to get {\os } for each local 
> instance.  Now, what I have noticed was that the small caps switch, \sc, 
> seems to disable old-style numerals.  Is this a typographic convention, i.e., 
> that in a run of small caps one should not revert to old-style numerals?  Is 
> there a way of avoiding this assumption for a larger project?  I sometimes 
> have text set in small caps that as part of a project ID would have some 
> numbers in it.  In that case, I would like the old-style numerals to be used.

No, the answer is that smallcaps are activated with the “smcp” feature and this 
is applied to the regular style with the “smallcaps” set. To get now old style 
figures when you use smallcaps letters you need also this setup:

\definefontfeature[smallcaps][smallcaps][onum=yes]

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://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___


Re: [NTG-context] Why does the oldstyle numerals switch, \os, also switch off m-dashes?

2011-11-30 Thread Willi Egger
Hi Pavneet,

I do not know which font/kind of font you intend to use. So provided the font 
is a otf-type the following works:

\setupbodyfont[times,rm,12pt]
\definefontfeature[oldstyle][sript=latin,onum=yes]
\starttext
\addff{oldstyle}
1234567890 A Pause---between yes and no.


1234567890 A Pause---between yes and no.
\stoptext



Willi
On 30 Nov 2011, at 20:19, Pavneet Arora wrote:

> Okay another anomaly:  I used the example in the FAQs to try to set the 
> feature across the entire document, which is really what I want.
> 
> http://wiki.contextgarden.net/FAQ#How_can_I_get_the_.E2.80.9Coldstyle_numbers.E2.80.9D_.28text_figures.29_in_a_document.3F
> 
> In a manuscript length project, I wouldn't want to get {\os } for each local 
> instance.  Now, what I have noticed was that the small caps switch, \sc, 
> seems to disable old-style numerals.  Is this a typographic convention, i.e., 
> that in a run of small caps one should not revert to old-style numerals?  Is 
> there a way of avoiding this assumption for a larger project?  I sometimes 
> have text set in small caps that as part of a project ID would have some 
> numbers in it.  In that case, I would like the old-style numerals to be used.
> 
> I again enclose a small example with output.
> 
> advTHANKSance.
> 
> On 11-11-30 01:30 AM, Wolfgang Schuster wrote:
>> 
>> Am 30.11.2011 um 02:19 schrieb Pavneet Arora:
>> 
>>> I enclose a minimal example as well as the output.  It would seem that the 
>>> \os causes the m-dash to come out as three hyphens.  Is this the expected 
>>> behavior?
>> 
>> Write {\os 123…}, context use a special fontfeature set (with the name 
>> “just-os”) for old style figure where where kerning, text ligatures etc. are 
>> disabled.
>> 
>> Wolfgang
> 
> -- 
> -
> - Pavneet Arora
> 
> Waroc Fine Audio + Custom Home Cinema
> www.waroc.com  416.937.WAROC (9276)
> 
> ___
> 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://tex.aanhet.net
> archive  : http://foundry.supelec.fr/projects/contextrev/
> 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://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___


Re: [NTG-context] Why does the oldstyle numerals switch, \os, also switch off m-dashes?

2011-11-30 Thread Pavneet Arora
Okay another anomaly:  I used the example in the FAQs to try to set the feature 
across the entire document, which is really what I want.


http://wiki.contextgarden.net/FAQ#How_can_I_get_the_.E2.80.9Coldstyle_numbers.E2.80.9D_.28text_figures.29_in_a_document.3F

In a manuscript length project, I wouldn't want to get {\os } for each local 
instance.  Now, what I have noticed was that the small caps switch, \sc, seems 
to disable old-style numerals.  Is this a typographic convention, i.e., that in 
a run of small caps one should not revert to old-style numerals?  Is there a way 
of avoiding this assumption for a larger project?  I sometimes have text set in 
small caps that as part of a project ID would have some numbers in it.  In that 
case, I would like the old-style numerals to be used.


I again enclose a small example with output.

advTHANKSance.

On 11-11-30 01:30 AM, Wolfgang Schuster wrote:


Am 30.11.2011 um 02:19 schrieb Pavneet Arora:


I enclose a minimal example as well as the output.  It would seem that the \os 
causes the m-dash to come out as three hyphens.  Is this the expected behavior?


Write {\os 123…}, context use a special fontfeature set (with the name 
“just-os”) for old style figure where where kerning, text ligatures etc. are 
disabled.

Wolfgang


--
-
- Pavneet Arora

Waroc Fine Audio + Custom Home Cinema
www.waroc.com  416.937.WAROC (9276)



test.pdf
Description: Adobe PDF document
\definefontfeature[default][default][onum=yes]

\setupbodyfont[schola]

\starttext
1234567890 A Pause---between yes and no.

{\sc 1234567890 A Pause---between yes and no.} 0987654321

\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://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___

Re: [NTG-context] Why does the oldstyle numerals switch, \os, also switch off m-dashes?

2011-11-30 Thread Pavneet Arora

Many thanks Wolfgang!

On 11-11-30 01:30 AM, Wolfgang Schuster wrote:


Am 30.11.2011 um 02:19 schrieb Pavneet Arora:


I enclose a minimal example as well as the output.  It would seem that the \os 
causes the m-dash to come out as three hyphens.  Is this the expected behavior?


Write {\os 123…}, context use a special fontfeature set (with the name 
“just-os”) for old style figure where where kerning, text ligatures etc. are 
disabled.

Wolfgang


--
-
- Pavneet Arora

Waroc Fine Audio + Custom Home Cinema
www.waroc.com  416.937.WAROC (9276)

___
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://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___


Re: [NTG-context] Why does the oldstyle numerals switch, \os, also switch off m-dashes?

2011-11-29 Thread Wolfgang Schuster

Am 30.11.2011 um 02:19 schrieb Pavneet Arora:

> I enclose a minimal example as well as the output.  It would seem that the 
> \os causes the m-dash to come out as three hyphens.  Is this the expected 
> behavior?

Write {\os 123…}, context use a special fontfeature set (with the name 
“just-os”) for old style figure where where kerning, text ligatures etc. are 
disabled.

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://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___


[NTG-context] Why does the oldstyle numerals switch, \os, also switch off m-dashes?

2011-11-29 Thread Pavneet Arora
I enclose a minimal example as well as the output.  It would seem that the \os 
causes the m-dash to come out as three hyphens.  Is this the expected behaviour?


advTHANKSance.

--
-
- Pavneet Arora



test.pdf
Description: Adobe PDF document
\starttext
1234567890 A Pause---between yes and no.

\os
1234567890 A Pause---between yes and no.
\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://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___

Re: [NTG-context] [m-chart] Focus feature

2011-10-20 Thread Hans Hagen

On 19-10-2011 22:00, Otared Kavian wrote:


On 18 oct. 2011, at 23:49, Hans Hagen wrote:


On 18-10-2011 21:32, Marco wrote:


Another issue: According to the manual, “action” should be
the default shape. However, when no shape is specified, an
error is raised. Is it a bug?


fixed in next beta

also connection parsing is more tolerant now: "+ left - right" in addition to 
"lr" etc


Dear Hans,

The command
\comment[r]{blabla}
does not work anymore  in mkiv when using \usemodule[chart]: one gets an error 
message. (ConTeXt  version 2011.10.19 00:02).
It seems that in the file
m-chart.mkvi
there is a typo at line 277: one finds there
\do_FLOW_commment
instead of \do_FLOW_comment. Fixing this typo eliminates the error message but 
the comment does not show up.


I've added comment to the new code but I'm not sure how compatible it 
is. However, there is more control, compare [t] (anchored at edge) with 
[t:0.5] (anchored halfway along the path) ... comments now relate to the 
connection that they follow so each connection can have a whole bunch of 
comments.


Hans

-
  Hans Hagen | PRAGMA ADE
  Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
tel: 038 477 53 69 | voip: 087 875 68 74 | www.pragma-ade.com
 | 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://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___


Re: [NTG-context] [m-chart] Focus feature

2011-10-20 Thread Hans Hagen

On 20-10-2011 10:43, Ian Lawrence wrote:

Another one on flow cells:

The latest beta adds an unwanted frame around the text ' radiations that 
ionise', for cells like:

\startFLOWcell
\name{episode_04_title}
\location {1,5}
\shape{7}
\text[align=left]{{\bf Radiations that ionise}}
\connection[nb,pt]{episode_05_title}
\stopFLOWcell


\text[l]{...}

-
  Hans Hagen | PRAGMA ADE
  Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
tel: 038 477 53 69 | voip: 087 875 68 74 | www.pragma-ade.com
 | 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://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___


Re: [NTG-context] [m-chart] Focus feature

2011-10-20 Thread Ian Lawrence
Another one on flow cells:

The latest beta adds an unwanted frame around the text ' radiations that 
ionise', for cells like:

\startFLOWcell
\name{episode_04_title}
\location {1,5}
\shape{7}
\text[align=left]{{\bf Radiations that ionise}}
\connection[nb,pt]{episode_05_title}
\stopFLOWcell


And I'm not expert enough to figure out another way of aligning them left…

On 19 Oct 2011, at 21:00, Otared Kavian wrote:

> 
> On 18 oct. 2011, at 23:49, Hans Hagen wrote:
> 
>> On 18-10-2011 21:32, Marco wrote:
>> 
>>> Another issue: According to the manual, “action” should be
>>> the default shape. However, when no shape is specified, an
>>> error is raised. Is it a bug?
>> 
>> fixed in next beta
>> 
>> also connection parsing is more tolerant now: "+ left - right" in addition 
>> to "lr" etc
> 
> Dear Hans,
> 
> The command 
>   \comment[r]{blabla} 
> does not work anymore  in mkiv when using \usemodule[chart]: one gets an 
> error message. (ConTeXt  version 2011.10.19 00:02). 
> It seems that in the file 
>   m-chart.mkvi
> there is a typo at line 277: one finds there
>   \do_FLOW_commment
> instead of \do_FLOW_comment. Fixing this typo eliminates the error message 
> but the comment does not show up.
> 
> 
> Best regards: 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://tex.aanhet.net
> archive  : http://foundry.supelec.fr/projects/contextrev/
> 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://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___


Re: [NTG-context] [m-chart] Focus feature

2011-10-19 Thread Otared Kavian

On 18 oct. 2011, at 23:49, Hans Hagen wrote:

> On 18-10-2011 21:32, Marco wrote:
> 
>> Another issue: According to the manual, “action” should be
>> the default shape. However, when no shape is specified, an
>> error is raised. Is it a bug?
> 
> fixed in next beta
> 
> also connection parsing is more tolerant now: "+ left - right" in addition to 
> "lr" etc

Dear Hans,

The command 
\comment[r]{blabla} 
does not work anymore  in mkiv when using \usemodule[chart]: one gets an error 
message. (ConTeXt  version 2011.10.19 00:02). 
It seems that in the file 
m-chart.mkvi
there is a typo at line 277: one finds there
\do_FLOW_commment
instead of \do_FLOW_comment. Fixing this typo eliminates the error message but 
the comment does not show up.


Best regards: 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://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___


Re: [NTG-context] [m-chart] Focus feature

2011-10-19 Thread Marco
On 2011-10-18 Hans Hagen  wrote:

> On 18-10-2011 21:32, Marco wrote:
> 
> > Another issue: According to the manual, “action” should be
> > the default shape. However, when no shape is specified, an
> > error is raised. Is it a bug?
> 
> fixed in next beta

Thanks for the quick fix. It works now.

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://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___

Re: [NTG-context] [m-chart] Focus feature

2011-10-18 Thread Hans Hagen

On 18-10-2011 21:32, Marco wrote:


Another issue: According to the manual, “action” should be
the default shape. However, when no shape is specified, an
error is raised. Is it a bug?


fixed in next beta

also connection parsing is more tolerant now: "+ left - right" in 
addition to "lr" etc


-
  Hans Hagen | PRAGMA ADE
  Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
tel: 038 477 53 69 | voip: 087 875 68 74 | www.pragma-ade.com
 | 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://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___

Re: [NTG-context] [m-chart] Focus feature

2011-10-18 Thread Marco
On 2011-10-18 Willi Egger  wrote:

> Hi
> 
> It works here with version ConTeXt  ver: 2011.07.19 11:22 MKIV incl. the
> autofocus feature.
> 
> It does not put the focus color in version ConTeXt  ver: 2011.10.14 22:47
> MKIV, nor does the autofocus feature work.

Thanks for testing. Confirmed with versions:

works:
2011.06.11 16:45, beta-0.70.1-2011051911

fails:
2011.10.17 10:36, beta-0.70.1-2011051918

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://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___


Re: [NTG-context] [m-chart] Focus feature

2011-10-18 Thread Hans Hagen

On 18-10-2011 22:07, Willi Egger wrote:

Hi

It works here with version ConTeXt  ver: 2011.07.19 11:22 MKIV incl. the 
autofocus feature.

It does not put the focus color in version ConTeXt  ver: 2011.10.14 22:47 MKIV, 
nor does the autofocus feature work.

(Hans, however it does work again with the experimental version 2011.10.10 
13:38 MKIV and module [chart], there is no focus in module [flow])


module flow is gone .. it's chart again now (flow was a temp version)


Hans

-
  Hans Hagen | PRAGMA ADE
  Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
tel: 038 477 53 69 | voip: 087 875 68 74 | www.pragma-ade.com
 | 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://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___


Re: [NTG-context] [m-chart] Focus feature

2011-10-18 Thread Willi Egger
Hi

It works here with version ConTeXt  ver: 2011.07.19 11:22 MKIV incl. the 
autofocus feature.

It does not put the focus color in version ConTeXt  ver: 2011.10.14 22:47 MKIV, 
nor does the autofocus feature work.

(Hans, however it does work again with the experimental version 2011.10.10 
13:38 MKIV and module [chart], there is no focus in module [flow])

Willi
On 18 Oct 2011, at 21:32, Marco wrote:

> \usemodule   [chart]
> \setupFLOWfocus  [framecolor=yellow]
> \setupFLOWcharts [focus=bar]
> 
> \startFLOWchart [mychart]
>   \startFLOWcell
>   \name {foo}
>   \location {1,1}
>   \shape{action} % mandatory, otherwise error
>   \text {Foo}
>   \stopFLOWcell
>   \startFLOWcell
>   \name {bar}
>   \location {1,2}
>   \shape{action} % mandatory, otherwise error
>   \text {Bar}
>   \connection [tb] {foo}
>   \stopFLOWcell
> \stopFLOWchart
> 
> \starttext
>   \FLOWchart [mychart]
> \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://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___


[NTG-context] [m-chart] Focus feature

2011-10-18 Thread Marco
Hi,

it's  me with  flow chars  again. I  didn't get  the focus
feature  to work.  The  following example  does not  focus
anything. Has the syntax changed or is the feature gone?


%%
\usemodule   [chart]
\setupFLOWfocus  [framecolor=yellow]
\setupFLOWcharts [focus=bar]

\startFLOWchart [mychart]
\startFLOWcell
\name {foo}
\location {1,1}
\shape{action} % mandatory, otherwise error
\text {Foo}
\stopFLOWcell
\startFLOWcell
\name {bar}
\location {1,2}
\shape{action} % mandatory, otherwise error
\text {Bar}
\connection [tb] {foo}
\stopFLOWcell
\stopFLOWchart

\starttext
\FLOWchart [mychart]
\stoptext
%%

Another issue: According to the manual, “action” should be
the default shape. However, when no shape is specified, an
error is raised. Is it a bug?

Regards

Marco Patzer


___
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://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___

Re: [NTG-context] [m-chart] Connections

2011-10-18 Thread Marco
On 2011-10-18 Wolfgang Schuster  wrote:

> […]
>
> To be sure I looked for the correct input and also MkII expects
> the + and - before the location of the node but MkII had “n” as
> synonym for + which is now “m” in MkIV.

I see.  Thanks for  checking the  sources. That  means the
syntax is as follows:

   -tt+t
  
 +l || +r
||
  l ||  r
||
 -l || -r
||
  
   -bb+b

I added a section to the wiki.

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://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___

Re: [NTG-context] [m-chart] Connections

2011-10-18 Thread Wolfgang Schuster

Am 18.10.2011 um 18:52 schrieb Aditya Mahajan:

> On Tue, 18 Oct 2011, Wolfgang Schuster wrote:
> 
>> 
>> Am 18.10.2011 um 18:14 schrieb Marco:
>> 
>>> On 2011-10-18 Aditya Mahajan  wrote:
>>> 
>>>> t b r and l correspond  to top, bottom, right, and left.
>>>> The other  two points  are accessed  throught t+  and t-
>>>> etc.  IIRC, for  top and  bottom, +  corresponds to  the
>>>> right point and - to the left point; for left and right,
>>>> +  corresponds to  the top  point  and -  to the  bottom
>>>> point.
>>> 
>>> According  to  this, [tb+]  should  yield  to the  desired
>>> result. However, it produces the same output as [tb].
>> 
>> The order of arguments is now different in MkIV (bug?),
> 
> It is more likely that I did not recall the syntax correctly.

Neither do I, I don’t use module often enough to remember syntax.

To be sure I looked for the correct input and also MkII expects
the + and - before the location of the node but MkII had “n” as
synonym for + which is now “m” in MkIV.

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://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___


Re: [NTG-context] [m-chart] Connections

2011-10-18 Thread Aditya Mahajan

On Tue, 18 Oct 2011, Wolfgang Schuster wrote:



Am 18.10.2011 um 18:14 schrieb Marco:


On 2011-10-18 Aditya Mahajan  wrote:


t b r and l correspond  to top, bottom, right, and left.
The other  two points  are accessed  throught t+  and t-
etc.  IIRC, for  top and  bottom, +  corresponds to  the
right point and - to the left point; for left and right,
+  corresponds to  the top  point  and -  to the  bottom
point.


According  to  this, [tb+]  should  yield  to the  desired
result. However, it produces the same output as [tb].


The order of arguments is now different in MkIV (bug?),


It is more likely that I did not recall the syntax correctly.

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://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___


Re: [NTG-context] [m-chart] Connections

2011-10-18 Thread Wolfgang Schuster

Am 18.10.2011 um 18:14 schrieb Marco:

> On 2011-10-18 Aditya Mahajan  wrote:
> 
>> t b r and l correspond  to top, bottom, right, and left.
>> The other  two points  are accessed  throught t+  and t-
>> etc.  IIRC, for  top and  bottom, +  corresponds to  the
>> right point and - to the left point; for left and right,
>> +  corresponds to  the top  point  and -  to the  bottom
>> point.
> 
> According  to  this, [tb+]  should  yield  to the  desired
> result. However, it produces the same output as [tb].

The order of arguments is now different in MkIV (bug?),
you have to write “tmb” or “t-p” to connect from the center
of the bottom shape the left of the top shape, the two
keywords “m” and “p” are synonyms for “-” (minus) and “+” (plus).

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://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___


Re: [NTG-context] [m-chart] Connections

2011-10-18 Thread Marco
On 2011-10-18 Aditya Mahajan  wrote:

> t b r and l correspond  to top, bottom, right, and left.
> The other  two points  are accessed  throught t+  and t-
> etc.  IIRC, for  top and  bottom, +  corresponds to  the
> right point and - to the left point; for left and right,
> +  corresponds to  the top  point  and -  to the  bottom
> point.

According  to  this, [tb+]  should  yield  to the  desired
result. However, it produces the same output as [tb].

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://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___


Re: [NTG-context] [m-chart] Connections

2011-10-18 Thread Aditya Mahajan

On Tue, 18 Oct 2011, Marco wrote:


Hi,

I cannot  figure out  how to connect  to the  bottom right
point  (the small  red  one). Anyway,  in  the manual  the
shortcuts to address the  individual points are not really
explained. I blindly guess:

tm - top middle
t  - top middle
bl - bottom left
br - bottom right
bm - bottom centre
b  - bottom centre
…



These don't look right. I haven't checked what the manual says, but I 
usually use


t, t+, t-
b, b+, b-
r, r+, r-
l, l+, l-

t b r and l correspond to top, bottom, right, and left. The other two 
points are accessed throught t+ and t- etc. IIRC, for top and bottom, + 
corresponds to the right point and - to the left point; for left and 
right, + corresponds to the top point and - to the bottom point.


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://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___

[NTG-context] [m-chart] Connections

2011-10-18 Thread Marco
Hi,

I cannot  figure out  how to connect  to the  bottom right
point  (the small  red  one). Anyway,  in  the manual  the
shortcuts to address the  individual points are not really
explained. I blindly guess:

tm - top middle
t  - top middle
bl - bottom left
br - bottom right
bm - bottom centre
b  - bottom centre
…

However,  in the  following example  it doesn't  work. Any
ideas?

%
\usemodule [chart]
\setupFLOWcharts [option=test]

\startFLOWchart [mychart]
\startFLOWcell
\name {foo}
\location {1,1}
\shape{action}
\text {Foo}
\stopFLOWcell

\startFLOWcell
\name {bar}
\location {1,2}
\shape{action}
\text {Bar}
%\connection [tmbl] {foo}  % left
\connection [tmbr] {foo}  % also left ??
\stopFLOWcell
\stopFLOWchart

\starttext
\FLOWchart [mychart]
\stoptext
%

Regards

Marco Patzer


___
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://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___

Re: [NTG-context] Footer including "Page n of m"

2011-08-01 Thread Wolfgang Schuster

Am 02.08.2011 um 06:34 schrieb Alasdair McAndrew:

> However,
> 
> \setuppagenumbering[location=none]
> 
> doesn't work for me (page numbers are still printed), whereas
> 
> \setuppagenumbering[state=stop]
> 
> does.

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://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___


Re: [NTG-context] Footer including "Page n of m"

2011-08-01 Thread Alasdair McAndrew
Well,

\setuppagenumbering[location=]

still prints page numbers where I don't want them.

-Alasdair

On Tue, Aug 2, 2011 at 2:43 PM, Wolfgang Schuster <
schuster.wolfg...@googlemail.com> wrote:

>
> Am 02.08.2011 um 06:34 schrieb Alasdair McAndrew:
>
> > However,
> >
> > \setuppagenumbering[location=none]
> >
> > doesn't work for me (page numbers are still printed), whereas
> >
> > \setuppagenumbering[state=stop]
>
> Sorry, you need \setuppagenumbering[location=].
>
> The “state=stop” setting isn’t the prefect solution because it stops
> pagenumbering. You can see this when you replace in Adityas example
> \currentpage with \pagenumber and \lastpage with \lastpagenumber.
>
> 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://tex.aanhet.net
> archive  : http://foundry.supelec.fr/projects/contextrev/
> wiki : http://contextgarden.net
>
> ___
>



-- 
Blog: http://amca01.wordpress.com
Web:  http://bit.ly/Alasdair
Facebook: http://www.facebook.com/alasdair.mcandrew
___
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://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___

Re: [NTG-context] Footer including "Page n of m"

2011-08-01 Thread Wolfgang Schuster

Am 02.08.2011 um 06:34 schrieb Alasdair McAndrew:

> However,
> 
> \setuppagenumbering[location=none]
> 
> doesn't work for me (page numbers are still printed), whereas
> 
> \setuppagenumbering[state=stop]

Sorry, you need \setuppagenumbering[location=].

The “state=stop” setting isn’t the prefect solution because it stops
pagenumbering. You can see this when you replace in Adityas example
\currentpage with \pagenumber and \lastpage with \lastpagenumber.

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://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___


Re: [NTG-context] Footer including "Page n of m"

2011-08-01 Thread Alasdair McAndrew
However,

\setuppagenumbering[location=none]

doesn't work for me (page numbers are still printed), whereas

\setuppagenumbering[state=stop]

does.

-Alasdair

On Tue, Aug 2, 2011 at 2:19 PM, Wolfgang Schuster <
schuster.wolfg...@googlemail.com> wrote:

>
> Am 02.08.2011 um 02:41 schrieb Alasdair McAndrew:
>
> > Thanks very much!  All I had to do was include
> >
> > \setuppagenumbering[state=stop]
> >
> > to stop the page number being automatically included in the middle of my
> footer.
>
> Don’t do this, use \setuppagenumbering[location=none].
>
> 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://tex.aanhet.net
> archive  : http://foundry.supelec.fr/projects/contextrev/
> wiki : http://contextgarden.net
>
> ___
>



-- 
Blog: http://amca01.wordpress.com
Web:  http://bit.ly/Alasdair
Facebook: http://www.facebook.com/alasdair.mcandrew
___
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://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___

Re: [NTG-context] Footer including "Page n of m"

2011-08-01 Thread Wolfgang Schuster

Am 02.08.2011 um 02:41 schrieb Alasdair McAndrew:

> Thanks very much!  All I had to do was include
> 
> \setuppagenumbering[state=stop]
> 
> to stop the page number being automatically included in the middle of my 
> footer.

Don’t do this, use \setuppagenumbering[location=none].

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://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___


Re: [NTG-context] Footer including "Page n of m"

2011-08-01 Thread Alasdair McAndrew
Thanks very much!  All I had to do was include

\setuppagenumbering[state=stop]

to stop the page number being automatically included in the middle of my
footer.

cheers,
Alasdair

On Tue, Aug 2, 2011 at 10:26 AM, Aditya Mahajan  wrote:

> On Tue, 2 Aug 2011, Alasdair McAndrew wrote:
>
>  I'm trying to recreate an MS Word document in ConTeXt.  The reason for
>> this
>> is so the final document won't stand out from the others too much, and
>> also
>> so that I can have better control over the layout.
>>
>> One thing I'm having difficulty with is the footer, which consists of a
>> rule, followed by
>>
>> "Name of document on the left << space >> Page n of m"
>>
>> where "n" is the current page number, and "m" is the total number of pages
>> and is on the right.  Is there an automatic way of obtaining "m",
>>
>
>
> \setupfootertexts[Page \currentpage\ of \lastpage]
>
>
>  and what's the best way of preceding this footer by a rule?
>>
>
> \setupbackgrounds[footer][**text][topframe=on]
>
> 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 <http://www.ntg.nl/mailman/listinfo/ntg-context>
> webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
> archive  : 
> http://foundry.supelec.fr/**projects/contextrev/<http://foundry.supelec.fr/projects/contextrev/>
> wiki : http://contextgarden.net
> __**__**
> ___
>



-- 
Blog: http://amca01.wordpress.com
Web:  http://bit.ly/Alasdair
Facebook: http://www.facebook.com/alasdair.mcandrew
___
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://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___

Re: [NTG-context] Footer including "Page n of m"

2011-08-01 Thread Aditya Mahajan

On Tue, 2 Aug 2011, Alasdair McAndrew wrote:


I'm trying to recreate an MS Word document in ConTeXt.  The reason for this
is so the final document won't stand out from the others too much, and also
so that I can have better control over the layout.

One thing I'm having difficulty with is the footer, which consists of a
rule, followed by

"Name of document on the left << space >> Page n of m"

where "n" is the current page number, and "m" is the total number of pages
and is on the right.  Is there an automatic way of obtaining "m",



\setupfootertexts[Page \currentpage\ of \lastpage]


and what's the best way of preceding this footer by a rule?


\setupbackgrounds[footer][text][topframe=on]

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://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___


  1   2   3   4   >