Malicious little bugger
All, Came across this again. \placeformula[-] \startformula [9,\infty)=\{x:\,x\ge 9\} \stopformula Got it to compile with: \placeformula[-] \startformula\relax [9,\infty)=\{x:\,x\ge 9\} \stopformula Yuk!
David Arnold wrote:
All,
Came across this again.
\placeformula[-] \startformula [9,\infty)=\{x:\,x\ge 9\} \stopformula
Got it to compile with:
\placeformula[-] \startformula\relax [9,\infty)=\{x:\,x\ge 9\} \stopformula
indeed, that's the price to pay for optional arguments Hans ----------------------------------------------------------------- Hans Hagen | PRAGMA ADE Ridderstraat 27 | 8061 GH Hasselt | The Netherlands tel: 038 477 53 69 | fax: 038 477 53 74 | www.pragma-ade.com | www.pragma-pod.nl -----------------------------------------------------------------
On Sun, 2 Jul 2006, Hans Hagen wrote:
David Arnold wrote:
\startformula\relax [9,\infty)=\{x:\,x\ge 9\} \stopformula
indeed, that's the price to pay for optional arguments
Really? Isn't it rather the price for optional space before the "["? Cheers, Peter -- http://pmrb.free.fr/contact/
Peter Münster wrote:
On Sun, 2 Jul 2006, Hans Hagen wrote:
David Arnold wrote:
\startformula\relax [9,\infty)=\{x:\,x\ge 9\} \stopformula
indeed, that's the price to pay for optional arguments
Really? Isn't it rather the price for optional space before the "["?
Same thing, because there is no way to turn that optional space off. Taco
� wrote:
On Sun, 2 Jul 2006, Hans Hagen wrote:
David Arnold wrote:
\startformula\relax [9,\infty)=\{x:\,x\ge 9\} \stopformula
indeed, that's the price to pay for optional arguments
Really? Isn't it rather the price for optional space before the "["?
for tex: \bla[ and \bla [ are the same, i.e. the \cs ends at a non-letter and the space is gobbled Hans ----------------------------------------------------------------- Hans Hagen | PRAGMA ADE Ridderstraat 27 | 8061 GH Hasselt | The Netherlands tel: 038 477 53 69 | fax: 038 477 53 74 | www.pragma-ade.com | www.pragma-pod.nl -----------------------------------------------------------------
On Sun, 2 Jul 2006, Hans Hagen wrote:
for tex:
\bla[
and
\bla [
are the same, i.e. the \cs ends at a non-letter and the space is gobbled
Ah, I see... Then, the #1 in \def\MyZigzag#1[#2]{% % the #1 makes sure we allow a space before the bracket on page http://wiki.contextgarden.net/Commands_with_KeyVal_arguments seems to be not really necessary. Thanks, Peter -- http://pmrb.free.fr/contact/
Can someone give me an example where this happens in either latex or tex? On Jul 2, 2006, at 12:53 PM, Hans Hagen wrote:
� wrote:
On Sun, 2 Jul 2006, Hans Hagen wrote:
David Arnold wrote:
\startformula\relax [9,\infty)=\{x:\,x\ge 9\} \stopformula
indeed, that's the price to pay for optional arguments
Really? Isn't it rather the price for optional space before the "["?
for tex:
\bla[
and
\bla [
are the same, i.e. the \cs ends at a non-letter and the space is gobbled
Hans
----------------------------------------------------------------- Hans Hagen | PRAGMA ADE Ridderstraat 27 | 8061 GH Hasselt | The Netherlands tel: 038 477 53 69 | fax: 038 477 53 74 | www.pragma-ade.com | www.pragma-pod.nl -----------------------------------------------------------------
_______________________________________________ ntg-context mailing list ntg-context@ntg.nl http://www.ntg.nl/mailman/listinfo/ntg-context
are the same, i.e. the \cs ends at a non-letter and the space is gobbled
Can someone give me an example where this happens in either latex or tex?
Not sure if this example is what you're looking for, but a typical case in TeX or LaTeX is: \TeX has a programming language that only a mother could love. which should be written as \TeX{} has a programming language that only a mother could love. or as \TeX\ has a ... -Sanjoy `Never underestimate the evil of which men of power are capable.' --Bertrand Russell, _War Crimes in Vietnam_, chapter 1.
Sanjoy, Of course. Thanks. But how about an example in latex or tex where a function eats a brace and crashes, as what happens with this context code: \placeformula[-] \startformula [9,\infty)=\{x:\,x\ge 9\} \stopformula I know I've seen this in Latex before, but I can't remember where. On Jul 2, 2006, at 7:29 PM, Sanjoy Mahajan wrote:
are the same, i.e. the \cs ends at a non-letter and the space is gobbled
Can someone give me an example where this happens in either latex or tex?
Not sure if this example is what you're looking for, but a typical case in TeX or LaTeX is:
\TeX has a programming language that only a mother could love.
which should be written as
\TeX{} has a programming language that only a mother could love.
or as
\TeX\ has a ...
-Sanjoy
`Never underestimate the evil of which men of power are capable.' --Bertrand Russell, _War Crimes in Vietnam_, chapter 1. _______________________________________________ ntg-context mailing list ntg-context@ntg.nl http://www.ntg.nl/mailman/listinfo/ntg-context
On Sun, 2 Jul 2006, David Arnold wrote:
Sanjoy,
Of course. Thanks.
But how about an example in latex or tex where a function eats a brace and crashes, as what happens with this context code:
\placeformula[-] \startformula [9,\infty)=\{x:\,x\ge 9\} \stopformula
I know I've seen this in Latex before, but I can't remember where.
\begin{equation} \begin{aligned} [g,\infty)=\{...\} \end{aligned} \end{equation} The package mathtools enforces that the optional arguments of aligned et al. should come in the same line, that is \begin{aligned}[t] takes "t" as an optional arguments which \begin{aligned} [t] does not. I do not think that this can be ever enforced in Context, because a lot of Context code is written like \definesomething [somename] [some options] \dosingleempty et al, could be changed to stop scanning on a newline, but I am certain it will break some of the internals. Aditya
Aditya Mahajan wrote:
On Sun, 2 Jul 2006, David Arnold wrote:
Sanjoy,
Of course. Thanks.
But how about an example in latex or tex where a function eats a brace and crashes, as what happens with this context code:
\placeformula[-] \startformula [9,\infty)=\{x:\,x\ge 9\} \stopformula
I know I've seen this in Latex before, but I can't remember where.
\begin{equation} \begin{aligned} [g,\infty)=\{...\} \end{aligned} \end{equation}
The package mathtools enforces that the optional arguments of aligned et al. should come in the same line, that is
\begin{aligned}[t] takes "t" as an optional arguments which
\begin{aligned} [t]
that only can work if one gives the end of line characters a different catcode; a side effect is that the lookahead may fail when the formula is passed in a macro so it will never be robust
does not.
I do not think that this can be ever enforced in Context, because a lot of Context code is written like
\definesomething [somename] [some options]
\dosingleempty et al, could be changed to stop scanning on a newline, but I am certain it will break some of the internals.
indeed, for tex (unless one messes around with the endline char) \define[] \define [] \define [] \define [] is the same, and in order to be consistent, context even does some explicit testing so that intermediate newlines and spaces are gobbles (when non standard), think of: \define[][] \define[] [] \define [] [] why should we treat spaces between \define [] and [] [] differently? anyhow, it dates back a long time, is rather optimized, and will not change Hans
David Arnold wrote:
Sanjoy,
Of course. Thanks.
But how about an example in latex or tex where a function eats a brace and crashes, as what happens with this context code:
\placeformula[-] \startformula [9,\infty)=\{x:\,x\ge 9\} \stopformula
I know I've seen this in Latex before, but I can't remember where.
LaTeX's newline -- \\ -- command is infamous for this, esp. because non-expert users tend to forget it even has an optional argument. Greetings, Taco
participants (6)
-
Aditya Mahajan
-
David Arnold
-
Hans Hagen
-
Peter Münster
-
Sanjoy Mahajan
-
Taco Hoekwater