* Can't write accents in R graphics
@ 2013-12-05 10:33 Sebastien Vauban
2013-12-05 19:15 ` John Hendy
0 siblings, 1 reply; 7+ messages in thread
From: Sebastien Vauban @ 2013-12-05 10:33 UTC (permalink / raw)
To: emacs-orgmode-mXXj517/zsQ
#+TITLE: ECM Process Coding System
#+PROPERTY: eval yes
#+PROPERTY: exports both
#+PROPERTY: cache no
* Problem
I can't write accents in graphic titles (nor legends).
* Settings
After Googling (a lot), I always come back to the same set of solutions:
- Adding the following in my ~.emacs~ file:
#+begin_src emacs-lisp
(setq process-coding-system-alist '(("R.*" . utf-8-unix)))
#+end_src
#+begin_src emacs-lisp
(add-hook 'ess-R-post-run-hook
(lambda () (set-buffer-process-coding-system
'utf-8-unix 'utf-8-unix)))
#+end_src
- Setting the process coding system in the =*R*= buffer:
#+begin_src emacs-lisp
M-x set-buffer-process-coding-system RET utf-8-unix RET utf-8-unix RET
#+end_src
None of those does work for me, from an Org file...
* Example
** Text
Print a string does always work, in the Org buffer, and in the export.
#+begin_src R
print("Élève")
#+end_src
#+results:
: Élève
** Graph
But adding a title with accents never does:
#+header: :file ecm-R-coding-system.png
#+begin_src R :results graphics :width 240 :height 240
x <- 0:12
plot(sin(x/2))
title("Élève")
#+end_src
#+results:
[[file:ecm-R-coding-system.png]]
* Observations
You can see a demo of (some of) the tests I made on
http://screencast.com/t/7Nz87zuqiz.
Maybe the problem is not related neither to Org, nor ESS, as I see that
=sessionInfo()= outputs French stuff.
Maybe some of the R users here could share their experience with the "coding
system" configuration?
Best regards,
Seb
--
Sebastien Vauban
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: Can't write accents in R graphics
2013-12-05 10:33 Can't write accents in R graphics Sebastien Vauban
@ 2013-12-05 19:15 ` John Hendy
2013-12-06 11:19 ` [babel] Can't write accented characters " Sebastien Vauban
2013-12-15 20:48 ` Can't write accents " Bernd Haug
0 siblings, 2 replies; 7+ messages in thread
From: John Hendy @ 2013-12-05 19:15 UTC (permalink / raw)
To: Sebastien Vauban; +Cc: emacs-orgmode
[-- Attachment #1: Type: text/plain, Size: 2102 bytes --]
On Dec 5, 2013 4:35 AM, "Sebastien Vauban" <sva-news@mygooglest.com> wrote:
>
> #+TITLE: ECM Process Coding System
> #+PROPERTY: eval yes
> #+PROPERTY: exports both
> #+PROPERTY: cache no
>
> * Problem
>
> I can't write accents in graphic titles (nor legends).
>
> * Settings
>
> After Googling (a lot), I always come back to the same set of solutions:
>
> - Adding the following in my ~.emacs~ file:
>
> #+begin_src emacs-lisp
> (setq process-coding-system-alist '(("R.*" . utf-8-unix)))
> #+end_src
>
> #+begin_src emacs-lisp
> (add-hook 'ess-R-post-run-hook
> (lambda () (set-buffer-process-coding-system
> 'utf-8-unix 'utf-8-unix)))
> #+end_src
>
> - Setting the process coding system in the =*R*= buffer:
>
> #+begin_src emacs-lisp
> M-x set-buffer-process-coding-system RET utf-8-unix RET utf-8-unix RET
> #+end_src
>
> None of those does work for me, from an Org file...
>
> * Example
>
> ** Text
>
> Print a string does always work, in the Org buffer, and in the export.
>
> #+begin_src R
> print("Élève")
> #+end_src
>
> #+results:
> : Élève
>
> ** Graph
>
> But adding a title with accents never does:
>
> #+header: :file ecm-R-coding-system.png
> #+begin_src R :results graphics :width 240 :height 240
> x <- 0:12
> plot(sin(x/2))
> title("Élève")
> #+end_src
>
> #+results:
> [[file:ecm-R-coding-system.png]]
>
> * Observations
>
> You can see a demo of (some of) the tests I made on
> http://screencast.com/t/7Nz87zuqiz.
>
> Maybe the problem is not related neither to Org, nor ESS, as I see that
> =sessionInfo()= outputs French stuff.
>
> Maybe some of the R users here could share their experience with the
"coding
> system" configuration?
>
Can you do it straight from R? Might be a better place to start? If not,
I'd look into that first to avoid googling org and ESS stuff in vain!
John
> Best regards,
> Seb
>
> --
> Sebastien Vauban
>
>
[-- Attachment #2: Type: text/html, Size: 2983 bytes --]
^ permalink raw reply [flat|nested] 7+ messages in thread
* [babel] Can't write accented characters in R graphics
2013-12-05 19:15 ` John Hendy
@ 2013-12-06 11:19 ` Sebastien Vauban
2013-12-10 18:47 ` Sebastien Vauban
2013-12-15 20:48 ` Can't write accents " Bernd Haug
1 sibling, 1 reply; 7+ messages in thread
From: Sebastien Vauban @ 2013-12-06 11:19 UTC (permalink / raw)
To: emacs-orgmode-mXXj517/zsQ
John Hendy wrote:
> Can you do it straight from R? Might be a better place to start? If not,
> I'd look into that first to avoid googling org and ESS stuff in vain!
The 1'42" demo on http://screencast.com/t/A9q6CQlLY6 clearly shows that:
- It (now [1]) works from the R terminal
- It works from the Org edit buffer (via C-c '), when sending the commands to
the iESS process
- It does not work from the Org file itself...
Environment:
- Microsoft Windows 8
- GNU Emacs 24.3.50.1 (i686-pc-mingw32) of 2013-10-19 on LEG570
- Org-mode version 8.2.3c (release_8.2.3c-333-g487c74)
- R 3.0.2
Best regards,
Seb
[1] I've added the following code in my .emacs to make it work:
#+begin_src emacs-lisp
(setq process-coding-system-alist
'(("R.*" . iso-latin-1)))
#+end_src
--
Sebastien Vauban
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [babel] Can't write accented characters in R graphics
2013-12-06 11:19 ` [babel] Can't write accented characters " Sebastien Vauban
@ 2013-12-10 18:47 ` Sebastien Vauban
2013-12-10 21:08 ` Christian Moe
0 siblings, 1 reply; 7+ messages in thread
From: Sebastien Vauban @ 2013-12-10 18:47 UTC (permalink / raw)
To: emacs-orgmode-mXXj517/zsQ
"Sebastien Vauban" wrote:
> John Hendy wrote:
>> Can you do it straight from R? Might be a better place to start? If not,
>> I'd look into that first to avoid googling org and ESS stuff in vain!
>
> The 1'42" demo on http://screencast.com/t/A9q6CQlLY6 clearly shows that:
>
> - It (now [1]) works from the R terminal
>
> - It works from the Org edit buffer (via C-c '), when sending the commands to
> the iESS process
>
> - It does not work from the Org file itself...
Fixed with:
--8<---------------cut here---------------start------------->8---
;; accented characters on graphics
(setq org-babel-R-command
(concat org-babel-R-command " --encoding=UTF-8")))
--8<---------------cut here---------------end--------------->8---
> Environment:
> - Microsoft Windows 8
>
> [1] I've added the following code in my .emacs to make it work:
>
> #+begin_src emacs-lisp
> (setq process-coding-system-alist
> '(("R.*" . iso-latin-1)))
> #+end_src
Best regards,
Seb
--
Sebastien Vauban
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [babel] Can't write accented characters in R graphics
2013-12-10 18:47 ` Sebastien Vauban
@ 2013-12-10 21:08 ` Christian Moe
2013-12-11 8:48 ` Sebastien Vauban
0 siblings, 1 reply; 7+ messages in thread
From: Christian Moe @ 2013-12-10 21:08 UTC (permalink / raw)
To: Sebastien Vauban; +Cc: emacs-orgmode
Sebastien Vauban writes:
> Fixed with:
>
> --8<---------------cut here---------------start------------->8---
> ;; accented characters on graphics
> (setq org-babel-R-command
> (concat org-babel-R-command " --encoding=UTF-8")))
> --8<---------------cut here---------------end--------------->8---
That looked promising, but when I tried it, I got the following
*Org-Babel Error Output*, which shows Babel choking on the first
non-ascii character at the start of the xlab string:
Error: unexpected '/' in:
"plot(1:10, 1:10, xlab="dev.off()
}}(),transfer.file="/var/folders/JV/JVNxBfnMGkWC9Aw0BZa8Kk+++TI/-Tmp-/"
Execution halted
Still baffled,
Christian
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [babel] Can't write accented characters in R graphics
2013-12-10 21:08 ` Christian Moe
@ 2013-12-11 8:48 ` Sebastien Vauban
0 siblings, 0 replies; 7+ messages in thread
From: Sebastien Vauban @ 2013-12-11 8:48 UTC (permalink / raw)
To: emacs-orgmode-mXXj517/zsQ
Christian Moe wrote:
> Sebastien Vauban writes:
>
>> Fixed with:
>>
>> --8<---------------cut here---------------start------------->8---
>> ;; accented characters on graphics
>> (setq org-babel-R-command
>> (concat org-babel-R-command " --encoding=UTF-8")))
>> --8<---------------cut here---------------end--------------->8---
>
> That looked promising, but when I tried it, I got the following
> *Org-Babel Error Output*, which shows Babel choking on the first
> non-ascii character at the start of the xlab string:
>
> Error: unexpected '/' in:
> "plot(1:10, 1:10, xlab="dev.off()
> }}(),transfer.file="/var/folders/JV/JVNxBfnMGkWC9Aw0BZa8Kk+++TI/-Tmp-/"
> Execution halted
>
> Still baffled,
Maybe try with variations of the above encoding, such as latin1 or so.
Pay attention:
- Different installations have different expectations (the Windows R binary
does not behave the same as the Cygwin R for the default encoding).
- The encoding name is not spelled the same between the Windows R binary and
the Cygwin R one: UTF-8 passes both tests, utf8 only for the Windows
binary...
Best regards,
Seb
--
Sebastien Vauban
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: Can't write accents in R graphics
2013-12-05 19:15 ` John Hendy
2013-12-06 11:19 ` [babel] Can't write accented characters " Sebastien Vauban
@ 2013-12-15 20:48 ` Bernd Haug
1 sibling, 0 replies; 7+ messages in thread
From: Bernd Haug @ 2013-12-15 20:48 UTC (permalink / raw)
To: Sebastien Vauban; +Cc: emacs-orgmode
Hey,
The thread's a bit stale, so sorry if I'm beating a dead horse here,
On 5 December 2013 20:15, John Hendy <jw.hendy@gmail.com> wrote:
> Can you do it straight from R? Might be a better place to start? If not, I'd
> look into that first to avoid googling org and ESS stuff in vain!
More concrete: Try using cairo_pdf as your graph output function in R.
It can do PDF exports with non-ASCII characters.
Caveats: Getting Cairo for R may be some work on Windows from what
I've heard. Also I was still on 2.15.3 when I had this working.
Cheers, Bernd
--
Senior Software Engineer
Xaidat GmbH
web: http://www.xaidat.com/
^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2013-12-15 20:48 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-12-05 10:33 Can't write accents in R graphics Sebastien Vauban
2013-12-05 19:15 ` John Hendy
2013-12-06 11:19 ` [babel] Can't write accented characters " Sebastien Vauban
2013-12-10 18:47 ` Sebastien Vauban
2013-12-10 21:08 ` Christian Moe
2013-12-11 8:48 ` Sebastien Vauban
2013-12-15 20:48 ` Can't write accents " Bernd Haug
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.