Skip to content

Commit

Permalink
fix tables
Browse files Browse the repository at this point in the history
  • Loading branch information
Flavjack committed Sep 16, 2024
1 parent dbd49ee commit 1894a27
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 10 deletions.
4 changes: 2 additions & 2 deletions CRAN-SUBMISSION
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
Version: 0.6.6
Date: 2024-09-03 16:31:15 UTC
SHA: c821b18b209c6d34cec6a7fe23e2a1be5bc73310
Date: 2024-09-03 17:40:42 UTC
SHA: 91e1cf0d80df358a541e5b886d28b20bde1f97d4
5 changes: 5 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,11 @@
- Include lattice
- Include LCD

# inti 0.6.7

- Rticles
- Fix table conversion when only is present one table

# inti 0.6.6

- Package
Expand Down
17 changes: 9 additions & 8 deletions R/gdoc2qmd.R
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,8 @@ gdoc2qmd <- function(file
)) %>%
tidyr::fill(., .data$group, .direction = "up") %>%
dplyr::mutate(group = case_when(
group %in% NA ~ 1
is.na(.data$group) ~ 1
, .default = .data$group
)) %>%
split(.$group) %>%
purrr::map_dfr(~ slice(.data = ., c(n(), 1:(n()-1)))) %>%
Expand Down Expand Up @@ -171,13 +172,13 @@ gdoc2qmd <- function(file

}
} %>%
tibble::add_row(value = "\\newpage", .before = which(grepl("statements and declarations$", .$value, ignore.case = TRUE))) %>%
tibble::add_row(value = "\\newpage", .before = which(grepl("# abstract$", .$value, ignore.case = TRUE))) %>%
tibble::add_row(value = "\\newpage", .before = which(grepl("# introduction$", .$value, ignore.case = TRUE))) %>%
tibble::add_row(value = "\\newpage", .before = which(grepl("# materials and methods$", .$value, ignore.case = TRUE))) %>%
tibble::add_row(value = "\\newpage", .before = which(grepl("# results$", .$value, ignore.case = TRUE))) %>%
tibble::add_row(value = "\\newpage", .before = which(grepl("# discussion$", .$value, ignore.case = TRUE))) %>%
tibble::add_row(value = "\\newpage", .before = which(grepl("# references$", .$value, ignore.case = TRUE))) %>%
tibble::add_row(value = "\\newpage", .before = which(grepl("statements and declarations", .$value, ignore.case = TRUE))) %>%
tibble::add_row(value = "\\newpage", .before = which(grepl("# abstract", .$value, ignore.case = TRUE))) %>%
tibble::add_row(value = "\\newpage", .before = which(grepl("# introduction", .$value, ignore.case = TRUE))) %>%
tibble::add_row(value = "\\newpage", .before = which(grepl("# materials and methods", .$value, ignore.case = TRUE))) %>%
tibble::add_row(value = "\\newpage", .before = which(grepl("# results", .$value, ignore.case = TRUE))) %>%
tibble::add_row(value = "\\newpage", .before = which(grepl("# discussion", .$value, ignore.case = TRUE))) %>%
tibble::add_row(value = "\\newpage", .before = which(grepl("# references", .$value, ignore.case = TRUE))) %>%
{
if (any(grepl(pattern = '# abstract', x = .$value, ignore.case = TRUE))) {
tibble::add_row(.data = ., value = paste(tt, "\n\n"),
Expand Down

0 comments on commit 1894a27

Please sign in to comment.