Re: [O] Python Code Block error with header option :results output

2014-01-31 Thread Ahmadou Dicko
I'm not a Python expert too but I don't that return statement can be used
as is on the fly.
So, yes is the expected behavior of Python

Try instead

#+begin_src python :results output
  a = (1, 2, 3, 4)
  print(a)
#+end_src

#+RESULTS:
: (1, 2, 3, 4)



On Fri, Jan 31, 2014 at 9:24 PM, Soapy Smith wrote:

> Hello-
>
> I am not a user of Python (yet).  During a comparison of code block
> behavior between Clojure and Python, I discovered a possible Python
> error.
>
> Here is the code block:
>
> #+begin_src python :results output
>  a = (1, 2, 3, 4)
>  return a
> #+end_src
>
> The evaluation of this block results in this error:
>
>   File "", line 2
> SyntaxError: 'return' outside function
>
> Could someone please comment if this is expected Python behavior?
>
> I am using org 8.2.4.
>
> Regards,
> Greg
>
>
>


-- 
Ahmadou H. DICKO
statistician economist (Ingénieur Statisticien Économiste)
PhD candidate in Climate change economics
Faculty of economics and managment - Cheikh Anta Diop University
West African Science Service Center on Climate Change and Adaptated Land
Use (WASCAL)
Center for Development Research (ZEF) - University of Bonn
email : ahmadou.di...@ucad.edu.sn
twitter : @dickoah
github : github/dickoa 
tel : +221 33 827 55 16
portable: +221 77 123 81 69


Re: [O] How to use ox-bibtex

2014-01-30 Thread Ahmadou Dicko
You  can also use
latexmkwhich
was designed to solve this kind of problem.
I have this in my init.el

(setq org-latex-pdf-process
  '("latexmk -pdflatex=xelatex -pdf -latexoption=-shell-escape %f"))



On Wed, Jan 29, 2014 at 2:46 PM, Nick Dokos  wrote:

> "o.castillo.felis...@gmail.com"  writes:
>
>
> > A single doubt is left... the bibtex compilation is not performed
> > during the exportation process, should be done manually, Am I write?
> >
>
> You can customize org-latex-pdf-process to do what you want.
> By default, it does three pdflatex runs in a row. If texi2dvi
> works for you, it might be preferable. But you can always add
> a bibtex run after the first pdflatex run.
>
> Nick
>
>
>


-- 
Ahmadou H. DICKO
statistician economist (Ingénieur Statisticien Économiste)
PhD candidate in Climate change economics
Faculty of economics and managment - Cheikh Anta Diop University
West African Science Service Center on Climate Change and Adaptated Land
Use (WASCAL)
Center for Development Research (ZEF) - University of Bonn
email : ahmadou.di...@ucad.edu.sn
twitter : @dickoah
github : github/dickoa 
tel : +221 33 827 55 16
portable: +221 77 123 81 69


Re: [O] Proposal/request for input: slidify export for html slides

2014-01-29 Thread Ahmadou Dicko
I love slidify too and I think that having similar functionnality in org
could be great.
I think that you have everything to do that using the html backend, you
just need to interface the right Javascript/HTML5 library.
In slidify you can use io2012, deck.js, shower and landslide and I know
that you can use deck.js through ox-deck and it will not be difficult to
create and interface for other library too.
For example if you need a nice non Beamer library you can also check
ox-reveal  which interface reveal.js.

Here is a minimal example with R code.  (Make sure to have ox-reveal.el in
your path and export using C-c C-e R R)




On Thu, Jan 30, 2014 at 12:05 AM, John Hendy  wrote:

> Greetings,
>
>
> I use R quite a bit, and ran into a new exporter sometime last year called
> Slidify:
> - http://slidify.org/start.html
>
> Would anyone be able to suggest a good starting place for creating a
> possible backend exporter for this? RStudio allows this pretty easily, but
> I really like my prose/code in Orgmode format and working within Emacs.
> Plus, it allows the obvious benefit of exporting to Beamer or Slidify at
> will (perhaps with some tweaks).
>
> I planned to look at the existing non-Beamer libraries for reference, but
> thought it wouldn't hurt to inquire about potential pitfalls based in how
> Slidify works:
> - initializes a git repo with some css/other folders
> - creates an index.Rmd file (markdown, which one edits to create
> presentation)
> - spits out an index.html file when you run `slidify("index.Rmd")`
>
> I think the folders in the presentation directory could be initialized and
> then Org syntax could be converted to R markdown, followed by running the
> slidify command to compile, but am not sure.
>
> I'm coming from ~zero elisp experience but think this would be a neat
> hobby project if I could pull it off.
>
>
> Thanks for any input,
> John
>



-- 
Ahmadou H. DICKO
statistician economist (Ingénieur Statisticien Économiste)
PhD candidate in Climate change economics
Faculty of economics and managment - Cheikh Anta Diop University
West African Science Service Center on Climate Change and Adaptated Land
Use (WASCAL)
Center for Development Research (ZEF) - University of Bonn
email : ahmadou.di...@ucad.edu.sn
twitter : @dickoah
github : github/dickoa 
tel : +221 33 827 55 16
portable: +221 77 123 81 69
Title: (Ox-reveal and R)








Ox-reveal and R

@dickoah





Code




Embedding rCharts


library(rCharts)
hair_eye_male = subset(as.data.frame(HairEyeColor), Sex == "Male")
n1 <- nPlot(Freq ~ Hair, group = 'Eye',
data = "" type = 'multiBarChart'
)
n1$set(width = 1200, height = 600)  
n1$show('inline', include_assets = TRUE, cdn = TRUE)







 
 








Code

You can check the raw Org-file here





 Created by Ahmadou H. Dicko. 







rChart.org
Description: Lotus Organizer


Re: [O] Different behavior of exported results in org-babel

2014-01-18 Thread Ahmadou Dicko
Thanks a lot Nicolas and Nick.
I just tried it and everything works as expected.
Thank you very much.



On Sat, Jan 18, 2014 at 2:43 PM, Nicolas Goaziou wrote:

> Hello,
>
> Nick Dokos  writes:
>
> > I have traced it down to org-babel-exp-process-buffer: it does the
> > deletions of the source code blocks (possibly putting them back again
> > if the header args tell it to) but it does not always delete the right
> > region. More details later.
>
> Indeed. I pushed a fix that should, hopefully, solve the issue.
>
> Thanks to Ahmadou Dicko for reporting the problem, and to you for
> tracking it.
>
>
> Regards,
>
> --
> Nicolas Goaziou
>
>


-- 
Ahmadou H. DICKO
statistician economist (Ingénieur Statisticien Économiste)
PhD candidate in Climate change economics
Faculty of economics and managment - Cheikh Anta Diop University
West African Science Service Center on Climate Change and Adaptated Land
Use (WASCAL)
Center for Development Research (ZEF) - University of Bonn
email : ahmadou.di...@ucad.edu.sn
twitter : @dickoah
github : github/dickoa <https://github.com/dickoa>
tel : +221 33 827 55 16
portable: +221 77 123 81 69


Re: [O] Different behavior of exported results in org-babel

2014-01-17 Thread Ahmadou Dicko
Thanks for testing.
As a workaround I will use your trick (in buffer evaluation before
exporting) but I was thinking of writing a filter.


On Fri, Jan 17, 2014 at 7:04 PM, Nick Dokos  wrote:

> Ahmadou Dicko  writes:
>
> > Hi everyone,
> >
> > I use the latest version of org-mode (from github) and I update it daily.
> > I noticed some changes recently in org-babel (ob-R).
> >
> > Here's a sample code to explain the problem :
> >
> > #+TITLE: Test export
> > #+AUTHOR: Ahmadou H. DICKO
> > #+PROPERTY: session *R*
> > #+PROPERTY: cache yes
> > #+PROPERTY: exports both
> > #+PROPERTY: tangle yes
> > #+OPTIONS: toc:nil
> >
> > * Minimal example
> >  This works quite well
> > #+begin_src R :exports both :results output
> > mtcars[1:2, 1:2]
> > #+end_src
> >
> > I just want the output without code but I have this
> > 'bf7c7b2c131fcf88c89639d10326a972f0ff25' before the code
>
> > #+begin_src R :exports results :results output
> > mtcars[1:2, 1:2]
> > #+end_src
> >
>
> I used your reproducer (thanks for providing it!) and was able to
> duplicate your results (more or less - I get this
>
>7c7b2c131fcf88c89639d10326a972f0ff25]:
>
> before the second set of results).
>
> If I evaluate both code blocks by hand in the org buffer and
> *then* export, I don't get the extra junk.
>
> > I use emacs 24.3.1, org-version 8.2.5f (updated this morning) and R
> > 3.0.2 You can find attached the sample code and output, if you have
> > something different please let me know.
> >
>
> Nick
>
>
>


