aboutsummaryrefslogtreecommitdiff
path: root/R/tex_listing.R
diff options
context:
space:
mode:
authorJohannes Ranke <jranke@uni-bremen.de>2023-02-13 05:19:08 +0100
committerJohannes Ranke <jranke@uni-bremen.de>2023-02-13 05:19:08 +0100
commit8d1a84ac2190538ed3bac53a303064e281595868 (patch)
treeacb894d85ab7ec87c4911c355a5264a77e08e34b /R/tex_listing.R
parent51d63256a7b3020ee11931d61b4db97b9ded02c0 (diff)
parent4200e566ad2600f56bc3987669aeab88582139eb (diff)
Merge branch 'main' into custom_lsoda_call
Diffstat (limited to 'R/tex_listing.R')
-rw-r--r--R/tex_listing.R32
1 files changed, 0 insertions, 32 deletions
diff --git a/R/tex_listing.R b/R/tex_listing.R
deleted file mode 100644
index 05f662e4..00000000
--- a/R/tex_listing.R
+++ /dev/null
@@ -1,32 +0,0 @@
-#' Wrap the output of a summary function in tex listing environment
-#'
-#' This function can be used in a R markdown code chunk with the chunk
-#' option `results = "asis"`.
-#'
-#' @param object The object for which the summary is to be listed
-#' @param caption An optional caption
-#' @param label An optional label
-#' @param clearpage Should a new page be started after the listing?
-#' @export
-tex_listing <- function(object, caption = NULL, label = NULL,
- clearpage = TRUE) {
- cat("\n")
- cat("\\begin{listing}", "\n")
- if (!is.null(caption)) {
- cat("\\caption{", caption, "}", "\n", sep = "")
- }
- if (!is.null(label)) {
- cat("\\caption{", label, "}", "\n", sep = "")
- }
- cat("\\begin{snugshade}", "\n")
- cat("\\scriptsize", "\n")
- cat("\\begin{verbatim}", "\n")
- cat(capture.output(suppressWarnings(summary(object))), sep = "\n")
- cat("\n")
- cat("\\end{verbatim}", "\n")
- cat("\\end{snugshade}", "\n")
- cat("\\end{listing}", "\n")
- if (clearpage) {
- cat("\\clearpage", "\n")
- }
-}

Contact - Imprint