emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Nick Dokos <nicholas.dokos@hp.com>
To: Richard Stanton <stanton@haas.berkeley.edu>
Cc: "emacs-orgmode@gnu.org" <emacs-orgmode@gnu.org>,
	"eric.schulte@gmx.com" <eric.schulte@gmx.com>
Subject: Re: Question on latex source block
Date: Mon, 10 Sep 2012 15:07:02 -0400	[thread overview]
Message-ID: <4361.1347304022@alphaville.americas.hpqcorp.net> (raw)
In-Reply-To: Message from Richard Stanton <stanton@haas.berkeley.edu> of "Mon, 10 Sep 2012 09:49:57 PDT." <CC736692.24529%stanton@haas.berkeley.edu>

Richard Stanton <stanton@haas.berkeley.edu> wrote:


> Thanks. Things now get a lot further, but I'm still not quite getting what
> I was hoping for. In particular, this source:
> 
> #+begin_src latex :file test.png
> \frac{1}{2}
> #+end_src
> 
> results in this output:
> 
> #+Results:
> #+BEGIN_LaTeX
> [[file:test.png]]
> #+END_LaTeX
> 
> There are two problems here.
> 
> 
> 1) I'd like the graphic file to be displayed inline in the org file
> buffer, so I don't think I want those #+BEGIN_LaTeX ... #+END_LaTeX lines
> 

If you add org-redisplay-inline-images to org-babel-after-execute-hook,
that should happen whether or not the #+{BEGIN,END}_LaTeX lines are
there (you can get rid of them by using :results raw).

This works for me (after I C-c C-c on the second source block):

--8<---------------cut here---------------start------------->8---

* foo

#+begin_src latex :file frac.png :results raw
\(
\frac{1}{2}
\)
#+end_src


* bar

#+BEGIN_SRC elisp
(add-hook 'org-babel-after-execute-hook (function org-redisplay-inline-images))
#+END_SRC
--8<---------------cut here---------------end--------------->8---

> 2) There is no file test.png in the current working directory.
> 

That however may be saying that there is a problem with your setup. Is
there anything in *Messages* that indicates a problem? Assuming that
debug-on-error is not set currently, you might also want to

M-x toggle-debug-on-error RET

and rerun the code block to see if there is some error that is triggered
(sometimes errors are caught using condition-case and are hard to see).

Just to be clear, the frac.png (I renamed it to avoid clobbering an unrelated
test.png file in my setup) *is* produced in my case.

Nick

  reply	other threads:[~2012-09-10 19:07 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <mailman.113.1347292828.2054.emacs-orgmode@gnu.org>
2012-09-10 16:49 ` Question on latex source block Richard Stanton
2012-09-10 19:07   ` Nick Dokos [this message]
2012-09-10 20:43     ` Richard Stanton
2012-09-10 20:53       ` Nick Dokos
2012-09-11  6:52         ` Giovanni Ridolfi
2012-09-09  5:15 Richard Stanton
2012-09-09  7:07 ` Nick Dokos
2012-09-09  7:17   ` Nick Dokos
2012-09-09 16:49   ` Eric Schulte
2012-09-09 17:44     ` Nick Dokos
2012-09-09 19:39       ` Eric Schulte
2012-09-09 20:31         ` Nick Dokos
2012-09-13  6:00         ` Jambunathan K
2012-09-13  7:28           ` Nick Dokos
2012-09-13  7:58             ` Nick Dokos
2012-09-13 15:07           ` Eric Schulte
2012-09-13 16:04             ` Nick Dokos
2012-09-13 17:09               ` Eric Schulte
2012-09-13 19:12                 ` Abdó Roig-Maranges
2012-09-13 19:42                   ` Jambunathan K
2012-09-14  7:27                     ` Bastien

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.orgmode.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4361.1347304022@alphaville.americas.hpqcorp.net \
    --to=nicholas.dokos@hp.com \
    --cc=emacs-orgmode@gnu.org \
    --cc=eric.schulte@gmx.com \
    --cc=stanton@haas.berkeley.edu \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).