Re: [O] imaxima babel

2013-11-27 Thread Alan Schmitt
Hello Johnny,

yggdra...@gmx.co.uk writes:

 Many thanks for all the help! I have now figured out how to use maxima
 from org-mode source blocks and display the results as pretty printed
 equations online. To remember, I made a small summarising example file,
 attached below for posteriority.

This is very useful, thanks a lot. A couple comments and questions on
your example file (which would be a nice addition to worg).

It would be useful to know more about maxima and how to enable it with
babel (a link to existing documentation, if there is any, would be
great).

In my setup, the previewing latex fragment keybinding is C-c C-x C-l,
not C-c C-x C-x.

I tried previewing the fragment, but I got the error:

,
| Failed to create dvi file from 
/var/folders/68/fvntfrw92y50gkk_67rkhsfwgn/T/orgtex16220cbr.tex
`

Looking at the tex file and the log file, it seems that the tex files is
to be processed by xelatex, but the command called seems to be pdfTeX. I
probably have something misconfigured, but I don't know what it is. Any
suggestion?

Finally, and it's a nitpick: breaking lines in the middle of (info ...)
links prevents following them using C-x C-e.

Thanks again,

Alan



Re: [O] imaxima babel

2013-11-27 Thread yggdrasil
Alan Schmitt alan.schm...@polytechnique.org writes:


 This is very useful, thanks a lot. A couple comments and questions on
 your example file (which would be a nice addition to worg).

There is actually already some maxima documentation on worg that got me
started as I was unsure if maxima is supported at all, I have added the
link in the summary. It would probably be good to merge to worg, but I
have no access to it and not time right now to learn how it works. Feel
free to copy paste whatever is useful to amend it though.

 It would be useful to know more about maxima and how to enable it with
 babel (a link to existing documentation, if there is any, would be
 great).

Thanks for the pointer, I have included some more resources I used.

 In my setup, the previewing latex fragment keybinding is C-c C-x C-l,
 not C-c C-x C-x.
Sorry, that was a typo!


 I tried previewing the fragment, but I got the error:

 ,
 | Failed to create dvi file from
 /var/folders/68/fvntfrw92y50gkk_67rkhsfwgn/T/orgtex16220cbr.tex
 `

 Looking at the tex file and the log file, it seems that the tex files is
 to be processed by xelatex, but the command called seems to be pdfTeX. I
 probably have something misconfigured, but I don't know what it is. Any
 suggestion?

Are you sure you have 'dvipng' installed as mentioned in the manual? 
,
| If you have `dvipng' installed, LaTeX fragments can be processed to
| produce preview images of the typeset expressions:
`
I have dvipng 1.14 that comes with texlive 2013-3 in F20 which seems to
work fine.

 Finally, and it's a nitpick: breaking lines in the middle of (info ...)
 links prevents following them using C-x C-e.

Actually, I never used these sort of links myself, thanks for pointing
out how this is done! :) I moved all infolinks to footnotes to avoid the
line breaks.

All the best,

J



orgmaxima_example.org
Description: Lotus Organizer


Re: [O] imaxima babel

2013-11-27 Thread Nick Dokos
yggdra...@gmx.co.uk writes:

 Alan Schmitt alan.schm...@polytechnique.org writes:

  ...
 Finally, and it's a nitpick: breaking lines in the middle of (info ...)
 links prevents following them using C-x C-e.

 Actually, I never used these sort of links myself, thanks for pointing
 out how this is done! :) I moved all infolinks to footnotes to avoid the
 line breaks.


Just a clarification: you cannot break the *string* argument but
newlines in other places are fine:

  (info
 (org) The Spreadsheet)

works fine, but

  (info
 (org) The 
Spreadsheet)

does not: the second string is not the same as the first one, since it
includes a newline. OTOH, you can escape the newline:

  (info
 (org) The \
Spreadsheet)

works fine.

The point is that all of this follows from the properties of
strings. Just go to the *scratch* buffer and evaluate some
expressions:

(string-equal a b a \
b)
t

(string-equal a b a 
b)
nil

-- 
Nick




Re: [O] imaxima babel

