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


[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] \startcolumnset ... \stopcolumnset fatal error: return code 11

2021-12-17 Thread John Kitzmiller via ntg-context
>
> Date: Fri, 17 Dec 2021 08:49:55 +0900
> From: Jeong Dal 
> Subject: [NTG-context] \startcolumnset ... \stopcolumnset fatal error:
> return code 11
>
> I have used newcolumnset module to make a test sheet. It was made by the
> help of experts in the list.
> It worked fine a month ago and also worked via TeXlive 2021.
> But I got error using the recent version.
> Thanks Nicola and John for testing.
>
> I have listed it before and tried to find out the cause.
> I have test the following file in the editors,  vscode, vim, atom and even
> in the terminal.
> It might be an apple binary problem as Hans suspected.
> I’d like to know that it is the only problem for Mac users.
>
> Here is the code and the part of error message:
> It was tested in vscode, vim and terminal too.
>
> I am using Mac OSX,
> ConTeXt  ver: 2021.12.03 15:20 LMTX  fmt: 2021.12.9  int: english/english
>
> Thank you for reading.
> Best regards,
>
> Dalyoung
>

I confirm Dalyoung's problem with \columnsets on Mac OSX with current lmtx.

The following MnWE worked on July 2021 versions of lmtx, but does not work
with December versions (gives Fatal Error 11)

\definecolumnset[example][n=2]
  \starttext
 \startcolumnset[example]
   \dorecurse{20}{\input bryson}
 \stopcolumnset
  \stoptext


system  > ConTeXt  ver: 2021.12.14 19:19 LMTX  fmt: 2021.12.16  int:
english/english


mtx-context | fatal error: return code: 11


HTH,

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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___


Re: [NTG-context] how to setup path of ConTeXtLMTX for MacVim?

2021-12-12 Thread John Kitzmiller via ntg-context
>
> How to redirect the path for ConTeXt in MacVim?
>

I put this in .vimrc:
map   :w  :!context % 

and $PATH directs "context" to the right place:

/Users/kitz/lmtx/tex/texmf-osx-64/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/Library/TeX/texbin


To open the .pdf:

:!open -a  %r.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] file names lmtx

2019-04-30 Thread John Kitzmiller
I just started testing with lmtx and this minor detail with different 
file names presented:


fourth2.tex compiles to produce fourth2.pdf

but fourth.2.tex compiles to produce fourth.pdf


With mkiv I get fourth2.pdf and fourth.2.pdf

Not a problem, just an observation.


___
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] steps module

2018-03-04 Thread John Kitzmiller


Adjust shading and outline of cells and text in steps module, or not  
available as written?


Something like \startSTEPtable[frame=off], etc.

I have grabbed the code to modify for local input, but I have made a  
terrible mess of it!


___
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] vertical alignment of images in Natural Table

2017-10-28 Thread John Kitzmiller


Martin Althoff wrote:

Hello, I am trying to vertically align images within a  
bTABLE/Natural Table cell.


The result should be 4 cards on an A4 page with a simple maths  
exercise and a small image that illustrates the exercise. The image  
should be horizontally and vertically centered within the space  
after the text. Exercise text and image size vary somewhat, so a  
fixed placement is not possible.


I have tried \vfill, but it seems to have no effect in a Natural  
Table. Similarly, \placefigure has not worked for me.


As basic layout I am using a Natural Table (4 x 4 cells per page, 12  
pages), maybe not the best solution. Alternative suggestions are  
most welcome.


Suggestions would be much appreciated.

Martin


\starttext
\setupTABLE[frame=on,offset=2mm]
\setupTABLE[c][1,2][width=.5\textwidth]
\setupTABLE[r][1,2][height=.5\textheight]

\bTABLE
\bTR
\bTD
7·3 apples are on a tree. Anne picks 4·3 apples.
\blank[.5em]
How many apples remain on the tree?

\framed[align={low,middle},location=lohi,width=local]{\externalfigure[apple]}
\eTD
\eTABLE
\stoptext



Hello Martin,

I am guessing at directing you away from bTABLE. Maybe imposition will  
help (along with the module fullpage to keep it simpler.)


\setuppagenumbering[state=stop]
\usemodule[fullpage][style={margin,empty},margin=1.4cm]
\useMPlibrary[dum]

\setuppapersize[A6][A4]
\setuppaper[nx=2,ny=2]
\setuplayout[page][location=middle]
\setuparranging [XY]

\showframe
\starttext

73 apples are on a tree.\\
Anne picks 43 apples.
\blank
How many apples remain on the tree?
\placefigure[bottom,none]{}{\externalfigure[A]}
\page

\input ward
\placefigure[bottom,none]{}{\externalfigure[B]}
\page

\input thuan
\placefigure[bottom,none]{}{\externalfigure[C]}
\page

Jack and Jill went up the hill with the Duke of York.
\placefigure[bottom,none]{}{\externalfigure[D]}

\stoptext


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

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

[NTG-context] xtable align

2016-07-18 Thread John Kitzmiller
In the first table, the lohi of align works, but the middle does not have any 
effect. Putting the content in a frame gives the desired result as in the 
second table. This is not a problem, I just wondered if it is supposed to work 
in the first table.

Thanks, John


\useMPlibrary[dum]
\starttext
\showframe
\startxtable[frame=on,height=7cm,option=stretch,align={lohi,middle}]
\startxrow
\startxcell \externalfigure[dummy][width=5cm,height=5cm] \stopxcell
\startxcell \externalfigure[dummy][width=3cm,height=3cm] \stopxcell
\stopxrow
\stopxtable

\startxtable [frame=on,height=7cm,option=stretch,align={lohi,middle}]
\startxrow
\startxcell 
  \framed[frame=off,width=local]{\externalfigure[dummy][width=5cm,height=5cm]}
\stopxcell
\startxcell
  \framed[frame=off,width=local]{\externalfigure[dummy][width=3cm,height=3cm]}
\stopxcell
\stopxrow
\stopxtable
\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] \defineparagraphs

2016-07-09 Thread John Kitzmiller

> On 8Jul, 2016, at 09:20, Wolfgang Schuster  
> wrote:
> 
>> The code below works with context2016.02.15, but fails with 
>> context2016.05.19.
>> 
>> Itemize within the defined paragraph (Mypar) no longer puts the thinrule in 
>> the margin (see the third question.) The \ansblank command seems to the 
>> second part of Mypar is 
>> the margin? Pdf of the success and fail attached.
>> 
>> Thanks! John
>> 
>> \startMypar
>> \item Third question refers to graphic at right. 
>> \Mypar
>> 
>> \stopMypar
> \item
> \startcombination[nx=2,ny=1]
> 
> {\framed[frame=off,align=flushleft,location=top,width=.5\localhsize]{Third 
> question refers to graphic at right.}}{}
> {\tbox{\externalfigure[cow]}}{}
> \stopcombination

