2023-09-13 18:34:12 +02:00
|
|
|
# setwd("C:/Users/nwickelmaier/Nextcloud/Documents/MDS/2023ss/60100_master_thesis/code")
|
|
|
|
|
2023-09-22 16:16:20 +02:00
|
|
|
# TODO: Write an Rmd file this way and render at the end? Then put it in a
|
|
|
|
# function, so everybody can do it???
|
|
|
|
devtools::load_all("../../../../software/mtt")
|
2023-09-13 18:34:12 +02:00
|
|
|
|
2023-09-27 08:08:32 +02:00
|
|
|
fname <- "../museums/overview_artworks_8o8m.tex"
|
2023-09-13 18:34:12 +02:00
|
|
|
if (file.exists(fname)) file.remove(fname)
|
|
|
|
|
2023-09-22 16:16:20 +02:00
|
|
|
path <- "C:/Users/nwickelmaier/Nextcloud/Documents/MDS/2023ss/60100_master_thesis/data/8o8m/Content8o8m"
|
2023-09-13 18:34:12 +02:00
|
|
|
artworks <- dir(path = path)
|
|
|
|
|
2023-09-26 18:34:59 +02:00
|
|
|
dat <- extract_artworks(artworks, xmlfiles = paste0(artworks, "_de.xml"), xmlpath = path)
|
2023-09-13 18:34:12 +02:00
|
|
|
|
|
|
|
fout <- file(fname, "a") # open in append mode
|
|
|
|
|
|
|
|
writeLines("\\documentclass[a4paper,12pt]{article}", fout)
|
|
|
|
writeLines("\\usepackage{graphicx}", fout)
|
|
|
|
writeLines("\\usepackage[margin = 2cm]{geometry}", fout)
|
|
|
|
writeLines("\\author{Nora Wickelmaier}", fout)
|
2023-09-22 16:16:20 +02:00
|
|
|
writeLines("\\title{Overview of Artworks from 8 Objects 8 Museums (8o8m)}", fout)
|
2023-09-13 18:34:12 +02:00
|
|
|
writeLines("\\date{\\today}", fout)
|
|
|
|
writeLines("\\begin{document}", fout)
|
|
|
|
writeLines("\\maketitle", fout)
|
|
|
|
#writeLines("\\newpage", fout)
|
|
|
|
|
|
|
|
for (artwork in dat$artwork) {
|
|
|
|
|
|
|
|
writeLines(paste0("\\section*{Artwork Number ", artwork, "}"), fout)
|
|
|
|
writeLines("", fout)
|
|
|
|
writeLines("\\noindent", fout)
|
|
|
|
writeLines(paste0("Artist: ", dat[dat$artwork == artwork, "artist"]), fout)
|
|
|
|
writeLines("", fout)
|
|
|
|
writeLines("\\noindent", fout)
|
|
|
|
writeLines(paste0("Title: ", dat[dat$artwork == artwork, "title"]), fout)
|
|
|
|
writeLines("", fout)
|
|
|
|
|
|
|
|
writeLines("\\begin{center}", fout)
|
|
|
|
art_path <- paste(path, artwork, artwork, sep = "/")
|
|
|
|
writeLines(paste0("\\includegraphics[width = 12cm]{", art_path, "}"), fout)
|
|
|
|
writeLines("\\end{center}", fout)
|
|
|
|
writeLines("", fout)
|
|
|
|
writeLines("\\noindent", fout)
|
2023-09-14 12:29:04 +02:00
|
|
|
writeLines(paste0("Info: ", dat[dat$artwork == artwork, "misc"]), fout)
|
2023-09-13 18:34:12 +02:00
|
|
|
writeLines("\\newpage", fout)
|
|
|
|
}
|
|
|
|
|
|
|
|
writeLines("\\end{document}", fout)
|
|
|
|
close(fout)
|
|
|
|
|