7

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?

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

1 Answer 1

3

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:

orgexp()
{
    emacs  --batch -l ~/.emacs --eval \
           "(progn
             (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.

1
  • That actually sounds like what I was looking for. Commented Mar 15, 2016 at 12:32

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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