[NTG-context] Wrapping \type{}

2004-05-29 Thread Nikolai Weibull
In my BNF module I use " as an active character that begins and ends
terminals in the grammar:

:  ; , "\|", .

Now, the above doesn't quite work as written, as \ is still active (and
so is, in fact | as we're really inside a \starttabulate.

What I would like for the "" pair to do is work as a wrapper for
\type{}, so that everything in-between is passed on to \type{}.
Is there a way of getting them to do that?

This is my current definition:

\gdef"%
  {\ifBNFoutsidestring%
\global\BNFoutsidestringfalse%
\begingroup%
  \BNFunsetcatcodes%
  \catcode`\"\@@active%
  \@@bnfterminalstart%
  \else%
  \@@bnfterminalstop%
\endgroup%
\global\BNFoutsidestringtrue%
  \fi}

I figured something like

\long\gdef"#1"%
  {\type{#1}}

might work, but it didn't.  It chokes on "." where . is also an
activated character for terminating a production in the grammar.

Any suggestions on how to go about this?  I mean, the obvious solution
is simply to write

:  ; , "\type{\|}", .

instead, but I would like to keep the input as clean as possible.
nikolai


--
::: name: Nikolai Weibull:: aliases: pcp / lone-star / aka :::
::: born: Chicago, IL USA:: loc atm: Gothenburg, Sweden:::
::: page: www.pcppopper.org  :: fun atm: gf,lps,ruby,lisp,war3 :::
main(){printf(&linux["\021%six\012\0"],(linux)["have"]+"fun"-97);}
___
ntg-context mailing list
[EMAIL PROTECTED]
http://www.ntg.nl/mailman/listinfo/ntg-context


Re: Re[2]: [NTG-context] Known nath bugs?

2004-05-29 Thread Sebastian Sturm
Hi,
Yes, this is generally true. All modules should get loaded
before \starttext.
Well, I had loaded it before \starttext in both cases. But when I 
loaded it in the first line of my file, it didn't adjust the 
delimiters; after moving the \usemodule[nath] line directly above the 
\starttext line, it worked like a charm. Maybe I produced some garbage 
inbetween. :-)

However, the units module still isn't working when nath is
loaded. Is it supposed to?
[...]
Anyway, it looks like the fix is easy: the problem is that
dimension commands are not protected (unexpandable).
[...]
Thank you very much, I'll try that. If it doesn't work, I can still get 
along without units, though it would have been nice to have that too. 
BTW, is there some kind of manual on aligning nath equations? I tried 
to align multiline equations using \startalign, but that only worked 
(in display mode) as long as no delimiters were used;
\[ \startalign a &= (b \\
b &= c) \stopalign \]
always produced an error message saying that I had left out an "}". I 
probably made some mistake, so a tutorial on aligning equations with 
nath would be great. The nathguide.pdf mentions eqnarray, but I guess 
that's not available in ConTeXt, or is it?

Best regards,
Sebastian
___
ntg-context mailing list
[EMAIL PROTECTED]
http://www.ntg.nl/mailman/listinfo/ntg-context


Re[2]: [NTG-context] Known nath bugs?

2004-05-29 Thread Giuseppe Bilotta
Saturday, May 29, 2004 Sebastian Sturm wrote:

> Hi,

> the delimiter sizing is working now; i had to load the module directly
> before \starttext.

Yes, this is generally true. All modules should get loaded
before \starttext.

> However, the units module still isn't working when nath is
> loaded. Is it supposed to?

Well, I had never tested them together, and given the very
extensive changes nath enacts, I'm not surprised it doesn't
work.

Anyway, it looks like the fix is easy: the problem is that
dimension commands are not protected (unexpandable).

In m-units.tex, look for the lines

\def\dimensionprefix#1%
  {\gdef\thedimensionprefix{#1}}

\def\dimensionaddfix#1%
  {\unskip
  %\mathematics{\umathematicstypeface#1}%
   \ustartmathmode\umathematicstypeface#1\ustopmathmode
   \nobreak
   \hskip\dimensionaddfixsignal}

\def\dimensionnopfix#1%
  {\dontbreakdimension
   \ifdim\scratchdimen=\dimensionpowersignal\relax
 \ustartmathmode
   \else
 \ustartmathmode
 \udimensionhalfspace
 \nobreak
   \fi
   \umathematicstypeface#1%
   \ustopmathmode
   \nobreak
   \hskip\dimensionsignal}

\def\dimensionmidfix#1%
  {\dontbreakdimension
   \ifdim\scratchdimen=\dimensionpowersignal\relax
 \ustartmathmode
 \udimensionbackspace
 \nobreak
   \else
 \ustartmathmode
   \fi
   \umathematicstypeface#1%
   \ustopmathmode
   \nobreak
   \hskip\dimensionmidfixsignal}

\def\dimensionpower#1%
  {\gdef\thedimensionpower{#1}}

and change each

\def\dimension...

into

\unexpanded\def\dimension

This should solve the problem.

I'm not 100% sure this is the best solution, though. An
alternative could be to keep those definition as they are and
instead make unexpandable the actual commands (\Micro etc).

Hans, what do you think?

-- 
Giuseppe "Oblomov" Bilotta

___
ntg-context mailing list
[EMAIL PROTECTED]
http://www.ntg.nl/mailman/listinfo/ntg-context


Re: [NTG-context] Re: Overwritten metapost files

2004-05-29 Thread Maurice Diamantini
Le 28 mai 04, à 21:27, Henning Hraban Ramm a écrit :
Am Freitag, 28.05.04, um 10:16 Uhr (Europe/Zurich) schrieb Nikolai 
Weibull:
Probably not as good a reason as I think, but yes, the reason being 
that
I want all texexec output to go into a separate directory.

Yes, I'd lik that idea very much too!
Sometimes, one have many (user) files in the main directory, One can
creates subdirectories for well indentified files such as "figures"
for all fil related to figure source (xfig, pstricks, matlab,...)
But I think all context build files (and file derived from context
like metopost files should go **by default** into a separate directory .
(but not the main output file such as "myRaport.pdf" !)
Did you try
texexec myfile --result=output/myfile

Maurice Diamantini
___
ntg-context mailing list
[EMAIL PROTECTED]
http://www.ntg.nl/mailman/listinfo/ntg-context


Re: [NTG-context] Known nath bugs?

2004-05-29 Thread Sebastian Sturm
Hi,
the delimiter sizing is working now; i had to load the module directly 
before \starttext. However, the units module still isn't working when 
nath is loaded. Is it supposed to?

Best regards,
Sebastian
___
ntg-context mailing list
[EMAIL PROTECTED]
http://www.ntg.nl/mailman/listinfo/ntg-context


[NTG-context] Re: Overwritten metapost files

2004-05-29 Thread Patrick Gundlach
Hi,

>> You know about texutil --purgeall ?
>
> No.  It seems it's called --purge on my machine, but it seems to do what
> you're suggesting :-).  Perhaps this is a better solution actually.

well, newer versions of texutil has purgeall; search the mailing list
archive if you need to find out the exact date when it changed.

Patrick

PS: mine is:

TeXUtil 8.2 - ConTeXt / PRAGMA ADE 1992-2004
___
ntg-context mailing list
[EMAIL PROTECTED]
http://www.ntg.nl/mailman/listinfo/ntg-context


[NTG-context] Re: Overwritten metapost files

2004-05-29 Thread Nikolai Weibull
* Patrick Gundlach <[EMAIL PROTECTED]> [May 29, 2004 11:50]:
> You know about texutil --purgeall ?

No.  It seems it's called --purge on my machine, but it seems to do what
you're suggesting :-).  Perhaps this is a better solution actually.

Thanks,
nikolai

--
::: name: Nikolai Weibull:: aliases: pcp / lone-star / aka :::
::: born: Chicago, IL USA:: loc atm: Gothenburg, Sweden:::
::: page: www.pcppopper.org  :: fun atm: gf,lps,ruby,lisp,war3 :::
main(){printf(&linux["\021%six\012\0"],(linux)["have"]+"fun"-97);}
___
ntg-context mailing list
[EMAIL PROTECTED]
http://www.ntg.nl/mailman/listinfo/ntg-context


[NTG-context] Re: Getting { in the input.

2004-05-29 Thread Nikolai Weibull
* Patrick Gundlach <[EMAIL PROTECTED]> [May 28, 2004 13:30]:
> \starttext
> \textbraceleft

in enco-def.tex this is
\definecharacter textbraceleft{\mathematics{\{}}
which means wrapping {\tt ...} around it doesn't give a teletyped brace
but a nice mathematics one.

> \type-{-

This doesn't seem to work well inside a table:

! Missing { inserted.

{

   &
\normalTABLEquote ->\unskip \!ttRightGlue &
   \omit \tablepos &
\NC ...rentTABLEcolumn \plusone \normalTABLEquote
  \fi
l.754 \NC
  \type{|}  \NC $\}$ \NC  \type{~} \NC  {\tt DEL} \NC\AR
?

where my .tex source reads:

\NC 120 \NC \type{x}  \NC \type{y}  \NC \type{z}  \NC \type-{-
\NC \type{|}  \NC $\}$ \NC  \type{~} \NC  {\tt DEL} \NC\AR

> \stoptext

It would be great if one could get the second version (\type-{-) working
inside a table, as this is the prettier solution.

Currently I just did my own

\definecharacter textbraceleft 123

(which some of the other enco-*.tex files did) for this and wrapped that
inside a {\tt ...}:

{\tt \textbraceleft}

Anyway, thanks for the suggestions,
nikolai

P.S.
Here's a small testfile:

\starttext
\starttable[|c|]
\NC \type-{- \NC\AR
\stoptable
\stoptext

D.S.

--
::: name: Nikolai Weibull:: aliases: pcp / lone-star / aka :::
::: born: Chicago, IL USA:: loc atm: Gothenburg, Sweden:::
::: page: www.pcppopper.org  :: fun atm: gf,lps,ruby,lisp,war3 :::
main(){printf(&linux["\021%six\012\0"],(linux)["have"]+"fun"-97);}
___
ntg-context mailing list
[EMAIL PROTECTED]
http://www.ntg.nl/mailman/listinfo/ntg-context


[NTG-context] Re: Overwritten metapost files

2004-05-29 Thread Patrick Gundlach
Hello,

> still go in the same directory as myfile, such as metapost files a .tmp
> and the .tui file.  I guess it's not that bad, but I like keeping things
> as clean as possible.  

You know about texutil --purgeall ?

Patrick
___
ntg-context mailing list
[EMAIL PROTECTED]
http://www.ntg.nl/mailman/listinfo/ntg-context


[NTG-context] Re: Re: Overwritten metapost files

2004-05-29 Thread Nikolai Weibull
* Henning Hraban Ramm <[EMAIL PROTECTED]> [May 29, 2004 11:11]:
> Did you try
> texexec myfile --result=output/myfile

Yes, I began with that, but the problem is that a lot of files will
still go in the same directory as myfile, such as metapost files a .tmp
and the .tui file.  I guess it's not that bad, but I like keeping things
as clean as possible.  Perhaps I'm being a bit unreasonable though,
cause having the directory structure that I do complicates some stuff
(such as includes),
nikolai

--
::: name: Nikolai Weibull:: aliases: pcp / lone-star / aka :::
::: born: Chicago, IL USA:: loc atm: Gothenburg, Sweden:::
::: page: www.pcppopper.org  :: fun atm: gf,lps,ruby,lisp,war3 :::
main(){printf(&linux["\021%six\012\0"],(linux)["have"]+"fun"-97);}
___
ntg-context mailing list
[EMAIL PROTECTED]
http://www.ntg.nl/mailman/listinfo/ntg-context