emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* Org-mode Beamer  graphviz & images
@ 2015-02-09 20:59 deadbrain
  2015-02-10  9:51 ` Eric S Fraga
  0 siblings, 1 reply; 3+ messages in thread
From: deadbrain @ 2015-02-09 20:59 UTC (permalink / raw)
  To: emacs-orgmode

Hi all org-mode gurus,
I am trying to generate a deck of slides using Emacs/org-mode /beamer &
some companion tools (graphviz & plantuml).
I have a problem to set the dimensions for the graphviz (or plantuml)
generated pictures.
Whatever the version used (tested 8.2.10-30 or 8.3-beta from git) and
whatever the option (ATTR_LATEX set) the TEX file generated does not
contain the right scaling options.

Here is a generated TEX file (very short) :
% Created 2015-02-09 Mon 21:54
\documentclass[presentation,smaller]{beamer}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{fixltx2e}
\usepackage{graphicx}
\usepackage{longtable}
\usepackage{float}
\usepackage{wrapfig}
\usepackage{rotating}
\usepackage[normalem]{ulem}
\usepackage{amsmath}
\usepackage{textcomp}
\usepackage{marvosym}
\usepackage{wasysym}
\usepackage{amssymb}
\usepackage{capt-of}
\usepackage{hyperref}
\tolerance=1000
\usetheme{Marburg}
\usecolortheme{}
\usefonttheme{}
\useinnertheme{}
\useoutertheme{}
\date{\today}
\title{Test ORG \& Graphviz}
\begin{document}

\maketitle
\begin{frame}{Outline}
\tableofcontents
\end{frame}


\section{Une section}
\label{sec-1}
\begin{frame}[label=sec-1-1]{Test graphviz}
\includegraphics[width=.9\linewidth]{graph-intro.png}
\end{frame}
% Emacs 24.4.1 (Org mode 8.3beta)
\end{document}




from this org document:

#+BEAMER_COLOR_THEME:
#+BEAMER_FONT_THEME:
#+BEAMER_HEADER:
#+BEAMER_INNER_THEME:
#+BEAMER_OUTER_THEME:
#+BEAMER_THEME: Marburg
#+OPTIONS:   H:2 toc:t
#+LATEX_CLASS: beamer
#+LaTeX_CLASS_OPTIONS: [presentation,smaller]
#+BEAMER_FRAME_LEVEL: 2
#+COLUMNS: %20ITEM %13BEAMER_env(Env) %6BEAMER_envargs(Args)
%4BEAMER_col(Col) %7BEAMER_extra(Extra)
#+TITLE: Test ORG & Graphviz

* Une section
** Test graphviz
#+ATTR_LATEX: :height 25cm
#+begin_src dot :file graph-intro.png :cmdline -Kdot -Tpng
digraph G{
node1 -> node2
node1 -> node3
node3 -> node4
node3 -> node5
}
#+end_src


Obviously I am doing something wrong , but what ?

Thanks for your help
Kind regards

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Org-mode Beamer  graphviz & images
  2015-02-09 20:59 Org-mode Beamer graphviz & images deadbrain
@ 2015-02-10  9:51 ` Eric S Fraga
  2015-02-10 10:15   ` jerome moliere
  0 siblings, 1 reply; 3+ messages in thread
From: Eric S Fraga @ 2015-02-10  9:51 UTC (permalink / raw)
  To: deadbrain; +Cc: emacs-orgmode

On Monday,  9 Feb 2015 at 21:59, deadbrain wrote:
> Hi all org-mode gurus,
> I am trying to generate a deck of slides using Emacs/org-mode /beamer &
> some companion tools (graphviz & plantuml).
> I have a problem to set the dimensions for the graphviz (or plantuml)
> generated pictures.
> Whatever the version used (tested 8.2.10-30 or 8.3-beta from git) and
> whatever the option (ATTR_LATEX set) the TEX file generated does not
> contain the right scaling options.

Two changes are required to get this to work.

1. you need to have the latex attribute just before the image.  To do
   this, execute the src block which will generate the results
   line.  Then move the attribute line to just before the RESULTS
   directive.

2. you need to tell the exporter that the results to export are a file.

In summary, I got your example to work with the following snippet:

--8<---------------cut here---------------start------------->8---
#+name: graph-info-figure
#+begin_src dot :file graph-intro.png :cmdline -Kdot -Tpng :results file
digraph G{
node1 -> node2
node1 -> node3
node3 -> node4
node3 -> node5
}
#+end_src

#+ATTR_LATEX: :height 3cm
#+results: graph-info-figure
[[file:graph-intro.png]]
--8<---------------cut here---------------end--------------->8---

I named the src block as I find that it is good practice in general to
do so...

Note that I changed the size directive to 3cm to see the effect clearly!

HTH,
eric


-- 
: Eric S Fraga (0xFFFCF67D), Emacs 25.0.50.1, Org release_8.3beta-798-g528b90

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Org-mode Beamer graphviz & images
  2015-02-10  9:51 ` Eric S Fraga
@ 2015-02-10 10:15   ` jerome moliere
  0 siblings, 0 replies; 3+ messages in thread
From: jerome moliere @ 2015-02-10 10:15 UTC (permalink / raw)
  To: emacs-orgmode

[-- Attachment #1: Type: text/plain, Size: 1988 bytes --]

Thanks a lot Eric
The small sise was just there for my experiments to ensure my attributes
were processed
Thanks again i will be able to finish my deck of slides.
I did not know this syntax but I guessed that the workflow was the problem

Kind regards
Le 10 févr. 2015 10:51, "Eric S Fraga" <e.fraga@ucl.ac.uk> a écrit :

> On Monday,  9 Feb 2015 at 21:59, deadbrain wrote:
> > Hi all org-mode gurus,
> > I am trying to generate a deck of slides using Emacs/org-mode /beamer &
> > some companion tools (graphviz & plantuml).
> > I have a problem to set the dimensions for the graphviz (or plantuml)
> > generated pictures.
> > Whatever the version used (tested 8.2.10-30 or 8.3-beta from git) and
> > whatever the option (ATTR_LATEX set) the TEX file generated does not
> > contain the right scaling options.
>
> Two changes are required to get this to work.
>
> 1. you need to have the latex attribute just before the image.  To do
>    this, execute the src block which will generate the results
>    line.  Then move the attribute line to just before the RESULTS
>    directive.
>
> 2. you need to tell the exporter that the results to export are a file.
>
> In summary, I got your example to work with the following snippet:
>
> --8<---------------cut here---------------start------------->8---
> #+name: graph-info-figure
> #+begin_src dot :file graph-intro.png :cmdline -Kdot -Tpng :results file
> digraph G{
> node1 -> node2
> node1 -> node3
> node3 -> node4
> node3 -> node5
> }
> #+end_src
>
> #+ATTR_LATEX: :height 3cm
> #+results: graph-info-figure
> [[file:graph-intro.png]]
> --8<---------------cut here---------------end--------------->8---
>
> I named the src block as I find that it is good practice in general to
> do so...
>
> Note that I changed the size directive to 3cm to see the effect clearly!
>
> HTH,
> eric
>
>
> --
> : Eric S Fraga (0xFFFCF67D), Emacs 25.0.50.1, Org
> release_8.3beta-798-g528b90
>

[-- Attachment #2: Type: text/html, Size: 2420 bytes --]

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2015-02-10 10:15 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-02-09 20:59 Org-mode Beamer graphviz & images deadbrain
2015-02-10  9:51 ` Eric S Fraga
2015-02-10 10:15   ` jerome moliere

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).