Thank you Wolfgang. I had to change .5\localhsize to .5\textwidth for it to 
work here (and scale down the cow to make it fit in the barn.)

I am looking into combinations to center the graphic in the second x box, and 
make a \setupcombination[mycombination] similar to \defineparagraph[Mypar] to 
reduce typing.

\tbox is new to me. Is that a ConTeXt macro of TEX \vtop{\hbox}?

Thanks again, 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] \inright

2016-06-25 Thread John Kitzmiller
> John Kitzmiller <mailto:kitz at inradius.net 
> <https://mailman.ntg.nl/mailman/listinfo/ntg-context>>
> 25. Juni 2016 um 16:20
> The following is no longer putting the “answer blank” in the right margin.
>
> \define\ansblank{\inright{\getnumber[itemgroup:itemize]. \thinrule}}
> \setupitemgroup [itemize] [n, style=bold,right=\ansblank]
>
\setupitemgroup[itemize][style=bold,before=\ansblank]

Wolfgang
—

Thank you Wolfgang. That works for one item but it does not carry forward to 
multiple items: 

\define\ansblank{\inright{\getnumber[itemgroup:itemize]. \thinrule}} 
\setupitemgroup [itemize] [n, style=bold,before=\ansblank]

\starttext
\startitemize[n]
\item A question.
\item Another question.
\item Yet another.
\stopitemize
\showframe
\stoptext

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] \inright

2016-06-25 Thread John Kitzmiller
The following is no longer putting the “answer blank” in the right margin.

\define\ansblank{\inright{\getnumber[itemgroup:itemize]. \thinrule}} 
\setupitemgroup [itemize] [n, style=bold,right=\ansblank]

\starttext
\startitemize[n]
\item A question.
\stopitemize
\showframe
\stoptext

When I source context 2016.02.15 it works, but not with 2016.05.19. Thank you 
for any help on the new way.

Some background:
http://www.mail-archive.com/ntg-context%40ntg.nl/msg72108.html 



___
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] anglestriped shifts path

2016-02-03 Thread John Kitzmiller
I expect anglestriped to work more like fill, but it shifts the path. Is it 
intended behavior?

\startMPpage[offset=2mm]
 path p;
 p = unitsquare scaled 4cm ;
 filldraw p withcolor blue;
 draw p;
 draw p anglestriped(0,0,0) withcolor blue;
\stopMPpage

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

[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 
, 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] Change location of local texmf

2015-07-27 Thread John Kitzmiller

>> The minimals use ~/texmf for the local tex folder. How to change it to 
>> ~/dropbox/texmf?
>> 
>> My ConTeXt installation is ~/dropbox/context.
> 
> One option is:
> 
>  ln -s ~/dropbox/texmf ~/texmf
> 
> Aditya

A fine option it is. Thank you 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] Change location of local texmf

2015-07-25 Thread John Kitzmiller
The minimals use ~/texmf for the local tex folder. How to change it to  
~/dropbox/texmf?

My ConTeXt installation is ~/dropbox/context.

I have tried directly modifying cnf files but I am missing some magic.
___
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] crash with new beta (2015.03.09 19:27)

2015-03-09 Thread John Kitzmiller
On Mar 9, 2015, Aditya wrote:
By any chance, is the name of your test file `knuth.tex`?

Aditya

Yes, 127 times yes! Sorry about that.

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] crash with new beta (2015.03.09 19:27)

2015-03-09 Thread John Kitzmiller

> On Mar 9, 2015, at 5:13 PM, Hans Hagen wrote:
> 
> i uploaded a new beta ... works at luigi's end (actually we tested that 
> previous time too but the issue is only triggered in docs that use 
> positions and tuc files remember that)
> 
> Hans

Now with current version: 2015.03.09 22:02 and 
\starttext
\input knuth
\stoptext

I get:

open source > 3 > 4 > knuth.tex
open source > 4 > 5 > knuth.tex
open source > 5 > 6 > knuth.tex
...
open source > 125 > 126 > knuth.tex
open source > 126 > 127 > knuth.tex

tex error   > error on line 2 in file knuth.tex: ! TeX capacity exceeded, 
sorry [text input levels=127]

l.2 \input knuth
  

1 \starttext
2 >>  \input knuth
3 \stoptext
4 

If you really absolutely need more capacity,
you can ask a wizard to enlarge me.



No problem with \input ward \input zapf \input lorem

___
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] crash with new beta (2015.03.09 19:27)

2015-03-09 Thread John Kitzmiller

> On Mar 9, 2015, at 4:28 PM, Hans Hagen wrote:
> 
> On 3/9/2015 8:11 PM, Pablo Rodriguez wrote:
>> Hans,
>> 
>> I’m afraid that the following sample crashes ConTeXt:
>> 
>> \starttext
>> \input knuth
>> \stoptext
>> 
>> Error message is the following:
>> 
>> tex error   > error on line 1 in file /home/ousia/a.tex: ! Undefined
>> control sequence
>> 
>> 
>> \anch_backgrounds_text_initialize ...ositionsused
>>   \enableparpositions
>> \donot...
>>  ...erytopofpage \anch_backgrounds_text_initialize
>> 
>> \font_preloads_at_start_te...
>> \dostarttext ...ttext \relax \the \everystarttext
>>   \global
>> \everystarttext \e...
>> l.1 \dostarttext
>> 
>> \ctxcommand #1->\directlua {commands.#1}
>> 
>> l.1 \starttext
>> 
>> Could you fix this?
> 
> it works here .. can others confirm the issue?
> 
> -
>   Hans Hagen | PRAGMA ADE


I just loaded up (2015.03.09 19:27) and get the same error as Pablo.

MacOSX?

—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] Hatch an area with Metapost (Metafun)

2015-02-17 Thread John Kitzmiller
On Feb 16, 2015, at 3:21 PM, Fabrice Couvreur wrote:
> 
> This does not work with :
> 
> labeloffset := 2mm;



On Feb 09, 2015, Hans Hagen wrote:

\startMPpage[offset=2pt]
 path p, q, r ; pair z ;
 p := unitsquare scaled 4cm ;
 z := point 3.6 of p ;
 q := z--urcorner p ;
 r := q -- reverse bottomboundary p -- cycle ;
 draw p ;
 draw q ;
 draw r numberstriped (.25,10,5) withcolor blue ;
 draw thetextext.llft("B", llcorner p) ;
 draw thetextext.lrt ("C", lrcorner p) ;
 draw thetextext.ulft("A", ulcorner p) ;
 draw thetextext.urt ("D", urcorner p) ;
 draw thetextext.lft ("M", z) ;
