Re: [O] [patch] Problems producing TikZ PNGs from LaTeX src blocks (was: Problems producing TikZ PNGs from LaTeX src blocks)

2018-09-30 Thread Christian Moe


Benjamin Motz writes:

> It seems that the function `org-babel-execute:latex' ignores the
> property :headers under certain circumstances. Therefore the line
> "\usepackage{tikz}" will be missing in your resulting latex document.
>
> The property is not ignored if you also append the property
> ":imagemagick t" to the #+header line. So you can use the following
> header as a fix (for another fix, see below):
>
> #+header: :file "tikzpic.png" :fit yes :results raw file :exports results 
> :headers '("\\usepackage{tikz}") :imagemagick t

Thank you. When I try this workaround, I run into another issue, which
may be local to my setup. When I add the :imagemagick header, Org tries
to generate a PDF.  This gives me a message that the file wasn't
produced, but in fact a PDF with the correct image is produced --
however, it has a temporary file name, not the one I assigned to
it. (The same problem occurs if I try to create file output from this or
any other Babel latex block with a .pdf extension instead of .png.) It
looks like Org for some reason fails to take a last step in the
latex-to-PDF export -- changing the file name and cleaning up temporary
files. Probably as a result of this failure, no PNG is created.

I have also tried to apply your patch, without effect. Maybe I did it
wrong, but it increasingly looks like I have some weird problem with my
setup in addition to the issue you uncovered.

Yours,
Christian Moe



[O] Fwd: Re: Problems producing TikZ PNGs from LaTeX src blocks

2018-09-30 Thread Christian Moe


(Forgot to copy this to the list, sorry)

> Hi, Eric
>
> Thanks for looking into this.
>
>> This works for me, cutting and pasting exactly what you have posted into a 
>> small org file.
>>
>> Output from my *Messages* buffer:
>> ,
>> | Wrote /tmp/x.org
>> | org-babel-exp process latex at position 128...
>> | Evaluate this latex code block on your system? (y or n) y
>> | executing Latex code block...
>> | (Shell command succeeded with no output)
>> | Code block evaluation complete.
>> | Local Ispell dictionary set to british
>> | Saving file /tmp/x.tex...
>> `
>> when I export to LaTeX.  What does your message log say?
>
> org-babel-exp process latex at position 148...
> executing Latex code block...
> Code block evaluation complete.
> Saving file /home/cm/Pro/CiP/latex-babel-test.tex...
> Wrote /home/cm/Pro/CiP/latex-babel-test.tex
> Processing LaTeX file latex-babel-test.tex...
> PDF file produced.
> Running evince /home/cm/Pro/CiP/latex-babel-test.pdf...done
>
> Nothing obvious here that I can see.
>
>> Finally, what version of org are you using?  (maybe should have asked this 
>> first...)
>
> I'm on 9.1.14 (2018-09-24) via ELPA.
>
> Yours,
> Christian




Re: [O] Problems producing TikZ PNGs from LaTeX src blocks

2018-09-30 Thread Christian Moe


Eric S Fraga writes:

> On Friday, 28 Sep 2018 at 16:37, Christian Moe wrote:
>> Hi, Eric
>>
>> Thanks for looking into this.
>>
>>> | executing Latex code block...
>>> | (Shell command succeeded with no output)
>>> | Code block evaluation complete.
>>
>> executing Latex code block...
>> Code block evaluation complete.
>>
>> Nothing obvious here that I can see.
>
> Well, for some reason my case outputs that extra line about shell command 
> succeeding...

Yes, that may be where the problem lies. I also have a problem
outputting PDFs instead of PNGs with the same setup (just changing .png
extension to .pdf). This gives me a message that the file wasn't
produced, but in fact a PDF with the correct image is produced --
however, it has a temporary file name, not the one I assigned to it.

> Have you tried with emacs -Q to make sure it's not a configuration error?

I should probably try this with a minimal init file (need one loading latex as a
babel language and probably a few other things). Didn't get around to that.

> I do have
>
>   (add-to-list 'org-latex-packages-alist '("" "tikz"))
>
> in my configuration so maybe that's the key even though you are specifying 
> that this package should be included in the babel header spec.

I have tried this without success. Also tried adding the LATEX_HEADERS
keyword to the document. Doesn't solve the problem, but changes the
output from an image of the code to an empty image.

Yours,
Christian



Re: [O] R source code block :session

2018-09-30 Thread William Denton

On 30 September 2018, Berry, Charles wrote:


Notice the "R> " prompt that prefixes the actual output.


The issue is that babel has to clean up dangling prompts from the R session 
buffer and is currently not smart enough to do this in your case.
...
I think your easiest path forward is to use the default R prompt. Or maybe use 
these header args:

