Commit 0652099a authored by Knut Wenzig's avatar Knut Wenzig
Browse files

füge zusätzlichen LaTeX-Lauf ein

parent ecc6e56f
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
# #
# - aktuelles Repository additional metadata # - aktuelles Repository additional metadata
# https://gitlab.soep.de/kwenzig/additionalmetadata # https://gitlab.soep.de/kwenzig/additionalmetadata
library(xlsx) # library(xlsx)
library(foreign) library(foreign)
library(dortools) library(dortools)
# Pfade # Pfade
...@@ -14,20 +14,25 @@ library(dortools) ...@@ -14,20 +14,25 @@ library(dortools)
# Das steuert alles # Das steuert alles
############################## ##############################
# Ordner mit codebook.csv # Ordner mit codebook.csv
codebookcsvpath <- "D:/lokal/piaac-l-2014/Metadata/datasets/ZA5989_Persons_14/"
codebookcsvpath <- "D:/lokal/core-doku/v31/datasets/health/" codebookcsvpath <- "D:/lokal/core-doku/v31/datasets/health/"
codebookcsvpath <- "D:/lokal/core-doku/v31/datasets/behgen/"
codebookcsvpath <- "D:/lokal/dokumentation_fams/datasets/bep_mig/" codebookcsvpath <- "D:/lokal/dokumentation_fams/datasets/bep_mig/"
codebookcsvpath <- "D:/lokal/piaac-l-2014/Metadata/datasets/ZA5989_Household_14/" codebookcsvpath <- "D:/lokal/piaac-l-2014/Metadata/datasets/ZA5989_Household_14/"
distribution <- "2016" codebookcsvpath <- paste0("D:/lokal/core-doku/v31/datasets/", dtan, "/")
codebookcsvpath <- "D:/lokal/core-doku/v31/datasets/bepgen/"
codebookcsvpath <- "D:/lokal/dokumentation_fams/datasets/bep_mig/"
codebookcsvpath <- "D:/lokal/dokumentation_fams/datasets/bioagel/"
codebookcsvpath <- "D:/lokal/piaac-l-2014/Metadata/datasets/ZA5989_Persons_14/"
codebookcsvpath <- "D:/lokal/piaac-l-2014/Metadata/datasets/ZA5989_Registry/"
distribution <- "2014"
language <- "en" language <- "en"
allow.markdown <- FALSE allow.markdown <- TRUE
collapse.variable.groups <- TRUE collapse.variable.groups <- TRUE
calc.abs.frequencies <- TRUE # TRUE: show only all value labels without frequencies calc.abs.frequencies <- TRUE # TRUE: show only all value labels without frequencies
omit.unlabeled.values <- TRUE # if only_labeled_vals==1 omit.unlabeled.values <- TRUE # if only_labeled_vals==1
optimize.tables <- TRUE optimize.tables <- TRUE
restrict.questions <- FALSE # Anzeige der Fragen begrenzen (unique Fragen im letzten Jahr) restrict.questions <- FALSE # Anzeige der Fragen begrenzen (unique Fragen im letzten Jahr)
display.question.id <- TRUE display.question.id <- FALSE
do.xelatex <- TRUE # LaTeX-Lauf starten do.xelatex <- TRUE # LaTeX-Lauf starten
rename.pdf <- TRUE # pdf>questionnaire umbenennen do.xelatex=T rename.pdf <- TRUE # pdf>questionnaire umbenennen do.xelatex=T
...@@ -223,7 +228,7 @@ questionnaires.csv <- read.csv(paste0(meta.path, "questionnaires.csv"), ...@@ -223,7 +228,7 @@ questionnaires.csv <- read.csv(paste0(meta.path, "questionnaires.csv"),
titles.csv <- read.csv(paste0(addpath, "titles.csv"), titles.csv <- read.csv(paste0(addpath, "titles.csv"),
colClasses="character",encoding="UTF-8") colClasses="character",encoding="UTF-8")
# Export titel-file für Weitergabe # Export titel-file für Weitergabe
write.xlsx(titles.csv, paste0(addpath, "titles_export.xls")) # write.xlsx(titles.csv, paste0(addpath, "titles_export.xls"))
# Einschränkung auf benötigte Informationen # Einschränkung auf benötigte Informationen
...@@ -371,7 +376,7 @@ TitleLaTeX <- function(study, distribution, dataset, version) { ...@@ -371,7 +376,7 @@ TitleLaTeX <- function(study, distribution, dataset, version) {
# Returns: # Returns:
# LaTeX-Snippet zur Generierung des Titels # LaTeX-Snippet zur Generierung des Titels
title.row <- min(which((titles.csv$study==study & titles.csv$distribution==distribution & title.row <- min(which((titles.csv$study==study & titles.csv$distribution==distribution &
titles.csv$dataset==dataset & titles.csv$version==version) == titles.csv$dataset==dataset.name & titles.csv$version==version) ==
TRUE)) TRUE))
title <- titles.csv$Title[title.row] title <- titles.csv$Title[title.row]
seriesno <- TeXifyStr(titles.csv$No[title.row]) seriesno <- TeXifyStr(titles.csv$No[title.row])
...@@ -397,7 +402,7 @@ TitleLaTeX <- function(study, distribution, dataset, version) { ...@@ -397,7 +402,7 @@ TitleLaTeX <- function(study, distribution, dataset, version) {
topleft <- paste0(study.label, " ", distribution) topleft <- paste0(study.label, " ", distribution)
title.latex <- "" title.latex <- ""
title.latex <- TitlePageLaTeX(language=language, topleft=topleft, topright=dataset, title.latex <- TitlePageLaTeX(language=language, topleft=topleft, topright=dataset,
title=title, subtitle="", author=author, date="", title=title, subtitle="", author=author, date=date,
bottomline=bottomline, abstract="", study=study, objectid=dataset, bottomline=bottomline, abstract="", study=study, objectid=dataset,
with.footer, running.title.only, first.page.number) with.footer, running.title.only, first.page.number)
if(language=="en"){ if(language=="en"){
...@@ -732,6 +737,7 @@ if(do.xelatex){ ...@@ -732,6 +737,7 @@ if(do.xelatex){
" ", xelatexpath, "codebook.tex") " ", xelatexpath, "codebook.tex")
log <- shell(xelatexcmd, invisible=FALSE, intern=TRUE) log <- shell(xelatexcmd, invisible=FALSE, intern=TRUE)
log <- shell(xelatexcmd, invisible=FALSE, intern=TRUE) log <- shell(xelatexcmd, invisible=FALSE, intern=TRUE)
log <- shell(xelatexcmd, invisible=FALSE, intern=TRUE)
if(rename.pdf){ if(rename.pdf){
file.copy(from=paste0(xelatexpath,"codebook.pdf"), file.copy(from=paste0(xelatexpath,"codebook.pdf"),
to=paste0(xelatexpath, to=paste0(xelatexpath,
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment