I am currently adding an #+ATTR_LATEX before every image in my org-file to center it in the produced LaTeX beamer slides. That is slightly annoying and clutters up the document.

Is there a way to set an #+ATTR_LATEX for all images or even just for the whole .org file?

  • What if you add \usepackage{floatrow} header?
    – wvxvw
    Sep 18 '15 at 16:57
  • 2
    Sounds like this answered question.
    – JeanPierre
    Nov 11 '15 at 21:49

There is the org-latex-image-default-option variable. Would that do for you? I'm using a shell function for a fixed image width, perhaps you can use something similar:

    emacs  --batch -l ~/.emacs --eval \
             (setq org-latex-image-default-width \".4cm\"
                   org-export-allow-bind-keywords t
                   org-confirm-babel-evaluate nil)
             (find-file \"$1\") (org-latex-export-to-pdf))"

So I simply call

orgexp myorgfile.org

to get a PDF where all images are .4 cm wide.

  • That actually sounds like what I was looking for. Mar 15 '16 at 12:32

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.