all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* org-babel source code :fonts serif not working
@ 2015-03-26  2:14 Vikas Rawal
  2015-03-26 18:15 ` Charles C. Berry
  0 siblings, 1 reply; 3+ messages in thread
From: Vikas Rawal @ 2015-03-26  2:14 UTC (permalink / raw
  To: org-mode mailing list

The following code does not produce image with serif fonts for me. It used to work earlier but it seems the behaviour has changed. Could anyone confirm.

#+BEGIN_SRC R :results output graphics :exports results :file filename.png :width 1200 :height 700 :fonts serif
 <<R code here to produce a graph>>
#+END_SRC

Org-version: Org-mode version 8.3beta (release_8.3beta-688-g44744b @ /Users/vikas/.emacs.d/src/org-mode/lisp/)


Vikas

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: org-babel source code :fonts serif not working
  2015-03-26  2:14 org-babel source code :fonts serif not working Vikas Rawal
@ 2015-03-26 18:15 ` Charles C. Berry
  2015-03-27  1:25   ` Vikas Rawal
  0 siblings, 1 reply; 3+ messages in thread
From: Charles C. Berry @ 2015-03-26 18:15 UTC (permalink / raw
  To: Vikas Rawal; +Cc: org-mode mailing list

On Thu, 26 Mar 2015, Vikas Rawal wrote:

> The following code does not produce image with serif fonts for me. It 
> used to work earlier but it seems the behaviour has changed. Could 
> anyone confirm.

AFAICS, it does not work in R.

FWIW, the code that Babel sends to R is (after some formatting):

#+BEGIN_SRC R
   png(filename="filename.png",width=1200,height=700,fonts="serif")
   tryCatch({
   <<<< your plot goes here >>>>
   },
            error=function(e){
                plot(x=-1:1, y=-1:1, type='n', xlab='', ylab='', 
axes=FALSE)
                text(x=0, y=0, labels=e$message, col='red')
                paste('ERROR', e$message, sep=' : ')})
   dev.off()
#+END_SRC

If you can get that or something like to work in R, report back here.

Otherwise take this to one of the R lists.

Also, I note that the filename "filename.png" seems troublesome even apart 
from the font issue. I do not have time to run down why that might be.

Chuck



>
> #+BEGIN_SRC R :results output graphics :exports results :file filename.png :width 1200 :height 700 :fonts serif
> <<R code here to produce a graph>>
> #+END_SRC
>

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: org-babel source code :fonts serif not working
  2015-03-26 18:15 ` Charles C. Berry
@ 2015-03-27  1:25   ` Vikas Rawal
  0 siblings, 0 replies; 3+ messages in thread
From: Vikas Rawal @ 2015-03-27  1:25 UTC (permalink / raw
  To: Charles C. Berry; +Cc: org-mode mailing list

> 
> #+BEGIN_SRC R
>  png(filename="filename.png",width=1200,height=700,fonts="serif")
>  tryCatch({
>  <<<< your plot goes here >>>>
>  },
>           error=function(e){
>               plot(x=-1:1, y=-1:1, type='n', xlab='', ylab='', axes=FALSE)
>               text(x=0, y=0, labels=e$message, col='red')
>               paste('ERROR', e$message, sep=' : ')})
>  dev.off()
> #+END_SRC
> 
> If you can get that or something like to work in R, report back here.


Thanks for the pointer. It is an issue with the graphics device being used. 

Using cairo and family (instead of fonts) works for me:

#+BEGIN_SRC R :results output graphics :exports results :file filename.png :width 1200 :height 700 :type cairo :family serif
<<R code here to produce a graph>>
#+END_SRC

Vikas

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2015-03-27  1:25 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-03-26  2:14 org-babel source code :fonts serif not working Vikas Rawal
2015-03-26 18:15 ` Charles C. Berry
2015-03-27  1:25   ` Vikas Rawal

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.