-- 
Ahmadou H. DICKO
statistician economist (Ingénieur Statisticien Économiste)
PhD candidate in Climate change economics
Faculty of economics and managment - Cheikh Anta Diop University
West African Science Service Center on Climate Change and Adaptated Land
Use (WASCAL)
Center for Development Research (ZEF) - University of Bonn
email : ahmadou.di...@ucad.edu.sn
twitter : @dickoah
github : github/dickoa <https://github.com/dickoa>
tel : +221 33 827 55 16
portable: +221 77 123 81 69


[O] Different behavior of exported results in org-babel

2014-01-17 Thread Ahmadou Dicko
Hi everyone,

I use the latest version of org-mode (from github) and I update it daily.
I noticed some changes recently in org-babel (ob-R).

Here's a sample code to explain the problem :

#+TITLE: Test export
#+AUTHOR: Ahmadou H. DICKO
#+PROPERTY: session *R*
#+PROPERTY: cache yes
#+PROPERTY: exports both
#+PROPERTY: tangle yes
#+OPTIONS: toc:nil

* Minimal example
 This works quite well
#+begin_src R :exports both :results output
mtcars[1:2, 1:2]
#+end_src

I just want the output without code but I have this
 'bf7c7b2c131fcf88c89639d10326a972f0ff25' before the code
#+begin_src R :exports results :results output
mtcars[1:2, 1:2]
#+end_src

I use emacs 24.3.1, org-version 8.2.5f (updated this morning) and R 3.0.2
You can find attached the sample code and output, if you have something
different please let me know.

Thanks for your help.


-- 
Ahmadou H. DICKO
statistician economist (Ingénieur Statisticien Économiste)
PhD candidate in Climate change economics
Faculty of economics and managment - Cheikh Anta Diop University
West African Science Service Center on Climate Change and Adaptated Land
Use (WASCAL)
Center for Development Research (ZEF) - University of Bonn
email : ahmadou.di...@ucad.edu.sn
twitter : @dickoah
github : github/dickoa 
tel : +221 33 827 55 16
portable: +221 77 123 81 69
Title: Test export






Test export



1 Minimal example


1.1 with exports both



mtcars[1:2, 1:2]




  mpg cyl
Mazda RX4  21   6
Mazda RX4 Wag  21   6






1.2 with exports results only


bf7c7b2c131fcf88c89639d10326a972f0ff25]:


  mpg cyl
Mazda RX4  21   6
Mazda RX4 Wag  21   6






Author: Ahmadou H. DICKO
Created: 2014-01-17 Fri 16:33
Emacs 24.3.1 (Org mode 8.2.5f)
Validate





example.org
Description: Binary data