2013-11-27 Thread Thomas S. Dye
yggdra...@gmx.co.uk writes:

 There is actually already some maxima documentation on worg that got me
 started as I was unsure if maxima is supported at all, I have added the
 link in the summary. It would probably be good to merge to worg, but I
 have no access to it and not time right now to learn how it works. Feel
 free to copy paste whatever is useful to amend it though.

I added this to ob-doc-maxima. It might require some editing.

You can learn how to edit Worg here:

http://orgmode.org/worg/worg-git.html

All the best,
Tom

-- 
Thomas S. Dye
http://www.tsdye.com



Re: [O] imaxima babel

2013-11-26 Thread yggdrasil
Eric Schulte schulte.e...@gmail.com writes:

 yggdra...@gmx.co.uk writes:

 [... how to use maxima code from org-mode and display results inline
 in the org-buffer ...]

 You would switch from :results latex to :results raw, in which case
 the latex will be inserted directly into the Org-mode buffer, and
 org-mode's existing pretty display functionality may be used to view the
 equations inline and should work for export to HTML as well.

 Alternately, if you really want to get fancy you could use noweb
 expansion (see the manual) to insert the results of the imaxima code
 block into a latex code block, and then use the existing latex code
 block functionality to convert the imaxima output to images of different
 types depending on the export target [1].


Many thanks for all the help! I have now figured out how to use maxima
from org-mode source blocks and display the results as pretty printed
equations online. To remember, I made a small summarising example file,
attached below for posteriority.

All the best,

Johnny



orgmaxima_example.org
Description: Lotus Organizer


Re: [O] imaxima babel

2013-11-23 Thread Eric Schulte
yggdra...@gmx.co.uk writes:

 Thanks, this does answer my initial question and works good enough to
 enable latex export! 

 Even better would be if it's possible to mimic imaxima behaviour which
 is (I think) to directly process the resulting latex code and
 (temporarily?) store it as an image to display the pretty-printed
 equations directly inline in the org-buffer (which will make it export
 as html better I guess as the latex output doesn't seem to be recognised
 when exporting to html).


You would switch from :results latex to :results raw, in which case
the latex will be inserted directly into the Org-mode buffer, and
org-mode's existing pretty display functionality may be used to view the
equations inline and should work for export to HTML as well.

Alternately, if you really want to get fancy you could use noweb
expansion (see the manual) to insert the results of the imaxima code
block into a latex code block, and then use the existing latex code
block functionality to convert the imaxima output to images of different
types depending on the export target [1].

Best,


 All the best,

 Johnny

 Eric Schulte schulte.e...@gmail.com writes:

 Changing :results output to :results output latex in Rüdiger's nice
 example below would probably be an improvement.

 Best,

 Rüdiger Sonderfeld ruedi...@c-plusplus.de writes:

 TeX output is a feature of Maxima.  See
 (info (maxima) Functions and Variables for TeX Output)

 E.g.

 #+name: solve-maxima
 #+header: :exports results
 #+begin_src maxima :results output
   tex(exp(-x)/x);
 #+end_src
 #+RESULTS: solve-maxima
 : $${{e^ {- x }}\over{x}}$$


 On Thursday 21 November 2013 23:58:35 yggdra...@gmx.co.uk wrote:
 Hi,
 
 Is there a way to evaluate imaxima source code in org-mode to display
 the latex output inline in the org-buffer? I have found in [1] how to
 evaluate maxima code, but I don't understand if and how to adopt it to
 get the nice latex/pdf output. Any pointers appreciated, or just whether
 it is possible or not.
 
 
 I am running emacs 24.3.1 with org mode 7.9.3f.
 
 Thanks,
 
 Johnny
 
 Footnotes:
 [1]  http://orgmode.org/worg/org-contrib/babel/languages/ob-doc-maxima.html




Footnotes: 
[1]  
http://orgmode.org/worg/org-contrib/babel/languages/ob-doc-LaTeX.html#sec-4-3

-- 
Eric Schulte
https://cs.unm.edu/~eschulte
PGP: 0x614CA05D



Re: [O] imaxima babel

