Skip to content

Commit

Permalink
add fontsize to template, see #2
Browse files Browse the repository at this point in the history
  • Loading branch information
Romain Lesur committed Jul 23, 2018
1 parent aa76fea commit 0969cb1
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 2 deletions.
10 changes: 9 additions & 1 deletion inst/rmarkdown/templates/wpdf_document/skeleton/skeleton.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,10 @@ The `papersize` variable control the size of the pages. You can use:
You can add `landscape` for orientation, for instance: `"a5 landscape"`.
- a customized size: `"4in 6in"`...

### Font size

The `fontsize` variable control the main size of the font for the document. Its default value is `11pt`.

## Built-in classes

The `weasydoc::wpdf_document` provides a set of built-in classes. They can be overridden with a customized `CSS` style.
Expand All @@ -38,7 +42,11 @@ You can add the class `portrait` or `landscape` to change the orientation.

For instance, the following `data.frame` will be print in landscape mode.

```{r class.output="landscape"}
`r ''````{r echo=FALSE, class.output="landscape"}
mtcars
```

```{r echo=FALSE, class.output="landscape"}
mtcars
```

Expand Down
5 changes: 4 additions & 1 deletion inst/templates/default/default.html
Original file line number Diff line number Diff line change
Expand Up @@ -29,11 +29,14 @@
</style>
$endif$
<style type="text/css">
@page {$if(papersize)$size: $papersize$;$endif$}
@page {size: $if(papersize)$$papersize$$else$a4$endif$;}
@page portrait {size: portrait;}
.portrait {page: portrait;}
@page landscape {size: landscape;}
.landscape {page: landscape;}
@media print {
html {font-size: $if(fontsize)$$fontsize$$else$11pt$endif$;}
}
</style>
$for(css)$
<link rel="stylesheet" href="$css$" />
Expand Down

0 comments on commit 0969cb1

Please sign in to comment.