Re: [O] :exclude sub folder in org-publish

2014-08-06 Thread regcl
Bastien  writes:

> Hi,
>
> regcl  writes:
>
>> I could not figure out how to do this from INFO. I found examples of
>> preventing publishing of specific file extensions, but not whole
>> directories.
>
> Unless my memory fails me, :exclude works on names, not just on
> extensions.  So maybe using both :recursive and :exclude can lead
> to what you want.

Yes that matches my understanding and experience. But I could not figure
out how to, for example in this tree ...

~/A
.
+--proj
|  +--.git
|  +--README.org
|  |  +--Manuscript
|  |  |  +--.git
|  |  |  +--README.org
|  |  |  +--drafts
|  |  |  +--GenomicsData
|  |  |  |  +--.git
|  |  |  |  +--README.org

... publish the README's above GenomicsData, but not in GenomicsData.

But maybe this is asking too much of org-mode publish. 

FWIW, I ended up using a recursive sub- make harness with something like
this in the Makefile ...

.PHONY: html
html: README.html

# export org file to html
%.html: %.org
emacs --batch --load=~/.emacs $*.org --eval='(org-html-export-to-html)'


Best,
George




Re: [O] eliminate creation of backup files in :publishing-directory

2014-08-06 Thread regcl
> regcl  writes:
>
>> Is there a way to stop org mode from creating backup files in the
>> :publishing-directory?
>
> What are "backup files" exactly?

e.g., the second time you run org-html-export-to-html or
org-html-publish-to-html on README.org you get README.html -plus-
README.html~. I would like to not produce README.html~. I believe there
is a global emacs setting, but I would prefer to disable only those
backups produced by org-html-export-to-html, etc.

Thanks,
regcl

