[Rd] non-ascii vignettes

Hin-Tak Leung htl10 at users.sourceforge.net
Thu Nov 3 20:59:43 CET 2011


just saw "require vignettes to declare their encoding (trunk at 57560)". Having played with non-ascii vignettes (well, a lot of Chinese...) on-and-off for almost two weeks, I noticed it was a bit odd that a *commented* \usepackage[utf8]{inputenc} had any effort at all on R's Sweave behavior - while it is understandable (probably no check is made whether a "%" is before \usepackage), it is probably wrong.

Besides commented statements having an effect, I found parsing \usepackage for encoding a bit disturbing - because at one point I was considering adding non-ascii's to one of the \usepackage options (hyperref can takes non-ascii for options), and it is possible, or may be even necessary, for \usepackage's to be in a particular order. There is also another drawback: if a latex document is multi-language, it is quite customary to have different encoding in different parts - one reason is to switch fonts and the availability of glyphs. 

FWIW, I noticed it because I was adding/removing \usepackage{}'s and switching between CJK and XeTeX a fair bit to see which gives me better results. They have different font selection mechanisms and different compatible/conflicted TeX packages; CJK on TexLive uses postscript Type 1 fonts while XeTeX uses Truetype/Opentype - the typeface is the same (both using a Arphic derivative) but the visual result is different.


More information about the R-devel mailing list