\stopMPpage
Hello Fabrice,

labeloffset does not work with Hans’ code above using ‘draw thetextext’ for 
labels. It works with the label macro:

\startMPpage[offset=2mm]
 path p, q, r ; pair z ;
 p := unitsquare scaled 4cm ;
 z := point 3.6 of p ;
 q := z--urcorner p ;
 r := q -- reverse bottomboundary p -- cycle ;
 draw p ;
 draw q ;
 draw r numberstriped (.25,10,5) withcolor blue ;
 labeloffset := 2mm ;
 label.llft("B", llcorner p) ;
 label.lrt ("C", lrcorner p) ;
 label.ulft("A", ulcorner p) ;
 label.urt ("D", urcorner p) ;
 label.lft ("M", z) ;
 \stopMPpage

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] Hatch an area with Metapost (Metafun)

2015-02-15 Thread John Kitzmiller
On Feb 15, 2015, at 6:00 AM, Fabrice mailto:couvreur.fabr...@wanadoo.fr>> wrote:
> 
> Thank you for this new example.
>> Try the mpost variable lableoffset := ? to adjust.
> 
> This does not seem to workwith lableoffset := 2mm.
> Fabrice

I spelled it wrong, sorry! It is labeloffset := 2mm;

___
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] Hatch an area with Metapost (Metafun)

2015-02-11 Thread John Kitzmiller
On Feb 10, 2015, at 3:42 PM, couvreur.fabr...@wanadoo.fr 
 wrote:
> Is it  possible to have  some explanation of  the parameters of  the  macro  
> numberstriped(#1,#2,#3)  ?
> How to have  horizontal hatching  ?  (How to  change the slope  hatching  ?)

There is also anglestriped in mp-tool with some examples. The second argument 
changes the angle.

\startMPpage[offset=2mm]
  path p, q ;
  p := unitsquare scaled 4cm ;
  z1 = point 3.6 of p ;
  q := subpath (0,2) of p -- z1 -- cycle;
  q := q shifted(-4cm,-4cm);
  draw q anglestriped(1,180,6) withcolor blue;
  draw p ; 
\stopMPpage

(I have not yet found why the striped path q goes out of position. Looking at 
mp-tool may help.)

> I  just noticed  that the position of  labels  is not  quite the  same  when 
> using  macros  and macro  Metafun Metapost:
> I think the  labels are  too near to the  corners of the square  with the  
> macro  Metafun.

Try the mpost variable lableoffset := ? to adjust.

HTH,
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] Hatch an area with Metapost (Metafun)

2015-02-09 Thread John Kitzmiller
On Feb 9, 2015, at 1:46 PM, Fabrice mailto:couvreur.fabr...@wanadoo.fr>> wrote:
> 
> Great, but I did not know the macro numberstriped. Is it a Metapost or 
> Metafun macro?



It is a MetaFun macro in mp-tool, afaik.

The idea of filling a path is sometimes clipping to a path. Here is a way to do 
your task with (almost) only MetaPost:

\startMPpage[offset=2mm]
 path p, q ;
 p := unitsquare scaled 4cm ;
 z1 = point 3.6 of p ;
 q := z1 -- urcorner p -- lrcorner p -- llcorner p -- cycle;
 for i = 8 step -.5 until 0:
   draw (i,0)*cm -- (i-4,4)*cm withpen pencircle scaled 2pt withcolor blue;
 endfor;
 clip currentpicture to q;
 draw p ; draw q ;
 label.llft("B", llcorner p) ;
 label.lrt ("C", lrcorner p) ;
 label.ulft("A", ulcorner p) ;
 label.urt ("D", urcorner p) ;
 label.lft ("M", z1) ;
\stopMPpage

…just in case it helps to clarify.

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] 2UP Arranging

2015-02-02 Thread John Kitzmiller
Using 2UP the rightmargin on odd (recto) pages becomes the leftmargin on even 
(verso) pages.

Is there an option for 2UP doublesided to be printed and folded where the 
rightmargin is always on the righthand side of each ‘page’ from the reader’s 
viewpoint? Or another layout scheme to get the same result?

This mwe shows 2UP default:

\definepapersize[booklet][width=140mm,height=216mm]
\setuppapersize[booklet][letter,landscape]
\setuppagenumbering[alternative=doublesided]
\setuparranging[2UP,doublesided]

\setuplayout[
  width=92mm,
  leftedge=0mm,  
  leftmargin=0mm,
  backspace=15mm,
  rightmargindistance=3mm,
  rightmargin=25mm,
  ]

\showframe

\starttext
\dorecurse{4}{\input ward \page}
\stoptext

And this gives an image of the desired layout:

\definepapersize[booklet][width=140mm,height=216mm]
\setuppapersize[booklet][letter,landscape]
\setuppagenumbering[alternative=doublesided]
\setuparranging[2UP,doublesided]

\setuplayout[
  width=92mm,
  leftedge=0mm,  
  leftmargin=0mm,
  backspace=15mm,
  rightmargindistance=3mm,
  rightmargin=25mm,
  ]

\definelayout[evenside][
  width=92mm,
  leftmargindistance=3mm,
  leftmargin=25mm,
  backspace=43mm,
  rigthedge=0mm,
  rightmargin=0mm,
  ]

\showframe

\starttext
\input ward \page
\setuplayout[evenside] \input ward \page
\setuplayout[reset] \input ward \page
\setuplayout[evenside] \input ward 
\stoptext

I would like to avoid the manual switching if possible. 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] letter booklet

2015-01-31 Thread John Kitzmiller

> On Jan 26, 2015, at 4:04 AM, schuster.wolfg...@gmail.com wrote:
> 
>> Am 25.01.2015 um 23:15 schrieb John Kitzmiller > <mailto:k...@inradius.net>>:
>> 
>> Desired outcome: a multipage booklet on letter size paper with margins lined 
>> up when duplex printed and folded.
>> 
>> Using imposition with [letter][letter,landscape] did not work, so to start I 
>> used:
>> 
>> \definepapersize[booklet][width=140mm,height=216mm]
>> \setuppapersize[booklet][letter,landscape]
>> \setuparranging[2UP,doublesided]
>> \setuplayout[width=115mm,
>> leftedge=0mm,  
>> leftmargin=0mm,
>> backspace=15mm,
>> rightmargin=0mm,
>> rigthedge=0mm]  
>> \showframe
>> \starttext
>> \dorecurse{8}{\input Ward \page}
>> \stoptext
>> 
>> but the inside and outside margins do not line up. Where is the elegant path?
> 
> 1. Set your document doublesided with
> 
> \setuppagenumbering[alternative=doublesided]
> 
> 
> 2. Reduce the width of the backspace
> 
> \setuplayout[backspace=10mm]

