get.pdf: Get a pdf by concatenating outputs from 'get.ggplot' and...

Description Usage Arguments Details Value Author(s) See Also Examples

Description

get.pdf generates a pdf file using LaTeX

Usage

1
2
get.pdf(dir = "./", form.name, LaTeX_head = NULL, LaTeX_body,
  compile.tex = TRUE, color1 = "white", color2 = "white")

Arguments

dir

Directory where the pdf should be created

form.name

Name of the pdf file and the folder that contains all the raw information. See details.

LaTeX_head

Path of tex file containing the head of the LaTeX document. It contains the packages and macros used in LaTeX_body. If NULL, a default LaTeX head is generated.

LaTeX_body

A list that contains the elements to be displayed in the pdf. This list must contain the following elements:

  • "titlepage": a list containing the following elements:

    • "title": the title of the document. Nothing by default.

    • "authors": the authors of the document. Nothing by default.

    • "email": the corresponding email. Nothing by default.

    • "date": the date of the document. Nothing by default.

  • "tableofcontents": if TRUE, a table of content is displayed.

  • "chapter": name of a chapter

  • "section": name of a section

  • "subsection": name of a subsection

  • "subsubsection": name of a subsubsection

  • "text": text to add

  • "includepdf": path of a .pdf to include. It includes entire document.

  • "includeimage": a list containing the following elements:

    • "content": path of image to include. It can be a pdf, png, jpeg ...

    • "caption": caption of the image

    • "width" : width of the picture in textwidth unit. 1 means the same width as the text. It is 1 by default.

  • "input": path of a .tex to insert

  • "table": a list containing the following elements:

    • "content": output from get.table

    • "caption": caption of the table

    • "landscape": If TRUE, the table is in landscape. FALSE by default.

    • "display.rownames": If TRUE, displays the row names of the table. FALSE by default.

  • "figure": a list containing the following elements:

    • "content" : output from get.ggplot

    • "caption" : caption of the figure

    • "layout" : the layout of the plots. It is a matrix under the form layout = matrix(c(1:4), ncol = 2, nrow = 2). It is layout = matrix(1, ncol = 1, nrow= 1) by default.

    • "width" : width of the figure in textwidth unit. 1 means the same width as the text. It is 1 by default.

    • "landscape" : If TRUE, the figure is in landscape. FALSE by default.

compile.tex

If TRUE compile the pdf.

color1

For table, color of the head of the table. White by default.

color2

For table, color of the row. White by default. The color of the rows is an alternation of white and color2.

Details

The function creates one folder named "form.name" (first argument of the function). This folder contains two folders: "figures" where all the pdf of the plots are stored and "tex.files" where all the .tex generated are stored. The pdf generated is moved from "./form.name/tex.files" to the current directory.

Note this function works if you have installed LaTeX and the following packages: longtable, lscape, graphicx, pdfpages, float, hyperref and fancyhdr. To download LaTeX, go to http://latex-project.org/ftp.html

Note that the argument [H] from the package float is used by default for figures and tables.

If you use LaTeX macro, do not forget to use escape mode, for example \textbf{}.

Value

The function returns a pdf which is the result of the concatenation as well as folders with raw data (see Details).

Author(s)

Pierre Riviere

See Also

get.ggplot, get.table

Examples

1
# See the vignette

priviere/shinemas2R_deprecated documentation built on May 8, 2019, 1:21 p.m.