emacs-orgmode
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

How do I set attr_latex for the babel-block outputs?


From: Vladimir Nikishkin
Subject: How do I set attr_latex for the babel-block outputs?
Date: Mon, 25 May 2020 12:47:31 +0800

And the same question: I am drawing pictures for my book suing TikZ and babel.

This is my code (almost and mwe):

#+name: figure-1-2
#+header: :imagemagick yes :iminoptions -density 600 :imoutoptions -geometry 300
#+header: :fit yes :headers '("\\usepackage{tikz}")
#+header: :buffer on
#+begin_src latex :results value graphics file :exports both :file
figure-1-2-tree.png
\usetikzlibrary{trees}
\begin{tikzpicture}[color=gray]
\node {sqrt} % root
  child { node {sqrt-iter}
                  child[sibling distance=5cm] { node{ good-enough }
                          child[sibling distance=2cm] { node { square } }
                          child[sibling distance=2cm] { node { abs } } }
                  child { node{ improve }
                          child { node { average } } } };
\end{tikzpicture}
#+end_src

The #+RESULTS has a link
[file:figure-1-2-tree.png]]
below it.

However, after export the picture is rendered \textwidth-wide.

If I manually set
#+attr_latex: :width 8cm above the #+RESULTS, it is displayed as
expected, but If I recompute the picture, it is pasted above my
manually added attr line.

As far as I understand, the "graphics" Format is essentially
org-mode-text. Is it possible to set proper width attributes?


-- 
Yours sincerely, Vladimir Nikishkin



reply via email to

[Prev in Thread] Current Thread [Next in Thread]