Thank you Wolfgang.

Follow-up question: how to have a right margin appear on the right side of 
every booklet page?

The layouts I have tried with the following mwe put the right margin on the cut 
side of the paper, but that “reverses” the margin side from the reader’s view 
when printed and folded.


\definepapersize[booklet][width=140mm,height=216mm]
\setuppapersize[booklet][letter,landscape]
\setuppagenumbering[alternative=doublesided]
\setuparranging[2UP,doublesided]

\setuplayout[
  width=90mm,
  leftedge=0mm,  
  leftmargin=0mm,
  backspace=15mm,
  rightmargindistaince=3mm,
  rightmargin=25mm,
  ]

\showframe

\starttext
\dorecurse{4}{\input ward \page}
\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] letter booklet

2015-01-25 Thread John Kitzmiller
Desired outcome: a multipage booklet on letter size paper with margins lined up 
when duplex printed and folded.

Using imposition with [letter][letter,landscape] did not work, so to start I 
used:

\definepapersize[booklet][width=140mm,height=216mm]
\setuppapersize[booklet][letter,landscape]
\setuparranging[2UP,doublesided]
\setuplayout[width=115mm,
  leftedge=0mm,  
  leftmargin=0mm,
  backspace=15mm,
  rightmargin=0mm,
  rigthedge=0mm]  
\showframe
\starttext
\dorecurse{8}{\input Ward \page}
\stoptext

but the inside and outside margins do not line up. Where is the elegant path?

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] plot data from file: cld

2015-01-05 Thread John Kitzmiller
On Jan 5, 2015, at 5:51 AM, Hans Hagen mailto:pra...@wxs.nl>> 
wrote:

>> On 1/4/2015 6:04 AM, Akira Kakuto wrote:
>> Dear John,
>> 
>>> How to make this a polygon?
>> 
>> An example:
>> 
>> \starttext
>> \startluacode
>> local metafun = context.metafun
>> metafun.start()
>> io.input("DATA")
>> local i, j
>> local x, y, s, t1, t2
>> i = 1
>> x={}
>> y={}
>> s="draw "
>> while true do
>>  x[i], y[i] = io.read("*n", "*n")
>>  if not x[i] then break end
>>  metafun("filldraw fullcircle scaled 2mm shifted(%dcm,%dcm);",x[i],y[i])
>>  i = i + 1
>> end
>> i = i - 1
>> for j = 1, i do
>>  t1 = tostring(x[j])
>>  t2 = tostring(y[j])
>>  s = s.."("..t1.."cm,"..t2.."cm)--"
>> end
>> t1 = tostring(x[1])
>> t2 = tostring(y[1])
>> s = s.."("..t1.."cm,"..t2.."cm)"
>> s = s.." withpen pencircle scaled 1bp;"
>> metafun(s)
>> metafun.stop()
>> \stopluacode
>> \stoptext
> 
> Here is a bit more compact version. A path can normally nicely be concat 
> using "--" or ".." and we have a metafun helper drawpoints.
> 
> \starttext
> \startluacode
> context.metafun.start()
> local split = utilities.parsers.csvsplitter { separator = " " }
> local data = split(io.loaddata("data.txt"))
> for i=1,#data do
> data[i] = string.formatters["(%s,%s)"](unpack(data[i]))
> end
> context.metafun("path p ; p := (%s -- cycle) scaled cm 
> ;",table.concat(data,"--"))
> context.metafun("draw   p withpen pencircle scaled 0.25mm ;")
> context.metafun("drawpoints p withpen pencircle scaled 2.00mm ;")
> context.metafun.stop()
> \stopluacode
> \stoptext

Thank you Hans. A few tools new to me in there!

I am wondering (and will try to find) if multiple paths could be contained in 
the external file— a marker and test structure?

Thanks again,

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] plot data from file: cld

2015-01-04 Thread John Kitzmiller
On Jan 4, 2015, at 6:00 AM, ntg-context-requ...@ntg.nl wrote:
> Dear John,
> 
>> How to make this a polygon?
> 
> An example:

Many thanks to you Akira.

Reading the file into lua tables is good sense, and thank you for the string 
manipulations to pass to metafun().

From your teaching I changed this assignment:

> t1 = tostring(x[1])
> t2 = tostring(y[1])
> s = s.."("..t1.."cm,"..t2.."cm)"
> s = s.." withpen pencircle scaled 1bp;"

to: s = s.."cycle withpen pencircle scaled 1bp;”

to close the polygon.

With respect,

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] plot data from file: cld

2015-01-03 Thread John Kitzmiller
I seek how to use context-lua to draw a path from ‘points’ in an external file. 

Below is one way to plot points from an external file, call the file DATA with 
contents:

1 3
-2 2
-3 -1
3 -2

\starttext
\startluacode
local metafun = context.metafun
metafun.start()

io.input(“DATA")
while true do
  local x, y = io.read("*n", "*n")
  if not x then break end
  metafun("filldraw fullcircle scaled 2mm shifted(%dcm,%dcm);",x,y)
end

metafun.stop()
\stopluacode
\stoptext


How to make this a polygon?

I know other ways to read and manipulate DATA with Lua—it is the drawing part 
where I most look for help.

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] Using Euler with simplefonts

2015-01-01 Thread John Kitzmiller
On Jan 1, 2015, at 6:00 AM, Kumar Appaiah wrote:

> I am trying to use the simplefonts approach to get Euler for math,
> along with TeX Gyre fonts for text. 


Here is setup magic from Hans and Aditya from August 2013:


\usetypescriptfile[euler]
\starttypescript[myfamily]
\definetypeface[myfamily][rm][serif][pagella][default]
\definetypeface[myfamily][ss][sans] [dejavu][default]
\definetypeface[myfamily][tt][mono] [inconsolata][default]
\definetypeface[myfamily][mm][math] [pagellaovereuler][default]
\stoptypescript

\usetypescript[myfamily]
\setupbodyfont[myfamily]
\appendtoks \rm \to \everymathematics
\setupmathematics
 [lcgreek=normal, ucgreek=normal]


One can change the families, e.g. schola for pagella, etc., but I think the  
last [pagellaovereuler] and the rest has to stay.
___
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] overlay

