Re: [O] Problem with including file

2019-05-02 Thread Andreas Kiermeier
Hi Jamie,
Thanks for the info and link.
Seems like I got too excited after Nicolas' reply and noticed exactly what
you pointed out.
I've now worked out that leaving the original buffer-wide properties in
place is OK.
But, as you suggested, I've added property drawer to the heading for the
appendix.
This needed inclusion of a few more of the buffer-wide header-arguments, but
at least it saves having to specify a property drawer for every section.
Thanks again!
Andreas

> -Original Message-
> From: Emacs-orgmode  bounces+andreas.kiermeier=gmail@gnu.org> On Behalf Of Jamie Forth
> Sent: Thursday, 2 May 2019 20:53
> To: emacs-orgmode@gnu.org
> Subject: Re: [O] Problem with including file
> 
> Hi Andreas,
> 
> "Andreas Kiermeier"  writes:
> 
> > The reason I did tried to do it this way was because it's simpler than
> > having to say :export results for every source block.
> > But, it a second call to
> >
> > #+PROPERTY: header-args+ :exports code Just before the #+INCLUDE gets
> > everything working perfectly.
> 
> A second #+PROPERTY keyword will just append an additional file property
> (the second one shadowing the first). Setting the header-args in property
> drawers would do what you want.
> 
> #+PROPERTY: header-args:R :session *R* :cache no
> #+PROPERTY: header-args+ :results output
> #+PROPERTY: header-args+ :eval never-export
> #+PROPERTY: header-args+ :tangle yes
> 
> * Intro
> :PROPERTIES:
> :header-args: :exports results
> :END:
> 
> * Data Analysis Source Code
> :PROPERTIES:
> :header-args: :exports code
> :END:
> 
> https://orgmode.org/manual/Using-Header-Arguments.html#Header-
> arguments-in-Org-mode-properties
> 
> --
> Jamie
> 





Re: [O] Problem with including file

2019-05-02 Thread Andreas Kiermeier
Thanks for the quick reply.
Of course you are spot on, Nicolas.
Changing to  
#+PROPERTY: header-args+ :exports code
Or 
#+PROPERTY: header-args+ :exports both
Does indeed fix the problem.
The reason I did tried to do it this way was because it's simpler than
having to say :export results for every source block.
But, it a second call to 
#+PROPERTY: header-args+ :exports code
Just before the #+INCLUDE gets everything working perfectly.
Thanks again!
Andreas




Re: [O] Problem with including file

2019-05-02 Thread Andreas Kiermeier
Hi Sharon,

