* Re: Can't write accents in R graphics
[not found] <CACJpEk2aXhDBnY4WuvcaBkHuzB8_inZiEKPedMYvAvSO2UAfDA@mail.gmail.com>
@ 2013-12-05 18:43 ` Sebastien Vauban
0 siblings, 0 replies; 4+ messages in thread
From: Sebastien Vauban @ 2013-12-05 18:43 UTC (permalink / raw)
To: Vicente Vera; +Cc: emacs-orgmode-mXXj517/zsQ
Hello Vicente,
(Copying to the mailing list...)
Vicente Vera wrote:
> I have a similar problem, but found out a workaround.
> My native coding system is Latin-1, and after setting almost everything in
> my Emacs to UTF-8 with these lines in my init.el:
>
> (set-language-environment "UTF-8")
> (prefer-coding-system 'utf-8)
> (set-keyboard-coding-system 'utf-8)
> (set-selection-coding-system 'utf-8)
> (set-terminal-coding-system 'utf-8)
>
> it became troublesome to add accents in plot legends/titles.
> My guess is that is an R related problem. I tried changing the coding
> system in R but it seems to be bound to the OS encoding (i'm using Windows
> btw).
I should have said it: I'm on Windows as well.
> Since all my Emacs files (Org files included) are encoded in UTF-8, i
> simply replace the troublesome characters with their Unicode equivalent.
And, by default, I'm using UTF-8 everywhere...
> Following your example:
>
> title("Élève")
>
> becomes:
>
> title("\U00C9l\U00E8ve")
>
> This site might help in looking for specific codes:
> http://www.utf8-chartable.de/
OK, I can imagine that workaround works, but I really can't resolve to type
such esoteric characters in my Org buffers, really.
I'd well be enclined to convert my buffers to ISO Latin 1, would it resolve the
problem -- but I did not find any solution with Latin 1 either.
Best regards,
Seb
--
Sebastien Vauban
^ permalink raw reply [flat|nested] 4+ messages in thread
* 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; 4+ 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] 4+ messages in thread
* Re: Can't write accents in R graphics
2013-12-05 10:33 Sebastien Vauban
@ 2013-12-05 19:15 ` John Hendy
2013-12-15 20:48 ` Bernd Haug
0 siblings, 1 reply; 4+ 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] 4+ messages in thread
* Re: Can't write accents in R graphics
2013-12-05 19:15 ` John Hendy
@ 2013-12-15 20:48 ` Bernd Haug
0 siblings, 0 replies; 4+ 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] 4+ messages in thread
end of thread, other threads:[~2013-12-15 20:48 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
[not found] <CACJpEk2aXhDBnY4WuvcaBkHuzB8_inZiEKPedMYvAvSO2UAfDA@mail.gmail.com>
2013-12-05 18:43 ` Can't write accents in R graphics Sebastien Vauban
2013-12-05 10:33 Sebastien Vauban
2013-12-05 19:15 ` John Hendy
2013-12-15 20:48 ` Bernd Haug
Code repositories for project(s) associated with this public inbox
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).