2014-11-24 Thread John Kitzmiller
>Am 22.11.2014 um 21:32 schrieb John Kitzmiller:
>> Given rectangles with text:
>> 
>> \starttext
>> Before:\\
>> \startMPcode
>>   draw unitsquare xscaled 2cm yscaled 1cm;  
>> \stopMPcode
>> \\
>> After:\\
>> \startMPcode
>>   for i=0 upto 1:
>> draw unitsquare scaled 1cm xshifted i*cm;
>>   endfor;
>> \stopMPcode
>> \stoptext
>> 
>> 
>> How can a line be drawn connecting the right edges of the rectangles? I
>> have played with:
>> 
>> \startuniqueMPgraphic{line}
>>   path a;
>>   a:=(0,0)--(0,3cm);
>>   draw a withpen pencircle scaled 3pt withcolor green;
>> \stopuniqueMPgraphic
>> 
>> \defineoverlay[line][{\uniqueMPgraphic{line}}]
>> 
>> 
>> and using it in \framed, but placing the line correctly is elusive.
>> 
>> 
>Just a quick and dirty solution. The trick is to draw the extra line as
>part of the graphic and then fake the boundingbox. This is also limited
>to a few centimeter, objects are cut off after you reach that
>'invisible' border around the boundingbox.
>
>I would use uniqueMPgraphic with proper parameters for the graphics.
>Using overlays is also possible (urcorner OverlayBox), but I see no real
>need or benefit to do so.
>
>
>HTH,  Peter

Yes it helped Peter, thank you. Interesting moves with the mpost bounding box.

I thought I might need more flexibility—overlays—but it has turned out that 
single mp graphic with labels for the commentary will work for the task.

Thanks again, 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] overlay

2014-11-22 Thread John Kitzmiller
Given rectangles with text:

\starttext
Before:\\
\startMPcode
  draw unitsquare xscaled 2cm yscaled 1cm;  
\stopMPcode
\\
After:\\
\startMPcode
  for i=0 upto 1:
draw unitsquare scaled 1cm xshifted i*cm;
  endfor;
\stopMPcode
\stoptext

How can a line be drawn connecting the right edges of the rectangles? I have 
played with:

\startuniqueMPgraphic{line}
  path a;
  a:=(0,0)--(0,3cm);
  draw a withpen pencircle scaled 3pt withcolor green;
\stopuniqueMPgraphic

\defineoverlay[line][{\uniqueMPgraphic{line}}]

and using it in \framed, but placing the line correctly is elusive.




___
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] Lua to Context Table

2014-08-02 Thread John Kitzmiller

> On Aug 2, 2014, Aditya Mahajan  wrote:
>> On Sat, 2 Aug 2014, luigi scarso wrote:
>>> On Sat, Aug 2, 2014, John Kitzmiller  wrote:
>>> Here is Lua code that prints the first nine fibonacci numbers:
>>> 
>>> local function fib(n)
>>>  f={1,1}
>>> ...the Wiki entries, CLD, and tried Aditya's method from Stack Exchange; I 
>>> am
>>> missing something.
>>> 
>> 
>> You have a *global* table f  that collides with the internals of context
>> ...
>> local function fib(n)
>> local f={1,1}
>> ...
> 
> This version recomputes all fibnocci numbers from scrach each time. Here 
> is a memoized version:
> 
> local fibs = {1, 1}
> local function fib(n)
>   if fibs[n] == nil then
> print(">>>>", "Computing fib:" .. n)
> fibs[n] = fib(n-1) + fib(n-2)
>   end
> ...


Thanks to you both! I missed the global/local conflict, and then learned a way 
to avoid double computation; thanks again!

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] Lua to Context Table

2014-08-01 Thread John Kitzmiller
Here is Lua code that prints the first nine fibonacci numbers:

local function fib(n)
  f={1,1}
  for i=3,9 do
f[i]=f[i-1]+f[i-2]
  end
  return(f[n])
end
for n=1,9 do print(fib(n)) end

Here is Context+Lua that prints 3 x 3 table of the first nine natural numbers:

\starttext
\setupTABLE[each][each][frame=off,align=left,width=4em,height=2em]
\startluacode
context.bTABLE()
for j = 0, 2 do
  context.bTR()
for k = 1, 3 do
  context.bTD()
context(3*j+k)
  context.eTD()
end
  context.eTR()
end
context.eTABLE()
\stopluacode
\stoptext

How can these be combined to print a 3 x 3 table of the first nine fibonacci 
numbers?

I have tried a couple of ways to iterate over the lua table f in the most 
indented line of context, looked at what pertinent threads I could find, the 
Wiki entries, CLD, and tried Aditya's method from Stack Exchange; I am missing 
something.

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] s-edu-01.cld

2014-07-30 Thread John Kitzmiller
Where to find s-edu-01.cld mentioned in Context Lua Documents?

I use minimals, just updated, --modules="all" --engine="luatex". Also tried 
--modules="s-edu-01.cld" as well as Google.


___
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] ConTeXt minimal on chromebook

2014-02-19 Thread John Kitzmiller
On Feb 17, 2014, at 5:51 PM, ntg-context-requ...@ntg.nl wrote:

> On Mon, Feb 17, 2014 at 9:23 PM, John Kitzmiller wrote:
>> I attempted to put ConTeXt minimal on Samsung chromebook and got:
>>  Error: your system "Linux armv7l" is not supported yet.
>>  Please report to the ConTeXt mailing-list (ntg-context@ntg.nl)
>> 
>> This is not a request to support the armv7l (unless it is trivial) but,
>> 
>> is it futile to attempt installing minimal on a chromebook with Intel ATOM 
>> N570, or Intel Celeron-867? (If I had them at hand I would try.)
> 
> It is trivial provided that someone is willing to compile the latest
> LuaTeX. Well, there might be some issues with different flavours of
> arm architectures (I'm not sure how to distinguish one from another).
> 
> Can you please try if these binaries work (there are two arm binaries,
> I'm not sure which ones are the proper ones)?
> - http://tug.org/svn/texlive/trunk/Master/bin/
> Or if you are able to install TeX Live?
> - http://www.tug.org/texlive/acquire-netinstall.html
> 
> If so, I'll add the necessary architecture to the list.


I installed Ubuntu on the chromebook using crouton 
(http://lifehacker.com/how-to-install-linux-on-a-chromebook-and-unlock-its-ful-509039343)
 and then apt-get context which gave a texlive version for armhf; also got vim 
and evince. From terminal under Ubuntu, which runs on top of ChromeOS, context 
foo.tex compiled a Hello World and a \startMPpage figure. That much worked.

This made me think the link for armhf-linux above might work without Ubuntu, 
but I am not skilled enough to use the trunk/Master--I got a text sym-link and 
a 7.3mb luatex file that I can not yet make executable (command not found.)

The texlive/acquire-netinstall results in 'Permission denied' even with sudo on 
the chromebook.

I have not yet tried Martin's approach with the .deb files but wanted to report 
back and thank you both for your suggestions.

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] ConTeXt minimal on chromebook

2014-02-17 Thread John Kitzmiller
On Feb 17, 2014, at 4:01 PM, Martin maaca Rehula wrote:

> I was using ConTeXt (ages ago) on my Nokia N800. There were/are pre-compiled 
> Debian packages for arm architecture. Try looking this direction.
> 
> Martin
> 
> 21:23:53 CET 2014, John Kitzmiller  napsal(a):
>> I attempted to put ConTeXt minimal on Samsung chromebook and got:
>>  Error: your system "Linux armv7l" is not supported yet.
>>  Please report to the ConTeXt mailing-list (ntg-context@ntg.nl)
>> 
>> This is not a request to support the armv7l (unless it is trivial) but,
>> 
>> is it futile to attempt installing minimal on a chromebook with Intel ATOM 
>> N570, or Intel Celeron-867? (If I had them at hand I would try.)

Thank you Martin. I was not clear. I can run Debian and other *nix flavors on 
the chromebook by various methods and then have ConTeXt, but I would rather not 
'dual boot.'

What I am after is to have ConTeXt run 'natively,' if that is the right 
word/concept, on a chromebook core platform. From the chromebook shell I know I 
can run vim to edit files but I would like to compile them. (Viewing will be 
the next chapter!)


 ___
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] ConTeXt minimal on chromebook

2014-02-17 Thread John Kitzmiller
I attempted to put ConTeXt minimal on Samsung chromebook and got:
  Error: your system "Linux armv7l" is not supported yet.
  Please report to the ConTeXt mailing-list (ntg-context@ntg.nl)

This is not a request to support the armv7l (unless it is trivial) but,

is it futile to attempt installing minimal on a chromebook with Intel ATOM 
N570, or Intel Celeron-867? (If I had them at hand I would try.)





___
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] nested itemize in margin

