3

I am using pander to print nicer looking tables via RStudio, knitr, pander, pandoc, Word. I have a two-page table, to which I would like to add a Spanish caption:

set.caption("Límites izquierdo y derecho para las diferentes variables")
pander(LimitesUnivariado, include.rownames=FALSE)

This almost works, but my caption states:

Table: Límites izquierdo y derecho para las diferentes variables (continued below)

I can't find find the way to change the Table and continued below to their Spanish equivalents. Does anybody know how to do it?

Charles
  • 50,943
  • 13
  • 104
  • 142
ap53
  • 783
  • 2
  • 8
  • 19
  • Looking at [the code](https://github.com/Rapporter/pander/blob/master/R/helpers.R) it seems that those are hard-coded in. The package author @daroczig frequents SO though so he'll probably see this at some point. You might want to submit an issue [here](https://github.com/Rapporter/pander/issues) though. – Dason Mar 31 '13 at 23:45
  • @dason I've submitted the issue, thank you! – ap53 Apr 01 '13 at 11:32
  • Thanks @ap53 for the question, I will definitely add a new option in `pander` package to update the `continued below` hardcoded string to anything in the next few days (hopefully in 24 hours) - although not sure about letting users update the `Table:` prefix as that is part of Pandoc syntax: http://johnmacfarlane.net/pandoc/README.html#tables PS: I have added the `pander` tag to the question – daroczig Apr 01 '13 at 16:33

1 Answers1

4

Thank you for reporting this issue on GitHub, I have just pushed a few lines to the master branch which introduced two new options to tweak the caption if the table was split. Quick example:

  1. Update the default caption of split tables without specified captions:

    > panderOptions('table.continues', 'Continuará')
    > pander(mtcars)
    
  2. Update affix concatenated to user specified caption if the table was split:

    > panderOptions('table.continues.affix', '(continuará)')
    > set.caption('MTCARS')
    > pander(mtcars)
    

Please install the most recent version of pander and verify if this update would work for you - and sorry for the above lame examples, please note that unfortunately I do not speak Spanish.

PS: I have not touched the Table: prefix as that seems to be specified in Pandoc's syntax which is to be removed by Pandoc automatically anyway when the conversion to some other document format is being done: please see the relevant docs. But if you would find a new options about this latter too, I would happily add that to the package in a jiffy.

daroczig
  • 28,004
  • 7
  • 90
  • 124
  • It works! Thank you for the quick answer. I can live with the Table issue ;-) – ap53 Apr 01 '13 at 19:14
  • The `relevant docs` state: ``` A caption is a paragraph beginning with the string Table: (or just :), which will be stripped off. ``` Do you think an option to just use ':' would work? – ap53 Apr 01 '13 at 19:21
  • 1
    Sure, please check the new `table.caption.prefix` option, @ap53: https://github.com/Rapporter/pander/commit/0eb5e9af9ce8744c937caeef3060596b99cf3179 – daroczig Apr 01 '13 at 22:21
  • It works as well. Initially I thought I needed to use ':' as prefix, but pandoc didn't strip it in the docx. So I tried a spanish 'Tabla: ' and it came out great. Thanks again! – ap53 Apr 02 '13 at 00:22