[Rd] Regression and inconsistency of width of apostrophes in R vignettes
Hin-Tak Leung
htl10 at users.sourceforge.net
Thu Sep 18 02:44:29 CEST 2014
My main dev machine died a well-deserved death a few weeks ago after six
and a half years of faithful service, and refused to be re-animated. A substantial
part of setting up its replacement is re-running a lot of R vignettes (mostly
for timing to establish new performance baselines) - and also
cleaning away some such vignettes generated in the past under different
versions of R.
So I noticed a regression of behavior between R 2.x and 3.x/current. The width
of apostrophes in code output was working correctly in R 2.x and is wrong in R 3.x
generated vignettes. Specifically, it affects summary(data.frame) with some columns
that contains NA's. Here is an edited example snipplet (you should view this with
fixed-width font terminal):
=================
\begin{Sinput}
> summary(some.data.frame)
\end{Sinput}
\begin{Soutput}
P.BB z.HWE
Min. :0.00000 Min. :-3.83163
1st Qu.:0.07071 1st Qu.:-0.56856
Median :0.26263 Median : 0.18426
Mean :0.33754 Mean : 0.06581
3rd Qu.:0.56566 3rd Qu.: 0.73845
Max. :0.98990 Max. : 3.73120
NA's :2
\end{Soutput}
=================
In R 2.x generated pdf's, the ":" all lined up. In R 3.x/current generated pdf's, the "NA's"
is typesetted with a narrower apostrophe and therefore the ":" no longer line
up properly.
This is running both versions in parallel on the same system so there is no LaTeX related
issue in the rest of the system. I see Prof Ripley is the person to have changed
R Sweave's behavior in the last few years, and all the recent changes are to do with
quotes (which probably means apostophes also) I suspect the relevant change is probably
r63858 (and its equivalent r63864 in the R-3.0 branch) although I'd be happy to be
corrected. In any case, the above new behavior of summary(data.frame)
columns not lining up seems to be undesirable so I'd prefer reverting to the older
appearance, unless there is a good reason; or at least identify what
local quirks I have which results in this, if I am the only person experiencing this difference
of behavior between R 2.x and R 3.x.
------------------------------------------------------------------------
r65917 | ripley | 2014-06-11 11:46:03 +0100 (Wed, 11 Jun 2014) | 2 lines
prefer zi4.sty, use [noupquote] only with that
------------------------------------------------------------------------
r65748 | ripley | 2014-05-26 08:39:14 +0100 (Mon, 26 May 2014) | 2 lines
use [noupquote]
------------------------------------------------------------------------
r63858 | ripley | 2013-09-07 07:02:08 +0100 (Sat, 07 Sep 2013) | 3 lines
add inconsolata option to Sweave
Arrange for '' and `` to render in the same way in \code, \samp as \examples.
More information about the R-devel
mailing list