DOCUM=present

pdf:
	pdflatex  $(DOCUM).tex 


pdfse:
	pdflatex --shell-escape golem.tex 

	
F12:
	echo "xterm -hold -e make -C $$PWD" >~/bin/F12

	
	
edit:
	make -iB archiv
	kile -title Golem makefile $(DOCUM).tex &
	konsole &
	krusader --left $$PWD &
	#chromium-browser http://golem.fjfi.cvut.cz/wiki/TrainingCourses/GOMTRAIC/13/ &
	make -iB view &
	make F12
	

view:
	okular $(DOCUM).pdf &

	
archiv:
	mkdir -p archiv
	zip archiv/`date '+%d%m%y'` *.tex makefile
	
	
slides:
	make intro
	make -iBs src > slides.tex
	make -iBs SlidesGeneration
	make -i clean	
#	make commit


intro:
	echo "---\nformat:markdown\n...\n" >slides.page

	
src:
	echo "\def\GW{/GW}\n\input{\GW/root/GW4reports/GWlatexBeamerHead.tex}\n"; \
	echo "\\\\begin{document}\n\setboolean{Generate_slides.page}{true}\n\\\\newwrite\\\\filer\n\immediate\openout\\\\filer=slides.tmp\n" ; \
	grep GWis present.tex; \
	echo "\n\immediate\\\\closeout\\\\filer\n\\\\end{document}\n" 
	
SlidesGeneration:	
	pdflatex  --shell-escape slides.tex
	cat slides.tmp >> slides.page

clean:
	rm *.aux *.bib *.log *.run.xml *.nav *.out *.snm *.toc *.tmp slides.tex *.bbl *.blg
	
commit:
	git add .; git commit -am "Automated commit @ $$PWD"
	
bibtex:
	rsync -ve ssh bn:/home/svoboda/GOLEM/wikidata/root/golem.bib .
	pdflatex $(DOCUM)
	bibtex $(DOCUM) 
	pdflatex $(DOCUm)

rsyncLB:
	rsync -r -u -v -K -e ssh $$PWD bn:$${PWD%/*}

rsyncBL:
	rsync -r -u -v -e ssh bn:$$PWD $${PWD%/*}

	