0

The texreg package is supposed to write tables with nicely aligned columns, using the command dcolumn = TRUE, see the user's guide for the texreg package, dated 3 March 2018. The command calls the dcolumn package, but dcolumn is not available for the current version of R (see earlier post).

Without alignment, tables generated by texreg do not look good in a PDF document compiled with knitr. (The knitr package uses the Times New Roman font family for PDF, not monospaced font.) One (not optimal) solution might be to change the font in the whole PDF to monospace. I have found no reference to changing the font family in the knitr documentation, but a post here at SO discusses it. I had no success using the suggested solution. It would anyway not be a great solution to use monospace font throughout a document that combines text and code.

So, how should users of texreg make sure tables in a document knitted to PDF have aligned columns in a table?

This question is very similar to an earlier post, but no suggestion was provided to the earlier question. It is probably important for most users of texreg to have a solution for aligning table columns after the dcolumn package has become outdated.

cibr
  • 453
  • 5
  • 16
  • 1
    Perhaps this might help somehow: https://stackoverflow.com/questions/25721884/how-should-i-deal-with-package-xxx-is-not-available-for-r-version-x-y-z-wa – jay.sf Jul 27 '18 at 20:07
  • Thanks! I'll look into that and report back here. – cibr Jul 27 '18 at 20:21
  • 1
    `dcolumn` is not at CRAN, but at CTAN and part of Latex. – cibr Jul 28 '18 at 12:06
  • maybe this could help https://stackoverflow.com/questions/50375041/dcolumn-not-available-solution-or-alternative-for-use-with-texreg – CZuC Oct 08 '18 at 11:57
  • Thank you for your suggestion. Speaking form myself, I switched to `kable` and `kableExtra`. – cibr Oct 08 '18 at 16:31

0 Answers0