emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* #+BEGIN_HTML in beamer export
@ 2013-07-15 18:29 Nick Dokos
  2013-07-15 19:33 ` Nicolas Goaziou
  0 siblings, 1 reply; 3+ messages in thread
From: Nick Dokos @ 2013-07-15 18:29 UTC (permalink / raw)
  To: emacs-orgmode

I have a dot source block in a presentation that produces SVG. I use the
svg.sty package to get the image processed to pdf and included in the
presentation (I only export to latex and use a Makefile to go the rest
of the way to PDF, because I have some more stuff to do in between):

--8<---------------cut here---------------start------------->8---
* foo

#+name: foo
#+BEGIN_SRC dot :file images/machines.svg :exports none :results file
digraph foo {
  size="4.9,3.1";
  page="4.9,3.0";
  ratio=auto;
/*  center=1; */
  nodesep=.3
  ranksep=.3
/*  rankdir=LR */
  node [shape="box"];
  node [fontsize=18];
  g -> h [style=dashed];
  h -> g [style=dashed];
  h -> c;
  c -> t;
  h -> p [color=lightgray];
  c -> p [style=dotted];
  p -> t [style=dotted];
  t -> r [color=darkgreen];
}
#+END_SRC

#+BEGIN_HTML
#+RESULTS: foo
[[file:images/machines.svg]]
#+END_HTML

#+BEGIN_LaTeX
\includesvg[clean]{machines}
#+END_LaTeX
--8<---------------cut here---------------end--------------->8---

But it is convenient to do C-c C-c in the code block and then click the
file link to do a quick check on the image, so I thought I'd put the
result in a BEGIN_HTML block, so it would not contaminate the latex
output (and if I exported to HTML, I'd get the image too).  That works
fine iff I don't have a #+RESULTS line (or I comment it out with another
#), otherwise I get literal \#+BEGIN_HTML \#END_HTML in the latex
output.

Bug or confusion on my part?
-- 
Nick

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

* Re: #+BEGIN_HTML in beamer export
  2013-07-15 18:29 #+BEGIN_HTML in beamer export Nick Dokos
@ 2013-07-15 19:33 ` Nicolas Goaziou
  2013-07-15 20:15   ` Nick Dokos
  0 siblings, 1 reply; 3+ messages in thread
From: Nicolas Goaziou @ 2013-07-15 19:33 UTC (permalink / raw)
  To: Nick Dokos; +Cc: emacs-orgmode, Eric Schulte

Hello,

Nick Dokos <ndokos@gmail.com> writes:

> I have a dot source block in a presentation that produces SVG. I use the
> svg.sty package to get the image processed to pdf and included in the
> presentation (I only export to latex and use a Makefile to go the rest
> of the way to PDF, because I have some more stuff to do in between):
>
> * foo
>
> #+name: foo
> #+BEGIN_SRC dot :file images/machines.svg :exports none :results file
> digraph foo {
>   size="4.9,3.1";
>   page="4.9,3.0";
>   ratio=auto;
> /*  center=1; */
>   nodesep=.3
>   ranksep=.3
> /*  rankdir=LR */
>   node [shape="box"];
>   node [fontsize=18];
>   g -> h [style=dashed];
>   h -> g [style=dashed];
>   h -> c;
>   c -> t;
>   h -> p [color=lightgray];
>   c -> p [style=dotted];
>   p -> t [style=dotted];
>   t -> r [color=darkgreen];
> }
> #+END_SRC
>
> #+BEGIN_HTML
> #+RESULTS: foo
> [[file:images/machines.svg]]
> #+END_HTML
>
> #+BEGIN_LaTeX
> \includesvg[clean]{machines}
> #+END_LaTeX
>
> But it is convenient to do C-c C-c in the code block and then click the
> file link to do a quick check on the image, so I thought I'd put the
> result in a BEGIN_HTML block, so it would not contaminate the latex
> output (and if I exported to HTML, I'd get the image too).  That works
> fine iff I don't have a #+RESULTS line (or I comment it out with another
> #), otherwise I get literal \#+BEGIN_HTML \#END_HTML in the latex
> output.
>
> Bug or confusion on my part?

It's an over-zealous `org-babel-remove-result' function, which removes
both newline character before and after the block.

Try calling `org-export-execute-babel-code' from your buffer. It will
give you

  #+BEGIN_HTML#+END_HTML

instead of

  #+BEGIN_HTML
  #+END_HTML

Cc'ing Eric for is insight.


Regards,

-- 
Nicolas Goaziou

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

* Re: #+BEGIN_HTML in beamer export
  2013-07-15 19:33 ` Nicolas Goaziou
@ 2013-07-15 20:15   ` Nick Dokos
  0 siblings, 0 replies; 3+ messages in thread
From: Nick Dokos @ 2013-07-15 20:15 UTC (permalink / raw)
  To: emacs-orgmode

Nicolas Goaziou <n.goaziou@gmail.com> writes:

>>
>> Bug or confusion on my part?
>
> It's an over-zealous `org-babel-remove-result' function, which removes
> both newline character before and after the block.
>
> Try calling `org-export-execute-babel-code' from your buffer. It will
> give you
>
>   #+BEGIN_HTML#+END_HTML
>
> instead of
>
>   #+BEGIN_HTML
>   #+END_HTML
>
> Cc'ing Eric for is insight.
>
>

Thanks! So the easy workaround is to add an extra newline before the end
line, so org-babel-remove-result will have something extra to munch on
:-)

-- 
Nick

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

end of thread, other threads:[~2013-07-15 20:16 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-07-15 18:29 #+BEGIN_HTML in beamer export Nick Dokos
2013-07-15 19:33 ` Nicolas Goaziou
2013-07-15 20:15   ` Nick Dokos

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).