2013-10-23 Thread John Kitzmiller

To enumerate answer blanks in the right margin to match the question, thanks to 
Marco:

\define\ansblank{\inright{\getnumber[itemgroup:itemize]. \thinrules[n=1]}}
\setupitemgroup [itemize] [n,style=bold,right=\ansblank]

I am trying to augment this to handle nested itemizations so that the 
\getnumber in the right margin is from the parent itemize but the "\getletter" 
is from the child:

\starttext
\startitemize[n]
\item First
\item Second   
  \startitemize[a]
\item Related problem   % Would like this to show 2 a. before the marginrule
\item Related question  % Would like this to show 2 b. before the marginrule
  \stopitemize
\item Third
\stopitemize
\stoptext

Desired output:

1. First  1. _

2. Second
a. Related problem2a. 
b. Related question   2b. 

3. Third  3. _


My attempts have been to define a new "blank" and use [conversion=Character] 
along with stabs from cont-eni.pdf, but I am flailing and failing.

Thanks for any help,
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] error when installing ConTeXt Standalone

2013-09-25 Thread John Kitzmiller
Maybe you need to specify the installation directory or issue tex/setuptex from 
inside the install folder?

font-opt.lua should be in /tex/texmf-context/tex/context/base

John


> On 09/25/2013 12:01 AM, Mica Semrick wrote:
>> Have you added the bin directory to your PATH?
> 
> No, I invoke "source tex/setuptex", which does the same job.
> 
> 
> Pablo
> 
> 
>> On Tue, Sep 24, 2013 at 1:55 PM, Pablo Rodr?guez wrote:
>> 
>>Dear list,
>> 
>>I have installed a system-wide ConTeXt Standalone in Fedora 19,
>>following the instructions from the wiki.
>> 
>>But when I try to rebuild the font cache, I get the following error
>>(with option verbose):
>> 
>>resolvers   | resolving | remembering file 'font-otp.lua'cannot open
>>: No such file or directory
>> 
>>I don?t know what I?m doing wrong, but I get the error as root also.
>> 
>>Could anyone tell me what it?s wrong here?
>> 
>>Many thanks for your help,
>> 
>> 
>>Pablo

___
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] Math fallback

2013-07-31 Thread John Kitzmiller

On Jul 31, 2013, at 12:15 PM, ntg-context-requ...@ntg.nl wrote:

> 
> Am 30.07.2013 um 18:55 schrieb Aditya Mahajan :
> 
>> Is it possible to use the fallback mechanism for math fonts? For example, I 
>> am using Neo Euler for math which has a few missing glyphs. Can I use 
>> Cambria (or Xits) as a fallback font for missing glyphs.
>> 
>> I am using the simplefonts module, but I am happy to write a typescript file 
>> if that makes things easier. I do not really want to define a new virtual 
>> font.
> 
> The simplefonts module is written on top of the typescript mechanism and 
> there is nothing available at this level which can be used by the module. 
> When you use the \setmathfont command simplefonts loads only one of the 
> predefined typescripts.
> 
> Wolfgang

I too would like to use Neo Euler for math but need some of the missing 
glyphs/symbols, like \angle and \triangle. What would the typescript look like 
to provide fallback to font for the symbols?

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


[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] mptopdf in minimals

2013-04-18 Thread John Kitzmiller
On Wed, Apr 17, 2013 at 10:51 PM, John Kitzmiller wrote:
> 
> Is there something extra needed to use mptopdf with only context minimal?

Does it help if you run the following command first?
  texexec --make mptopdf
(it should or at least used to be used in past)

Mojca

--

Thank you Mojca,

Your idea did help for minimal examples. I get conflicts with more elaborate 
files (even the dreaded 'cannot make .mpx file') sometimes using either 
suggestions so...

retraining my fingers to put MP code in \startMPpage is the direction I will 
take because it gives the best looking forward result for me.

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] mptopdf in minimals

2013-04-17 Thread John Kitzmiller

On Apr 17, 2013, at 5:00 PM, Hans Hagen wrote:

> On 4/17/2013 10:51 PM, John Kitzmiller wrote:
>> Is there something extra needed to use mptopdf with only context minimal?
>> 
>> Experimenting with having just context standalone on mac osx:
>>  
>>  
>>  
>>  
>>  
>>  
>>  
>>  
>>  
>>  
>>  
>>  
>>   
>   
>   
>   
>   
>   
>   
>   
>   
>   
>Compiling with just mpost or using a 
> context \startMPcode wrapper works, e.g.:
>> 
>> beginfig(1);
>> draw origin--(100,100);
>> endfig;
>> end
> 
> if you have context installed you can try
> 
> mtxrun --script metapost ….


Thank you Hans. It works (no surprise) but now I will have to script it to save 
typing!

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] mptopdf in minimals

2013-04-17 Thread John Kitzmiller
Is there something extra needed to use mptopdf with only context minimal?

Experimenting with having just context standalone on mac osx:





















 Compiling with just mpost 
