I have a repository on Gitlab, I'm trying to change my README from Markdown to Org, I'm fully able to make the changes, but for reasons the the images are having some sizing issues, they expand outside of the document itself. I'm trying to figure out how to fix this?

Here is a screenshot to help explain the situation better, enter image description here

As you can see the image is exceeding the width of document, and page is scroll-able horizontally.

This screenshot is from a private test repository, I was testing how Org renders before I update my original repository.

Here is the code where I add this image,

#+CAPTION: Screenshot of SampleHive
#+ATTR_HTML: :alt logo-hive :title SampleHive Logo :align left :width 500
  • I don't know how GItlab renders the README: are you exporting it to HTML? If not, then the #+ATTR_HTML stuff is irrelevant. You might want to add some explanation to your question about how Gitlab renders such a README. Is there any guidance from them? – NickD May 20 at 1:06
  • Actually, it might be relevant: what is the value of the variable org-image-actual-width? – NickD May 20 at 1:09
  • I don't know how Gitlab renders their Org README, I tried asking on their Reddit but got no response yet. Value for the variable org-image-actual-width, if I do describe-variable on it, is nil and it says original value is t. – apoorv569 May 20 at 1:13
  • OK - the description of the variable says that if it is nil, then it will look for any #+ATTR declaration of the width and use that, otherwise fall back to the original width - so it should work. Does it make any difference if you change the :width 500 to, say, :width 200? – NickD May 20 at 2:29
  • If I change :width to anything it does change inside Emacs, if I toggle org-toggle-inline-images, but on Gitlab it does nothing. Looking around on internet for other people's Org README on Gitlab, I found one that had acsiinema session video on his/her README, and looking at the raw file, I found he/she was doing this, `#+HTML: <a href="LINK HERE" target="_blank"><img src="IMAGE PATH HERE" width="800"/></a>. I tried this, and this seems to work. Wonder why the other one doesn't. Here is the link if you want to see yourself. – apoorv569 May 20 at 9:07

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.