[Vegan-commits] r2572 - pkg/vegan/inst/doc

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Thu Jul 18 14:57:11 CEST 2013


Author: jarioksa
Date: 2013-07-18 14:57:11 +0200 (Thu, 18 Jul 2013)
New Revision: 2572

Modified:
   pkg/vegan/inst/doc/decision-vegan.Rnw
   pkg/vegan/inst/doc/diversity-vegan.Rnw
   pkg/vegan/inst/doc/intro-vegan.Rnw
   pkg/vegan/inst/doc/vegan.sty
Log:
figure style depends automatically on the number of columns

Modified: pkg/vegan/inst/doc/decision-vegan.Rnw
===================================================================
--- pkg/vegan/inst/doc/decision-vegan.Rnw	2013-07-16 19:38:11 UTC (rev 2571)
+++ pkg/vegan/inst/doc/decision-vegan.Rnw	2013-07-18 12:57:11 UTC (rev 2572)
@@ -17,7 +17,7 @@
 %% need no \usepackage{Sweave}
 \begin{document}
 \SweaveOpts{strip.white=true}
-\setkeys{Gin}{width=\linewidth}
+
 <<echo=false,results=hide>>=
 figset <- function() par(mar=c(4,4,1,1)+.1)
 options(SweaveHooks = list(fig = figset))

Modified: pkg/vegan/inst/doc/diversity-vegan.Rnw
===================================================================
--- pkg/vegan/inst/doc/diversity-vegan.Rnw	2013-07-16 19:38:11 UTC (rev 2571)
+++ pkg/vegan/inst/doc/diversity-vegan.Rnw	2013-07-18 12:57:11 UTC (rev 2572)
@@ -11,11 +11,11 @@
 
 %% need no \usepackage{Sweave}
 \begin{document}
-\setkeys{Gin}{width=\linewidth}
+
 \SweaveOpts{strip.white=true}
 <<echo=false>>=
 par(mfrow=c(1,1))
-options(width=55)
+options(width=55) 
 figset <- function() par(mar=c(4,4,1,1)+.1)
 options(SweaveHooks = list(fig = figset))
 options("prompt" = "> ", "continue" = "  ")

Modified: pkg/vegan/inst/doc/intro-vegan.Rnw
===================================================================
--- pkg/vegan/inst/doc/intro-vegan.Rnw	2013-07-16 19:38:11 UTC (rev 2571)
+++ pkg/vegan/inst/doc/intro-vegan.Rnw	2013-07-18 12:57:11 UTC (rev 2572)
@@ -3,9 +3,6 @@
 \documentclass[a4paper,10pt]{article}
 \usepackage{vegan} % vegan settings
 
-%% one column and sidecaption figures
-\renewenvironment{figure}[1][tp]{\begin{SCfigure}[][#1]}{\end{SCfigure}}
-
 \title{Vegan: an introduction to ordination} 
 \author{Jari Oksanen}
 
@@ -17,7 +14,6 @@
 %% need no \usepackage{Sweave}
 \begin{document}
 
-\setkeys{Gin}{width=0.55\linewidth} % 0.55 for sidecaption
 \SweaveOpts{strip.white=true}
 <<echo=false>>=
 par(mfrow=c(1,1))

Modified: pkg/vegan/inst/doc/vegan.sty
===================================================================
--- pkg/vegan/inst/doc/vegan.sty	2013-07-16 19:38:11 UTC (rev 2571)
+++ pkg/vegan/inst/doc/vegan.sty	2013-07-18 12:57:11 UTC (rev 2572)
@@ -1,4 +1,10 @@
-%% typeset vegan vignettes
+%% typeset vegan vignettes. Should work with article style in one and
+%% two columns, and with amsart style with one column (two columns are
+%% too narrow in amsart, but basically works).  In one column, sets
+%% sidecaption figures, and in two columns normal column-wide figures
+%% and smaller example font. R output width (options(width=)) probably
+%% needs correct setting in the Rnw file, and some formatting may need
+%% adjustment. 
 \usepackage{amsmath}
 \usepackage{amssymb}
 \usepackage{ucs}
@@ -21,9 +27,12 @@
 \newcommand{\VAR}{\mathsf{VAR}}
 \newcommand{\COV}{\mathsf{COV}}
 \newcommand{\Prob}{\mathsf{P}}
-%% smaller examples, size depends on the no. of columns
+%% layout depends on the number of columns
 \if at twocolumn
-  \renewenvironment{Schunk}{\par\footnotesize}{}
+  \renewenvironment{Schunk}{\par\footnotesize}{} % smaller examples
+  \setkeys{Gin}{width=\linewidth} % column wide figs
 \else
-  \renewenvironment{Schunk}{\par\small}{}
+  \renewenvironment{Schunk}{\par\small}{} % small examples
+  \setkeys{Gin}{width=0.55\linewidth} % narrow figs for sidecaps
+  \renewenvironment{figure}[1][tp]{\begin{SCfigure}[][#1]}{\end{SCfigure}} %sidecaps
 \fi



More information about the Vegan-commits mailing list