We switched to a manual approval system for registration on this forum, as this makes it easier to keep bots out of the forum. We'll approve everybody who doesn't look like a bot!

Questions about Image and File Handling

Hello hendrik and others,

I recently found this app and felt in love due to the in-app file browser, ability to perform citation, design, etc.
Nevertheless, I have some questions regarding the handling of images:

One use-case for me is writing summaries of experiments I've done (phD student here). These should include images, typically some sort of graph or scetch. Since I eventually write a paper or use them in my thesis (both written in LateX) I currently use graphics as vector graphics, i.e. pdf, whenever possible. Including pdf's in Zettlr is possible like with all pictures: ![caption](path/file.pdf)

  1. While this is working smoothly for PDF export, it always maximized the graphic to the whole page width. Is there a command to restrict graphics to a certain width?
  2. The graphic is not recognized in Zettlr, and in html there's only a small PDF viewer. Is there something I can do? Is there another vector graphic format (.eps, .svg) which is better suited?

PDF in Zettlr
PDF in Zettlr
PDF in HTML
PDF in HTML

More general questions:

  1. I believe typora has a function, where you can drop images into it and it automatically copies the file into a subdirectory with the same name as the corresponding .md file. This would be something I would find useful - is there someone else?
  2. For my described use case and since Zettlr can handle to much data within its opened directory (and I don't need my actual data within Zettlr anyways) I figured a separate directory for my summaries would be usefull (as root directory in Zettlr, see below). I managed to link to the corresponding file directory in my markdown document with [Link to Directory](file:///home/[...]/Projekte/Project B). Unfortunately this seems only to work with absolut links, which is problematic if the database is synced to other computers. Does anybody knows of a way to achieve the same with relative paths?

Thanks a lot in advance for any time spent to answer and any suggestion I get. :)

Comments

  • Concerning your first question to manipulate the image width for export to PDF try to append the following at the end of the image-link:

    {width=[Width]}

    Where '[Width]' should be replaced with the desired value including a unit string ('px', '%' etc.). Hope this works for you.

  • For an answer to 1, refer to my forespeaker :D

    For 2: I am quite surprised that rendering PDF files within an image tag would actually give you the PDF viewer, I was unaware of that hidden feature o_O

    For 3: Basically, Zettlr allows you to do that if you copy the image to the clipboard. I try to prevent Zettlr from doing too much automated stuff, as I personally hate it when for instance, images are copied criss-cross across my computer (why have two copies of the same thing, right?) But I understand that in some circumstances this might be not so beneficial.

    4 So … you link to a Markdown file, correct? If so, it should also work with relative links if I'm not misinformed. If it does, it might indicate a bug!

  • Thanks for both of your answers. I was traveling last week therefore a belated answer.

    @jothanne said:
    Concerning your first question to manipulate the image width for export to PDF try to append the following at the end of the image-link:

    {width=[Width]}

    Where '[Width]' should be replaced with the desired value including a unit string ('px', '%' etc.). Hope this works for you.

    Thank you, I'll have a look. I would prefer to have an option not depending on the kind of export, i.e. both HTML and PDF.


    @hendrik said:
    For 2: I am quite surprised that rendering PDF files within an image tag would actually give you the PDF viewer, I was unaware of that hidden feature o_O

    I was as well. So it seems there's no good option for vector graphics?

    @hendrik said:
    For 3: Basically, Zettlr allows you to do that if you copy the image to the clipboard. I try to prevent Zettlr from doing too much automated stuff, as I personally hate it when for instance, images are copied criss-cross across my computer (why have two copies of the same thing, right?) But I understand that in some circumstances this might be not so beneficial.

    I can see the point of then having multiple versions of the same files. For some work, where you maybe want to share the results this would be advantageous nevertheless. I have to admit I haven't tried yet, drag'n'drop would be a better solution I guess. But I already saw the github-issue. :smile:

    @hendrik said:
    4 So … you link to a Markdown file, correct? If so, it should also work with relative links if I'm not misinformed. If it does, it might indicate a bug!

    No, actually I tried to link a file directory and it worked for absolute paths. If this would work for relative links as well, this would be even better. Do you know of something like that?

Sign In or Register to comment.