From: Bruce <ep...@gm...> - 2006-07-17 11:31:34
|
Hi, I`m having trouble using latex mode with pyx. I get an error when testing the use of latex, seems like system isn`t set to use latex in some way. I have installed tex and I wonder if I have to do something to make PyX find it or something? If I say pyx.text.set(mode="latex") I get something like: TexResultError: Unhandled tex response expression passed to tex was \doucumentclass{article}% \PyXInput{3} then there`s the path to article.cls path to size10.clo !Ilegal parameter number in definition of \striptwo |
From: Michael S. <mic...@ph...> - 2006-07-17 14:21:23
|
Hello Bruce, On 17.07.06, Bruce wrote: > I`m having trouble using latex mode with pyx. I get an error when > testing the use of latex, seems like system isn`t set to use latex in > some way. I have installed tex and I wonder if I have to do something > to make PyX find it or something? > If I say > > pyx.text.set(mode="latex") > > I get something like: > > TexResultError: Unhandled tex response > expression passed to tex was > \doucumentclass{article}% > \PyXInput{3} > then there`s the path to article.cls > path to size10.clo > !Ilegal parameter number in definition of \striptwo Your problem description is not yet sufficient to analyze the problem. Please try out one of the example files on the pyx hompage: The "hello world" example is a minimal example for the use of TeX. You can switch it to use LaTeX as well. Please send the whole error output of this example. Then, we need to know what kind of TeX distribution on what operating system you use. Best, Michael. -- "A mathematician is a device for turning coffee into theorems" Paul Erdös. |
From: Bruce <ep...@gm...> - 2006-07-18 10:20:15
|
On 7/17/06, Michael Schindler <mic...@ph...> wr= ote: > Hello Bruce, > > On 17.07.06, Bruce wrote: > > I`m having trouble using latex mode with pyx. I get an error when > > testing the use of latex, seems like system isn`t set to use latex in > > some way. I have installed tex and I wonder if I have to do something > > to make PyX find it or something? > > If I say > > > > pyx.text.set(mode=3D"latex") > > > > I get something like: > > > > TexResultError: Unhandled tex response > > expression passed to tex was > > \doucumentclass{article}% > > \PyXInput{3} > > then there`s the path to article.cls > > path to size10.clo > > !Ilegal parameter number in definition of \striptwo > > Your problem description is not yet sufficient to analyze the problem. > Please try out one of the example files on the pyx hompage: > The "hello world" example is a minimal example for the use of TeX. You > can switch it to use LaTeX as well. > Please send the whole error output of this example. > > Then, we need to know what kind of TeX distribution on what operating > system you use. > > Best, > Michael. > > -- > "A mathematician is a device for turning coffee into theorems" > Paul Erd=F6s. > > > ------------------------------------------------------------------------- > Using Tomcat but need to do more? Need to support web services, security? > Get stuff done quickly with pre-integrated technology to make your job ea= sier > Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronim= o > http://sel.as-us.falkag.net/sel?cmd=3Dlnk&kid=3D120709&bid=3D263057&dat= =3D121642 > _______________________________________________ > PyX-user mailing list > PyX...@li... > https://lists.sourceforge.net/lists/listinfo/pyx-user > Thanks. I`ll try to provide more information. The tex distro is MiKTeX-TeX 2.4.1986 (3.141592) (MiKTeX 2.4) on Windows XP. The Hello World example: from pyx import * c =3D canvas.canvas() c.text(0, 0, "Hello, world!") c.stroke(path.line(0, 0, 2, 0)) c.writeEPSfile("hello") c.writePDFfile("hello") is working fine. However, if try for example this one: from pyx import * unit.set(uscale=3D2, xscale=3D2) col =3D color.cmyk.PineGreen text.set(mode=3D"latex") text.preamble("\usepackage{color}") text.preamble(r"\definecolor{COL}{cmyk}{%(c)g,%(m)g,%(y)g,%(k)g}" % col.col= or) c =3D canvas.canvas() c.text(0, 0, r"\textcolor{COL}{Text} and outline have the same color") c.stroke(path.rect(-0.2, -0.2, 6.2, 0.6), [col]) c.writeEPSfile("color") c.writePDFfile("color") , I get the errormessage like in previous posting. It`s cut after 5 line, how can I increase errordebug? |
From: Michael J G. <mic...@fa...> - 2006-07-18 10:35:55
|
Bruce venit, vidit, dixit 2006-07-18 12:20: ... > , I get the errormessage like in previous posting. It`s cut after 5 > line, how can I increase errordebug? Your code works for me in PyX 0.9 and 0.8.1, but not in PyX 0.7 nor in 0.6.3. Which version are you using? Parsing of TeX messages has improved quite a bit over the last versions. Often this type of errors means/t that TeX/LaTeX run OK but PyX doesn't understand the output. Michael |
From: Bruce <ep...@gm...> - 2006-07-18 12:29:37
|
Yes the last example is also from the pyx`website. I`m using 0.9. On 7/18/06, Michael J Gruber <mic...@fa...> wrote: > Bruce venit, vidit, dixit 2006-07-18 12:20: > ... > > , I get the errormessage like in previous posting. It`s cut after 5 > > line, how can I increase errordebug? > > Your code works for me in PyX 0.9 and 0.8.1, but not in PyX 0.7 nor in > 0.6.3. Which version are you using? Parsing of TeX messages has improved > quite a bit over the last versions. Often this type of errors means/t > that TeX/LaTeX run OK but PyX doesn't understand the output. > > Michael > > ------------------------------------------------------------------------- > Take Surveys. Earn Cash. Influence the Future of IT > Join SourceForge.net's Techsay panel and you'll get the chance to share your > opinions on IT & business topics through brief surveys -- and earn cash > http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV > _______________________________________________ > PyX-user mailing list > PyX...@li... > https://lists.sourceforge.net/lists/listinfo/pyx-user > |
From: Michael J G. <mic...@fa...> - 2006-07-18 12:50:14
|
Bruce venit, vidit, dixit 2006-07-18 14:29: > Yes the last example is also from the pyx`website. I`m using 0.9. If it isn't working for you with PyX 0.9 but it's working for me: the code is correct ;) You can try text.set(errordebug=2) in order to make PyX's message parser more talkative. Michael |
From: Michael J G. <mic...@fa...> - 2006-07-18 13:23:54
|
Bruce venit, vidit, dixit 2006-07-18 15:08: ... > Thanks again. Here`s the result with debug=2. Can you get anything from it? Hmm, I should have known the clarity of TeX's prose... It looks strange. Maybe try a raw string for every preamble line, i.e. use text.preamble(r"\usepackage{color}") instead (note the "r"). It works without "r" for me but this might differ among python implementations (?). [ I'm talking about \u being undefined. ] Another debugging attempt would be to use text.set(texdebug="colordebug.tex") which stores all (La)TeX commands used by PyX in colordebug.tex. In particular this would clarify my above mentioned suspicion about quoting: Does this file contain "usepackage{..." or "\usepackage{..." (at the very end)? Michael |
From: Bruce <ep...@gm...> - 2006-07-20 11:53:34
|
On 7/18/06, Michael J Gruber <mic...@fa...> wrote: > Bruce venit, vidit, dixit 2006-07-18 14:29: > > Yes the last example is also from the pyx`website. I`m using 0.9. > > If it isn't working for you with PyX 0.9 but it's working for me: the > code is correct ;) > > You can try text.set(errordebug=2) in order to make PyX's message parser > more talkative. > > Michael > > > ------------------------------------------------------------------------- > Take Surveys. Earn Cash. Influence the Future of IT > Join SourceForge.net's Techsay panel and you'll get the chance to share your > opinions on IT & business topics through brief surveys -- and earn cash > http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV > _______________________________________________ > PyX-user mailing list > PyX...@li... > https://lists.sourceforge.net/lists/listinfo/pyx-user > Just to close this subject.. After fixing an error in article.cls and testing that my tex installation actually compiles fine, I get this Exception raised after trying again: Traceback (most recent call last): File "pyxtest3.py", line 7, in ? text.preamble("\usepackage{color}") File "C:\Python23\lib\site-packages\pyx\text.py", line 1166, in preamble self.execute(expr, texmessages) File "C:\Python23\lib\site-packages\pyx\text.py", line 985, in execute self.defaulttexmessagesdocclass + self.texmessagesdocclass) File "C:\Python23\lib\site-packages\pyx\text.py", line 1035, in execute raise TexResultError("unhandled TeX response (might be an error)", self) pyx.text.TexResultError: unhandled TeX response (might be an error) The expression passed to TeX was: \documentclass{article}% \PyXInput{3}% After parsing the return message from TeX, the following was left: * *(C:\program files\texmf\tex\latex\base\article.cls Document Class: article 2004/02/16 v1.4f Standard LaTeX document class (C:\program files\texmf\tex\latex\base\size10.clo)) I found that if I uncomment the line raising the error (as suggested in another trhead named "latex non errors " or something, it works fine. Like in that case referred to I`m using miktex, perhaps that`s got something to do with it? |
From: Andre W. <wo...@us...> - 2006-07-20 12:22:47
|
Hi, On 20.07.06, Bruce wrote: > Just to close this subject.. > > After fixing an error in article.cls and testing that my tex > installation actually compiles fine, Ah ... ok. I see. (And I even guessed that already when I was reading the thread ...) > I get this Exception raised after > trying again: > > Traceback (most recent call last): > File "pyxtest3.py", line 7, in ? > text.preamble("\usepackage{color}") > File "C:\Python23\lib\site-packages\pyx\text.py", line 1166, in preamble > self.execute(expr, texmessages) > File "C:\Python23\lib\site-packages\pyx\text.py", line 985, in execute > self.defaulttexmessagesdocclass + self.texmessagesdocclass) > File "C:\Python23\lib\site-packages\pyx\text.py", line 1035, in execute > raise TexResultError("unhandled TeX response (might be an error)", self) > pyx.text.TexResultError: unhandled TeX response (might be an error) > The expression passed to TeX was: > \documentclass{article}% > \PyXInput{3}% > After parsing the return message from TeX, the following was left: > * > *(C:\program files\texmf\tex\latex\base\article.cls > Document Class: article 2004/02/16 v1.4f Standard LaTeX document class > (C:\program files\texmf\tex\latex\base\size10.clo)) > > I found that if I uncomment the line raising the error (as suggested > in another trhead named "latex non errors " or something, it works > fine. Like in that case referred to I`m using miktex, perhaps that`s > got something to do with it? No, I'm pretty sure the problem is the space in the path name (i.e. "program files"). PyX doesn't find a file "C:\program" and hence it does not ignore all the stuff in the brackets. Sure, we do have real problems in parsing TeX's output, but we really try to do our very best. How should we know that "files\texmf\tex\latex\base\article.cls" is a continuation of the file name. We just don't know ... While it's clearly a bug, I don't know how to properly fix it. We might need to add some more magic here ... (as we already did with file names longer than the line length). So thanks for the moment for the hint and I'll add a todo item ... André -- by _ _ _ Dr. André Wobst / \ \ / ) wo...@us..., http://www.wobsta.de/ / _ \ \/\/ / PyX - High quality PostScript and PDF figures (_/ \_)_/\_/ with Python & TeX: visit http://pyx.sourceforge.net/ |