r - umlauts in comments in preambel with knitr cause problems with texi2dvi -
i found errors umlauts in comments knitr in latex. first mini-example:
\documentclass[12pt, % ß a4paper % page format ]{scrartcl} \begin{document} <<code>>= rnorm(30) @ \end{document}
and errors shown:
error in texi2dvi(file = file, pdf = true, clean = clean, quiet = quiet,: running 'texi2dvi' on 'minimalexample.tex' failed. latex errors: ! latex error: environment knitrout undefined. see latex manual or latex companion explanation. type h <return> immediate help. ... ! undefined control sequence. l.6 \definecolor {shadecolor}{rgb}{0.969, 0.969, 0.969}\color{fgcolor}\begin{... control sequence @ end of top line of error message never \def'ed. if have ! undefined control sequence. l.6 ...shadecolor}{rgb}{0.969, 0.969, 0.969}\color {fgcolor}\begin{kframe} control sequence @ end of top line of error message never \def'ed. if have ! latex error: environment kframe undefined. see latex manual or latex companion explanation. type h <return> immediate help. ... ! latex error: environment alltt undefined. see la calls: knit2pdf -> <anonymous> -> texi2dvi in addition: there 13 warnings (use warnings() see them) execution halted process exited error(s)
i use texstudio (v 2.9.4) editor , knitr version 1.12.3.
is there chance use umlauts in comments , avoid these errors?
ok, got solution.
it didn't affected comments. every umlaut caused error. file encoded in iso-8859-1 , r running utf-8. found out in r with:
sys.getlocale() [1] "lc_ctype=en_us.utf-8;lc_numeric=c;lc_time=de_de.utf-8;lc_collate=en_us.utf-8;lc_monetary=de_de.utf-8;lc_messages=en_us.utf-8;lc_paper=de_de.utf-8;lc_name=c;lc_address=c;lc_telephone=c;lc_measurement=de_de.utf-8;lc_identification=c"
Comments
Post a Comment