I would like to define a buffer wide variable in an org-file and use the value from this variable later for, e.g., define the width of images for latex export.
Is there a way how this can be done?
Can this be done using #+CONSTANTS:
?
Ideally, it should work like this:
I define a variable image_width
in a buffer, e.g.
image_width=10
and use this variable in for #+ATTR_LATEX:
settings, e.g., #+ATTR_LATEX: :width $image_width
.
#+MACRO: image_width 16
. in plain text in the org file this works perfect and as expected{{{image_width}}}
will be replaced with 16 in the exported file. However, when I add it to a LaTeX attribute like#+ATTR_LATEX: :center :placement [H] :width {{{image_width}}}cm
I get\includegraphics[width={{{image_width}}}cm]{test.png}
and not\includegraphics[width=16cm]{test.png}
. So, that's not working for me. – Salian