diff --git a/DESCRIPTION b/DESCRIPTION index ddd19c7..9539a7d 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,7 +1,7 @@ Package: latexpdf Type: Package Title: Convert Tables to PDF or PNG -Version: 0.1.7 +Version: 0.1.8 Author: Tim Bergsma Maintainer: Tim Bergsma Description: Converts table-like objects to stand-alone PDF or PNG. @@ -17,8 +17,8 @@ Description: Converts table-like objects to stand-alone PDF or PNG. e.g. . License: GPL-3 Encoding: UTF-8 -RoxygenNote: 7.1.1 +RoxygenNote: 7.2.3 NeedsCompilation: no -Packaged: 2021-08-17 18:02:01 UTC; tim.bergsma +Packaged: 2023-12-19 18:00:40 UTC; tim.bergsma Repository: CRAN -Date/Publication: 2021-08-17 18:40:02 UTC +Date/Publication: 2023-12-19 18:30:02 UTC diff --git a/MD5 b/MD5 index 6476668..e3c818b 100644 --- a/MD5 +++ b/MD5 @@ -1,39 +1,39 @@ -0bcfe844ce7b4075e2a5d7ec0ff0ee04 *DESCRIPTION +75e49e8d422fd74a62cb94e4054e533e *DESCRIPTION a0d0d58a3dd125a3f5c46cd6de6b869e *NAMESPACE -0def9c880c0a23309be5f9f0ab6123a1 *R/document.R +b6cd276055298c62b2c17ddfc3adc385 *R/document.R f8601cb3a01ebb27ed8a30d23f6e6e33 *R/latex.R 4a9c26f96134250e03a43554cd497534 *R/latexpdf.R 7572305af443bbbe257552c3510bbf45 *R/ltable.R -e1a9b659746ef17a1b163c58ab77884d *R/pdf.R +2e4d2be802301e085e9789284c1178c4 *R/pdf.R 09c238cb4b35f3bfd6731ccd42110212 *R/pdfdataframe.R 82a1d91782acf2408e40bf779e63accf *R/png.R c860b7e5c8467477a9c4313286473b34 *R/reserve.R 5453421e323775f4286457020847ca34 *R/tabular.R b170ba140e51301bce6ad35b64c11f98 *R/util.R -6318334ebc5b6f56c988fe2476c81f4b *build/vignette.rds -68c122d752a4b4d68b5ae8be751cebc4 *inst/doc/tabular.R -42da481913d07122d6ba7955371fa553 *inst/doc/tabular.Rnw -21cf0135ccf04b1dcd618e1111c5aad4 *inst/doc/tabular.pdf -610724cf55132201989878ad6b44b982 *man/as.document.Rd -bc22c94da46431c929ca2f60de791032 *man/as.ltable.Rd -1b3097e10ba60649a20490b819729f73 *man/as.pdf.Rd +104ce350dd7dfe04af20f276cdd728de *build/vignette.rds +51ef1b960e9a2f29121cedad56f19078 *inst/doc/tabular.R +fa549fe43a19489502f852ee11a637a7 *inst/doc/tabular.Rnw +f2641a033d1835a2f7960c8b6405d1b3 *inst/doc/tabular.pdf +34ce2491ef3f20e44c2a69925f6a13bc *man/as.document.Rd +c723d4d19bff874731cb9a3c2ede845a *man/as.ltable.Rd +223cf5f17d392f0a371da63ffdcb5c18 *man/as.pdf.Rd fd0c3ff4caf17f1839d69a3b43c1e51f *man/as.pdf.data.frame.Rd -7237829a5059b9f03a2834022d21a4f7 *man/as.png.Rd +f7bac53db8e28572ebcd56e23c50f72c *man/as.png.Rd 1bcb368b59a6b9834a7e22fdee635d7f *man/as.png.data.frame.Rd -929504d1ec659662d9098e2a7143f758 *man/as.tabular.Rd +6fb44d0d4a3633446a2b09a6e3b03151 *man/as.tabular.Rd 7f667960189dbd5fecf687671296c567 *man/breaks.Rd 10d30063d90be091188c6c5e0b00bc3e *man/command.Rd f6c3311f2e19708f6a5ed3696e3ddb38 *man/ghostconvert.Rd a4bc227d6459c1d0c24616822df6441f *man/latexpdf-package.Rd -424d53cb69bd60095a2a1766ff8557d7 *man/makePreamble.Rd +a44e3f5de55ed07a629fb83e171b7ebf *man/makePreamble.Rd bcf0ff091acab2f1c6add6e1815c179f *man/reserve.Rd 061972118f190317b0daa86eafec6530 *man/reserve.character.Rd e3302a9747bba24601b79dfd265a4692 *man/reserve.data.frame.Rd bd07e118f192b4d1eafc7be303e3a53f *man/reserve.default.Rd 62c5dfeeacf65fb7432de752d990bcd4 *man/reserve.factor.Rd 436741bc9751db61691105d613278d2b *man/reserve.list.Rd -1c76b0b8ad33a99b54908c83e1dfd0a3 *man/tex2pdf.Rd +0bfee9cf407cf30256a98bcd272edec8 *man/tex2pdf.Rd 26c574b8bc6d382adf3b82a7e07fb402 *man/tex2png.Rd 66076902a9d661098a3790d7c336c712 *man/viewtex.Rd 61384c34bbd1ba80eabe65dbc8d409af *man/wrap.Rd -42da481913d07122d6ba7955371fa553 *vignettes/tabular.Rnw +fa549fe43a19489502f852ee11a637a7 *vignettes/tabular.Rnw diff --git a/R/document.R b/R/document.R index 70dff85..f89e0ee 100644 --- a/R/document.R +++ b/R/document.R @@ -33,7 +33,10 @@ makePreamble <- function( geoTop = '1mm', geoBottom = '1mm', documentclass = command('documentclass',args='article'), - xcolorPackage = command('usepackage',options=list('usenames','dvispnames','svgnames','table'),args='xcolor'), + xcolorPackage = command('usepackage',options=list( + # 'usenames', 2023-12-18 usenames obsolete + 'dvipsnames', + 'svgnames','table'),args='xcolor'), geometryPackage = command('usepackage',options=list(left=geoLeft,top=geoTop,bottom=geoBottom,right=geoRight),args='geometry'), geometry = command('geometry',args=list(paste0('papersize=',paste0('{',wide,'mm',',',long,'mm}')))), multirow = command('usepackage',args='multirow'), diff --git a/R/pdf.R b/R/pdf.R index 9afd13f..4fa568b 100644 --- a/R/pdf.R +++ b/R/pdf.R @@ -79,9 +79,11 @@ as.pdf.character <- function(x,stem,...)as.pdf(as.document(x,...),stem=stem,...) #' @return invisible vector of paths to created files #' #' @examples +#' \dontrun{ #' file <- file.path(tempdir(),'test.tex') #' writeLines(as.ltable(head(Theoph)), file) #' tex2pdf(file) +#' } tex2pdf <- function( x, stem=NULL, diff --git a/build/vignette.rds b/build/vignette.rds index 8259b33..aa214a8 100644 Binary files a/build/vignette.rds and b/build/vignette.rds differ diff --git a/inst/doc/tabular.R b/inst/doc/tabular.R index 3146790..a4f4391 100644 --- a/inst/doc/tabular.R +++ b/inst/doc/tabular.R @@ -13,44 +13,44 @@ x ################################################### -### code chunk number 2: tabular.Rnw:73-75 +### code chunk number 2: tabular.Rnw:75-77 ################################################### library(latexpdf) writeLines(as.ltable(x)) ################################################### -### code chunk number 3: tabular.Rnw:77-78 +### code chunk number 3: tabular.Rnw:79-80 ################################################### writeLines(as.ltable(x,environments=NULL)) ################################################### -### code chunk number 4: tabular.Rnw:80-81 +### code chunk number 4: tabular.Rnw:82-83 ################################################### writeLines(as.ltable(x,caption='Plasma Concentrations',label='pctab')) ################################################### -### code chunk number 5: tabular.Rnw:83-84 +### code chunk number 5: tabular.Rnw:85-86 ################################################### writeLines(as.ltable(x,caption='Plasma Concentrations',cap.top=FALSE)) ################################################### -### code chunk number 6: tabular.Rnw:86-87 +### code chunk number 6: tabular.Rnw:88-89 ################################################### writeLines(as.ltable(x,grid=TRUE,caption='grid is TRUE')) ################################################### -### code chunk number 7: tabular.Rnw:89-90 +### code chunk number 7: tabular.Rnw:91-92 ################################################### writeLines(as.ltable(x,grid=TRUE,caption='Includes Walls',walls=1,rules=c(1,2,1))) ################################################### -### code chunk number 8: tabular.Rnw:92-95 +### code chunk number 8: tabular.Rnw:94-97 ################################################### writeLines(as.ltable(x,grid=TRUE,caption='Custom Breaks', colbreaks=c(0,2,0),rowgroups=x$subject @@ -58,7 +58,7 @@ writeLines(as.ltable(x,grid=TRUE,caption='Custom Breaks', ################################################### -### code chunk number 9: tabular.Rnw:97-100 +### code chunk number 9: tabular.Rnw:99-102 ################################################### writeLines(as.ltable(x,grid=TRUE,caption='Custom Justify', numjust='left',charjust='right' @@ -66,7 +66,7 @@ writeLines(as.ltable(x,grid=TRUE,caption='Custom Justify', ################################################### -### code chunk number 10: tabular.Rnw:101-104 +### code chunk number 10: tabular.Rnw:103-106 ################################################### writeLines(as.ltable(x,grid=TRUE,caption='Decimal Align', justify=c('center','left','right','decimal') @@ -74,7 +74,7 @@ writeLines(as.ltable(x,grid=TRUE,caption='Decimal Align', ################################################### -### code chunk number 11: tabular.Rnw:105-109 +### code chunk number 11: tabular.Rnw:107-111 ################################################### writeLines(as.ltable(x,grid=TRUE,caption='Not Verbatim', justify=c('center','left','right','decimal'), @@ -83,7 +83,7 @@ writeLines(as.ltable(x,grid=TRUE,caption='Not Verbatim', ################################################### -### code chunk number 12: tabular.Rnw:110-114 +### code chunk number 12: tabular.Rnw:112-116 ################################################### writeLines(as.ltable(x,grid=TRUE,caption='Custom Column Width', justify=c('center','left','right','decimal'), @@ -92,13 +92,13 @@ writeLines(as.ltable(x,grid=TRUE,caption='Custom Column Width', ################################################### -### code chunk number 13: tabular.Rnw:115-116 +### code chunk number 13: tabular.Rnw:117-118 ################################################### writeLines(as.ltable(x,caption='Row Colors',rowcolors=c('white','lightgray'))) ################################################### -### code chunk number 14: tabular.Rnw:118-127 +### code chunk number 14: tabular.Rnw:120-129 ################################################### writeLines( as.ltable( @@ -112,7 +112,7 @@ writeLines( ################################################### -### code chunk number 15: tabular.Rnw:129-136 +### code chunk number 15: tabular.Rnw:131-138 ################################################### writeLines( as.ltable( @@ -124,7 +124,7 @@ writeLines( ################################################### -### code chunk number 16: tabular.Rnw:138-148 +### code chunk number 16: tabular.Rnw:140-150 ################################################### writeLines( as.ltable( diff --git a/inst/doc/tabular.Rnw b/inst/doc/tabular.Rnw index d476ae0..7e68a2f 100644 --- a/inst/doc/tabular.Rnw +++ b/inst/doc/tabular.Rnw @@ -23,6 +23,8 @@ \usepackage{graphicx} \usepackage{tocbibind} \usepackage[parfill]{parskip} % Activate to begin paragraphs with an empty line rather than an indent +% tinytex::parse_packages(files = 'upgreek.sty') +% tinytex::tlmgr_install('was') \usepackage{upgreek} \usepackage{textpos} \usepackage{relsize} diff --git a/inst/doc/tabular.pdf b/inst/doc/tabular.pdf index 7895164..706a187 100644 Binary files a/inst/doc/tabular.pdf and b/inst/doc/tabular.pdf differ diff --git a/man/as.document.Rd b/man/as.document.Rd index a6da9c7..0326461 100644 --- a/man/as.document.Rd +++ b/man/as.document.Rd @@ -120,11 +120,11 @@ Coerces to LaTeX document from data.frame. } \section{Methods (by class)}{ \itemize{ -\item \code{character}: character method +\item \code{as.document(character)}: character method -\item \code{data.frame}: data.frame method -}} +\item \code{as.document(data.frame)}: data.frame method +}} \examples{ as.document(head(Theoph)) } diff --git a/man/as.ltable.Rd b/man/as.ltable.Rd index 2f0800d..93c3ada 100644 --- a/man/as.ltable.Rd +++ b/man/as.ltable.Rd @@ -79,13 +79,13 @@ Extra arguments(\dots) are passed to \code{\link{as.tabular}}. } \section{Methods (by class)}{ \itemize{ -\item \code{data.frame}: data.frame method +\item \code{as.ltable(data.frame)}: data.frame method -\item \code{table}: table method +\item \code{as.ltable(table)}: table method -\item \code{matrix}: matrix method -}} +\item \code{as.ltable(matrix)}: matrix method +}} \examples{ as.ltable(head(Theoph)) as.ltable(table(1:3,4:6)) diff --git a/man/as.pdf.Rd b/man/as.pdf.Rd index 3920a92..7eb51bd 100644 --- a/man/as.pdf.Rd +++ b/man/as.pdf.Rd @@ -50,11 +50,11 @@ Coerces character to document and then to PDF. Extra arguments passed to \code{\ } \section{Methods (by class)}{ \itemize{ -\item \code{document}: document method +\item \code{as.pdf(document)}: document method -\item \code{character}: character method -}} +\item \code{as.pdf(character)}: character method +}} \seealso{ \code{\link{as.pdf.character}} diff --git a/man/as.png.Rd b/man/as.png.Rd index f5606fa..548e039 100644 --- a/man/as.png.Rd +++ b/man/as.png.Rd @@ -44,11 +44,11 @@ Coerces character to document, PDF, and then PNG. Extra arguments passed to \cod } \section{Methods (by class)}{ \itemize{ -\item \code{document}: document method +\item \code{as.png(document)}: document method -\item \code{character}: character method -}} +\item \code{as.png(character)}: character method +}} \seealso{ \code{\link{as.png.character}} diff --git a/man/as.tabular.Rd b/man/as.tabular.Rd index bc4124e..a56188f 100644 --- a/man/as.tabular.Rd +++ b/man/as.tabular.Rd @@ -124,13 +124,13 @@ Coerces to tabular from matrix. } \section{Methods (by class)}{ \itemize{ -\item \code{data.frame}: data.frame method +\item \code{as.tabular(data.frame)}: data.frame method -\item \code{table}: table method +\item \code{as.tabular(table)}: table method -\item \code{matrix}: matrix method -}} +\item \code{as.tabular(matrix)}: matrix method +}} \examples{ as.tabular(head(Theoph)) as.tabular(table(1:3,4:6)) diff --git a/man/makePreamble.Rd b/man/makePreamble.Rd index 14afa59..645ea7b 100644 --- a/man/makePreamble.Rd +++ b/man/makePreamble.Rd @@ -13,12 +13,12 @@ makePreamble( geoTop = "1mm", geoBottom = "1mm", documentclass = command("documentclass", args = "article"), - xcolorPackage = command("usepackage", options = list("usenames", "dvispnames", - "svgnames", "table"), args = "xcolor"), + xcolorPackage = command("usepackage", options = list("dvipsnames", "svgnames", + "table"), args = "xcolor"), geometryPackage = command("usepackage", options = list(left = geoLeft, top = geoTop, bottom = geoBottom, right = geoRight), args = "geometry"), - geometry = command("geometry", args = list(paste0("papersize=", paste0("{", wide, - "mm", ",", long, "mm}")))), + geometry = command("geometry", args = list(paste0("papersize=", paste0("{", wide, "mm", + ",", long, "mm}")))), multirow = command("usepackage", args = "multirow"), float = command("usepackage", args = "float"), longtable = command("usepackage", args = "longtable"), diff --git a/man/tex2pdf.Rd b/man/tex2pdf.Rd index aadc632..9f93180 100644 --- a/man/tex2pdf.Rd +++ b/man/tex2pdf.Rd @@ -26,10 +26,12 @@ invisible vector of paths to created files Converts TEX to PDF. \code{tex2pdf} accepts the file names of TEX fragments. It reads those fragments, wraps them like documents and makes PDF files. } \examples{ +\dontrun{ file <- file.path(tempdir(),'test.tex') writeLines(as.ltable(head(Theoph)), file) tex2pdf(file) } +} \seealso{ \code{\link{as.pdf.character}} diff --git a/vignettes/tabular.Rnw b/vignettes/tabular.Rnw index d476ae0..7e68a2f 100644 --- a/vignettes/tabular.Rnw +++ b/vignettes/tabular.Rnw @@ -23,6 +23,8 @@ \usepackage{graphicx} \usepackage{tocbibind} \usepackage[parfill]{parskip} % Activate to begin paragraphs with an empty line rather than an indent +% tinytex::parse_packages(files = 'upgreek.sty') +% tinytex::tlmgr_install('was') \usepackage{upgreek} \usepackage{textpos} \usepackage{relsize}