første commit

This commit is contained in:
Christoffer Müller Madsen 2017-10-03 23:52:55 +02:00
commit a228eb6d8e
4 changed files with 80 additions and 0 deletions

41
Makefile Normal file
View File

@ -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/

23
README.org Normal file
View File

@ -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

9
init.el Normal file
View File

@ -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}"))))

7
setup.org Normal file
View File

@ -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}