Re: [NTG-context] Passing text to Metapost functions

2005-12-26 Thread Hans Hagen

David Arnold wrote:


1. How can I do this in plain metapost?

2. What would be the Context Way?



btex ... etex is parsed as-is and therefore cannot be uses

this is what the macro textext(...) is for, it writes the (expanded) 
string to a file and then applies tex to it between runs


Hans
___
ntg-context mailing list
ntg-context@ntg.nl
http://www.ntg.nl/mailman/listinfo/ntg-context


Re: [NTG-context] Table of content

2005-12-26 Thread Hans Hagen

Willi Egger wrote:


Dear ConTeXters,

At the moment I am bit at a loss.
I should prepare a document, wherein there will be a difference 
between one chapter title and the respective row in the table of 
contents. What it should become looks as follows:


\chapter{This is the title of the chapter}

In the table of contents it should show up as:

Epilog: This is the title of the chapter

So the question is, how to get the word Epilog into the table of 
contents in front of the chapter title, neatly aligned with the rest 
of the table of contents.


each time ... then hook it into the list command

once: then do something like:

\def\Epilog{Epilog: }

\placelist[chapter]

\def\Epilog{}

\chapter{\Epilog This...}

Hans

___
ntg-context mailing list
ntg-context@ntg.nl
http://www.ntg.nl/mailman/listinfo/ntg-context


Re: [NTG-context] spanish symbols for interrogation and exclamation

2005-12-26 Thread Hans Hagen

Henning Hraban Ramm wrote:

 How do I write the spanish interrogation symbol that is up-side  
down?

 also
 How do I write the spanish exclamation symbol that is also up- 
side down?

 thank you



Better in matters of logical markup would be a definition like  
\quotation, say \exclamation or \question,
but I don't know if there are languages other than Spanish that need  
additional signs/formatting for those...


interesting suggestion, we can use the delimited text mechanism for it 
(core-mis);  what do the spanish users think of if?


Hans
___
ntg-context mailing list
ntg-context@ntg.nl
http://www.ntg.nl/mailman/listinfo/ntg-context


Re: [NTG-context] Columns (text alignment)

2005-12-26 Thread Fabio Mancinelli

Peter Rolf wrote:


using \blank[line] (and also the derived halfline) inserts *no* glue
(see definition in context manual). use small,medium,big or any
fraction/combination of these instead.



I did several (simpler) tests:

\starttext
\startcolumns
\showmakeup
\dorecurse{5}{
  \section{Section}
  \input text
}
\stopcolumns
\stoptext

Line alignment is totally wrong. Putting sections while having columns 
leads to wrong alinged lines.


I tried several combinations of the following:
\setuplayou[grid=yes], \setupcolumns[blank={line,fixed}], various align 
assignments... The result is always the same.


I have read the manual where it is stated that When a switch in 
fontsize is desirable you should do so before starting the column 
mechanism. (page 65). I don't see how this statement is applicable to 
\section(s)


Thanks,
Fabio

P.S.: text.tex is a simple text paragraph without any control sequence
___
ntg-context mailing list
ntg-context@ntg.nl
http://www.ntg.nl/mailman/listinfo/ntg-context


Re: [NTG-context] Columns (text alignment)

2005-12-26 Thread Peter Rolf
Fabio Mancinelli wrote:
 Peter Rolf wrote:
 
 using \blank[line] (and also the derived halfline) inserts *no* glue
 (see definition in context manual). use small,medium,big or any
 fraction/combination of these instead.

 
 I did several (simpler) tests:
 
 \starttext
 \startcolumns
 \showmakeup
 \dorecurse{5}{
   \section{Section}
   \input text
 }
 \stopcolumns
 \stoptext
 
 Line alignment is totally wrong. Putting sections while having columns
 leads to wrong alinged lines.
 
 I tried several combinations of the following:
 \setuplayou[grid=yes], \setupcolumns[blank={line,fixed}], various align
 assignments... The result is always the same.
 
 I have read the manual where it is stated that When a switch in
 fontsize is desirable you should do so before starting the column
 mechanism. (page 65). I don't see how this statement is applicable to
 \section(s)
 
 Thanks,
 Fabio

