best way to embed a graph into a note

Hi Zotero users,

Anybody could recommend a good&easy way to embed graphs into a standalone note and keep it stored in Zotero? I'm generating a lot of graphs and need to make comments on them.
Currently, I'm dragging and dropping temporary png snapshots into my notes. But it doesn't seem to be stored physically in Zotero's file collection. Once I delete them and reopen the notes, they become broken links there.
Any good suggestion?
  • One solution would be to host them on an image hosting website then use the html editor in the notes to embed an image, something like this:

    <img src="http://newsimg.bbc.co.uk/media/images/47325000/jpg/_47325047_-10.jpg"
    alt="random bbc picture"/>


    Obviously this requires an internet connection. There may be better ways.
  • edited February 18, 2010
    I'm being silly, this doesn't have to be hosted anywhere. Just store the file on your local computer (in Zotero's files if you like) and link to it like this:

    <img src="file:///C:/Users/James/Desktop/image.jpg" alt="name" />

    Not sure how you would get the image to synch so you could access it on other computers.
  • Even better, you can drag and drop the graphs onto the parent item. Then open the attached image and copy its zotero:// link. You can then add the image by adding something like this to the HTML code (click on the HTML icon, insert this, and click "Update"):
    <img src="zotero://attachment/289/" alt="" />
    I have confirmed that this displays correctly, and I think it should sync fine too.
  • that's really clever.
  • It seems that you can even do this without opening the HTML editor, using these steps:
    1. Save your image as an item attachment in Zotero.
    2. Double-click on the attachment from within Zotero. The image will show up in your browser window.
    3. Open the note you are editing.
    4. Click on the image in the main browser window and drag it to the appropriate place in your note.
    5. That's all! The image should now display properly and sync between computers.
  • edited February 18, 2010
    Currently, I'm dragging and dropping temporary png snapshots into my notes. But it doesn't seem to be stored physically in Zotero's file collection. Once I delete them and reopen the notes, they become broken links there.
    So where tehsheng was going wrong was just that the images have to be dragged into the central Zotero pane to make them Zotero attachments before the attached images are dragged onto the Zotero notes.
  • That should be added to the wiki in "Getting the Most Out of Zotero"!
  • added this to tips and tricks:
    http://www.zotero.org/support/tips_and_tricks
  • Unfortunately this doesn't work for me. After step 4 all I see in my note is a broken image icon in my note.
    I remember that in an older version of Zotero it was possible for me to drag&drop images into my notes.
    This is a basic function for me I'm missing indeed.
  • yes, this has been broken for a while. I don't think it was broken on purpose, but it was always a bit problematic that people could drag images from the clipboard which would appear in the notes, but disappear whenever the temporary directory was cleaned- see the issue of the op.
  • this has been broken for a while
    More accurately, it never actually worked—it just gave the (dangerous) impression of working.
  • yes and no - the procedure as described by ajlyon above did work correctly and safely.
  • The procedure of embedding image attachments (images with zotero:// paths) worked until TinyMCE was moved from chrome to content. I reported this at the time, and I'm still hoping it'll be fixed. It's just a path issue-- if you edit the "broken image" in TinyMCE, you can set the path correctly and the image will display fine.
  • OK, right. I was referring to dragged/pasted images without fixed URLs, as in the original post. I haven't looked into the path issue.
  • The work arounds are useful but it would actually be great if this would be support more directly from zotero. I am thinking about two scenarios:
    1) a botton in the note toolbar that allows you to select an image from the file system, which then gets imported into Zotero storage and linked in the html note.
    2) drop and drop into a note would import the image to zotero storage and create a link in the html note
  • I'm afraid that the underlying issue here is that the team doesn't have anyone who does a lot of work with TinyMCE, so logical and useful changes like this, which would require plugins or modifications of the TinyMCE code, are few and far between.
  • Hi everybody,

    I would like to insert graphs into my notes too. I tried the solution of ajlyon but it doesn't completely work.
    In the note window, there is only an icon showing sort of broken link while in the HTML source of the note, the link exists.
    The most weird is that when I generate a report from the note, the graphs appeared correctly at the right place.

    Someone can explain that ?

    As one of my aims by taking notes is to share them by the mean of reports, it could be fine for now but I also would like to see the graph directly in the note window...
  • The situation has worsened somewhat in the last year, but I just took a look at this and think I have a basic fix on the TinyMCE side (https://github.com/zotero/zotero/pull/18). Now I'm seeing security errors that prevent the images from showing inside the notes; the fact that the images show in reports only confirms it, since reports and attachments are in the same security context (as I understand it).
  • In less technical terms, there has been some progress on this, and it may be fixed soon.
Sign In or Register to comment.