The tex file is straight out of the export, and the second ”}” matches the 
“\hypersetup{“ a few lines earlier.

Thanks,

Andreas

 

From: Sharon Kimble  
Sent: Thursday, 2 May 2019 17:57
To: Andreas Kiermeier 
Cc: emacs-orgmode@gnu.org
Subject: Re: [O] Problem with including file

 

"Andreas Kiermeier" mailto:andreas.kierme...@gmail.com> > writes: 
Andreas. 

Just a very quick glance at your problem, and in the tex output you've shown 
there is a double closing bracket on 'pdflang={English}}'. If you correct that 
then your output might be better, I don't know, but its certainly worth a try.

Thanks 
Sharon. 

> Hi, 
> 
> I’ve just run into a problem with exporting a file to latex. 
> 
> In a nutshell, my org files usually contain various analyses and output in R. 
> 
> I generally don’t include the source in the file, but instead tangle all 
> source blocks at the end and include the source code file in an Appendix. 
> This has worked in

> the past, but now the included file is not actually include. 
> 
> An example (close to minimal) consist of the two files below - test.org and 
> test.R (both in the same folder). 
> 
> When exporting test.org to PDF, the source block is correctly exported, while 
> the included file does not appear to be included at all (see also test.tex 
> below).

> 
> Any thoughts would be greatly appreciated. 
> 
> Thanks, 
> 
> Andreas 
> 
> --- begin test.org  
> 
> #+STARTUP: content indent hidestars fninline 
> 
> #+PROPERTY: header-args:R :session *R* :cache no 
> 
> #+PROPERTY: header-args+ :results output 
> 
> #+PROPERTY: header-args+ :exports results 
> 
> #+PROPERTY: header-args+ :eval never-export 
> 
> #+PROPERTY: header-args+ :tangle yes 
> 
> #+OPTIONS: toc:nil H:5 
> 
> #+LATEX_HEADER: \usepackage{minted} 
> 
> * Intro 
> 
> #+begin_src R :results none :exports code 
> 
> ls() 
> 
> #+end_src 
> 
> * Data Analysis Source Code  
> 
> #+INCLUDE: "test.R" src R 
> 
> --- end test.org  
> 
> --- begin test.R  
> 
> ls() 
> 
> --- end test.R  
> 
> --- begin test.tex  
> 
> % Created 2019-05-02 Thu 14:08 
> 
> % Intended LaTeX compiler: pdflatex 
> 
> \documentclass[11pt]{article} 
> 
> \usepackage[utf8]{inputenc} 
> 
> \usepackage[T1]{fontenc} 
> 
> \usepackage{graphicx} 
> 
> \usepackage{grffile} 
> 
> \usepackage{longtable} 
> 
> \usepackage{wrapfig} 
> 
> \usepackage{rotating} 
> 
> \usepackage[normalem]{ulem} 
> 
> \usepackage{amsmath} 
> 
> \usepackage{textcomp} 
> 
> \usepackage{amssymb} 
> 
> \usepackage{capt-of} 
> 
> \usepackage{hyperref} 
> 
> \usepackage{here} 
> 
> \usepackage{color} 
> 
> \usepackage{fancyhdr} 
> 
> \usepackage{fancybox} 
> 
> \usepackage{xspace} 
> 
> \usepackage{minted} 
> 
> \author{Andreas Kiermeier} 
> 
> \date{\today} 
> 
> \title{} 
> 
> \hypersetup{ 
> 
> pdfauthor={Andreas Kiermeier}, 
> 
> pdftitle={}, 
> 
> pdfkeywords={}, 
> 
> pdfsubject={}, 
> 
> pdfcreator={Emacs 25.3.1 (Org mode 9.2.3)}, 
> 
>  pdflang={English}} 
> 
> \begin{document} 
> 
> \section{Intro} 
> 
> \label{sec:org6eb9726} 
> 
> \begin{minted}[]{r} 
> 
> ls() 
> 
> \end{minted} 
> 
> \section{Data Analysis Source Code} 
> 
> \label{sec:org98a88b4} 
> 
> \end{document} 
> 
> --- begin test.text  
> 

-- 
A taste of linux = http://www.sharons.org.uk 
TGmeds = http://www.tgmeds.org.uk 
DrugFacts = https://www.drugfacts.org.uk 
Debian 9.9, fluxbox 1.3.7, emacs 26.2, org 9.2.3 



[O] Problem with including file

2019-05-01 Thread Andreas Kiermeier
Hi,

I've just run into a problem with exporting a file to latex.

In a nutshell, my org files usually contain various analyses and output in
R.

I generally don't include the source in the file, but instead tangle all
source blocks at the end and include the source code file in an Appendix.
This has worked in the past, but now the included file is not actually
include.

An example (close to minimal) consist of the two files below - test.org and
test.R (both in the same folder).

When exporting test.org to PDF, the source block is correctly exported,
while the included file does not appear to be included at all (see also
test.tex below).

Any thoughts would be greatly appreciated.

Thanks,

Andreas

 

--- begin test.org 

#+STARTUP: content indent hidestars fninline

#+PROPERTY: header-args:R :session *R* :cache no

#+PROPERTY: header-args+ :results output

#+PROPERTY: header-args+ :exports results

#+PROPERTY: header-args+ :eval never-export

#+PROPERTY: header-args+ :tangle yes

#+OPTIONS: toc:nil H:5

#+LATEX_HEADER: \usepackage{minted}

 

* Intro

 

#+begin_src R :results none :exports code

ls()

#+end_src

 

* Data Analysis Source Code   

 

#+INCLUDE: "test.R" src R

--- end test.org 

 

--- begin test.R 

ls()

--- end test.R 

 

--- begin test.tex 

% Created 2019-05-02 Thu 14:08

% Intended LaTeX compiler: pdflatex

\documentclass[11pt]{article}

\usepackage[utf8]{inputenc}

\usepackage[T1]{fontenc}

\usepackage{graphicx}

\usepackage{grffile}

\usepackage{longtable}

\usepackage{wrapfig}

\usepackage{rotating}

\usepackage[normalem]{ulem}

\usepackage{amsmath}

\usepackage{textcomp}

\usepackage{amssymb}

\usepackage{capt-of}

\usepackage{hyperref}

\usepackage{here}

\usepackage{color}

\usepackage{fancyhdr}

\usepackage{fancybox}

\usepackage{xspace}

\usepackage{minted}

\author{Andreas Kiermeier}

\date{\today}

\title{}

\hypersetup{

pdfauthor={Andreas Kiermeier},

pdftitle={},

pdfkeywords={},

pdfsubject={},

pdfcreator={Emacs 25.3.1 (Org mode 9.2.3)}, 

 pdflang={English}}

\begin{document}

 

 

\section{Intro}

\label{sec:org6eb9726}

 

\begin{minted}[]{r}

ls()

\end{minted}

 

\section{Data Analysis Source Code}

\label{sec:org98a88b4}

\end{document}

--- begin test.text 



Re: [O] org babel, ess, R

2017-07-02 Thread Andreas Kiermeier
>
> Thanks Andreas. I am perhaps being to finicky. The problem with your
> approach is that you would end up permanently losing screen space for the R
> session. I don’t want the R session obstructing my writing when I am not
> working on code blocks. Ideally, the R session should appear only when I am
> editing the code blocks in an edit buffer.
>
> Vikas
>
> ​Fair enough. I guess it comes down to personal preference.​
If I have emacs maximised, I "need" to split the frame into two windows -
otherwise a single window is too wide (and I don't have a wide screen
monitor).
Because I use this set up for running data analyses and writing reports, it
has the benefit that I can refer to output and calculations at any time.
But, each to their own.
Cheers,
AK


Re: [O] org babel, ess, R

2017-07-02 Thread Andreas Kiermeier
Hi Vikas,
for what it's worth, I usually run two windows (in the same frame),
side-by-side, with emacs maximised.
On the left I have my org file and on the right I have an R session, which
I start immediately after I open my org file.
When I use C-c ' on an R source block, the org buffer (on the left) is
replaced by by the source code edit buffer - leaving the R-session on the
right untouched.
That way I can either evaluate a whole code block (from org using C-c C-c)
or go through the source code line-by-line (using ESS).
Seems like that's what you want to do, too.
Anyway, just my two cents worth, in case it helps.
Cheers,
AK

On 3 July 2017 at 09:47, Vikas Rawal 
wrote:

> >
> > Vikas Rawal  writes:
> >
> >> Isn’t is what most users need while editing the code block? The
> >> possibility of evaluating the code to test and see what happens?
> >
> >
> > Many languages do not support sessions. So, the only possibility to
> > evaluate the code is to evaluate the code block in the source buffer.
> >
>
> Yes, what I am talking about is relevant only when a session is defined.
> What I would like is that if in a file the session is defined, C-c’ creates
> a window configuration that shows the edit buffer and the session. In
> other cases, the two windows could show the edit buffer and the original
> org buffer.
>
>
> Vikas
>


Re: [O] Org, reftex and LaTeX with multiple bibliographies

2016-09-17 Thread Andreas Kiermeier

On 17/09/2016 03:49, Ken Mankoff wrote:

Hi Org list,[snip]

# Note that the first line below is commented out
# #+LATEX_HEADER_EXTRA:\addbibresource{Library.bib,local.bib}
#+LATEX_HEADER_EXTRA:\addbibresource{Library.bib}
#+LATEX_HEADER_EXTRA:\addbibresource{local.bib}

Is this how others work with multiple bibliographies? Some other method?


Hi Ken, I use John Kitchin's org-ref. Multiple bibfiles can easily be 
include. I use this approach for most it for most projects - one global 
bib file and one project specific one, e.g. bibliographystyle:plainnat 
bibliography:C:/Users/andre/Dropbox/_biblio/refs.bib,C:/Users/andre/Dropbox/Consulting/Projects/RedMeat/MLA_Beef_Measles-C_bovis/literature/cbovis.bib 
Hope this helps. Cheers, AK




Re: [O] exporting documents w/ babel results w/o evaluating babel blocks

2016-05-24 Thread Andreas Kiermeier
I second that.
I like exporting everything to LaTeX without having to re-run all the code,
which in many cases can add considerable time.
Cheers,
Andreas

On 24 May 2016 at 11:04, Grant Rettke  wrote:

> On Sun, May 22, 2016 at 4:52 PM, Charles C. Berry 
> wrote:
> > TL;DR: Org babel headers give excellent control over what gets run,
> > when it gets run, and how. Users should use them.
>
> Definitely!
>
> > Don't reset `org-export-babel-evaluate'.
>
> Why not?
>
> It can be nice to disable org-export-babel-evaluate by setting it to `nil'.
>
> That way you separate your workflow into two distinct steps: one for
> execution and one for weaving.
>
> It would be fun to "see" everyone's Org-Mode workflows; I bet there
> are a lot of nice approaches.
>
>


Re: [O] org-ref no bibliography generated in pdf

2016-02-07 Thread Andreas Kiermeier
On 7 February 2016 at 04:38, John Kitchin  wrote:

> that is why you don't get bibtex run then ;) try this
> (setq org-latex-pdf-process
>'("pdflatex -shell-escape -interaction nonstopmode
> -output-directory %o %b"
>  "bibtex %b"
>  "pdflatex -shell-escape -interaction nonstopmode
> -output-directory %o %b"
>  "pdflatex -shell-escape -interaction nonstopmode
> -output-directory %o %b"))
>

​Hi John & list,

is there any reason why we should be hardcoding multiple runs of pdflatex​

​(& bibtex) instead of using texify?

I have my org-latex-to-pdf set to
"texify -p -b --tex-option=-shell-escape %f"​
​ (I'm on Windows 10, running MikTex 2.9), which hasn't given my any
problems to date and seem to be a little more efficient​.

I'm just curious.

Cheers,

AK


Re: [O] Problem with org-ref

2015-12-25 Thread Andreas Kiermeier
Magic!
Thanks a lot, John.

On 26 December 2015 at 12:06, John Kitchin  wrote:

> That sounds ok. I pushed a change that sort of does what you ask for. If
> the "calculated" pdf doesn't exist then you should get prompted for a pdf,
> and pressing enter for the default (no pdf) should not add a pdf link.
>
> John
>
> ---
> Professor John Kitchin
> Doherty Hall A207F
> Department of Chemical Engineering
> Carnegie Mellon University
> Pittsburgh, PA 15213
> 412-268-7803
> @johnkitchin
> http://kitchingroup.cheme.cmu.edu
>
>
> On Fri, Dec 25, 2015 at 7:03 PM, Andreas Kiermeier <
> andreas.kierme...@gmail.com> wrote:
>
>> Thanks John.
>>
>> Yes, that was the case, because I had no intention of downloading the
>> pdfs. So I had set
>>
>> (setq doi-utils-download-pdf nil)
>>
>> and left org-ref-pdf-directory nil. Setting it to a valid directory gets
>> rid of the error. Thanks.
>>
>> I would find it useful (given that I've disabled auto-download) if I was
>> prompted for the location of the pdf. That way I could either (a) provide a
>> link to the pdf wherever I've stored it, or (b) not provide a link (yet).
>> Just a thought.
>>
>> Thanks again for all your help.
>>
>> Andreas
>>
>> On 26 December 2015 at 00:37, John Kitchin 
>> wrote:
>>
>>> What about the value of org-ref-pdf-directory. This seems to be where
>>> your error is coming from. Your debugger info suggests it is set to nil.
>>>
>>> Debugger entered--Lisp error: (wrong-type-argument stringp nil)
>>>   file-name-as-directory(nil)
>>>   org-ref-open-bibtex-notes()
>>>   doi-utils-insert-bibtex-entry-fr
>>>
>>> John
>>>
>>> ---
>>> Professor John Kitchin
>>> Doherty Hall A207F
>>> Department of Chemical Engineering
>>> Carnegie Mellon University
>>> Pittsburgh, PA 15213
>>> 412-268-7803
>>> @johnkitchin
>>> http://kitchingroup.cheme.cmu.edu
>>>
>>>
>>> On Thu, Dec 24, 2015 at 10:16 PM, Andreas Kiermeier <
>>> andreas.kierme...@gmail.com> wrote:
>>>
>>>> I've set the HOME environment variable to
>>>> "C:/Users/andre_000/Documents" and hence need the .. to get into the
>>>> Dropbox folder.
>>>>
>>>> Executing (find-file org-ref-bibliography-notes) does find and open
>>>> the correct notes file.
>>>>
>>>> Using an absolute path, as in:
>>>>
>>>> (setq org-ref-bibliography-notes
>>>> "C:/Users/andre_000/Dropbox/_biblio/org-ref/bibnotes.org"
>>>>   org-ref-default-bibliography
>>>> '("C:/Users/andre_000/Dropbox/_biblio/refs.bib"))
>>>>
>>>> results in the same error.
>>>>
>>>> After dropping a PDF file into the .bib file I end up with the
>>>> following additional entry (for example) in the bibnotes.org file. I
>>>> thought I'd include it just to ensure that nothing gets chopped of - this
>>>> entry correctly reflect the PDF.
>>>>
>>>> ** TODO 2007 - Taenia Saginata in Europe
>>>>  :PROPERTIES:
>>>>   :Custom_ID: dorny_2007
>>>>   :AUTHOR: Dorny \& Praet
>>>>   :JOURNAL: Veterinary Parasitology
>>>>   :YEAR: 2007
>>>>   :VOLUME: 149
>>>>   :PAGES: 22-24
>>>>   :DOI: 10.1016/j.vetpar.2007.07.004
>>>>   :URL: http://dx.doi.org/10.1016/j.vetpar.2007.07.004
>>>>  :END:
>>>>
>>>> Does the notes file need a specific set up in terms of headers etc?
>>>>
>>>>
>>>> --
>>>> Dr Andreas Kiermeier | Director
>>>> Statistical Process Improvement Consulting and Training Pty Ltd
>>>> Mbl: +61 (4)23 028 565 | Email: andreas.kierme...@gmail.com
>>>> Australia
>>>>
>>>> On 25 December 2015 at 13:17, John Kitchin 
>>>> wrote:
>>>>
>>>>> That is an odd looking path. On Mac that would expand to something like
>>>>>
>>>>> /Users/Dropbox/_biblio/org-ref/bibnotes.org
>>>>>
>>>>> and on linux
>>>>>
>>>>> /home/Dropbox/_biblio/org-ref/bibnotes.org
>>>>>
>>>>> usually you should not have permission for that, and neither make sense
>>>>> to me.
>>&g

Re: [O] Problem with org-ref

2015-12-25 Thread Andreas Kiermeier
Thanks John.

Yes, that was the case, because I had no intention of downloading the pdfs.
So I had set

(setq doi-utils-download-pdf nil)

and left org-ref-pdf-directory nil. Setting it to a valid directory gets
rid of the error. Thanks.

I would find it useful (given that I've disabled auto-download) if I was
prompted for the location of the pdf. That way I could either (a) provide a
link to the pdf wherever I've stored it, or (b) not provide a link (yet).
Just a thought.

Thanks again for all your help.

Andreas

On 26 December 2015 at 00:37, John Kitchin  wrote:

> What about the value of org-ref-pdf-directory. This seems to be where your
> error is coming from. Your debugger info suggests it is set to nil.
>
> Debugger entered--Lisp error: (wrong-type-argument stringp nil)
>   file-name-as-directory(nil)
>   org-ref-open-bibtex-notes()
>   doi-utils-insert-bibtex-entry-fr
>
> John
>
> ---
> Professor John Kitchin
> Doherty Hall A207F
> Department of Chemical Engineering
> Carnegie Mellon University
> Pittsburgh, PA 15213
> 412-268-7803
> @johnkitchin
> http://kitchingroup.cheme.cmu.edu
>
>
> On Thu, Dec 24, 2015 at 10:16 PM, Andreas Kiermeier <
> andreas.kierme...@gmail.com> wrote:
>
>> I've set the HOME environment variable to "C:/Users/andre_000/Documents"
>> and hence need the .. to get into the Dropbox folder.
>>
>> Executing (find-file org-ref-bibliography-notes) does find and open the
>> correct notes file.
>>
>> Using an absolute path, as in:
>>
>> (setq org-ref-bibliography-notes
>> "C:/Users/andre_000/Dropbox/_biblio/org-ref/bibnotes.org"
>>   org-ref-default-bibliography
>> '("C:/Users/andre_000/Dropbox/_biblio/refs.bib"))
>>
>> results in the same error.
>>
>> After dropping a PDF file into the .bib file I end up with the following
>> additional entry (for example) in the bibnotes.org file. I thought I'd
>> include it just to ensure that nothing gets chopped of - this entry
>> correctly reflect the PDF.
>>
>> ** TODO 2007 - Taenia Saginata in Europe
>>  :PROPERTIES:
>>   :Custom_ID: dorny_2007
>>   :AUTHOR: Dorny \& Praet
>>   :JOURNAL: Veterinary Parasitology
>>   :YEAR: 2007
>>   :VOLUME: 149
>>   :PAGES: 22-24
>>   :DOI: 10.1016/j.vetpar.2007.07.004
>>   :URL: http://dx.doi.org/10.1016/j.vetpar.2007.07.004
>>  :END:
>>
>> Does the notes file need a specific set up in terms of headers etc?
>>
>>
>> --
>> Dr Andreas Kiermeier | Director
>> Statistical Process Improvement Consulting and Training Pty Ltd
>> Mbl: +61 (4)23 028 565 | Email: andreas.kierme...@gmail.com
>> Australia
>>
>> On 25 December 2015 at 13:17, John Kitchin 
>> wrote:
>>
>>> That is an odd looking path. On Mac that would expand to something like
>>>
>>> /Users/Dropbox/_biblio/org-ref/bibnotes.org
>>>
>>> and on linux
>>>
>>> /home/Dropbox/_biblio/org-ref/bibnotes.org
>>>
>>> usually you should not have permission for that, and neither make sense
>>> to me.
>>>
>>> Does (file-exists-p org-ref-bibliography-notes) return true?
>>>
>>> or alternatively does (find-file org-ref-bibliography-notes) actually
>>> open a writable file?
>>>
>>> I would think this is what you want (unless you have some unusual setup
>>> and permissions):
>>>
>>> (setq org-ref-bibliography-notes "~/Dropbox/_biblio/org-ref/bibnotes.org
>>> "
>>>org-ref-default-bibliography '("~/Dropbox/_biblio/refs.bib"))
>>>
>>> i.e. no .. in the path.
>>>
>>> Andreas Kiermeier writes:
>>>
>>> > Hi John,
>>> >
>>> > I've set it at follows (based on your setup) in my init.el file:
>>> >
>>> > (setq org-ref-bibliography-notes "~/../Dropbox/_biblio/org-ref/
>>> bibnotes.org"
>>> >   org-ref-default-bibliography '("~/../Dropbox/_biblio/refs.bib"))
>>> >
>>> > So, non-nil.
>>> >
>>> > Andreas
>>> >
>>> > On 25 December 2015 at 00:45, John Kitchin 
>>> wrote:
>>> >
>>> >>
>>> >> On Thu, Dec 24, 2015 at 1:04 AM, Andreas Kiermeier <
>>> >> andreas.kierme...@gmail.com> wrote:
>>> >>
>>> >>> org-ref-open-bibtex-notes()
>>> >>
>>> >>
>>> >> That looks like a different error that occurs in
>>> org-ref-open-bibtex-notes().
>>> >> Up to that point everything looks normal.
>>> >>
>>> >> What do you have your org-ref-bibliography-notes variable set to? The
>>> >> default value is nil which would cause that error.
>>> >>
>>> >>
>>> >>
>>> >> John
>>> >>
>>> >> ---
>>> >> Professor John Kitchin
>>> >> Doherty Hall A207F
>>> >> Department of Chemical Engineering
>>> >> Carnegie Mellon University
>>> >> Pittsburgh, PA 15213
>>> >> 412-268-7803
>>> >> @johnkitchin
>>> >> http://kitchingroup.cheme.cmu.edu
>>> >>
>>> >>
>>>
>>> --
>>> Professor John Kitchin
>>> Doherty Hall A207F
>>> Department of Chemical Engineering
>>> Carnegie Mellon University
>>> Pittsburgh, PA 15213
>>> 412-268-7803
>>> @johnkitchin
>>> http://kitchingroup.cheme.cmu.edu
>>>
>>
>>
>


Re: [O] Problem with org-ref

2015-12-24 Thread Andreas Kiermeier
I've set the HOME environment variable to "C:/Users/andre_000/Documents"
and hence need the .. to get into the Dropbox folder.

Executing (find-file org-ref-bibliography-notes) does find and open the
correct notes file.

Using an absolute path, as in:

(setq org-ref-bibliography-notes
"C:/Users/andre_000/Dropbox/_biblio/org-ref/bibnotes.org"
  org-ref-default-bibliography
'("C:/Users/andre_000/Dropbox/_biblio/refs.bib"))

results in the same error.

After dropping a PDF file into the .bib file I end up with the following
additional entry (for example) in the bibnotes.org file. I thought I'd
include it just to ensure that nothing gets chopped of - this entry
correctly reflect the PDF.

** TODO 2007 - Taenia Saginata in Europe
 :PROPERTIES:
  :Custom_ID: dorny_2007
  :AUTHOR: Dorny \& Praet
  :JOURNAL: Veterinary Parasitology
  :YEAR: 2007
  :VOLUME: 149
  :PAGES: 22-24
  :DOI: 10.1016/j.vetpar.2007.07.004
  :URL: http://dx.doi.org/10.1016/j.vetpar.2007.07.004
 :END:

Does the notes file need a specific set up in terms of headers etc?


-- 
Dr Andreas Kiermeier | Director
Statistical Process Improvement Consulting and Training Pty Ltd
Mbl: +61 (4)23 028 565 | Email: andreas.kierme...@gmail.com
Australia

On 25 December 2015 at 13:17, John Kitchin  wrote:

> That is an odd looking path. On Mac that would expand to something like
>
> /Users/Dropbox/_biblio/org-ref/bibnotes.org
>
> and on linux
>
> /home/Dropbox/_biblio/org-ref/bibnotes.org
>
> usually you should not have permission for that, and neither make sense
> to me.
>
> Does (file-exists-p org-ref-bibliography-notes) return true?
>
> or alternatively does (find-file org-ref-bibliography-notes) actually
> open a writable file?
>
> I would think this is what you want (unless you have some unusual setup
> and permissions):
>
> (setq org-ref-bibliography-notes "~/Dropbox/_biblio/org-ref/bibnotes.org"
>org-ref-default-bibliography '("~/Dropbox/_biblio/refs.bib"))
>
> i.e. no .. in the path.
>
> Andreas Kiermeier writes:
>
> > Hi John,
> >
> > I've set it at follows (based on your setup) in my init.el file:
> >
> > (setq org-ref-bibliography-notes "~/../Dropbox/_biblio/org-ref/
> bibnotes.org"
> >   org-ref-default-bibliography '("~/../Dropbox/_biblio/refs.bib"))
> >
> > So, non-nil.
> >
> > Andreas
> >
> > On 25 December 2015 at 00:45, John Kitchin 
> wrote:
> >
> >>
> >> On Thu, Dec 24, 2015 at 1:04 AM, Andreas Kiermeier <
> >> andreas.kierme...@gmail.com> wrote:
> >>
> >>> org-ref-open-bibtex-notes()
> >>
> >>
> >> That looks like a different error that occurs in
> org-ref-open-bibtex-notes().
> >> Up to that point everything looks normal.
> >>
> >> What do you have your org-ref-bibliography-notes variable set to? The
> >> default value is nil which would cause that error.
> >>
> >>
> >>
> >> John
> >>
> >> ---
> >> Professor John Kitchin
> >> Doherty Hall A207F
> >> Department of Chemical Engineering
> >> Carnegie Mellon University
> >> Pittsburgh, PA 15213
> >> 412-268-7803
> >> @johnkitchin
> >> http://kitchingroup.cheme.cmu.edu
> >>
> >>
>
> --
> Professor John Kitchin
> Doherty Hall A207F
> Department of Chemical Engineering
> Carnegie Mellon University
> Pittsburgh, PA 15213
> 412-268-7803
> @johnkitchin
> http://kitchingroup.cheme.cmu.edu
>


Re: [O] Problem with org-ref

2015-12-24 Thread Andreas Kiermeier
Hi John,

I've set it at follows (based on your setup) in my init.el file:

(setq org-ref-bibliography-notes "~/../Dropbox/_biblio/org-ref/bibnotes.org"
  org-ref-default-bibliography '("~/../Dropbox/_biblio/refs.bib"))

So, non-nil.

Andreas​

On 25 December 2015 at 00:45, John Kitchin  wrote:

>
> On Thu, Dec 24, 2015 at 1:04 AM, Andreas Kiermeier <
> andreas.kierme...@gmail.com> wrote:
>
>> org-ref-open-bibtex-notes()
>
>
> That looks like a different error that occurs in  org-ref-open-bibtex-notes().
> Up to that point everything looks normal.
>
> What do you have your org-ref-bibliography-notes variable set to? The
> default value is nil which would cause that error.
>
>
>
> John
>
> ---
> Professor John Kitchin
> Doherty Hall A207F
> Department of Chemical Engineering
> Carnegie Mellon University
> Pittsburgh, PA 15213
> 412-268-7803
> @johnkitchin
> http://kitchingroup.cheme.cmu.edu
>
>


Re: [O] Problem with org-ref

2015-12-23 Thread Andreas Kiermeier
Hi John,

thanks for the quick feedback and fix. Yes, the version that comes with
GitHub (on Windows) works when set this way, though I had to specify
slightly differently (i.e quotes & backslashes):

(setq pdftotext-executable
"C:/Users/andre_000/AppData/Local/GitHub/PortableGit_c7e0cbde92ba565cb218a521411d0e854079a28c/mingw32/bin/pdftotext.exe")

But now the following error occurs, after inserting the new bibtex entry
and creating a new note (in the notes file):

org-ref-open-bibtex-notes: Wrong type argument: stringp, nil

Turning debugging on yields the following:

Debugger entered--Lisp error: (wrong-type-argument stringp nil)
  file-name-as-directory(nil)
  org-ref-open-bibtex-notes()
  doi-utils-insert-bibtex-entry-from-doi("10.1016/j.vetpar.2010.10.058")
  doi-utils-add-bibtex-entry-from-doi("10.1016/j.vetpar.2010.10.058"
"c:/Users/andre_000/Dropbox/_biblio/refs.bib")

org-ref-pdf-dnd-protocol("file:C%3A/Users/andre_000/Dropbox/Consulting/Projects/RedMeat/MLA_Beef_Measles-C_bovis/literature/VetPara_McFadden_2011.pdf"
private)
  byte-code(" \306 \211 \203%

Looks like something is still not quite right with the ":" in the pathname.

​Cheers,

Andreas​

On 24 December 2015 at 12:03, John Kitchin  wrote:

> I tested part of this on Windows in a git bash shell:
>
> $ pdftotext -v
> pdftotext version 0.14.5
> Copyright 2005-2010 The Poppler Developers -
> http://poppler.freedesktop.org
> Copyright 1996-2004 Glyph & Cog, LLC
>
> and then this works:
> $ pdftotext.exe kitchin-2015-examp.pdf - | grep DOI
> ACS Catal., Just Accepted Manuscript • DOI: 10.1021/acscatal.5b00538 •
> Publicati
> on Date (Web): 11 May 2015
> readers and citable by the Digital Object Identifier (DOI®). “Just
> Accepted” is
> an optional service offered
> sharing site which assigned the data set a DOI. 19 An alternative data
> repositor
> y could be an
> institutional data repository which also provides a DOI for citing. It
> remains t
> o be seen if
> stores that provide a citable DOI for the data set. The point is that this
> appro
> ach is very
>
> However, I see that in emacs, it appears another pdftotext is getting
> used, which does not work.
> ~/Desktop $ pdftotext -v
> pdftotext version 2.03
> Copyright 1996-2003 Glyph & Cog, LLC
>
> that is the same version that runs in a cmd shell.
>
> The version that seems to work for me is at "C:\Program Files
> (x86)\Git\bin\pdftotext".
>
> I added a variable to set the location of this program, and then rely on
> the executable path. It was a little tricky to set this right, note the
> escaped quotes.
>
> #+BEGIN_SRC emacs-lisp
> (setq pdftotext-executable "\"C:/Program Files (x86)/Git/bin/pdftotext\"")
> #+END_SRC
>
>
> It turned out there was another issue with the uri in the drag-n-drop
> needing to be unescaped on windows because of the : in the path, which is
> also done now.
>
> I pushed these out. hopefully that makes some progress for you! or at
> least gives some hints on where to look for the problem.
>
> Merry Xmas!
>
> John
>
> -------
> Professor John Kitchin
> Doherty Hall A207F
> Department of Chemical Engineering
> Carnegie Mellon University
> Pittsburgh, PA 15213
> 412-268-7803
> @johnkitchin
> http://kitchingroup.cheme.cmu.edu
>
>
> On Wed, Dec 23, 2015 at 6:56 PM, Andreas Kiermeier <
> andreas.kierme...@gmail.com> wrote:
>
>> Hi John,
>> similar doi problem here.
>> My configuration is:
>>
>>- Windows 10
>>- GNU Emacs 24.5.1 (i686-pc-mingw32) of 2015-04-11 on LEG570
>>- Miktex (up-to-date) with pdftotext v0.32..0
>>- org-ref v 0.5.0 (from melpa)
>>
>> Running pdftotext from the command line works and produces a text file
>> with doi info.
>> Let me know what I can do to help to test things.
>> Thanks.
>> Andreas
>> PS: Thank you for org-ref ... an awesome Xmas present!
>>
>>
>> On 24 December 2015 at 08:00, John Kitchin 
>> wrote:
>>
>>> Thanks! Do you know if you have pdftotext working on your machine? The
>>> pdf drag-n-drop works by converting the pdf to text, and than matching a
>>> pattern to find a doi. If none is found, you get the message you noted. The
>>> url dnd works similarly, but there are a bunch of recipes for what to match
>>> depending on the base of the url.
>>>
>>> I did that on a Mac, and I haven't tested it on a windows or Linux
>>> machine.
>>>
>>> John
>>>
>>> ---
>>> Professor John Kitchin
>>> D

Re: [O] Problem with org-ref

2015-12-23 Thread Andreas Kiermeier
Hi John,
similar doi problem here.
My configuration is:

   - Windows 10
   - GNU Emacs 24.5.1 (i686-pc-mingw32) of 2015-04-11 on LEG570
   - Miktex (up-to-date) with pdftotext v0.32..0
   - org-ref v 0.5.0 (from melpa)

Running pdftotext from the command line works and produces a text file with
doi info.
Let me know what I can do to help to test things.
Thanks.
Andreas
PS: Thank you for org-ref ... an awesome Xmas present!


On 24 December 2015 at 08:00, John Kitchin  wrote:

> Thanks! Do you know if you have pdftotext working on your machine? The pdf
> drag-n-drop works by converting the pdf to text, and than matching a
> pattern to find a doi. If none is found, you get the message you noted. The
> url dnd works similarly, but there are a bunch of recipes for what to match
> depending on the base of the url.
>
> I did that on a Mac, and I haven't tested it on a windows or Linux
> machine.
>
> John
>
> ---
> Professor John Kitchin
> Doherty Hall A207F
> Department of Chemical Engineering
> Carnegie Mellon University
> Pittsburgh, PA 15213
> 412-268-7803
> @johnkitchin
> http://kitchingroup.cheme.cmu.edu
>
>
> On Wed, Dec 23, 2015 at 4:22 PM, marvin doyley 
> wrote:
>
>> Hi John,
>>
>> I am playing with org-ref,  the melpa version.
>>
>> Everything works fine except, one thing.  When I drag a pdf to an empty
>> bibtex file it doesn’t extract the doi ( no doi found in the file:///).
>> I tried it pdf you used  in your video (Examples of Effective Data Sharing
>> in Scientific Publishing), but I got the same error. Dragging the url to
>> the bibtex file also doesn’t works for me.
>>
>> cheers,
>> M
>>
>> PS by the way, your video was excellent :)
>>
>
>


Re: [O] #+BIBLIOGRAPHY multiple entries

2014-11-23 Thread Andreas Kiermeier
Hi Johnny,

​
On 24 November 2014 at 08:08,  wrote:

> I use
> #+BIBLIOGRAPHY mybibliographyfile plain
> which works, but
> #+BIBLIOGRAPHY myfirstbibliographyfile mysecondbibliographyfile plain
> does not.


Instead of #+BIBLIOGRAPHY I tend to use

#+LATEX: \bibliographystyle{plainnat}
#+LATEX: \bibliography{C:/Users/andreas/Dropbox/_biblio/refs}

were all my bibtex entries are in "refs.bib". I keep everything in the one
place and hence need to use the full path.

You can put these where you want the bibliography placed and you can
include multiple files in LaTeX' \bibliography{} command.

In your case I imagine it would look something like this.

#+LATEX: \bibliographystyle{plainnat}
#+LATEX: \bibliography{C:/Users/andreas/Dropbox/_biblio/refs}

HTH.

Cheers,

Andreas​


Re: [O] Paper Size for Exported LaTeX

2014-10-21 Thread Andreas Kiermeier
Hi Kenneth,

I believe the reason for the large margins are based on readability (long
lines are harder). Having said that, I've also found them a bit 'odd' and
maybe that's because I'm so used to Microsoft Word's default margins of 1in
all around.

Anyway, if you prefer to specify margins directly, rather than calculating
them via \textwidth, you can also use the geometry package, e.g.

#+LATEX_HEADER: \usepackage[various options]{geometry}

Cheers,
AK


Re: [O] header arguments, inheritance, and noweb expansion Was: «Macro» expansion in source blocks; code-sharing between blocks

2014-09-20 Thread Andreas Kiermeier
Thanks Chuck,
I thought the same, especially since I found the tabular() function by
looking at Hmisc and rms documentation (both packages by Frank Harrell).
But as it turns out the latex method for objects of class tabular is
defined in the table package and it has a much more limited set of options.
The upside is that I found the additional functions margin.table and
addmargins (I knew about prop.table) which are going to make my life easier
with R's tables.
Cheers,
Andreas

-- 
Dr Andreas Kiermeier | Director
Statistical Process Improvement Consulting and Training Pty Ltd
Mbl: +61 (4)23 028 565 | Email: andreas.kierme...@gmail.com
Australia

On 21 September 2014 01:36, Charles Berry  wrote:

> Andreas Kiermeier  gmail.com> writes:
>
> >
> > On 19 September 2014 20:29, Rainer M Krug  krugs.de> wrote:>
>
> [ snip ]
>
> >
> > The alternative mentioned by Chuck Berry is the xtable function (in R)
> > (https://lists.gnu.org/archive/html/emacs-orgmode/2014-09/msg00519.html
> ).
> > I just tried it and am happy to share that it does created the whole
> > output in one go, i.e. it does exactly what I need, including table
> > float, caption and label. Now I just got to sort out how to created the
> > tables without the use of tabular ...
> >
>
> I suggested xtable because that is what I often use.
>
> But thinking a bit more, I decided to look at tables::tabular() and
> at Hmisc::latex(), which I think is what you used at first.
>
> And it turns out that latex() has args for caption, label, where, and
> loads of other things. See its help page. So, it looks like you have the
> control you need and the ability to use
>
>   latex( tabular(...), caption = <...>, label = <...>, ...)
>
> to good effect.
>
> HTH,
>
> Chuck
>
>
>


Re: [O] header arguments, inheritance, and noweb expansion Was: «Macro» expansion in source blocks; code-sharing between blocks

2014-09-19 Thread Andreas Kiermeier
On 19 September 2014 20:29, Rainer M Krug  wrote:
> This boils down to the question I asked earlier about header-args and
> +header args, inheritance of header arguments and this in contrast to
> normal header args.
>
> Based on this discussion, I thought that the header arguments count
> *where the code is executed* and not where it is defined - well -
> surprise for me.
>
> You could try and put the code block with the definition of the code
> into a subtree where you set
>
> ,
> | :PROPERTIES:
> | :headser-args+: eval no
> | :END:
> `
>
> This might work?

Hi Rainer & list,

I've set the following property for the subtree that both code blocks are
in:

:header-args+: :eval no

but this results in no execution of either block
​​
.

I noticed in a separate thread (
https://lists.gnu.org/archive/html/emacs-orgmode/2014-09/msg00547.html)
​ that there is also :float header argument.​ The manual seems to indicate
that it only applies to org tables (exported to latex) - I've tried using
it on the original source block that produces a latex table as output,
which of course didn't work.

But ... if it did, that is,
if this float (and placement) header argument was utilised by the latex
source block, and so wrapped the output in a float (with optional caption
​ & label​
), then this
​c​ould
 circumvent the need for the second noweb source block.

The alternative mentioned by Chuck Berry is the xtable function (in R) (
https://lists.gnu.org/archive/html/emacs-orgmode/2014-09/msg00519.html). I
just tried it and am happy to share that it does created the whole output
in one go, i.e. it does exactly what I need, including table float, caption
and label. Now I just got to sort out how to created the tables without the
use of tabular ...

Thanks to all for your help!

Cheers,

Andreas


Re: [O] CV in orgmode for export to pdf (and html?)

2014-09-19 Thread Andreas Kiermeier
Hi Rainer,

like Tory I prepare my CV using latex directly. I've been using
"moderncv" for several years now and have been quite happy with it
(though that was before I've started using org). But even now, I can't
see how using org, would add to what I already have.

Mind you, I tend to add to my CV (mainly publications and experience)
and revise it when needed, rather than adapt it to different
situations.

Cheers,

Andreas



On 19 September 2014 19:40, Tory S. Anderson  wrote:
> I do mine in LaTeX and haven't had a reason to change that. I keep a "Master" 
> CV/resumé with all the gratuitous information in all categories, then make 
> subdirs for each submission and the trimmed-down versions of my resume that I 
> sent out. At this stage in my career–where I am still tailoring resumés to 
> employers and not really keeping a no-holds-barred CV— this is the best 
> workflow I've found. I'm not sure how I'd go about versioning, trimming, and 
> tracking things as neatly in an all-org environment.
>
> I'm presuming you just want a full-disclosure CV, though? Org makes more 
> sense there.
>
> Rainer M Krug  writes:
>
>> Hi
>>
>> I am looking for examples / templates for CVs written using org, as I
>> decided to ose org for my CV.



Re: [O] «Macro» expansion in source blocks; code-sharing between blocks

2014-09-19 Thread Andreas Kiermeier
Thanks Rainer,

but unfortunately this isn't working. I'm sure I'm doing something
wrong ... somewhere.

In case this makes any difference I have in the document header:

#+PROPERTY: header-args:R :session *R*
#+PROPERTY: header-args :results output graphics :exports results

I've now changed the source block header to ":exports none :eval no"
but now there really is nothing in the output.

In fact, the corresponding .tex file now contains:

\begin{table}[h]
\label{tbl:refyear}
\caption{Separation outcomes (death or any type of discharge) by
reference year.}
nil
\end{table}

and in the *Message* buffer I now have:

Evaluation of this R code-block (tbl-refyear) is disabled.
org-babel-exp processing...
Evaluation of this R code-block (tbl-refyear) is disabled.
executing Latex code block...

So, this source block really doesn't evaluated at all.

Thanks

Andreas

On 19 September 2014 18:34, Rainer M Krug  wrote:
> Andreas Kiermeier  writes:
>
>> I don't think you need the ":noweb yes" as part of the setup_fu
>> header, as this block is not pulling in other materials.
>>
>> Having used this type of setup only over the last couple of days, I've
>> come up with another question. It appears that the setup_fu is
>> executed twice ... once as it's own source block (though by itself not
>> need) and once as part of the second noweb block. This isn't a problem
>> if the execution time is small, but I'm trying to create a summary
>> table in Latex format from 2 million records - so the time is
>> considerable.
>>
>
> Check out the :eval header argument: if you use
>
> ,
> | #+BEGIN_SRC R :eval never :exports none
> `
>
> this block is never executed - this should work. There are also other
> values for :eval. From the help:
>
> ,
> | 14.8.2.25 `:eval'
> | .
> |
> | The `:eval' header argument can be used to limit the evaluation of
> | specific code blocks.  The `:eval' header argument can be useful for
> | protecting against the evaluation of dangerous code blocks or to ensure
> | that evaluation will require a query regardless of the value of the
> | `org-confirm-babel-evaluate' variable.  The possible values of `:eval'
> | and their effects are shown below.
> |
> | `never or no'
> |  The code block will not be evaluated under any circumstances.
> |
> | `query'
> |  Evaluation of the code block will require a query.
> |
> | `never-export or no-export'
> |  The code block will not be evaluated during export but may still
> |  be called interactively.
> |
> | `query-export'
> |  Evaluation of the code block during export will require a query.
> |
> |If this header argument is not set then evaluation is determined by
> | the value of the `org-confirm-babel-evaluate' variable see *Note Code
> | evaluation security::.
> `
>
> Cheers,
>
> Rainer
>
>
>> My two blocks (with some code removed for simplicity) are as follow:
>>
>> #+NAME: tbl-refyear
>> #+BEGIN_SRC R :results silent :exports none
>>   latex(tabular(   ))
>> #+END_SRC
>>
>> #+BEGIN_SRC latex :noweb yes
>> \begin{table}[h]
>> \label{tbl:refyear}
>> \caption{Separation outcomes (death or any type of discharge) by
>> reference year.}
>> <>
>> \end{table}
>> #+END_SRC
>>
>> I've tried :cache yes as part of the tbl-refyear source block, but
>> that didn't stop if from being run twice. Am I missing a suitable
>> header argument?
>>
>> This is the only way I could find to wrap the latex table (which has
>> some complex formatting and hence why I've used it over just producing
>> a table) in a float with a caption (though I still can't properly
>> reference the label when I export to a PDF file).
>>
>> Any thought would be greatly appreciated. TIA!
>>
>> Andreas



Re: [O] «Macro» expansion in source blocks; code-sharing between blocks

2014-09-19 Thread Andreas Kiermeier
Hi Chuck

On 19 September 2014 12:29, Charles Berry  wrote:
>
> Why not use library(xtable) and do it all in R?
>
> If you are not sure this is the right choice, I suggest you look at the
> help page for print.xtable - you have a lot of control over caption,
> label, positioning, etc.

I was trying to do that with "latex(tabular( ...))" though I can see
that I can wrap the table in a floating table environment with xtable.

In fact, I did look at xtable before settling on the above approach,
which I did because tabular does create some nice tables, including
multiple levels and totals. I was trying to avoid R's simple "table" &
prop table functions and having to construct the table and various
headings myself before wrapping it up in xtable(). But maybe that's
the way to go.

Thanks,

Andreas



Re: [O] «Macro» expansion in source blocks; code-sharing between blocks

2014-09-18 Thread Andreas Kiermeier
I don't think you need the ":noweb yes" as part of the setup_fu
header, as this block is not pulling in other materials.

Having used this type of setup only over the last couple of days, I've
come up with another question. It appears that the setup_fu is
executed twice ... once as it's own source block (though by itself not
need) and once as part of the second noweb block. This isn't a problem
if the execution time is small, but I'm trying to create a summary
table in Latex format from 2 million records - so the time is
considerable.

My two blocks (with some code removed for simplicity) are as follow:

#+NAME: tbl-refyear
#+BEGIN_SRC R :results silent :exports none
  latex(tabular(   ))
#+END_SRC

#+BEGIN_SRC latex :noweb yes
\begin{table}[h]
\label{tbl:refyear}
\caption{Separation outcomes (death or any type of discharge) by
reference year.}
<>
\end{table}
#+END_SRC

I've tried :cache yes as part of the tbl-refyear source block, but
that didn't stop if from being run twice. Am I missing a suitable
header argument?

This is the only way I could find to wrap the latex table (which has
some complex formatting and hence why I've used it over just producing
a table) in a float with a caption (though I still can't properly
reference the label when I export to a PDF file).

Any thought would be greatly appreciated. TIA!

Andreas

On 18 September 2014 23:31, Eric S Fraga  wrote:
>
> On Thursday, 18 Sep 2014 at 13:26, Tobias Getzner wrote:
> > On Thu, 18 Sep 2014 13:17:14 +, Tobias Getzner wrote:
> >
> >> Are there any convenient inline-expansion methods I might have
> >> overlooked?
> >
> > To illustrate, I was wondering if any of the following is feasible
> > somehow:
>
> Yes, and you almost got it right with your syntactic expansion:
>
> #+begin_src org
>
>   ,* Syntactic expansion
>
>   ,#+name: setup_fu
>   ,#+begin_src sh :noweb yes
> echo 2
>   ,#+end_src
>
>   ,#+begin_src sh :results raw :noweb yes
> echo 1
> <>
> echo 3
>   ,#+end_src
>
>   ,#+results:
>   1
>   2
>   3
>
> #+end_src
>
> Org src blocks can reference other src blocks.  Note the ":noweb yes"
> option and the use of <<...>>.
>
>
> --
> : Eric S Fraga (0xFFFCF67D), Emacs 24.4.50.1, Org release_8.3beta-366-gb2fca7



Re: [O] [babel, R] Commands are not copied in the iESS buffer upon evaluation

2014-08-30 Thread Andreas Kiermeier
Hi Seb,
I'm not quite sure why the commands are not echoed and someone else
can probably explain this.
But for what it's worth, using a header argument ":results output"
shows the command plus their output in the *R* buffer.
Cheers,
Andreas



Re: [O] R code block produces only partial output

2014-08-23 Thread Andreas Kiermeier
Hi Aaron,
thanks for keeping on this.
I personally don't have a problem with requiring an R package.
In fact, users will have a rather limited experience with R if they cannot
install add-on packages (for whatever reason) - this is one of the things
that makes R such an attractive option for data analysis.
While there might be some IT departments that are very restrictive, I also
think (no data behind this) that the majority of our users are not in that
situation.
Anyway, that's my two cents worth.
​Cheers,
Andreas


On 23 August 2014 18:02, Aaron Ecay  wrote:

> 2014ko abuztuak 19an, Achim Gratz-ek idatzi zuen:
> >
> > Aaron Ecay writes:
> >> R is capable of installing packages to a user-specified directory,
> >> without requiring root or any other special privileges.  So IT cannot
> >> literally prevent R users from installing their own packages;
> >
> > They can, all they have to do is to take away the ability to connect to
> > the outside network and that's what is increasingly being done (for
> > other reasons, mind you).
> >
> >> the requirement must rather come as a statement of policy.
> >
> > That is another common thing, if only to shift the responsibility if the
> > other measures don't actually prevent that.
> >
> >> I’d like to
> >> understand more about how such regimes work and how org could work
> >> with them, ideally from people who have direct experience with them.
> >
> > Ideally, don't require the use of a non-core package.  The beef with
> > things like CTAN, CRAN or CPAN is that they require extra maintenance
> > beyond the pure installation of some software and some specific
> > knowledge of the software in question and that's just not going to
> > happen in some places.
> >
> >> Otherwise, it would be disappointing if the fear that an unidentifiable
> >> somebody somewhere might not be able to install R packages derailed the
> >> improvement of babel’s R support.
> >
> > The request was to keep a fallback to core.  I have no comment at this
> > time if it would be possible or not.  Since ultimately it's the session
> > support of Emacs that is clunky (and that affects most other languages
> > as well), maybe an effort to improve that would be more generally
> > helpful than working around it in different ways in each language.
>
> Well, I think that it’s going to be difficult to make babel a better
> literate programming solution for R if we restrict ourselves not to
> use the state-of-the-art R package for low-level literate programming
> support.  Org is full of features which one needs to install other
> software to use, and I’m comfortable with the idea that babel’s R
> support should require the evaluate package.  However, it’s difficult
> to argue this point of view when no one has spoken up about their own
> requirements, and a spirit of conservatism in the face of vague
> imagined difficulties persists.
>
> The attached patch fixes the problem that touched off this thread.
> It’s only debatably nicer than the present approach, but it has the
> independently desirable property of segregating babel-driven output
> from the session buffer.  It incorporates what I think is a fix for
> the tramp bug Charles pointed out.
>
> It’s as yet only lightly tested, and as always comments are welcome.
>
> --
> Aaron Ecay
>
>


Re: [O] R code block produces only partial output

2014-08-05 Thread Andreas Kiermeier
​
On 6 August 2014 03:35, Charles Berry  wrote:
​[snip]​

> org-babel-R-evaluate-session uses
>
>  (string-match "^\\([ ]*[>+\\.][ ]?\\)+\\([[0-9]+\\|[ ]\\)" line)
>
> to find the start of R output in the session.
>
> This does not match the `  0', but matches the ` .6'
> in the output you show above, so if that had been in a session, all the
> output up to and including the '.' before the '6' would be clipped
> by the following
>
>   (substring line (match-end 1))
>
>
> as Andreas output showed.
>
> Deleting the "\\." fixes Andreas case, but what are the circumstances
> requiring the  "\\." ?
>

​
​
Thanks Charles for finding this.

I do use R quite a bit, and I can only think of ">
​ ​
" (at beginning of the line) as the command prompt, along with "+
​ ​
" (at beginning of the line) as a continuation prompt for multi-line
commands. I don't know what
 ​ ​
"\" or
​ ​
"." provide
​ (I don't think this has changed over the various R versions)​

​.

​A ​
complication might be that the user can change the command prompt (and
continuation prompt) to something else they like (
 ​see here: ​
http://cran.r-project.org/doc/manuals/r-release/R-intro.html#Customizing-the-environment
 ​)​.

​For the time being I've taken the "\\." out of my local version of ob-R.el
(then byte compiled and loaded) and it seems to work fine.

​Maybe this is a question for the ESS developers who use R extensively and
probably might be able to provide some more definitive guidance on this
than I can?

​Thanks,

Andreas​


Re: [O] R code block produces only partial output

2014-08-04 Thread Andreas Kiermeier
On 5 August 2014 13:30, John Hendy  wrote:
> I can reproduce with a minimal config and on Linux (to toss in a
> confirmation). I *also* accidentally just stumbled on a way I can
> toggle the behavior between correct and incorrect! It arose because my
> file was not able to use the #+PROPERTY settings you have -- my
> results were not obeying what I had set. I looked around and believe
> the syntax is correct per this page:
> - http://orgmode.org/manual/Header-arguments-in-Org-mode-properties.html

Thanks for confirming this John!
I couldn't see how the #+PROPERTY settings I had differed from those
in the link ... I recall getting them from there (but maybe I mistyped
something?). So I copied what you provided for the rest of my testing.

Getting rid of :session all together did produce the correct results
for me, too. However, including a :session in either #+PROPERTY or at
the beginning of the code block did not - irrespective of whether I
used *R* or simply r.

> Correct results:
>
> #+begin_src org
>
> #+STARTUP: showall indent hidestars
> #+PROPERTY: header-args:R :session r
>
> #+BEGIN_SRC R :results output drawer
>   require(rms)
>   set.seed(123)
>   x <- rnorm(100)
>   describe(x)
> #+END_SRC

[snip]

So, this example did *not* work for me.

> The reason, I think, is this (also correct):
>
> #+begin_src org
>
> #+STARTUP: showall indent hidestars
>
>
> #+BEGIN_SRC R :results output drawer
>   require(rms)
>   set.seed(123)
>   x <- rnorm(100)
>   describe(x)
> #+END_SRC

Yes, without a session it seems to work fine.

Thanks,

Andreas



Re: [O] R code block produces only partial output

2014-08-04 Thread Andreas Kiermeier
Hi Eric,
I'm running Org 8.2.7c (via ELPA) and ESS 14.05.
I've tried to run with a minimal Org setup using only the following in
my init file.
The shortcut I use to start Emacs (on Windows 8.1) is:
C:\emacs\bin\runemacs.exe -Q -l "C:\emacs\bin\minimal-org.el"

However, the results are the same as before. Any thoughts on what else
I could try?

-
;;; Minimal setup to load latest `org-mode'

;; activate debugging
(setq debug-on-error t
  debug-on-signal nil
  debug-on-quit nil)

;; add latest org-mode to load path
(add-to-list 'load-path (expand-file-name
"C:/Users/andre_000/Documents/.emacs.d/elpa/org-20140804/"))
(add-to-list 'load-path (expand-file-name
"C:/Users/andre_000/Documents/.emacs.d/elpa/ess-20140716.2033/lisp/"))

(require 'ess-site)

(setq org-babel-R-command "C:/Progra~1/R/R-3.1.1/bin/x64/R --slave --no-save")

(org-babel-do-load-languages
 'org-babel-load-languages
 '((emacs-lisp . nil)
   (R . t)))


Thanks,
Andreas
--
Dr Andreas Kiermeier | Director
Statistical Process Improvement Consulting and Training Pty Ltd
Mbl: +61 (4)23 028 565 | Email: andreas.kierme...@gmail.com
Australia


On 4 August 2014 22:40, Eric Schulte  wrote:
> Andreas Kiermeier  writes:
>
>> On 4 August 2014 21:23, Eric Schulte  wrote:
>>> Why are you setting the output type to "graphics" when you are trying to
>>> return text?  I think that may be the source of your problem.
>>
>> Hi Eric,
>> thanks for the quick response.
>> I've had 'graphics' from my main data analysis file ... I think I got
>> that from WORG.
>> I've removed it, reloaded the file, but same outcome.
>> Any other thoughts?
>> Cheers,
>> Andreas
>
> Hi Andreas,
>
> I can't reproduce your problem.  I get the following from your minimal
> example when run in an Org-mode file, and from the command line.  They
> are identical.  Are you using the latest version of Org-mode?
>
> Best,
> Eric
>
>
> $ R
>
> R version 3.1.0 (2014-04-10) -- "Spring Dance"
> Copyright (C) 2014 The R Foundation for Statistical Computing
> Platform: x86_64-unknown-linux-gnu (64-bit)
>
> R is free software and comes with ABSOLUTELY NO WARRANTY.
> You are welcome to redistribute it under certain conditions.
> Type 'license()' or 'licence()' for distribution details.
>
>   Natural language support but running in an English locale
>
> R is a collaborative project with many contributors.
> Type 'contributors()' for more information and
> 'citation()' on how to cite R or R packages in publications.
>
> Type 'demo()' for some demos, 'help()' for on-line help, or
> 'help.start()' for an HTML browser interface to help.
> Type 'q()' to quit R.
>
> [Previously saved workspace restored]
>
>> x <- rnorm(100)
>> y <- quantile(x, probs=seq(0,1,0.1))
>> names(y) <- 
>> as.character(c("0",".1",".2",".3",".4",".5",".6",".7",".8",".9","1"))
>> y
>   0  .1  .2  .3  .4  .5
> -2.53624773 -1.30846042 -0.70659822 -0.43565010 -0.24318346 -0.01034625
>  .6  .7  .8  .9   1
>  0.24125644  0.49945059  0.92032314  1.36423669  2.83357915
>>
>
>
> --
> Eric Schulte
> https://cs.unm.edu/~eschulte
> PGP: 0x614CA05D (see https://u.fsf.org/yw)
>



Re: [O] R code block produces only partial output

2014-08-04 Thread Andreas Kiermeier
On 4 August 2014 21:23, Eric Schulte  wrote:
> Why are you setting the output type to "graphics" when you are trying to
> return text?  I think that may be the source of your problem.

Hi Eric,
thanks for the quick response.
I've had 'graphics' from my main data analysis file ... I think I got
that from WORG.
I've removed it, reloaded the file, but same outcome.
Any other thoughts?
Cheers,
Andreas



[O] R code block produces only partial output

2014-08-04 Thread Andreas Kiermeier
Hi all,

I've been using Org mode (latest version - see my set up below) to
perform some data analysis and have come across a problem evaluating R
code blocks. I usually use a session when working and when evaluating
a code block with describe (R package "rms") and a quantitative
variable the results in .org buffer and the *R* buffer (output)
differ. However, it's not the describe function, but something about
the output of that function. The following is a minimal example (both
with and without the describe function) to illustrate the problem.

I think it has something to do with a number of spaces followed by a
'.' in the output buffer.

Any thoughts or guidance would be greatly appreciated.

Thanks in advance.

Andreas

--- test.org -
#+STARTUP: showall indent hidestars
#+PROPERTY: header-args:R :session *R*
#+PROPERTY: header-args :results output graphics :exports both

#+BEGIN_SRC R
  require(rms)
  x <- rnorm(100)
  describe(x)
#+END_SRC

#+RESULTS:
: 75  .90  .95
:  0.69261  1.38170  1.71468
:
: lowest : -2.270 -1.878 -1.705 -1.525 -1.423
: highest:  1.739  2.032  2.061  2.150  2.480

#+BEGIN_SRC R
  x <- rnorm(100)
  y <- quantile(x, probs=seq(0,1,0.1))
  names(y) <- 
as.character(c("0",".1",".2",".3",".4",".5",".6",".7",".8",".9","1"))
  y
#+END_SRC

#+RESULTS:
: 6  .7  .8  .9   1
:  0.31144890  0.63292642  0.87168950  1.17596547  1.96212110
--- end test.org -


The actual output for the first code block in the *R* buffer was:

> describe(x)
x
   n  missing   unique Mean  .05  .10  .25  .50
 1000  100   0.1118 -1.39404 -1.02732 -0.45899  0.03756
 .75  .90  .95
 0.69261  1.38170  1.71468

lowest : -2.270 -1.878 -1.705 -1.525 -1.423
highest:  1.739  2.032  2.061  2.150  2.480


Similarly, the second code block resulted in:

> y
  0  .1  .2  .3  .4  .5
-2.23303584 -1.31137871 -0.69424743 -0.48689155 -0.16973865  0.09289862
 .6  .7  .8  .9   1
 0.31144890  0.63292642  0.87168950  1.17596547  1.96212110


And finally my set up is:

Emacs  : GNU Emacs 24.3.1 (i386-mingw-nt6.2.9200)
 of 2013-03-18 on MARVIN
Package: Org-mode version 8.2.7c (8.2.7c-elpa @
c:/Users/andre_000/Documents/.emacs.d/elpa/org-20140730/)

current state:
==
(setq
 org-ctrl-c-ctrl-c-hook '(org-babel-hash-at-point
org-babel-execute-safely-maybe)
 org-latex-format-headline-function 'org-latex-format-headline-default-function
 org-src-fontify-natively t
 org-html-format-inlinetask-function 'ignore
 org-completion-use-iswitchb t
 org-tab-first-hook '(org-hide-block-toggle-maybe
org-src-native-tab-command-maybe
 org-babel-hide-result-toggle-maybe org-babel-header-arg-expand)
 org-cycle-hook '(org-cycle-hide-archived-subtrees org-cycle-hide-drawers
 org-cycle-hide-inline-tasks org-cycle-show-empty-lines
 org-optimize-window-after-visibility-change)
 org-agenda-before-write-hook '(org-agenda-add-entry-text)
 org-confirm-babel-evaluate nil
 org-speed-command-hook '(org-speed-command-default-hook
org-babel-speed-command-hook)
 org-ascii-format-inlinetask-function 'org-ascii-format-inlinetask-default
 org-babel-pre-tangle-hook '(save-buffer)
 org-occur-hook '(org-first-headline-recenter)
 org-src-lang-modes '(("r" . ess-mode) ("ocaml" . tuareg) ("elisp" . emacs-lisp)
 ("ditaa" . artist) ("asymptote" . asy) ("dot" . fundamental)
 ("sqlite" . sql) ("calc" . fundamental) ("C" . c) ("cpp" . c++)
 ("C++" . c++) ("screen" . shell-script))
 org-shiftdown-final-hook '(windmove-down)
 org-html-format-headline-function 'ignore
 org-log-done 'time
 org-metaup-hook '(org-babel-load-in-session-maybe)
 org-confirm-elisp-link-function 'yes-or-no-p
 org-catch-invisible-edits 'smart
 org-default-notes-file "~/.org//notes.org"
 org-latex-format-drawer-function '(lambda (name contents) contents)
 org-src-tab-acts-natively t
 org-export-backends '(ascii html icalendar latex md)
 org-clock-out-hook '(org-clock-remove-empty-clock-drawer)
 org-completion-use-ido t
 org-use-speed-commands t
 org-mode-hook '(#[nil "\300\301\302\303\304$\207"
  [org-add-hook change-major-mode-hook org-show-block-all append local] 5]
#[nil "\300\301\302\303\304$\207"
  [org-add-hook change-major-mode-hook org-babel-show-result-all
append local] 5]
org-babel-result-hide-spec org-babel-hide-all-hashes org-mode-reftex-setup
(lambda nil (flyspell-mode 1) (auto-fill-mode 1)
 (local-set-key "\220" (quote outline-previous-visible-heading))
 (local-set-key "\225" (quote outline-up-heading))
 (local-set-key "\227" (quote org-table-copy-region))
 (local-set-key "\231" (quote org-table-paste-rectangle))
 (local-set-key "\214" (quote org-table-sort-lines))
 (local-set-key "\311" (quote org-toggle-iimage-in-org)))
)
 org-shiftup-final-hook '(windmove-up)
 org-ascii-format-drawer-function '(lambda (name contents width) contents)
 org-directory "~/.