Skip to content
This repository was archived by the owner on Mar 23, 2020. It is now read-only.

Commit

Permalink
example width
Browse files Browse the repository at this point in the history
  • Loading branch information
davidgohel committed May 11, 2014
1 parent ef05183 commit 88c8fbf
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 32 deletions.
32 changes: 16 additions & 16 deletions examples/docx_example.R
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ doc = addParagraph( doc, "Document title", stylename = "TitleDoc" )

# add a paragraph
doc = addParagraph( doc , "This document is generated with ReporteRs."
, stylename="Citationintense")
, stylename="Citationintense")

# add page break
doc = addPageBreak( doc )
Expand All @@ -44,8 +44,8 @@ doc = addPageBreak( doc )
# add a title
doc = addTitle( doc, "Texts demo", level = 1 )
texts = c( "Lorem ipsum dolor sit amet, consectetur adipiscing elit."
, "In sit amet ipsum tellus. Vivamus dignissim arcu sit amet faucibus auctor."
, "Quisque dictum tristique ligula."
, "In sit amet ipsum tellus. Vivamus dignissim arcu sit amet faucibus auctor."
, "Quisque dictum tristique ligula."
)

# add simple text
Expand All @@ -54,19 +54,19 @@ doc = addParagraph( doc, value = texts, stylename="BulletList" )
# Add "My tailor is rich" and "Cats and Dogs"
# format some of the pieces of text
pot1 = pot("My tailor"
, textProperties(color="red", font.size = 12 ) ) + " is " + pot("rich"
, textProperties(font.weight="bold") )
, textProperties(color="red", font.size = 12 ) ) + " is " + pot("rich"
, textProperties(font.weight="bold") )
pot2 = pot("Cats"
, textProperties(color="red", font.size = 12)
) + " and " + pot("Dogs"
, textProperties(color="blue", font.size = 12) )
, textProperties(color="red", font.size = 12)
) + " and " + pot("Dogs"
, textProperties(color="blue", font.size = 12) )
doc = addParagraph(doc, set_of_paragraphs( pot1, pot2 ), stylename="Normal" )

################ PLOT DEMO ################

myplot = qplot(Sepal.Length, Petal.Length
, data = iris, color = Species
, size = Petal.Width, alpha = I(0.7)
, data = iris, color = Species
, size = Petal.Width, alpha = I(0.7)
)
# Add titles and then 'myplot'
doc = addTitle( doc, "Plot examples", level = 1 )
Expand All @@ -91,18 +91,18 @@ doc = addTitle( doc, "FlexTable example", level = 1 )
# Create a FlexTable with data.frame mtcars, display rownames
# use different formatting properties for header and body cells
MyFTable = FlexTable( data = mtcars, add.rownames = TRUE
, body.cell.props = cellProperties( border.color = "#EDBD3E")
, header.cell.props = cellProperties( background.color = "#5B7778" )
, body.cell.props = cellProperties( border.color = "#EDBD3E")
, header.cell.props = cellProperties( background.color = "#5B7778" )
)
# zebra stripes - alternate colored backgrounds on table rows
MyFTable = setZebraStyle( MyFTable, odd = "#D1E6E7", even = "#93A8A9" )

# applies a border grid on table
MyFTable = setFlexTableBorders(MyFTable
, inner.vertical = borderProperties( color="#EDBD3E", style="dotted" )
, inner.horizontal = borderProperties( color = "#EDBD3E", style = "none" )
, outer.vertical = borderProperties( color = "#EDBD3E", style = "solid" )
, outer.horizontal = borderProperties( color = "#EDBD3E", style = "solid" )
, inner.vertical = borderProperties( color="#EDBD3E", style="dotted" )
, inner.horizontal = borderProperties( color = "#EDBD3E", style = "none" )
, outer.vertical = borderProperties( color = "#EDBD3E", style = "solid" )
, outer.horizontal = borderProperties( color = "#EDBD3E", style = "solid" )
)

# add MyFTable into document
Expand Down
32 changes: 16 additions & 16 deletions man/docx.Rd
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ doc = addParagraph( doc, "Document title", stylename = "TitleDoc" )
# add a paragraph
doc = addParagraph( doc , "This document is generated with ReporteRs."
, stylename="Citationintense")
, stylename="Citationintense")
# add page break
doc = addPageBreak( doc )
Expand All @@ -92,8 +92,8 @@ doc = addPageBreak( doc )
# add a title
doc = addTitle( doc, "Texts demo", level = 1 )
texts = c( "Lorem ipsum dolor sit amet, consectetur adipiscing elit."
, "In sit amet ipsum tellus. Vivamus dignissim arcu sit amet faucibus auctor."
, "Quisque dictum tristique ligula."
, "In sit amet ipsum tellus. Vivamus dignissim arcu sit amet faucibus auctor."
, "Quisque dictum tristique ligula."
)
# add simple text
Expand All @@ -102,19 +102,19 @@ doc = addParagraph( doc, value = texts, stylename="BulletList" )
# Add "My tailor is rich" and "Cats and Dogs"
# format some of the pieces of text
pot1 = pot("My tailor"
, textProperties(color="red", font.size = 12 ) ) + " is " + pot("rich"
, textProperties(font.weight="bold") )
, textProperties(color="red", font.size = 12 ) ) + " is " + pot("rich"
, textProperties(font.weight="bold") )
pot2 = pot("Cats"
, textProperties(color="red", font.size = 12)
) + " and " + pot("Dogs"
, textProperties(color="blue", font.size = 12) )
, textProperties(color="red", font.size = 12)
) + " and " + pot("Dogs"
, textProperties(color="blue", font.size = 12) )
doc = addParagraph(doc, set_of_paragraphs( pot1, pot2 ), stylename="Normal" )
################ PLOT DEMO ################
myplot = qplot(Sepal.Length, Petal.Length
, data = iris, color = Species
, size = Petal.Width, alpha = I(0.7)
, data = iris, color = Species
, size = Petal.Width, alpha = I(0.7)
)
# Add titles and then 'myplot'
doc = addTitle( doc, "Plot examples", level = 1 )
Expand All @@ -139,18 +139,18 @@ doc = addTitle( doc, "FlexTable example", level = 1 )
# Create a FlexTable with data.frame mtcars, display rownames
# use different formatting properties for header and body cells
MyFTable = FlexTable( data = mtcars, add.rownames = TRUE
, body.cell.props = cellProperties( border.color = "#EDBD3E")
, header.cell.props = cellProperties( background.color = "#5B7778" )
, body.cell.props = cellProperties( border.color = "#EDBD3E")
, header.cell.props = cellProperties( background.color = "#5B7778" )
)
# zebra stripes - alternate colored backgrounds on table rows
MyFTable = setZebraStyle( MyFTable, odd = "#D1E6E7", even = "#93A8A9" )
# applies a border grid on table
MyFTable = setFlexTableBorders(MyFTable
, inner.vertical = borderProperties( color="#EDBD3E", style="dotted" )
, inner.horizontal = borderProperties( color = "#EDBD3E", style = "none" )
, outer.vertical = borderProperties( color = "#EDBD3E", style = "solid" )
, outer.horizontal = borderProperties( color = "#EDBD3E", style = "solid" )
, inner.vertical = borderProperties( color="#EDBD3E", style="dotted" )
, inner.horizontal = borderProperties( color = "#EDBD3E", style = "none" )
, outer.vertical = borderProperties( color = "#EDBD3E", style = "solid" )
, outer.horizontal = borderProperties( color = "#EDBD3E", style = "solid" )
)
# add MyFTable into document
Expand Down

0 comments on commit 88c8fbf

Please sign in to comment.