Hi Fabio,

sorry, my first advice was bad. In the meantime I have played around
with columns and everything is working as expected. There are several
problems in your source. The first is, that you have to use

\setuplayout[grid=yes]

Read about grid snapping of headers in the details.pdf manual and look
into the columns environment (defined at the beginning of the columns
manual).

You can then adjust the headers (2 lines high) vertically by using the
'grid' parameter.

The problem with the graphic placing results from using \startcolumns
instead of \startcolumnset (see example in columns.pdf).

I attach my working example.

Greetings, Peter

 P.S.: text.tex is a simple text paragraph without any control sequence
 ___
 ntg-context mailing list
 ntg-context@ntg.nl
 http://www.ntg.nl/mailman/listinfo/ntg-context
 
 

\setupoutput[pdftex]

%\usetypescript[adobekb][\defaultencoding]
%\usetypescript[sans]
%\setupbodyfont[sans,10pt]
\loadmapfile [texnansi-bitstrea-zapfhumanist.map]
\usetypescriptfile [type-bitstrea-zapfhumanist]
\usetypescript [ZapfHumanist]
\setupbodyfont [ZapfHumanist,11pt]%



\definefont [SectionHeaderFont] [ZapfHumanist-Bold at 14pt]
\definefont [SubSectionHeaderFont] [ZapfHumanist-Bold at 12pt]
\definefont [SubSubSectionHeaderFont] [ZapfHumanist-Bold at 10pt]


\setuplayout[
  width=middle,
  height=middle,
  grid=yes,
  lines=50,
  topspace=1cm,
  bottomspace=1cm,
  header=1cm,
  footer=1cm,
  backspace=1cm,
]

\setuptolerance[verytolerant,stretch]


\setuphead[section][
  style=\SectionHeaderFont,
  grid={line,4pt},
%  before=,
%  after=,
]

\setuphead[subsection][
  style=\SubSectionHeaderFont,
  grid={line,-4pt},
  before=\blank,
  after=,
]

\def\runin#1#2{#2.}
\setuphead[subsubsection][
  style=\SubSubSectionHeaderFont,
%  before=\blank,
  command=\runin,
  alternative=text,
]


\setupheadertexts[{\sl XNemesis.org Research and Development}][{\sl The vault}]

\setuppagenumbering[location=bottom]


\useexternalfigure[test][ringbearer][frame=true] % resolution 96ppi, 256colors



\definecolumnset[threecolumns][n=3]

\definecolumnsetspan[spantwo][n=2]
\definecolumnsetspan[spanthree][n=3]

\definecolumnsethsize{threecolumns}{1}{1}\One
\definecolumnsethsize{threecolumns}{1}{2}\Two
\definecolumnsethsize{threecolumns}{1}{3}\Three


%%
\starttext

\showstruts
\showgrid
\showgridboxes


%\startcolumns
\startcolumnset[threecolumns]

%
\startcolumnsetspan[spantwo]

\bgroup
\switchtobodyfont[32pt]
{\bf Title}
\switchtobodyfont[20pt]
{\par\noindent\sl Subtitle}
\blank[20pt, flexible]
\egroup

\stopcolumnsetspan
%


\bgroup
\blank
\setupindenting[none]
\switchtobodyfont[9pt]
{\bf Abstract}\par
AbstractHere
\ignorespaces
\egroup

\bgroup
\blank
\setupindenting[none]
\switchtobodyfont[9pt]
{\bf Keywords:}
Keywords here
\ignorespaces
\egroup




\dorecurse{4}{
\section{Section}
\dorecurse{1}{
\input tufte

\startitemize[packed]
\item A
\item B
\item C
\stopitemize
}

\subsection{Subsection}
\dorecurse{1}{\input tufte\relax}

\placefigure[btlr]{Simple figure}{\externalfigure[test][width=\Two]}


\subsubsection{Subsubsection}
\dorecurse{1}{\input tufte}
}

\blank[3*line, flexible]