or using a context \startMPcode wrapper works, e.g.:

beginfig(1);
draw origin--(100,100);
endfig;
end

works with command line mpost % 

This is MetaPost, version 1.801 (kpathsea version 6.1.1dev)
(mpost.mp (/users/johnkitzmiller/context/tex/texmf/metapost/base/plain.mp
Preloading the plain mem file, version 1.004) ) (./mwe.mp [1] )
1 output file written: mwe.1
Transcript written on mwe.log.

and...

\starttext
\startMPcode
draw origin--(100,100);
\stopMPcode
\stoptext

works with command context %

But using mptopdf on the first snippet complains:

MPtoPDF 1.4.1 : running 'mpost --mem=mpost  mwe.mp'
This is MetaPost, version 1.801 (kpathsea version 6.1.1dev)
(mpost.mp (/users/johnkitzmiller/context/tex/texmf/metapost/base/plain.mp
Preloading the plain mem file, version 1.004) ) (./mwe.mp [1] )
1 output file written: mwe.1
Transcript written on mwe.log.
This is pdfTeX, Version 3.1415926-2.5-1.40.14 (TeX Live 2013)
 \write18 enabled.

kpathsea: Running mktexfmt mptopdf.fmt
/usr/texbin/mktexfmt: line 395: 
/users/johnkitzmiller/context/tex/texmf/texconfig/tcfmgr: is a directory
fmtutil: config file `fmtutil.cnf' not found.
I can't find the format file `mptopdf.fmt'!

MPtoPDF 1.4.1 : error while processing tex file


(Note: I do not have TeX Live 2013 installed. The message from line 7 gave me 
some hints and I created the directory and put mptopdf.fmt from a pdftex --ini 
mptopdf command … no luck)

Turning $PATH off from ~/context/tex/texmf-osx-64/bin mptopdf % gives:

MPtoPDF 1.4.1 : running 'mpost --mem=mpost  mwe.mp'
This is MetaPost, version 1.504 (kpathsea version 6.1.0)
(mpost.mp (/usr/local/texlive/2012/texmf-dist/metapost/base/plain.mp
Preloading the plain mem file, version 1.004)) (./mwe.mp [1] )
1 output file written: mwe.1
Transcript written on mwe.log.
This is pdfTeX, Version 3.1415926-2.4-1.40.13 (TeX Live 2012)
 restricted \write18 enabled.
[MP to PDF] (./mwe.1) [1]
Output written on mwe.pdf (1 page, 1305 bytes).
Transcript written on mwe.log.

MPtoPDF 1.4.1 : mwe is converted to mwe-1.pdf

as I have been using. How to get mptopdf working from command line with just 
minimals?








 
___
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] arc notation Lucida

2013-04-14 Thread John Kitzmiller
My primary plea for help is how to make an arc symbol over 3 letters in ConTEXt 
with lucidaot as body font.

In pdfLaTeX I could use package fourier to get such an extensible symbol where 
\widearc was preferable to \widehat.

Hans' new "about" regarding extensible glyphs is suggestive, but because I am 
kind of a dope, leads me to my secondary call for help:

How can I directly enter the 'code' for a LucidaBrightOT character from the 
tables at TUG:

http://www.tug.org/store/lucida/otmath-blocks.pdf

and see the result? Or find the name to use in a math $ \symbolname $ 
environment?

Thanks, Kitz




___
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] enumerate fillinline

2012-02-21 Thread John Kitzmiller
> From: Marco 
> To: ntg-context@ntg.nl
> Cc:
> Date: Tue, 21 Feb 2012 17:19:42 +0100
> Subject: Re: [NTG-context] enumerate fillinlne
> On 2012-02-21 John Kitzmiller  wrote:
>
>> Any hints on enumerating fillinlines? Below describes the request (I
>> hope this fomats okay on forum) the answer lines align with the top
>> line of the question and are in a margin column:
>
> I am misusing the “right” key to inject a custom command. I'm sure
> there's a cleaner solution for that, but it can serve as a starting
> point.
>
> \definemargindata [mymarginrule] [location=right, width=3cm]
> \define\myrules
>        {\mymarginrule{\getnumber[itemgroup:itemize]. \thinrules[n=1]}}
>
> \setupitemgroup [itemize] [n]
> \setupitemgroup [itemize] [right=\myrules]
>
> \starttext
>        \startitemize
>                \startitem \input knuth \stopitem
>                \startitem \input ward  \stopitem
>        \stopitemize
> \stoptext
>
> Marco

Thanks Marco, it is a start and would have taken me a long time to get
there, however, the rule number is not inside the margin (the
location=right I think doesn't quite do it) and the rule number is
bold? I will pursue the direction you set me.  --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] enumerate fillinlne

2012-02-21 Thread John Kitzmiller
Any hints on enumerating fillinlines? Below describes the request (I
hope this fomats okay on forum) the answer lines align with the top
line of the question and are in a margin column:

1. Here is a question.  1. __

2. Here is another question. If it wraps2. __
   around the text should be in a block and
   the fillinline should be aligned with the
   first line of the question. Diagrams can
   also be part of the questions.

I accomplish this in pdfLaTeX by defining command:

\newcommand{\ansblank}{\leavevmode\marginpar{\labelenumi\hrulefill\raggedright\par}}

So, in enumerate environment \item\ansblank does the the trick. My
inexperienced attempts with ConTeXt make a terrible hash of it.
Thanks.
___
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] SciTE configuration to use mkiv instead of mkii

2012-01-03 Thread John Kitzmiller
It looks like you need to point Scite to
/home/peter/context1220/texmf-mswin/bin (assuming you are using
windows) in your PATH.



On Mon, Jan 2, 2012 at 10:52 PM, Peter Park Nelson
 wrote:
>
> Hello, I installed and configured SciTE today to try it out. I am
> using the standalone distribution. When I try to process a context
> document with F7, SciTE calls texexec and uses mkii instead of mkiv (I
> always use mkiv/luatex). How do I configure SciTE to use mkiv?
>
> Here's the beginning of the output:
>
> >texexec --pdf H1.tex
> /home/peter/context1220/tex/texmf-context/scripts/context/ruby/base/system.rb:16:
> warning: Insecure world writable dir /usr/local/texlive in PATH, mode
> 040777
> TeXExec | processing document 'H1.tex'
> TeXExec | no ctx file found
> TeXExec | tex processing method: context
> TeXExec | TeX run 1
> TeXExec | writing option file H1.top
> TeXExec | using randomseed 202
> TeXExec | tex engine: pdftex
> TeXExec | tex format: cont-en.mkii
> warning: Could not open char translation file `natural.tcx'.
> This is pdfTeX, Version 3.1415926-1.40.11 (TeX Live 2010)
>  \write18 enabled.
> entering extended mode
> (./H1.tex
>
> ConTeXt  ver: 2011.12.31 15:44 MKII  fmt: 2011.12.31  int: english/english
>
> system          : cont-new.mkii loaded
> (/home/peter/context1220/tex/texmf-context/tex/context/base/cont-new.mkii
>
> [...more output...]
> --
> Peter Park Nelson
> peter.park.nel...@gmail.com
> ___
> 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] Scite Lexers

2011-12-31 Thread John Kitzmiller
This may not belong here but perhaps someone would be willing to confer
with me off-list?

After Scite re-install with new MkIV instructions I can not find where to
change background color. (I was able to change it before under ebswift
installation although syntax highlighting for *tex did not work--such a
deal!)

The only lead I have so far is, commenting out "import lexers/lpeg" in
SciteGlobal.properties takes away all highlighting for all languages.

I know there is a warning about lexer interaction from November 2011, but I
have not had any other problems (except Purge All does not work) with Scite
3.02, lpeg lexers 3.02-1, and ConTeXt  ver: 2011.12.20 22:24 MKIV.

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] MetaFUN's \setupMPpage broken?

2011-12-27 Thread John Kitzmiller
On Tue, Dec 27, 2011 at 6:00 AM,  wrote:

>
> Hi ConTeXt user's,
>
> A few weeks ago I upgraded to the 11-11-29 version (MkIV) and today
> installed the 11-12-23 version (MkIV). The \setupMPpage command in the
> basic example below:
>
> \setupMPpage[offset=1pt]
>
>  \startuseMPgraphic{test}
>   fill fullsquare rotated 45 ;
>  \stopuseMPgraphic
>
>  \starttext
>   \startMPpage
>\includeMPgraphic{test}
>   \stopMPpage
>  \stoptext
>
> yields the following error in both versions mentioned above:
>
> ! Undefined control sequence.
> system > tex > error on line 1 in file test.tex: Undefined control
> sequence ...
>
> All this worked just fine in the version of last August!
>
> Regards,
> Gerard Verhaag
>

Hello Gerard.

Moving the [offset=*] down to \startMPpage and eliminating the \setup
MPpage worked here. (I also scaled it up so I could see it on my viewer.)

\startuseMPgraphic{test}

fill fullsquare rotated 45 scaled 20;

\stopuseMPgraphic

 \starttext

\startMPpage[offset=5pt]

\includeMPgraphic{test}

\stopMPpage

\stoptext


This may be a feature.


--JohnK
___
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] Lua script not registered

2011-12-03 Thread John Kitzmiller
---Mojca wrote:

On Sat, Dec 3, 2011 at 04:56, John Kitzmiller wrote:
>
> I think I can get this setuptex.bat automated for random context runs but,
>
> for some reason(s) C:>context somefile.tex will not work globally on my
> personal computer (Lenovo x100e) over which I have admin control (maybe I
am
> not a good admin?) and I have added C:\context\tex\texmf-mswin\bin to my
> PATH
>
> I still get "Lua script not registered" complaint when I try to compile
> outside of C:\context directory
>
> I suppose I could live with keeping all binaries and docs in C:\context,
but
> that is not so inviting compared to being able to pdfLaTeX a doc over
> Dropbox via MikTeX for example.

You need to have C:\context\tex\texmf-mswin\bin in front of MikTeX's
bin, else the command "context" will use LuaTeX from MikTeX and that
one won't find ConTeXt scripts.

However, you might stumble into some problems with LaTeX then, but it
might be possible to remove pdfTeX (during installation of ConTeXt you
can say --engines=luatex) and then it will be unlikely that you will
want to use the same binary with ConTeXt and LaTeX (I have no idea how
kpathsea would work in such a scenario).

Mojca

end of quote ---

Good thinking Mojca! Moving C:\context up in PATH has done the trick from
the command line. Now I will fuss getting editor to work.

I compiled a few of my standard docs through MiKTeX pdflatex and mpost docs
with no conflict so far. Thank you so much for the suggestion and thanks to
luigi and Hans for their help too.

Then I will read and play with wonderful ConTeXt manuals and generate a
million more questions ;)

--johnk
___
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] Lua script not registered

2011-12-02 Thread John Kitzmiller
Replying to the list in this manner--having to retype the subject--is
unusual to me, and I hope it does not create problems for the list. Please
help me on how to reply within the mail archive to make more efficient.
Many thanks to those who have replied on the topic!

Thank you, Aditya--

I had run C:\context\tex\setuptex.bat and then tried

C:\context>context firstfile.tex

which worked (now down to 3+ secs from 11+ at first run--file = \starttext
Hello World \stoptext)

I think I can get this setuptex.bat automated for random context runs but,

for some reason(s) C:>context somefile.tex will not work globally on my
personal computer (Lenovo x100e) over which I have admin control (maybe I
am not a good admin?) and I have added C:\context\tex\texmf-mswin\bin to my
PATH

I still get "Lua script not registered" complaint when I try to compile
outside of C:\context directory

I suppose I could live with keeping all binaries and docs in C:\context,
but that is not so inviting compared to being able to pdfLaTeX a doc over
Dropbox via MikTeX for example.

--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] Lua script not registered

2011-12-02 Thread John Kitzmiller
I hope this does not open another thread with the same name, but I did not
find a way to respond directly within the archive--something else I am
missing or will ntg find the reference? Here it goes...

Thank you for response luigi. The story:

OS = Windows7 professional
I also have MikTeX installed which I use routinely for pdfLaTeX and
METAPOST from TeXworks

download 
context-setup-mswin.zip
from
the wiki
unzip to  C:\context
run from shell  C:\context>first-setup.bat --modules=all
add to PATH  C:\context\tex\texmf-mswin\bin\
run from shell  C:\context>first-setup.bat --keep

Then create tex file \starttext Hello world \stopptext  in different
location.

Navigate shell to that location and  >context firstfile.tex

Result is  message
context: The Lua script is not registered.
context: Data: context

Aha! I tried moving firstfile.tex into C:\context and then run and it
works, but takes 11.62 seconds--not so good.

However, I still get Lua script not registered when I try to run from other
file locations, which makes me think it is PATH problem that I will
continue to chase but if anything looks obvious please help.

--johnk
___
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] Lua script not registered

2011-12-02 Thread John Kitzmiller
Hello.

Trying to make my first doc with ConTeXt (Win7, standalone install) I get
the error:

context: The Lua script is not registered
context: Data: context

and I am taken back to the command prompt. Nothing is produced.

Any ideas?

What did I overlook?

After `texing otherwise for years I am really looking forward to diving
into ConTeXt.

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
___