:session :results value drawer :prologue "capture.output({" :epilogue 
"})"


Having the "library" call in its own block, with results silent, also works.

#+NAME: setup
#+BEGIN_SRC R :session :results silent
library(ascii)
#+END_SRC

#+NAME: test01
#+BEGIN_SRC R :session :results output
numstbl <- table(1:4, 1:4)
summary(numstbl)
#+END_SRC

That's how I usually do things, perhaps because I use "ℝ>" as m prompt and I 
ran into the same problem but found this got around it (though it's been a while 
and I can't remember for sure).  It also saves time when rerunning code because 
I don't reload stuff over and over.


Bill
--
William Denton :: Toronto, Canada   ---   Listening to Art: 
https://listeningtoart.org/
https://www.miskatonic.org/ ---   GHG.EARTH: http://ghg.earth/
Caveat lector.  ---   STAPLR: http://staplr.org/

Re: [O] Org mode + Solid = collaborative, privacy-respecting future

2018-09-30 Thread Martin Schöön
It looks like perfect solution to one of my org-mode uses.

Disclaimer: I have spent just a couple of minutes browsing those Solid-web
pages.

-- 
Martin Schöön

http://hem.bredband.net/b262106/index.html


Re: [O] R source code block :session

2018-09-30 Thread Berry, Charles



> On Sep 30, 2018, at 8:18 AM, Seb  wrote:
> 
> Hello,
> 
> I'm running into a couple of issues with R source code blocks using
> :session :
> 
> ------
> #+NAME: test01
> #+BEGIN_SRC R :session :results output
> library(ascii)
> numstbl <- table(1:4, 1:4)
> summary(numstbl)
> #+END_SRC
> 
> #+RESULTS: test01
> : R> Number of cases in table: 4
> : Number of factors: 2
> : Test for independence of all factors:
> : Chisq = 12, df = 9, p-value = 0.2
> : Chi-squared approximation may be incorrect
> ------
> 
> Notice the "R> " prompt that prefixes the actual output.  

The issue is that babel has to clean up dangling prompts from the R session 
buffer and is currently not smart enough to do this in your case.

Somebody who is well versed in regex's might be able to compare the regex that 
ess sets in the session buffer

"^[]a-zA-Z0-9.[]*\\(?:[>+.] \\)*> "

and compare that to the current regex just after `;; cleanup extra prompts left 
in output' in org-babel-R-evaluate-session  

"^\\([>+.]\\([ ][>.+]\\)*[ ]\\)"

and propose a fix that handles your case.  

However, this is bound to be a bit *fragile* as arbitrary prompts might end up 
looking like bona fide output and vice versa.

I think your easiest path forward is to use the default R prompt. Or maybe use 
these header args:

:session :results value drawer :prologue "capture.output({" :epilogue 
"})"

> If the first
> line (`library` call) is removed, then the prompt is correctly excluded
> from the results output.  I do have `options(prompt="R> ")` in my
> ~/.Rprofile.
> 
> The other problem:
> 
> ------
> #+NAME: test02
> #+BEGIN_SRC R :results output org
> library(ascii)
> options(asciiType="org")
> ascii(summary(table(1:4, 1:4)))
> #+END_SRC
> 
> #+RESULTS: test02
> #+BEGIN_SRC org
> - Number of cases in table: 4
> - Number of factors: 2
> - Test for independence of all factors:
>  - Chisq = 12, df = 9, p-value = 0.2
>  - Chi-squared approximation may be incorrect
> #+END_SRC
> ------
> 
> According to the documentation
> https://orgmode.org/worg/org-contrib/babel/languages/ob-doc-R.html, the
> results output should be wrapped in #+BEGIN_ORG #+END_ORG, not in
> another source code block.
> 

The manual says it is wrapped as you saw above. See 

(info "(org) Results of Evaluation")

Unfortunately, the worg pages are not as well curated as the manual.  So advice 
that is out of date persists.

You might want to use `:wrap' to get the behavior you seek, but be aware there 
is no `org' special block in the current releases. So even if you get to wrap 
the results in begin/end-org, it will probably not behave as you want or expect.

Perhaps `drawer' will satisfy your needs.

Chuck


ps. Org mode version 9.1.14





[O] Org mode + Solid = collaborative, privacy-respecting future

2018-09-30 Thread Karl Voit
Hi!

I stubled over Tim Berners-Lee Solid:
https://www.fastcompany.com/90243936/exclusive-tim-berners-lee-tells-us-his-radical-new-plan-to-upend-the-world-wide-web
https://www.inrupt.com/blog/one-small-step-for-the-web
https://en.wikipedia.org/wiki/Solid_(web_decentralization_project)

On https://github.com/solid/solid-apps I'd like to see something
that combines the awesome (local) power of Org mode with the
privacy-respecting soon-to-be platform Solid which adds
collaborative notions to the story.

Are there any actions going on already?

This just feels right to be combined with the power of Org/Emacs.

-- 
get mail|git|SVN|photos|postings|SMS|phonecalls|RSS|CSV|XML into Org-mode:
   > get Memacs from https://github.com/novoid/Memacs <
Personal Information Management > http://Karl-Voit.at/tags/pim/
Emacs-related > http://Karl-Voit.at/tags/emacs/




[O] R source code block :session

2018-09-30 Thread Seb
Hello,

I'm running into a couple of issues with R source code blocks using
:session :

------
#+NAME: test01
#+BEGIN_SRC R :session :results output
library(ascii)
numstbl <- table(1:4, 1:4)
summary(numstbl)
#+END_SRC

#+RESULTS: test01
: R> Number of cases in table: 4
: Number of factors: 2
: Test for independence of all factors:
:   Chisq = 12, df = 9, p-value = 0.2
:   Chi-squared approximation may be incorrect
------

Notice the "R> " prompt that prefixes the actual output.  If the first
line (`library` call) is removed, then the prompt is correctly excluded
from the results output.  I do have `options(prompt="R> ")` in my
~/.Rprofile.

The other problem:

------
#+NAME: test02
#+BEGIN_SRC R :results output org
library(ascii)
options(asciiType="org")
ascii(summary(table(1:4, 1:4)))
#+END_SRC

#+RESULTS: test02
#+BEGIN_SRC org
- Number of cases in table: 4
- Number of factors: 2
- Test for independence of all factors:
  - Chisq = 12, df = 9, p-value = 0.2
  - Chi-squared approximation may be incorrect
#+END_SRC
------

According to the documentation
https://orgmode.org/worg/org-contrib/babel/languages/ob-doc-R.html, the
results output should be wrapped in #+BEGIN_ORG #+END_ORG, not in
another source code block.

Any tips much appreciated.

Cheers,
-- 
Seb




[O] bug#32722: bug#32722: bug#32722: bug#32722: bug#32722: 26.1; Org-publish depend on non-free platform ?

2018-09-30 Thread Eli Zaretskii
> From: Kyle Meyer 
> Cc: n...@flqt.fr, r...@gnu.org, right...@gmail.com, ras...@gmx.us, 
> kaushal.m...@gmail.com, 32...@debbugs.gnu.org
> Date: Sat, 29 Sep 2018 19:35:25 -0400
> 
> Eli Zaretskii  writes:
> 
> >> From: Nicolas Goaziou 
> >> Cc: r...@gnu.org,  32...@debbugs.gnu.org,  n...@flqt.fr,  
> >> les...@watter.net,  right...@gmail.com,  kaushal.m...@gmail.com, Rasmus 
> >> 
> >> Date: Sat, 29 Sep 2018 20:33:35 +0200
> >> 
> >> > Thank you.  Can we have this change on the ermacs-26 branch of Emacs,
> >> > please?
> >> 
> >> I don't have access to the Emacs repository. 
> >> 
> >> You can either give me write access there, or I can send you the Texinfo
> >> @node contents, or someone with write access could do it for us. I'm
> >> Cc'ing Rasmus for the last option.
> >
> > I could install a patch that you produced from the Org repository's
> > appropriate branch.
> >
> > Thanks.
> 
> I've tried to combine these org-manual.org changes into a patch for
> org.texi.  This patch should apply on the emacs-26 branch.

Thanks, pushed.





[O] bug#32722: bug#32722: bug#32722: bug#32722: 26.1; Org-publish depend on non-free platform ?

2018-09-30 Thread Michael Albinus
Nicolas Goaziou  writes:

> Hello,

Hi Nicolas,

> 1 Setting up the staging area
> ═
>
>   The mobile application needs access to a file directory on a server[1]
>
>   Alternatively, by using TRAMP (see [TRAMP User Manual]),
>   `org-mobile-directory' may point to a remote directory accessible
>   through, for example, SSH and SCP:
>
>   ┌
>   │ (setq org-mobile-directory "/scpc:u...@remote.host:org/webdav/")
>   └
>
> [1] For a server to host files, consider using a WebDAV server, such
> as [Nextcloud] ().

Not every WebDAV server will support an ssh connection. On GNU/Linux
systems, Tramp supports also the connection methods "dav", "davs", and
"nextcloud" (this one since Emacs 27). Maybe it is worth to mention this.

> Regards,

Best regards, Michael.