Re: [R] Sweave UFT8 problem

2012-04-15 Thread Philippe Grosjean

Hello,

Have you tried to put that command in a comment:

%\usepackage[utf8]{inputenc}

I haven't tested it in this particular case, but it works in some other 
situations.

Best,

Philippe

..¡}))
 ) ) ) ) )
( ( ( ( (Prof. Philippe Grosjean
 ) ) ) ) )
( ( ( ( (Numerical Ecology of Aquatic Systems
 ) ) ) ) )   Mons University, Belgium
( ( ( ( (
..

On 14/04/12 22:37, Mark Heckmann wrote:

Hi,

I work on MacOS, trying to Sweave an UFT8 document.
AFAI remember R 2.14 used to render a warning when the encoding was not
declared when using Sweave.
With R 2.15 it seems to render an error.

Sweave(sim_pi.Rnw)
Error: 'sim_pi.Rnw' is not ASCII and does not declare an encoding

Declaring an encoding by adding a line like

\usepackage[utf8]{inputenc}

in the preamble does the job. In my case though the .Rnw document does no
have a preamble as it is just one chapter.
All chapters are Sweaved separately (due to computation time). Hence I
cannot inject the above line as LaTex will cause an error afterwards.
(usepackage{} is only allowed in the preamble which only appears once in
the main document, not in each chapter).

How can I get around this not using the terminal for Sweaving, like e.g.
R CMD Sweave --encoding=utf-8 sim_pi.Rnw  ?

Thanks
Mark

[[alternative HTML version deleted]]

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.




__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


Re: [R] Sweave UFT8 problem

2012-04-15 Thread Prof. Dr. Matthias Kohl

try:
Sweave(sim_pi.Rnw, encoding = utf8)

Best,
Matthias

On 15.04.2012 11:41, Philippe Grosjean wrote:

Hello,

Have you tried to put that command in a comment:

%\usepackage[utf8]{inputenc}

I haven't tested it in this particular case, but it works in some other
situations.
Best,

Philippe

..¡}))
) ) ) ) )
( ( ( ( ( Prof. Philippe Grosjean
) ) ) ) )
( ( ( ( ( Numerical Ecology of Aquatic Systems
) ) ) ) ) Mons University, Belgium
( ( ( ( (
..

On 14/04/12 22:37, Mark Heckmann wrote:

Hi,

I work on MacOS, trying to Sweave an UFT8 document.
AFAI remember R 2.14 used to render a warning when the encoding was not
declared when using Sweave.
With R 2.15 it seems to render an error.

Sweave(sim_pi.Rnw)
Error: 'sim_pi.Rnw' is not ASCII and does not declare an encoding

Declaring an encoding by adding a line like

\usepackage[utf8]{inputenc}

in the preamble does the job. In my case though the .Rnw document does no
have a preamble as it is just one chapter.
All chapters are Sweaved separately (due to computation time). Hence I
cannot inject the above line as LaTex will cause an error afterwards.
(usepackage{} is only allowed in the preamble which only appears once in
the main document, not in each chapter).

How can I get around this not using the terminal for Sweaving, like e.g.
R CMD Sweave --encoding=utf-8 sim_pi.Rnw ?

Thanks
Mark

[[alternative HTML version deleted]]

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide
http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.




__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide
http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


--
Prof. Dr. Matthias Kohl
www.stamats.de

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.