I'm answering myself. Partly. If I send:
DATA_BEGIN scheme:(image (tuple (raw-data (# hexdump of file ) "png") "" "" "" "") DATA_END I still get an error: <error|bad image|<tuple|<error|compund #EEEEE>|png>> However, if I save the file and reload it, then the image gets display correctly (!!). I think this just means that I managed to confuse TeXmacs enough that the text representation of what I inserted is correct, but the actual object isn't.... I still don't know what's the right way to do this .... Thanks for listening! Michael On 28 Jul 2011, at 2:57PM, Michael Lachmann wrote: > Ok, another question, related to the R interface. > > I'm trying to fix image rendering in the interface. Eps works now, as does > pdf. > > However, because pdf and eps is sometimes very big and renders amazingly slow > in TeXmacs, I'd like to give the user the option to render images in png. > > The way I render eps/pdf now is this: > > I send TeXmacs: > > DATA_BEGIN scheme:(image (tuple (raw-data " > > [at this point I cat the pdf/eps file into the pipe, and then send] > > ") "eps") "" "" "" "") DATA_END > > (or "pdf" for pdf). This is somewhat of a hack, but it works. Better than the > DATA_BEGIN ps: DATA_END > interface. (because that interface seems to have broken some time ago...) > > The problem is this: > I'm a bit afraid to just cat the file to TeXmacs. I actually don't quite > understand why this works. The reason is that TeXmacs needs to identify when > the raw data ends. How does TeXmacs do this? I've no idea. I open a quote, > and close a quote after I printed the file. I think it works because by > default pdf/eps files don't have any quotes in them. Actually I tested this. > If, for example, the title of the plot has a quote in it all breaks... :) > > So, I'd prefer to send the data to TeXmacs in hexadecimal. But I can't figure > out what the format is. > I tried > (raw-data #EEEEEEEE) > (#EEEEEE) > #EEEEEE > EEEEE > > (where EEEEE represents the hexdump of the file) > > What is the right format? > > > -------- > As an additional question - is there an optimal image format for TeXmacs. Is > there a format that doesn't need any conversion? > > I think eps is converted to png to display it. As far as I can tell, png is > converted to eps and then that eps is converted to png to display it on > screen. Is there any way so that the image will not be converted (maybe until > I try to print the document) > > > Thanks a lot! > > Michael > > > > _______________________________________________ > Texmacs-dev mailing list > Texmacs-dev@gnu.org > https://lists.gnu.org/mailman/listinfo/texmacs-dev > > > _______________________________________________ Texmacs-dev mailing list Texmacs-dev@gnu.org https://lists.gnu.org/mailman/listinfo/texmacs-dev