Skip to content
Snippets Groups Projects
Commit 6add8d2c authored by Walmes Marques Zeviani's avatar Walmes Marques Zeviani
Browse files

Função para produzír labels de figuras em html.

parent ed0e4697
Branches
No related tags found
No related merge requests found
...@@ -8,6 +8,26 @@ library(knitr) ...@@ -8,6 +8,26 @@ library(knitr)
opts_chunk$set( opts_chunk$set(
dev.args=list(family = "Palatino")) dev.args=list(family = "Palatino"))
opts_knit$set(eval.after = "fig.cap")
## http://stackoverflow.com/questions/13848137/figure-captions-references-using-knitr-and-markdown-to-html
fig <- local({
i <- 0
ref <- list()
list(
cap = function(refName, text) {
i <<- i + 1
ref[[refName]] <<- i
paste("Figura ", i, ": ", text, sep = "")
},
ref = function(refName) {
ref[[refName]]
})
})
## Tipo de output necessário para saber como gerar os captions.
ishtml <- any(grepl(pattern = "^html_document",
x = readLines("_output.yaml")))
options(width = 68) options(width = 68)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment