davidgohel / ReporteRs

Note that ReporteRs has been removed from CRAN the 16th of July 2018 and is not maintained anymore. please migrate to officer.
245 stars 44 forks source link

addTOC: How can I update the TOC in a template for a new document? #191

Closed minghao-wu closed 7 years ago

minghao-wu commented 7 years ago

Hi there,

Here is my problem.

I have a template created by ReporteRs. Now I want to update components in this template by locating bookmarks.

I tried to locate the TOC by bookmark and update the TOC for the new document, but the new TOC is always attached to the end of the document and the pre-defined TOC remains same.

I am not allowed to post my code here, and here is my sessionInfo: `

sessionInfo() R version 3.3.3 (2017-03-06) Platform: x86_64-apple-darwin13.4.0 (64-bit) Running under: macOS Sierra 10.12.4

locale: [1] en_US.UTF-8/en_US.UTF-8/en_US.UTF-8/C/en_US.UTF-8/en_US.UTF-8

attached base packages: [1] stats graphics grDevices utils datasets methods base

other attached packages: [1] reshape2_1.4.2 plyr_1.8.4 lubridate_1.6.0 stringr_1.2.0
[5] jpeg_0.1-8 dplyr_0.5.0 ggplot2_2.2.1 ReporteRs_0.8.8
[9] ReporteRsjars_0.0.2

loaded via a namespace (and not attached): [1] Rcpp_0.12.10 knitr_1.15.1 xml2_1.1.1 magrittr_1.5 munsell_0.4.3
[6] xtable_1.8-2 colorspace_1.3-2 R6_2.2.0 tools_3.3.3 grid_3.3.3
[11] gtable_0.2.0 png_0.1-7 rvg_0.1.3 R.oo_1.21.0 DBI_0.6-1
[16] htmltools_0.3.5 lazyeval_0.2.0 digest_0.6.12 assertthat_0.2.0 tibble_1.3.0
[21] shiny_1.0.1 rJava_0.9-8 officer_0.1.1 purrr_0.2.2 base64enc_0.1-3
[26] R.utils_2.5.0 mime_0.5 stringi_1.1.5 gdtools_0.1.4 scales_0.4.1
[31] R.methodsS3_1.7.1 httpuv_1.3.3
`

davidgohel commented 7 years ago

Hi

That's because addTOC does not handle bookmark argument.

If are new to ReporteRs, go to officer instead, this will be a feature of the next cran release.

David

minghao-wu commented 7 years ago

@davidgohel Thanks David.

then, my further question is, how can i adapt the pre-defined TOC in the template for my new documents?

Or, does your last reply indicate that I am unable to adapt the pre-defined TOC?

BTW, what's your plan for next cran release of ReporteRs?

Thank you again.

Minghao

davidgohel commented 7 years ago

Unfortunately, you can't (unless you decide to use officer instead)

There is no plan to release a new version for now.

++ David