-1

Adding #+attr_html: :width 100px above aa image link changes the width of the image in the exported html file. See this post for more info.

However, I wish I can set all images' widths to 100px in the exported html file without specifying #+attr_html: :width 100px for each image -- it's too much work. For some exceptions, I wish if #+attr_html: :width 200px is added, then the method should respect it.

If all I care is about the widths of images within org-mode, then this post suffices by adding (setq org-image-actual-width '(400)) to the config file. However, that does not take care of the images widths in the exported html file.

Student
  • 400
  • 3
  • 10
  • 1
    I don't know of a way to do that globally (and looking at the code seems to confirm that you cannot, although I might have missed something). OTOH, it's hardly "too much work": you can do a search-and-replace with one command essentially, for the existing cases. For new cases, you can define a command to insert the attribute line and bind the command to a key. – NickD Jan 20 '20 at 23:15

1 Answers1

1

Perhaps the strategy presented in Alignment of images in HTML export could be adopted here to "override the style used for images by adding custom CSS at the beginning of your document":

#+HTML_HEAD_EXTRA: <style> .figure p {width="200";}</style>
malcook
  • 1,686
  • 16
  • 16