With the attached test file, which uses MPinclusions for a
staticMPfigure, I get an "Isolated expression".  I think it's a parser
bug somewhere, because deleting almost any word in the file removes the
error.

The file itself looks a bit crazy.  It is a minimal example generated by
a program to help with debugging.  The program randomly deletes a word
in the file, then tests whether the error still happens.  If yes, it
deletes another word.  If no, it restores the word, and tries again by
choosing another word to delete.  That process reduced the file from 4KB
to 2KB.

Here's the relevant piece of the transcript.  The same error happens at
live.contextgarden.net (so I don't think it's a Debian-specific issue).

  ! terminal: >> r_ladder
  ! Isolated expression.
  <to be read again> 
                     ;
  <*>  r_ladder;
                 ;

  .

  system          > tex > error on line 73 in file test-mpfigures.tex: 
terminal: >> r_ladder
  ! Isolated expression.
  <to be read again> 
                     ;
  <*>  r_ladder;
                 ;

   ...

  63     
  64     \startMPinclusions
  65     def r_ladder := draw unitsquare; enddef;
  66     \stopMPinclusions
  67     
  68     \startstaticMPfigure{resistiveladder}
  69       r_ladder;
  70     \stopstaticMPfigure
  71     
  72     \usestaticMPfigure[resistiveladder]
  73 >>  
  74     \stoptext
  75     

  <inserted text> ...0;;]===], [===[;;]===], false)}

  \meta_process_graphic ...!!es , \MPaskedfigure )}}
                                                    \egroup \placeMPgraphic 
\m...
  \meta_handle_reusable_graphic ...cess_graphic {#3}
                                                    }\setxvalue {\??mpgraphic 
...
  \meta_use_graphic ...aphic \currentMPgraphicname }
                                                    \empty 
\meta_end_graphic_g...
  <to be read again> 
                     \fi 
  \dodoubleemptyonespaced #1#2->#1[{#2}][]

  ...
  l.73 

And the start of the output, showing the version information:     

  mtx-context     | run 1: luatex 
--fmt="/var/lib/texmf/luatex-cache/context/f919750633122078d706dd10f1cfd39b/formats/cont-en"
 
--lua="/var/lib/texmf/luatex-cache/context/f919750633122078d706dd10f1cfd39b/formats/cont-en.lui"
 --backend="pdf" "./test-mpfigures.tex" \stoptext
  This is LuaTeX, Version beta-0.70.2-2012070301 (TeX Live 2012/Debian)
   \write18 enabled.
  (test-mpfigures.tex

  ConTeXt  ver: 2012.05.30 11:26 MKIV  fmt: 2013.4.11  int: english/english

  system          > cont-new.mkiv loaded

If you can think of further tests to run, I'll be happy to try them.
-- 
-Sanjoy

\definereferenceformat [inproblem] [text=Problem]

 setups    

\setuplayout[marking=on,location=middle,
  backspace=1.25in,
  leftmargindistance=0.125in, 
  width=4.75in,
  rightmargindistance=0.25in, 
    headerdistance=24bp,
  height=8.5in,
     bottom=12bp]


  [problem]
  
  ]

\starttext

  many games  flipping     tedious.
 computer  instead simulate  games  pseudorandom numbers
as  substitute    coin.    several runs produced by 
 
   with $1$  $2$  indicate  player won the 
then   shows the    resulted in  win.
 these  iterations, each player   times.   reasonable
conclusion       Each     chance

 try    With   games, one   count the
number     player  scanning the  beginnings.
computer  the 
Each run    because  program  different
pseudorandom  each  produces  different   The 
recent   $68$: In  words, player~$1$  
 and player~$2$ won  times.   probability  
winning now seems closer  $2/3$   $1/2$.

\externalfigure[fig/coin-flip.1]

    value,  diagram   as  tree.  
  contains  and T, and  one flip.   game
ends  the leaves, when     heads.  The boldface
 show the   the first  wins, e.g.  TTH, 
TTTTH.   probabilities of each  way are, 
     The  sum    is
the    the first  
\placeformula\startformula        
 .
\stopformula

This    summed using   formula (see
However,  more enjoyable   which    
formula in \inproblem[prob:explain-geometric-series]   
noticing the presence of   tree  its  one
 down.   is,  the first   tails,  happens
    the second player starts the game as 
he   were the first player.     player wins
the game with probability $1/2$ times  (the factor   is from
 probability     tosses tails).  Because one of
the two     two winning   and $p/2$
add  unity.  Therefore, $p=2/3$,   from the 

\startMPinclusions
def r_ladder := draw unitsquare; enddef;
\stopMPinclusions

\startstaticMPfigure{resistiveladder}
  r_ladder;
\stopstaticMPfigure

\usestaticMPfigure[resistiveladder]

\stoptext
_______________________________________________
dev-context mailing list
dev-context@ntg.nl
http://www.ntg.nl/mailman/listinfo/dev-context

Reply via email to