emacs-orgmode
[Top][All Lists]
Advanced

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

Re: [O] Question on latex source block


From: Richard Stanton
Subject: Re: [O] Question on latex source block
Date: Mon, 10 Sep 2012 13:43:02 -0700
User-agent: Microsoft-MacOutlook/14.2.1.120420


On 9/10/12 12:07 PM, "Nick Dokos" <address@hidden> wrote:

>Richard Stanton <address@hidden> 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


The *Messages* buffer did indeed show something:

"Failed to create dvi file from
/var/folders/zf/bgjm4tvs3wv_6q7_6z3b2nx00000gn/T/orgtex64181Q3t.tex"


Checking the log file in that directory, I saw squawking about missing "$"
signs around the mathematical expression. Adding these, so the block now
reads

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

it now compiles and displays perfectly.


Thanks!




reply via email to

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