\bgroup
\switchtobodyfont[9pt]
{\bf Author}\par
Author
\ignorespaces
\egroup

\stopcolumnset


\stoptext
%%% Local Variables: 
%%% mode: latex
%%% TeX-master: t
%%% End: 
___
ntg-context mailing list
ntg-context@ntg.nl
http://www.ntg.nl/mailman/listinfo/ntg-context


Re: [NTG-context] Passing text to Metapost functions

2005-12-26 Thread David Arnold

Hans,

I've tried various things without much success. I cannot seem to  
access the contents of xlbl below.


Is this approach ever going to work?

Note: I am trying to pass the string x to the parameter xlbl.

%output=pdf

\setupcolors[state=start]

\definecolor[gridlines][s=0.7]

\startMPinclusions

color gridlines; gridlines:=\MPcolor{gridlines};

vardef create_grid(expr xxmin,xxmax,xxscl,yymin,yymax,yyscl,uux,uuy)=
  for k=xxmin step xxscl until xxmax:
draw (xmin*uux,k*uuy)--(xmax*uux,k*uuy) withcolor \MPcolor 
{gridlines};
draw (k*uux,ymin*uuy)--(k*uux,ymax*uuy) withcolor \MPcolor 
{gridlines};

  endfor;
enddef;

vardef create_axes (expr xxmin,xxmax,yymin,yymax,uux,uuy) (text xlbl)  =
  drawdblarrow (1.05*xxmin*uux,0)--(1.05*xxmax*uux,0);
  draw textext.origin(\MPstring{xlbl});
  drawdblarrow (0,1.05*yymin*uuy)--(0,1.05*yymax*uuy);
enddef;

\stopMPinclusions


\starttext

\startMPpage

%initialize window parameters
numeric xmin, xmax, xscl, ymin, ymax, yscl;
xmin:=-5;
xmax:=5;
xscl:=1;
ymin:=-5;
ymax:=5;
yscl:=1;

%initialize scale
numeric ux, uy;
(xmax-xmin)*ux=4in; (ymax-ymin)*uy=3in;

%create the grid
create_grid(xmin,xmax,xscl,ymin,ymax,yscl,ux,uy);

%create the axes
create_axes(xmin,xmax,ymin,ymax,ux,uy)(x);

\stopMPpage

\stoptext

%%% Local Variables:
%%% mode: conTeXt-en
%%% End:
___
ntg-context mailing list
ntg-context@ntg.nl
http://www.ntg.nl/mailman/listinfo/ntg-context


[NTG-context] \definedescription question

2005-12-26 Thread VnPenguin
Hi all,
I'm trying to define a description:

\definedescription
[Desc]
[location=top,hang=3,headcolor=red]

But my PDF has not color for description header (I have already
\setupcolors[state=start]).

Another test:

\definedescription
[Desc]
[location=top,hang=3,headstyle={\switchtobodyfont[16pt]\red\bf}]

