diff --git a/admin/survey/modules/mod_NIJZ/R/Nijz_report.R b/admin/survey/modules/mod_NIJZ/R/Nijz_report.R index 261c74b55..a6687a6ee 100644 --- a/admin/survey/modules/mod_NIJZ/R/Nijz_report.R +++ b/admin/survey/modules/mod_NIJZ/R/Nijz_report.R @@ -26,7 +26,7 @@ ID <- params[1] #-------------------------- USER DEFINED FUNCTION ---------------------# # Za potrebe pravilnega prikaza teksta v posameznih poglavjih -lxTranslate <- function(x, color = "NE", pisava = TRUE) { +lxTranslate <- function(x, color = "NE", pisava = TRUE, pikaklicaj = FALSE) { x <- gsub("", "\\\\\\\\textbf{", x) x <- gsub("", "}", x) x <- @@ -39,7 +39,9 @@ lxTranslate <- function(x, color = "NE", pisava = TRUE) { x <- gsub("%", "\\\\\\\\%", x) #x <- gsub("…", "\\\\\\\\dots", x) - x <- gsub("…", "...", x) + #x <- gsub("…", "", x) + + # ALI BNARVAMO? @@ -47,8 +49,12 @@ lxTranslate <- function(x, color = "NE", pisava = TRUE) { # Update, Potem pa želi NIJZ, da se prvi odstavek # vedno obarva z "zeleno barvo, zaot moramo to # utrezno ločiti + if (pikaklicaj == FALSE) { obarvajX <- stringr::str_extract(x, "[^.|!]+") - + } else { + obarvajX <- stringr::str_extract(x, "[^!]+") + + } # DOdamo barvanje obarvajX_1 <- paste0("{\\\\color{zelena}", obarvajX, "}") # Nadomestimo @@ -56,14 +62,17 @@ lxTranslate <- function(x, color = "NE", pisava = TRUE) { } if (pisava == TRUE) { val <- strsplit(x, "\\\\newline ")[[1]] - - # Gledamo tretji + # val <- val[!c(seq_along(val) %% 2 == 0)] + # Gledamo tretji odst <- val[4:length(val)] # Po drugem odstavku zmanjšamo pisavo na 9 - xsmall <- paste0("\\\\begin{footnotesize}", stringr::str_c(odst, collapse = "\\\\newline "), "\\\\end{footnotesize}") + xsmall <- paste0("\\\\begin{footnotesize}", stringr::str_c(odst, collapse = "\\\\smallskip "), "\\\\end{footnotesize}") x <- paste0(stringr::str_c(val[1:4], collapse = "\\\\newline "),xsmall) + + #x <- gsub("\\\\\\newline \\\\\\begin{footnotesize} ", "sd", x, fixed = T) + } return(x) } @@ -106,8 +115,8 @@ library(dplyr) data <- read.csv2(paste0( "modules/mod_NIJZ/temp/nijz_",ID,".csv"), sep = ";", - header = T, - fill = T, + header = FALSE, + fill = TRUE, stringsAsFactors = FALSE, encoding = "UTF-8" ) @@ -345,7 +354,7 @@ colnames(mydf) <- labels #par(col="#004078", font = 2, cex = 1.4) -par(col="#004078", font = 2, cex = 0.8, xpd = TRUE) +par(col="#004078", font = 2, cex = 1.2, xpd = TRUE) # Plot a radar chart radarchart2( mydf, @@ -360,9 +369,9 @@ radarchart2( na.itp = FALSE, plwd = 3, plty = 1, - seg = 7, + seg = 4, axistype = 1, - caxislabels = 0:7, + caxislabels = 0:4, centerzero = TRUE ) @@ -398,7 +407,7 @@ oblacila <- lxTranslate(oblacila, color = "DA") #------------------------ Poletni urnik za izvajanje aktivnosti na prostem ------------------------# solarij <- data %>% filter(str_detect(V1, "SOLARIJ")) %>% select(V2) -solarij <- lxTranslate(solarij, color = "DA") +solarij <- lxTranslate(solarij, color = "DA", pikaklicaj = TRUE) #--- diff --git a/admin/survey/modules/mod_NIJZ/latexkosi/glava-nijz.tex b/admin/survey/modules/mod_NIJZ/latexkosi/glava-nijz.tex index eefe33251..4d2821010 100644 --- a/admin/survey/modules/mod_NIJZ/latexkosi/glava-nijz.tex +++ b/admin/survey/modules/mod_NIJZ/latexkosi/glava-nijz.tex @@ -49,7 +49,7 @@ \textbf{1. Moj FOTOTIP KOŽE:} \newline \newline !varianta! -\ \\ \\ \\ \\ +\ \\ \\ \\ \begin{minipage}[t]{0.40\textwidth} \textbf{2. POLARNI GRAFIKON} \newline \hspace*{0.5cm}- grafični prikaz mojega dosedanjega \\ @@ -60,7 +60,7 @@ \begin{minipage}[t]{0.54\textwidth} \begin{figure}[H] \vspace*{-0.5cm} -\efbox{\includegraphics[width=10cm,height=8.1cm]{../results/img/radar.png}} +\efbox{\includegraphics[width=10cm,height=7.5cm]{../results/img/radar.png}} \end{figure} \end{minipage} \end{titlepage}