|
From: SourceForge.net <no...@so...> - 2011-05-15 09:18:19
|
Support Requests item #2802563, was opened at 2009-06-07 19:04 Message generated for change (Comment added) made by wobsta You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=442887&aid=2802563&group_id=45430 Please note that this message will contain a full copy of the comment thread, including the initial issue submission, for this request, not just the latest update. Category: None Group: None >Status: Closed Priority: 5 Private: No Submitted By: Nobody/Anonymous (nobody) Assigned to: Nobody/Anonymous (nobody) Summary: TeX interface Initial Comment: I'm having a lot of trouble adding titles to graphs with symbols that TeX wants to interpret. Is there a good way to title a graph ("Data from file" + path) where the path name contains both back slashes and underscores? ---------------------------------------------------------------------- >Comment By: Andre Wobst (wobsta) Date: 2011-05-15 11:18 Message: You can use pyx.text.escapestring() for the conversion. ---------------------------------------------------------------------- Comment By: Axel Freyn (freynaxe) Date: 2009-07-02 12:16 Message: As PyX depends on TeX / LaTeX to create text, the easiest solution will be to convert the string into a form acceptable to TeX / LaTeX. You could define a function to do this. For me, the following works perfectly: from pyx import * def CleanString(s): s = a.replace("\\",r"\textbackslash ") s = s.replace("_","\\_") return s text.set(mode="latex") c = canvas.canvas() c.text(0,0,CleanString("a\\b_c")) c.writePDFfile("test") ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=442887&aid=2802563&group_id=45430 |