2013-11-22 Thread yggdrasil
Thanks, this does answer my initial question and works good enough to
enable latex export! 

Even better would be if it's possible to mimic imaxima behaviour which
is (I think) to directly process the resulting latex code and
(temporarily?) store it as an image to display the pretty-printed
equations directly inline in the org-buffer (which will make it export
as html better I guess as the latex output doesn't seem to be recognised
when exporting to html).

All the best,

Johnny

Eric Schulte schulte.e...@gmail.com writes:

 Changing :results output to :results output latex in Rüdiger's nice
 example below would probably be an improvement.

 Best,

 Rüdiger Sonderfeld ruedi...@c-plusplus.de writes:

 TeX output is a feature of Maxima.  See
 (info (maxima) Functions and Variables for TeX Output)

 E.g.

 #+name: solve-maxima
 #+header: :exports results
 #+begin_src maxima :results output
   tex(exp(-x)/x);
 #+end_src
 #+RESULTS: solve-maxima
 : $${{e^ {- x }}\over{x}}$$


 On Thursday 21 November 2013 23:58:35 yggdra...@gmx.co.uk wrote:
 Hi,
 
 Is there a way to evaluate imaxima source code in org-mode to display
 the latex output inline in the org-buffer? I have found in [1] how to
 evaluate maxima code, but I don't understand if and how to adopt it to
 get the nice latex/pdf output. Any pointers appreciated, or just whether
 it is possible or not.
 
 
 I am running emacs 24.3.1 with org mode 7.9.3f.
 
 Thanks,
 
 Johnny
 
 Footnotes:
 [1]  http://orgmode.org/worg/org-contrib/babel/languages/ob-doc-maxima.html





Re: [O] imaxima babel

2013-11-21 Thread Rüdiger Sonderfeld
TeX output is a feature of Maxima.  See
(info (maxima) Functions and Variables for TeX Output)

E.g.

#+name: solve-maxima
#+header: :exports results
#+begin_src maxima :results output
  tex(exp(-x)/x);
#+end_src

#+RESULTS: solve-maxima
: $${{e^ {- x }}\over{x}}$$


On Thursday 21 November 2013 23:58:35 yggdra...@gmx.co.uk wrote:
 Hi,
 
 Is there a way to evaluate imaxima source code in org-mode to display
 the latex output inline in the org-buffer? I have found in [1] how to
 evaluate maxima code, but I don't understand if and how to adopt it to
 get the nice latex/pdf output. Any pointers appreciated, or just whether
 it is possible or not.
 
 
 I am running emacs 24.3.1 with org mode 7.9.3f.
 
 Thanks,
 
 Johnny
 
 Footnotes:
 [1]  http://orgmode.org/worg/org-contrib/babel/languages/ob-doc-maxima.html




Re: [O] imaxima babel

2013-11-21 Thread Eric Schulte
Changing :results output to :results output latex in Rüdiger's nice
example below would probably be an improvement.

Best,

Rüdiger Sonderfeld ruedi...@c-plusplus.de writes:

 TeX output is a feature of Maxima.  See
 (info (maxima) Functions and Variables for TeX Output)

 E.g.

 #+name: solve-maxima
 #+header: :exports results
 #+begin_src maxima :results output
   tex(exp(-x)/x);
 #+end_src
 #+RESULTS: solve-maxima
 : $${{e^ {- x }}\over{x}}$$


 On Thursday 21 November 2013 23:58:35 yggdra...@gmx.co.uk wrote:
 Hi,
 
 Is there a way to evaluate imaxima source code in org-mode to display
 the latex output inline in the org-buffer? I have found in [1] how to
 evaluate maxima code, but I don't understand if and how to adopt it to
 get the nice latex/pdf output. Any pointers appreciated, or just whether
 it is possible or not.
 
 
 I am running emacs 24.3.1 with org mode 7.9.3f.
 
 Thanks,
 
 Johnny
 
 Footnotes:
 [1]  http://orgmode.org/worg/org-contrib/babel/languages/ob-doc-maxima.html



-- 
Eric Schulte
https://cs.unm.edu/~eschulte
PGP: 0x614CA05D