From a228eb6d8ec04e7a0fdcb38d989c3456b734c86b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Christoffer=20M=C3=BCller=20Madsen?= Date: Tue, 3 Oct 2017 23:52:55 +0200 Subject: [PATCH] =?UTF-8?q?f=C3=B8rste=20commit?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Makefile | 41 +++++++++++++++++++++++++++++++++++++++++ README.org | 23 +++++++++++++++++++++++ init.el | 9 +++++++++ setup.org | 7 +++++++ 4 files changed, 80 insertions(+) create mode 100644 Makefile create mode 100644 README.org create mode 100644 init.el create mode 100644 setup.org diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..3b285dc --- /dev/null +++ b/Makefile @@ -0,0 +1,41 @@ +PDFLATEX ?= pdflatex +PDFLATEX_FLAGS ?= -halt-on-error -output-directory tmp +.PHONY: clean upload org html pdf tex + +all: org html pdf tex + +org html pdf tex: + for org in $(wildcard org/*.org); do \ + $(MAKE) `echo $$org | sed s/.org/.$@/ | sed s/org/out/`; \ + done +out tmp : + mkdir $@ + +.SECONDEXPANSION: +out/%.org out/%.tex out/%.pdf out/%.html : $$(subst out,tmp,$$@) + echo $@ + echo $< + echo $(subst out,tmp,$@) + cp $< out/ + +tmp/%.org : org/%.org | tmp + cp $< tmp/ + sed -i '1i#+SETUPFILE: ../setup.org' $@ + +tmp/%.tex : tmp/%.org | tmp + cd tmp; + emacs --batch $< -l ../init.el -f org-mode --eval '(org-latex-export-to-latex)' + +tmp/%.pdf : tmp/%.tex | tmp + $(PDFLATEX) $(PDFLATEX_FLAGS) $<; \ + $(PDFLATEX) $(PDFLATEX_FLAGS) $< + +tmp/%.html : tmp/%.org | tmp + emacs --batch $< -l ../init.el -f org-mode --eval '(org-html-export-to-html)' + +clean: + rm -r tmp + +upload: + scp -P 35284 out/* christoffer@users.guava.space:public_html/holdets_time/ + diff --git a/README.org b/README.org new file mode 100644 index 0000000..4dea6da --- /dev/null +++ b/README.org @@ -0,0 +1,23 @@ +Referatgeneratoren +================== + +Et program til effektivt at omsætte filer (særligt referater af Holdets time) i +Org-format til PDF, HTML og LaTeX. + +* Brug + +Lav mappen `org` og placér org-filerne deri. Eventuelle org-mode properties, der +ønskes sat for alle filer indsættes i `setup.org`. Emacs-kommandoer, der skal +køres før eksport til LaTeX og HTML, indsættes i `init.el`. + +Output skabes i `out`-mappen. + +* Make-mål + +- `all`: skaber PDF-, HTML-, Org- og HTML-filer for alle `.org`-filer i mappen + `org`. +- 'html': skaber HTML-filer for alle `.org`-filer i mappen `org` +- 'pdf': skaber PDF-filer for alle `.org`-filer i mappen `org` +- 'org': skaber Org-filer for alle `.org`-filer i mappen `org` +- 'tex': skaber LaTeX-filer for alle `.org`-filer i mappen `org` +- 'clean': fjerner `tmp`-mappen diff --git a/init.el b/init.el new file mode 100644 index 0000000..3f174ae --- /dev/null +++ b/init.el @@ -0,0 +1,9 @@ +(with-eval-after-load "ox-latex" + (add-to-list 'org-latex-classes + '("memoir" "\\documentclass{memoir}" + ("\\chapter{%s}" . "\\chapter*{%s}") + ("\\section{%s}" . "\\section*{%s}") + ("\\subsection{%s}" . "\\subsection*{%s}") + ("\\subsubsection{%s}" . "\\subsubsection*{%s}") + ("\\paragraph{%s}" . "\\paragraph*{%s}") + ("\\subparagraph{%s}" . "\\subparagraph*{%s}")))) diff --git a/setup.org b/setup.org new file mode 100644 index 0000000..b553ab9 --- /dev/null +++ b/setup.org @@ -0,0 +1,7 @@ +#+LANGUAGE: da +#+AUTHOR: Christoffer Müller Madsen +#+EMAIL: christoffer@guava.space +#+OPTIONS: email:t +#+LATEX_CLASS: memoir +#+LATEX_CLASS_OPTIONS: [a4paper,twoside,article] +#+LATEX_HEADER: \usepackage{ebgaramond} \chapterstyle{article}