From 6c2d02b8e06428044168c305c09834acee8211ff Mon Sep 17 00:00:00 2001 From: Michael Beck Date: Wed, 10 Dec 2025 16:47:38 +0100 Subject: [PATCH] Moves output format setting to makefile. Adds Readme. --- Makefile | 21 +++++++++++++++++++++ README.md | 1 + index.qmd | 5 ++++- 3 files changed, 26 insertions(+), 1 deletion(-) create mode 100644 Makefile create mode 100644 README.md diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..f030757 --- /dev/null +++ b/Makefile @@ -0,0 +1,21 @@ +QUARTO = quarto +QMD = index.qmd + +all: pdf docx + +# PDF + +pdf: OUTPUT_FORMAT = pdf/tex +pdf: index.pdf + +index.pdf: $(QMD) + OUTPUT_FORMAT="$(OUTPUT_FORMAT)" $(QUARTO) render $(QMD) --to pdf + +# DOCX + +docx: OUTPUT_FORMAT = docx +docx: index.docx + +index.docx: $(QMD) + OUTPUT_FORMAT="$(OUTPUT_FORMAT)" $(QUARTO) render $(QMD) --to docx + diff --git a/README.md b/README.md new file mode 100644 index 0000000..2ef7d92 --- /dev/null +++ b/README.md @@ -0,0 +1 @@ +This repository contains the quarto project for the article "Mining Transparency: Assessing Open Science Practices in Crime Research Over Time Using Machine Learning". \ No newline at end of file diff --git a/index.qmd b/index.qmd index 2e63057..a52b574 100644 --- a/index.qmd +++ b/index.qmd @@ -24,7 +24,10 @@ source("deps.R") # possible formats: # - docx # - pdf/tex -output_format <- "pdf/tex" + +# Read OUTPUT_FORMAT from env; default to "pdf/tex" +output_format <- Sys.getenv("OUTPUT_FORMAT", "pdf/tex") +# Background: some tables needs special treatment for docx rendering. # Debug Mode debug_mode <- TRUE