Does not work :(

Question: How to define color  font size for description header ? The
document of description is not complet. Search on Wiki  Mailing list
can not help me.

Thank you in advance,

--
http://vnoss.org
Vietnamese Open Source Software Community
___
ntg-context mailing list
ntg-context@ntg.nl
http://www.ntg.nl/mailman/listinfo/ntg-context


Re: [NTG-context] Table of content

2005-12-26 Thread Willi Egger

Hans, bedankt, dat werkt!

Willi

Hans Hagen wrote:


Willi Egger wrote:


Dear ConTeXters,

At the moment I am bit at a loss.
I should prepare a document, wherein there will be a difference 
between one chapter title and the respective row in the table of 
contents. What it should become looks as follows:


\chapter{This is the title of the chapter}

In the table of contents it should show up as:

Epilog: This is the title of the chapter

So the question is, how to get the word Epilog into the table of 
contents in front of the chapter title, neatly aligned with the rest 
of the table of contents.



each time ... then hook it into the list command

once: then do something like:

\def\Epilog{Epilog: }

\placelist[chapter]

\def\Epilog{}

\chapter{\Epilog This...}

Hans

___
ntg-context mailing list
ntg-context@ntg.nl
http://www.ntg.nl/mailman/listinfo/ntg-context


___
ntg-context mailing list
ntg-context@ntg.nl
http://www.ntg.nl/mailman/listinfo/ntg-context


Re: [NTG-context] Passing text to Metapost functions

2005-12-26 Thread Willi Egger

Hi David,

Put the x into a variable:

\setMPtext{1}{x}

you can define the \stetMPtext within the \starttext \stoptext or outside

Call
create_axes(xmin,xmax,ymin,ymax,ux,uy)(\MPbetex{1});


Willi

David Arnold wrote:


Hans,

I've tried various things without much success. I cannot seem to  
access the contents of xlbl below.


Is this approach ever going to work?

Note: I am trying to pass the string x to the parameter xlbl.

%output=pdf

\setupcolors[state=start]

\definecolor[gridlines][s=0.7]

\startMPinclusions

color gridlines; gridlines:=\MPcolor{gridlines};

vardef create_grid(expr xxmin,xxmax,xxscl,yymin,yymax,yyscl,uux,uuy)=
  for k=xxmin step xxscl until xxmax:
draw (xmin*uux,k*uuy)--(xmax*uux,k*uuy) withcolor \MPcolor 
{gridlines};
draw (k*uux,ymin*uuy)--(k*uux,ymax*uuy) withcolor \MPcolor 
{gridlines};

  endfor;
enddef;

vardef create_axes (expr xxmin,xxmax,yymin,yymax,uux,uuy) (text xlbl)  =
  drawdblarrow (1.05*xxmin*uux,0)--(1.05*xxmax*uux,0);
  draw textext.origin(\MPstring{xlbl});
  drawdblarrow (0,1.05*yymin*uuy)--(0,1.05*yymax*uuy);
enddef;

\stopMPinclusions


\starttext

\startMPpage

%initialize window parameters
numeric xmin, xmax, xscl, ymin, ymax, yscl;
xmin:=-5;
xmax:=5;
xscl:=1;
ymin:=-5;
ymax:=5;
yscl:=1;

%initialize scale
numeric ux, uy;
(xmax-xmin)*ux=4in; (ymax-ymin)*uy=3in;

%create the grid
create_grid(xmin,xmax,xscl,ymin,ymax,yscl,ux,uy);

%create the axes
create_axes(xmin,xmax,ymin,ymax,ux,uy)(x);

\stopMPpage

\stoptext

%%% Local Variables:
%%% mode: conTeXt-en
%%% End:
___
ntg-context mailing list
ntg-context@ntg.nl
http://www.ntg.nl/mailman/listinfo/ntg-context


___
ntg-context mailing list
ntg-context@ntg.nl
http://www.ntg.nl/mailman/listinfo/ntg-context


Re: [NTG-context] \definedescription question

2005-12-26 Thread Willi Egger

Hi,

Her the following works:

\definedescription
   [Desc]
   [location=top,hang=3,headstyle={\color[red]}]

or

\definedescription
   [Desc]
   [location=top,hang=3,headstyle={\switchtobodyfont[34pt]\bf\color[red]}]


Willi

VnPenguin wrote:


Hi all,
I'm trying to define a description:

\definedescription
[Desc]
[location=top,hang=3,headcolor=red]

But my PDF has not color for description header (I have already
\setupcolors[state=start]).

Another test:

\definedescription
[Desc]
[location=top,hang=3,headstyle={\switchtobodyfont[16pt]\red\bf}]

Does not work :(

Question: How to define color  font size for description header ? The
document of description is not complet. Search on Wiki  Mailing list
can not help me.

Thank you in advance,

--
http://vnoss.org
Vietnamese Open Source Software Community
 




___
ntg-context mailing list
ntg-context@ntg.nl
http://www.ntg.nl/mailman/listinfo/ntg-context
 


___
ntg-context mailing list
ntg-context@ntg.nl
http://www.ntg.nl/mailman/listinfo/ntg-context


Re: [NTG-context] spanish symbols for interrogation and exclamation

2005-12-26 Thread Ciro Soto
I think using a definition like \question
(or \pregunta if we use a spanish keyword)
would be useful. 
ciroOn 12/26/05, Hans Hagen [EMAIL PROTECTED] wrote:
Henning Hraban Ramm wrote:  How do I write the spanish interrogation symbol that is up-side down?  also  How do I write the spanish exclamation symbol that is also up-
 side down?  thank you Better in matters of logical markup would be a definition like \quotation, say \exclamation or \question, but I don't know if there are languages other than Spanish that need
 additional signs/formatting for those...interesting suggestion, we can use the delimited text mechanism for it(core-mis);what do the spanish users think of if?Hans___
ntg-context mailing listntg-context@ntg.nlhttp://www.ntg.nl/mailman/listinfo/ntg-context

___
ntg-context mailing list
ntg-context@ntg.nl
http://www.ntg.nl/mailman/listinfo/ntg-context


Re: [NTG-context] \definedescription question

2005-12-26 Thread VnPenguin
On 12/26/05, Willi Egger [EMAIL PROTECTED] wrote:
 Hi,

 Her the following works:

 \definedescription
 [Desc]
 [location=top,hang=3,headstyle={\color[red]}]

 or

 \definedescription
 [Desc]
 [location=top,hang=3,headstyle={\switchtobodyfont[34pt]\bf\color[red]}]


No, it does not work for me :(

I use:

 TeXExec 5.4.3 - ConTeXt / PRAGMA ADE 1997-2005

   texexec : TeXExec 5.4.3 - ConTeXt / PRAGMA ADE 1997-2005
   texutil : TeXUtil 9.0.0 - ConTeXt / PRAGMA ADE 1992-2004
   tex : pdfeTeX, 3.141592-1.30.5-2.2 (Web2C 7.5.5)
   context : ver: 2005.12.19
   cont-en : ver: 2005.12.19  fmt: 2005.12.19  mes: english

Thanks anyways,
___
ntg-context mailing list
ntg-context@ntg.nl
http://www.ntg.nl/mailman/listinfo/ntg-context


Re: [NTG-context] Passing text to Metapost functions

2005-12-26 Thread David Arnold

Willi et al,

No luck. I can't get any text to show up. I've spent about three days  
on this, reading, etc., and I'm no closer than I was three days ago.


%output=pdf

\setupcolors[state=start]

\definecolor[gridlines][s=0.7]

\startMPinclusions

color gridlines; gridlines:=\MPcolor{gridlines};

vardef create_grid(expr xxmin,xxmax,xxscl,yymin,yymax,yyscl,uux,uuy)=
  for k=xxmin step xxscl until xxmax:
draw (xmin*uux,k*uuy)--(xmax*uux,k*uuy) withcolor \MPcolor 
{gridlines};
draw (k*uux,ymin*uuy)--(k*uux,ymax*uuy) withcolor \MPcolor 
{gridlines};

  endfor;
enddef;

vardef create_axes (expr xxmin,xxmax,yymin,yymax,uux,uuy) (text xlbl)  =
  drawdblarrow (1.05*xxmin*uux,0)--(1.05*xxmax*uux,0);
  draw textext.origin(\MPbetex{xlbl});
  drawdblarrow (0,1.05*yymin*uuy)--(0,1.05*yymax*uuy);
enddef;

\stopMPinclusions

\starttext

\startMPpage

%initialize window parameters
numeric xmin, xmax, xscl, ymin, ymax, yscl;
xmin:=-5;
xmax:=5;
xscl:=1;
ymin:=-5;
ymax:=5;
yscl:=1;

%initialize scale
numeric ux, uy;
(xmax-xmin)*ux=4in; (ymax-ymin)*uy=3in;

%create the grid
create_grid(xmin,xmax,xscl,ymin,ymax,yscl,ux,uy);

%create the axes
\setMPtext{1}{x};
create_axes(xmin,xmax,ymin,ymax,ux,uy)(\MPbetex{1});

\stopMPpage

\stoptext

%%% Local Variables:
%%% mode: conTeXt-en
%%% End:
___
ntg-context mailing list
ntg-context@ntg.nl
http://www.ntg.nl/mailman/listinfo/ntg-context


[NTG-context] \setupMPvariables in \startMPpage

2005-12-26 Thread David Arnold


All,

Why doesn't this work?

%output=pdf

\startuseMPgraphic{usquare}
  draw unitsquare scaled 4cm;
\stopuseMPgraphic

\starttext

\startMPpage
\useMPgraphic{square}
\stopMPpage

\stoptext


Why doesn't this work?

%output=pdf

\startuseMPgraphic{usquare}
  draw unitsquare scaled \MPvar{u};
\stopuseMPgraphic

\starttext

\startMPpage
\setupMPvariables[usquare][u=4cm]
\includeMPgraphic{usquare}
\stopMPpage

\stoptext

___
ntg-context mailing list
ntg-context@ntg.nl
http://www.ntg.nl/mailman/listinfo/ntg-context


Re: [NTG-context] \setupMPvariables in \startMPpage

2005-12-26 Thread Willi Egger

Hi David,

without digging into depth, it works if you change MPpage into TEXpage

Willi

David Arnold wrote:



All,

Why doesn't this work?

%output=pdf

\startuseMPgraphic{usquare}
  draw unitsquare scaled 4cm;
\stopuseMPgraphic

\starttext

\startMPpage
\useMPgraphic{square}
\stopMPpage

\stoptext


Why doesn't this work?

%output=pdf

\startuseMPgraphic{usquare}
  draw unitsquare scaled \MPvar{u};
\stopuseMPgraphic

\starttext

\startMPpage
\setupMPvariables[usquare][u=4cm]
\includeMPgraphic{usquare}
\stopMPpage

\stoptext

___
ntg-context mailing list
ntg-context@ntg.nl
http://www.ntg.nl/mailman/listinfo/ntg-context


___
ntg-context mailing list
ntg-context@ntg.nl
http://www.ntg.nl/mailman/listinfo/ntg-context


[NTG-context] \startMPpage ... \stopMPpage

2005-12-26 Thread David Arnold

Hans, Taco, et al,

There's a quote in metafun-s.pdf (page 539) that says You can embed  
the graphic in a \startMPpage construct and process it with TEXEXEC.  
In that case you have the full MetaFun functionality available.  
Before processing the file, TEXEXEC will do a couple of checks on the  
file. It will also make sure that the auxiliary files (mpt for  
textext’s and mpo for outline fonts) are taken care of too.


I am really unsure of what this means as the code below will attest.  
Simply uncomment


% \startMPpage
%   \includeMPgraphic{EnglishRule}
% \stopMPpage

at the end and the file will not compile.

Just what can and cannot be used between a \startMPpage ...  
\stopMPpage pair? This is first introduced in metafun-s.pdf on page  
214 and wish there were more said there.



%output=pdf

\setupcolors[state=start]

\definecolor[gridlines][s=0.7]

\startMPinclusions
  color gridlines; gridlines:=\MPcolor{gridlines};
\stopMPinclusions


\starttext

\setupMPvariables
[EnglishRule]
[height=1ex,
   width=\localhsize,
   color=darkred]

\startuniqueMPgraphic{EnglishRule}{height,width,color}
numeric height; height=\MPvar{height};
x1=0;
x3=\MPvar{width};
x2=x4=.5x3;
y1=y3=0;
y2:=-y4=height/2;
fill z1..z2..z3  z3..z4..z1  cycle withcolor \MPvar{color};
\stopuniqueMPgraphic

\defineblank
[EnglishRule]
[medium]

\def\EnglishRule%
{\startlinecorrection[EnglishRule]
  \setlocalhsize
   \noindent \reuseMPgraphic{EnglishRule}
  \stoplinecorrection}

Why is this called an English line?
\startnarrower
  \EnglishRule
Is it because they cannot draw a straight one? This could be ture
after a few strong beers, but then, ow do Germans draw a line?
  \EnglishRule
\stopnarrower

\defineblank
[EnglishRule]
[big]

Why is this called an English line?
\startnarrower
  \EnglishRule
Is it because they cannot draw a straight one? This could be ture
after a few strong beers, but then, ow do Germans draw a line?
  \EnglishRule
\stopnarrower

% \startMPpage
%   \includeMPgraphic{EnglishRule}
% \stopMPpage

\stoptext


%%% Local Variables:
%%% mode: conTeXt-en
%%% End:___
ntg-context mailing list
ntg-context@ntg.nl
http://www.ntg.nl/mailman/listinfo/ntg-context


[NTG-context] hlingrid text t parameter?

2005-12-26 Thread David Arnold

All,

In mp-grid.mp, I find this definition:

def hlingrid (expr Min, Max, Step, Length, Width) text t =
  image ( for i=Min step Step until Max+grid_eps :
draw (origin--(Width,0)) shifted (0,i*(Length/Max)) t ;
  endfor ; ) ;
enddef ;

See the text t at the end of the first line? Can someone tell me what  
that does and can I have a small example of its use?


Thanks.
___
ntg-context mailing list
ntg-context@ntg.nl
http://www.ntg.nl/mailman/listinfo/ntg-context


[NTG-context] image command in Metapost

2005-12-26 Thread David Arnold

All,

In:

  def hlingrid (expr Min, Max, Step, Length, Width) text t =
image ( for i=Min step Step until Max+grid_eps :
draw (origin--(Width,0)) shifted (0,i*(Length/Max)) t ;
  endfor ; ) ;
  enddef ;

What does the image command do? Where is it documented?
___
ntg-context mailing list
ntg-context@ntg.nl
http://www.ntg.nl/mailman/listinfo/ntg-context


Re: [NTG-context] hlingrid text t parameter?

2005-12-26 Thread Aditya Mahajan

--- On Dec 26, David Arnold wrote ---


All,

In mp-grid.mp, I find this definition:

def hlingrid (expr Min, Max, Step, Length, Width) text t =
image ( for i=Min step Step until Max+grid_eps :
  draw (origin--(Width,0)) shifted (0,i*(Length/Max)) t ;
endfor ; ) ;
enddef ;

See the text t at the end of the first line? Can someone tell me what 
that does and can I have a small example of its use?


I think, (I can not test it right now), that this should allow you to 
do things like


hlingrid(0,10,0.1,5cm,3cm) withcolor 0.5white ;

which will draw the line with 50% gray, and

hlingrid(0,10,0.1,5cm,3cm) dashed evenly ;

which will draw a dashed grid and so on.


Aditya

--
Aditya Mahajan, EECS Systems, University of Michigan
http://www.eecs.umich.edu/~adityam || Ph: 7342624008
___
ntg-context mailing list
ntg-context@ntg.nl
http://www.ntg.nl/mailman/listinfo/ntg-context


Re: [NTG-context] hlingrid text t parameter?

2005-12-26 Thread David Arnold

Perfect! Thanks.

On Dec 26, 2005, at 11:29 PM, Aditya Mahajan wrote:


--- On Dec 26, David Arnold wrote ---


All,

In mp-grid.mp, I find this definition:

def hlingrid (expr Min, Max, Step, Length, Width) text t =
image ( for i=Min step Step until Max+grid_eps :
  draw (origin--(Width,0)) shifted (0,i*(Length/Max)) t ;
endfor ; ) ;
enddef ;

See the text t at the end of the first line? Can someone tell me  
what that does and can I have a small example of its use?


I think, (I can not test it right now), that this should allow you  
to do things like


hlingrid(0,10,0.1,5cm,3cm) withcolor 0.5white ;

which will draw the line with 50% gray, and

hlingrid(0,10,0.1,5cm,3cm) dashed evenly ;

which will draw a dashed grid and so on.


Aditya

--
Aditya Mahajan, EECS Systems, University of Michigan
http://www.eecs.umich.edu/~adityam || Ph: 7342624008
___
ntg-context mailing list
ntg-context@ntg.nl
http://www.ntg.nl/mailman/listinfo/ntg-context


___
ntg-context mailing list
ntg-context@ntg.nl
http://www.ntg.nl/mailman/listinfo/ntg-context