Use this function to export your (pre)registration specification to a PDF file. To embed it in an R Markdown file, use prereg_knit_item_content() instead.

prereg_spec_to_pdf(
  x,
  file,
  author = NULL,
  section = NULL,
  headingLevel = 1,
  silent = preregr::opts$get("silent")
)

Arguments

x

The (pre)registration object (as produced by a call to prereg_initialize()).

file

The filename to save the (pre)registration to.

author

The author to specify in the PDF.

section

Optionally, one or multiple sections to include (if NULL, all sections are included).

headingLevel

The level of the top-most headings.

silent

Whether to be silent or chatty.

Value

x, invisibly

Examples

# \donttest{
### Use a temporary file to write to
tmpFile <- tempfile(fileext = ".pdf");

### Load an example (pre)registration specification
data("examplePrereg_1", package = "preregr");

preregr::prereg_spec_to_pdf(
  examplePrereg_1,
  file = tmpFile
);
#> Warning: unable to load shared object '/usr/local/lib/R/modules//R_X11.so':
#>   libXt.so.6: cannot open shared object file: No such file or directory
#> Exported the (pre)registration specification to PDF file '/tmp/RtmpGT6HDs/file6021d622592.pdf'.
# }