>
> There is `org-publish-after-publishing-hook' which may help cleaning
> up stuff if needed.



Re: [O] :exclude sub folder in org-publish

2014-07-21 Thread regcl
Bastien  writes:

> regcl  writes:
>
>> Or, maybe there something obvious I am missing?
>
> Please tell us what you wanted to do, show us what you tried by
> sharing parts of your configuration, and we'll be able to help.

When my .org file points to a second .org file in a directory below, and
with ...

:publishing-function org-html-publish-to-html
:recursive t

... the sub directory gets published. I am no clear of whether this is
triggered by the references to the .org file below, or simply by
":recursive t."

In any event, this is generally a good thing, except that there are
situations where I would like to prevent recursion into specific
sub-directories. For example, consider the tree below, and that I want to
publish proj and Manuscript, but not GenomicsData ...

~/A
.
+--proj
|  +--.git
|  +--README.org
|  |  +--Manuscript
|  |  |  +--.git
|  |  |  +--README.org
|  |  |  +--drafts
|  |  |  +--GenomicsData
|  |  |  |  +--.git
|  |  |  |  +--README.org


I could not figure out how to do this from INFO. I found examples of
preventing publishing of specific file extensions, but not whole directories.

Thanks, regcl



Re: [O] publishing to gihub gh-pages branch

2014-07-21 Thread regcl
Hi Bastien,

Thanks, but I guess I didn't find the solutions you have
mentioned. Could you please point them out?

Thanks,
regcl

Bastien  writes:

> regcl  writes:
>
>> Does anyone have suggestions regarding how to automate HTML publishing
>> to the gh-pages branch of a github repo?
>
> There are several solutions here.  What did you try?



[O] turn off monospace in src result

2014-07-17 Thread regcl

With this line in my .org file ...

This is src_R{foo<-"FOO"; paste(foo)}.

... when I publish to html or pdf, I get ...

This is FOO.

... which is wonderful, except that "FOO" is monospace.  

Can I turn off monospace for all results of inline source?

Thanks,
regcl




[O] :exclude sub folder in org-publish

2014-06-19 Thread regcl
It looks like this question has been asked before, but not answered ... 

Is there a way to stop the decent of org-publish at a given directory?

Or, is there a syntax for including the path name of files I want to exclude?

Or, maybe there something obvious I am missing?

Thanks, regcl



[O] eliminate creation of backup files in :publishing-directory

2014-06-19 Thread regcl
Is there a way to stop org mode from creating backup files in the
:publishing-directory?

Thanks, regcl



[O] publishing to gihub gh-pages branch

2014-06-19 Thread regcl
Does anyone have suggestions regarding how to automate HTML publishing
to the gh-pages branch of a github repo?

Thanks,
regcl



Re: [O] controling width of graphviz source block result

2014-06-12 Thread regcl
Hi Nicolas, 

Thank you for your earlier comments.  In order to adjust the scaling of
a graphic generated by a R source block I am doing this ...

** adjusting scaling of a figure generated from source
#+begin_src R :results graphics silent :file foo2.pdf :exports results 
  plot(c(1:10), c(10:1))
  #+end_src
#+attr_latex: :width .35\textwidth
file:foo2.pdf 

While this does work, it is a wee bit unsatisfying to type "foo2.pdf""
twice.

Is there a better way to apply the latex keyword to the results?

Many thanks,
regcl

Nicolas Goaziou  writes:

> Hello,
>
> regcl  writes:
>
>> So I am understanding from your answer that attribues only "modify" the
>> next immediate "thing" in the .org document, and do not persist, so to
>> speak.
>
> "things" are called "elements" in Org lingo and "attributes" are called
> "affiliated keywords". So, yes, affiliated keywords apply to the element
> right after them.
>
>> But I have discovered that it works to stack them up like this ...
>>
>> #+ATTR_HTML: :width 1000
>> #+ATTR_ODT: :width 15 :height 15
>> [[file:gnus.png]]
>>
>> ... so I am a little confused. 
>>
>> Could you please clarify?
>
> Both keywords are affiliated keywords. There is only one element in this
> example (a paragraph containing a single link). Affiliated keywords
> apply to the next element, not the next affiliated keyword.
>
> For more information, see:
>
>   http://orgmode.org/worg/dev/org-syntax.html
>
> or the comments at the beginning of "org-element.el".
>
>
> Regards,



Re: [O] controling width of graphviz source block result

2014-02-22 Thread regcl
Nicolas Goaziou  writes:

> Hello,
>
> regcl  writes:
>
>> So I am understanding from your answer that attribues only "modify" the
>> next immediate "thing" in the .org document, and do not persist, so to
>> speak.
>
> "things" are called "elements" in Org lingo and "attributes" are called
> "affiliated keywords". So, yes, affiliated keywords apply to the element
> right after them.
>
>> But I have discovered that it works to stack them up like this ...
>>
>> #+ATTR_HTML: :width 1000
>> #+ATTR_ODT: :width 15 :height 15
>> [[file:gnus.png]]
>>
>> ... so I am a little confused. 
>>
>> Could you please clarify?
>
> Both keywords are affiliated keywords. There is only one element in this
> example (a paragraph containing a single link). Affiliated keywords
> apply to the next element, not the next affiliated keyword.
>
> For more information, see:
>
>   http://orgmode.org/worg/dev/org-syntax.html
>
> or the comments at the beginning of "org-element.el".
>
>
> Regards,

Thank you, this is helpful. May require a little study ;)

best,
regcl



Re: [O] controling width of graphviz source block result

2014-02-22 Thread regcl
Nicolas Goaziou  writes:

> Hello,
>
> regcl  writes:
>
>> When I try to control the width of the image produced by 
>> included graphviz (DOT) code like so ...
>>
>> #+ATTR_HTML: :width 300
>> #+INCLUDE: gnus.dot SRC dot :file gnus.png :exports results
>>
>> ... width is not controlled.
>
> Here the HTML attribute applies to the INCLUDE keyword below.
>
>> #+INCLUDE: "gnus.dot" SRC dot :file gnus.png :exports none
>> #+ATTR_HTML: :width 300
>> file:gnus.png
>
> Here, the HTML attribute applies to the link below.
>
> Therefore, the behaviour is to be expected.
>
>
> Regards,

So I am understanding from your answer that attribues only "modify" the
next immediate "thing" in the .org document, and do not persist, so to
speak.

But I have discovered that it works to stack them up like this ...

#+ATTR_HTML: :width 1000
#+ATTR_ODT: :width 15 :height 15
[[file:gnus.png]]

... so I am a little confused. 

Could you please clarify?

Thanks,
regcl




[O] controling width of graphviz source block result

2014-02-21 Thread regcl

When I try to control the width of the image produced by 
included graphviz (DOT) code like so ...

#+ATTR_HTML: :width 300
#+INCLUDE: gnus.dot SRC dot :file gnus.png :exports results

... width is not controlled. 

This works ...

#+INCLUDE: "gnus.dot" SRC dot :file gnus.png :exports none
#+ATTR_HTML: :width 300
file:gnus.png

So it makes me wonder... Is this a bug or operator error?

Thanks,
regcl

GNU Emacs 24.3.1 (x86_64-unknown-linux-gnu, X toolkit, Xaw scroll bars)
of 2014-02-20 on e3

Org-mode version 8.2.5c (release_8.2.5c @
/home/regcl/.emacs.d/lisp/org-mode/lisp/)






Re: [O] How to write medical journal articles with org-mode

2014-01-20 Thread regcl
Erik Hetzner  writes:

> At Mon, 20 Jan 2014 02:54:08 -0500,
> regcl wrote:
>> 
>> 3) How do I get references into MS word?
>> 
> Hi George,
>
> For question 3, you might have a look at pandoc
> (http://johnmacfarlane.net/pandoc/), which can convert from markdown
> to docx (MS Word) with citation support. You might find it simpler to
> export from org-mode to markdown and use pandoc to produce your docx
> files, thus saving some steps above.
>
> best, Erik

Hi Erik, Thank you for the suggestion.  

WRT this approach, I see that Rick Frankel has said ...

> From:  Rick Frankel
> Subject:   Re: [O] Org Table Export to Markdown Table Question
> Date:  Thu, 09 Jan 2014 11:58:37 -0500
>
> > On 2014-01-08 15:41, Aric wrote:
> > I am trying to use org-mode now with R code in it to write
> > manuscripts. That does unfortunately mean that it must be eventually
> > exported to some doc format. I have been able to export to markdown and
> > everything looks good in markdown (even previewed on github) with the
> > exception of latex code which is not converted. However, using pandoc to
> > convert the markdown to docx, the tables are not converted properly (all
> > a single column).
> 
> I'm not sure why you are using markdown as an intermediate file
> format. Org will export to latex, pdf (via latex) and openoffice odt
> (which can be exported from open/libre office to doc/docx.).
> 
> Both the above exporters are much more mature that the markdown
> exporter.
> 
> rick
> 

... which makes me wonder... Has anyone out there tried this for a
journal manuscript with figures, tables, and citations?

If I want go with pandoc, would I be ahead to do ...

org > latex > pandoc > docx ?

Thanks, George



[O] How to write medical journal articles with org-mode

2014-01-19 Thread regcl

I am looking for advice regarding how to write medical journal
articles using org-mode.

My primary motivations are the desire to ... automate the flow of data
from computation to publication, avoid clerical errors, speed up the
conversion of computational results to manuscript, and do 99.9% of my
typing in emacs ;)

My primary computation platform is linux clusters with OS X desktops.
I have used org-mode for project management and HTML export of
provisional computational results in working papers for ~1 year.

I recently started using org-mode/babel/ESS/R to export computation
results to HTML.

It looks like the medical journals require MS word submissions.  I
have used the scheme shown below to get MSword to/from my
collaborators for comments & corrections ...

doc.org--+
||
v|
M-x org-odt-export-to-odt|
||
v| 
Open office  |
||
v|
MS Word  |
||
v|
doc.docx |
||
v|
colaborator  |
||
v|
doc.docx |
||
v|
/http://docx2txt.sourceforge.net/|
||
v|
doc.docx.txt |
||
v|
ediff<---+  
|
v
doc.org

I am hopeful of using a similar approach for journal submission, but I
need references. I have endnote, and have used it a bit, but I feel
like I would be happier using ...

https://github.com/wash/pubmode 

... for bibtex pubmed search results + reftex + org-mode as reference
manager. I have experimented with this approach to feed references
into HTML via ox-bibtex.el and it looks encouraging.

So here are my questions...

1) Has anyone out there used org-mode to produce medical journal
articles (other than demonstration of reproducible research)?

2) I am mystified by all of these org-reftex-... functions.  Can
someone please point me to an overview of how to use
bibtex/reftex/orgmode/emacs/etc as reference manager?

3) How do I get references into MS word?

Any other comments or suggestions would be most welcome.

Many thanks,
george



Re: [O] bibtex org-capture says "Target buffer ".notes" for file+headline should be in Org mode"

2014-01-19 Thread regcl
regcl  writes:

Oops, my error... Once I did this ...

(setq org-default-notes-file (concat org-directory "/notes.org"))

... everything works great! ... sorry for the false alarm!

Best,
George

> I am having difficult creating an org entry from a bibtex file
> entry. Here is what I am doing:
>
> 1) open .bib file
>
> 2) position point in entry
>
> 3) M-x org-capture
>
> 4) respond to prompt: 'Template key:' with: t
>
> Instead of an link in the .org file, I get the message: 'Target buffer
> ".notes" for file+headline should be in Org mode'
>
> I believe I am running the latest emacs and org-mode releases (please
> see details below).
>
> BTW, is there a general discussion anywhere of how to use
> emacs/org-mode/reftex for reference management that comports with the
> latest release?
>
> And... given this interest, should I switch to bleeding edge?
>
> Many thanks,
> George
>
> ... from the *Messages* buffer ...
>
> ("emacs")
> Loading /etc/emacs/site-start.d/00debian-vars.el (source)...done
> Loading /etc/emacs/site-start.d/50dictionaries-common.el (source)...
> Loading debian-ispell...
> Loading /var/cache/dictionaries-common/emacsen-ispell-default.el 
> (source)...done
> Loading debian-ispell...done
> Loading /var/cache/dictionaries-common/emacsen-ispell-dicts.el (source)...done
> Loading /etc/emacs/site-start.d/50dictionaries-common.el (source)...done
> `flet' is an obsolete macro (as of 24.3); use either `cl-flet' or `cl-letf'. 
> [2 times]
> enabling speedbar support
> `flet' is an obsolete macro (as of 24.3); use either `cl-flet' or `cl-letf'. 
> [2 times]
> For information about GNU Emacs and the GNU system, type C-h C-a.
> Loading vc-git...done
> Template key: 
> (New file)
> org-capture-set-target-location: Target buffer ".notes" for file+headline 
> should be in Org mode
> GNU Emacs 24.3.1 (x86_64-pc-linux-gnu, GTK+ Version 3.8.6) of 2013-12-22 on 
> brahms, modified by Debian
> Org-mode version 8.2.5c (release_8.2.5c @ 
> /home/regcl/.emacs.d/lisp/org-mode/lisp/)



[O] bibtex org-capture says "Target buffer ".notes" for file+headline should be in Org mode"

2014-01-19 Thread regcl

I am having difficult creating an org entry from a bibtex file
entry. Here is what I am doing:

1) open .bib file

2) position point in entry

3) M-x org-capture

4) respond to prompt: 'Template key:' with: t

Instead of an link in the .org file, I get the message: 'Target buffer
".notes" for file+headline should be in Org mode'

I believe I am running the latest emacs and org-mode releases (please
see details below).

BTW, is there a general discussion anywhere of how to use
emacs/org-mode/reftex for reference management that comports with the
latest release?

And... given this interest, should I switch to bleeding edge?

Many thanks,
George

... from the *Messages* buffer ...

("emacs")
Loading /etc/emacs/site-start.d/00debian-vars.el (source)...done
Loading /etc/emacs/site-start.d/50dictionaries-common.el (source)...
Loading debian-ispell...
Loading /var/cache/dictionaries-common/emacsen-ispell-default.el (source)...done
Loading debian-ispell...done
Loading /var/cache/dictionaries-common/emacsen-ispell-dicts.el (source)...done
Loading /etc/emacs/site-start.d/50dictionaries-common.el (source)...done
`flet' is an obsolete macro (as of 24.3); use either `cl-flet' or `cl-letf'. [2 
times]
enabling speedbar support
`flet' is an obsolete macro (as of 24.3); use either `cl-flet' or `cl-letf'. [2 
times]
For information about GNU Emacs and the GNU system, type C-h C-a.
Loading vc-git...done
Template key: 
(New file)
org-capture-set-target-location: Target buffer ".notes" for file+headline 
should be in Org mode
GNU Emacs 24.3.1 (x86_64-pc-linux-gnu, GTK+ Version 3.8.6) of 2013-12-22 on 
brahms, modified by Debian
Org-mode version 8.2.5c (release_8.2.5c @ 
/home/regcl/.emacs.d/lisp/org-mode/lisp/)



[O] export from R to tables, possible correction to ob-doc-R.org

2014-01-13 Thread regcl
I was looking for an example of the export of R data frames into
tables in html, and the example in ...

http://orgmode.org/worg/org-contrib/babel/languages/ob-doc-R.org

... did not work for me. I am running ...

GNU Emacs 24.3.1 (x86_64-pc-linux-gnu, GTK+ Version 3.8.4) of 2013-09-26 on 
trouble, modified by Debian

Org-mode version 8.2.5c (release_8.2.5c @ 
/home/regcl/.emacs.d/lisp/org-mode/lisp/)

Here is the problematic code ...

### START SNIP ## START SNIP ## START SNIP ###

: #+BEGIN_SRC R :results output org
:  library(ascii)
:  a <- runif(100)
:  c <- "Quantiles of 100 random numbers"
:  b <- ascii(quantile(a),header=T,include.colnames=T,caption=c)
:  print(b,type="org")
:  rm(a,b,c)
: #+END_SRC
: 
: #+RESULTS:
: #+BEGIN_ORG
: #+CAPTION: Quantiles of 100 random numbers
: | 0%   | 25%  | 50%  | 75%  | 100% |
: |--+--+--+--+--|
: | 0.03 | 0.28 | 0.52 | 0.74 | 1.00 |
: #+END_ORG

The output exported to HTML can be quite nice.

#+RESULTS: 
#+BEGIN_ORG
#+CAPTION: Quantiles of 100 random numbers
|   0% |  25% |  50% |  75% | 100% |
|--+--+--+--+--|
| 0.03 | 0.28 | 0.52 | 0.74 | 1.00 |
#+END_ORG

### END SNIP ## END SNIP ## END SNIP ###

... As you can see, this code is statically "rigged" to export in such
a way that it looks like it is working with R. When I try to make the
code live by removing the markup as shown below ...

#+BEGIN_SRC R :results output org
  library(ascii)
  a <- runif(100)
  c <- "Quantiles of 100 random numbers"
  b <- ascii(quantile(a),header=T,include.colnames=T,caption=c)
  print(b,type="org")
  rm(a,b,c)
#+END_SRC

The html produced by ...

C-c C-e h h 

... contains the fontified source code, but no table. 

... C-c C-c on the code block produces these results ...

#+RESULTS:
#+BEGIN_SRC org
,#+CAPTION: Quantiles of 100 random numbers
| 0%   | 25%  | 50%  | 75%  | 100% |
|--+--+--+--+--|
| 0.02 | 0.30 | 0.49 | 0.70 | 0.99 |
#+END_SRC

By trial and error, I discovered that if I change the header arguments
as shown below ...

#+BEGIN_SRC R :results output raw :exports results
  library(ascii)
  a <- runif(100)
  c <- "Quantiles of 100 random numbers"
  b <- ascii(quantile(a),header=T,include.colnames=T,caption=c)
  print(b,type="org")
  rm(a,b,c)
#+END_SRC

... this produces a table in HTML that matches the table produced by
the static code.

... C-c C-c on this code block produces these results ...

#+RESULTS:
#+CAPTION: Quantiles of 100 random numbers
| 0%   | 25%  | 50%  | 75%  | 100% |
|--+--+--+--+--|
| 0.03 | 0.25 | 0.57 | 0.79 | 0.99 |

Can someone tell me if this is how it is supposed to work?

If so, how do I go about submiting a patch to ...

http://orgmode.org/worg/org-contrib/babel/languages/ob-doc-R.org

Thanks,
regcl