Wrong text() adjustment with (math)expression and "\n" (PR#299)

maechler@stat.math.ethz.ch maechler@stat.math.ethz.ch
Tue, 26 Oct 1999 19:57:17 +0200 (MET DST)


This is adapted from  partha_bagchi@hgsi.com 's report on R-help:

     plot(0); title(expression("Bad\n with much much more text")))

gives something like 

      Bad
          with much much more text

(``newline w/o carriage return'') instead of centering both lines such as

               Bad
     with much much more text

which is produced by (just dropping `expression' from the above)

      plot(0); title(("Bad\n with much much more text"))

By the way, the following would need even more attention if one insists on 
correct behavior:

plot(0)
title(expression(paste("Still works with math\n", "with", 
                       frac(1,sum(x[i], i==1,n)), " and more text")))

Martin Maechler <maechler@stat.math.ethz.ch>	http://stat.ethz.ch/~maechler/

-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
r-devel mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
Send "info", "help", or "[un]subscribe"
(in the "body", not the subject !)  To: r-devel-request@stat.math.ethz.ch
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._