cameronbracken / pgfSweave

Quality graphics and speedy compilation with Sweave
http://r-forge.r-project.org/projects/pgfsweave/
29 stars 6 forks source link

the 'center' option #18

Closed yihui closed 13 years ago

yihui commented 13 years ago

I tried the center option, and it seemed to be working for me. The test Rnw and pdf output:

https://github.com/downloads/yihui/pgfSweave/center.Rnw https://github.com/downloads/yihui/pgfSweave/center.pdf

I understand if you do not want to accept this as an option :) An alternative is to use something like isTRUE(getOption('center.graphics')) in the if statements.

(sorry for the "hurry" -- because I really need it)

cameronbracken commented 13 years ago

That still does not work for me, not sure why. Both graphics are left aligned, the minipage option does though so I may just tweak this a bit.

yihui commented 13 years ago

Maybe it is dependent on the LaTeX distribution? I'm using Ubuntu with TeXLive and Package: pgf 2008/01/15 v2.00 (rcs-revision 1.12)

I also remember I tried last time on Windows and it failed.

The minipage solution does NOT work under Ubuntu/TeXLive, however... sigh

cameronbracken commented 13 years ago

hmm, I am using TeXLive 2010 and pgf 2.10, that might be the reason. I would really like the end solution to be universal whatever that might be....

yihui commented 13 years ago

how about asking the pgf authors or their mailing list?

Now I'm on Windows again, and surprisingly it works! I'm using MikTeX 2.9 and Package: pgf 2008/01/15 v2.10 (rcs-revision 1.12)

The Ubuntu environment above was 10.10 (Maverick Meerkat) with TeXLive 2009-7.

cameronbracken commented 13 years ago

I think I will.

cameronbracken commented 13 years ago

I am going to hold off on this for just a bit, I am going to tackle using the tikz external library first instead of the basic externalization. Then I should be able to incorporate your changes and decide how to do this once and for all.

yihui commented 13 years ago

OK, no problem. Thanks!

cameronbracken commented 13 years ago

Should be basically solved in the next version (which is called the tikz-external branch currently) by wrapping output in a separate environment

https://github.com/cameronbracken/pgfSweave/commits/tikz-external

https://github.com/cameronbracken/pgfSweave/commit/4d07efb597e262913c5112aa712686da9278f043