[R] odfWeave: Some questions about potential formatting options

Milan Bouchet-Valat nalimilan at club-internet.fr
Fri Apr 12 11:10:27 CEST 2013

Le jeudi 11 avril 2013 à 13:40 -0700, Paul Miller a écrit :
Hello All,
> Learning to use the odfWeave package. I really like the package. It has good documentation, makes some very nice looking tables, and seems to have lots of options for customizing output.
> There are a few things I'd like to do that don't seem to be covered in the documentation though. So I'm not sure if they're possible or not. 
> Here's a list of some things I'd like to be able to do:
> 1. Make titles generated by odfTableCaption/odfFigureCaption bold 
> 2. Add footnotes to tables (using something other than odfCat)
> 3. Control the width of columns
> 4. Control the alignment of columns (first column left and centered otherwise)
> Is it possible to do any or all of these things using odfWeave?
> For points 1 and 4, you have to use a style, and edit the style via LibreOffice to make the text bold or change its alignement. See tableStyles() for the latter.

For point 3 (column widths), I needed to make small changes to odfWeave to support that part of the ODF spec. I've sent them to Max Kuhn for review, but so far he probably could not find the time to study them.

If you are interested, you can grab the modified version of the package from here :

Then you can set the width like that:

currentDefs <- getStyleDefs()

currentDefs$firstColumn$type <- "Table Column"
currentDefs$firstColumn$columnWidth <- "5 cm"

currentDefs$secondColumn$type <- "Table Column"
currentDefs$secondColumn$columnWidth <- "3 cm"


Then you can use these styles this way:
odfTable(df, styles=style,
         colStyles=c("firstColumn", "secondColumn"))

For point 2, I'm not sure what you mean. Do you want to include a legend below the table, or do you want to use real footnotes?


More information about the R-help mailing list