første commit
This commit is contained in:
commit
a228eb6d8e
41
Makefile
Normal file
41
Makefile
Normal 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
23
README.org
Normal 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
9
init.el
Normal 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}"))))
|
Loading…
Reference in New Issue
Block a user