	# /GW/Presentations/GlobalOverviews/Training
DOCUM=present


#SAKRYS, je toho nejak moc: \GWinclMovie{XX}
# * 0) Bez movies se starterem a endereme pro mou prezentaci (~ 30 MB)  # Tohle bylo nestahnutelne v Turine 18
# * 1) s videama pouze na mem stroji .. WmoviespresentVS.pdf
# * 2) s videama zazipovane na jakykoli stroj (je to ale proklate velke, cca 200 Mb - asi neakceptovatelne)
# * 3) ted je jeste asi potreba vytvorit prezentaci bez starteru a bez enderu (~ 20 MB) # snad to bude stahnutelne ...
# Je potreba to nejak rozmyslet
# A default MUSI byt bez videi ... ted to tak neni!!!

final:
	make bibtex
	make GSreduction
	make clean
	mv present4w.pdf present.pdf
	
GSreduction:	
	#dle http://milan.kupcevic.net/ghostscript-ps-pdf/
	gs -sDEVICE=pdfwrite -dCompatibilityLevel=1.4 -dPDFSETTINGS=/printer -dNOPAUSE -dQUIET -dBATCH -sOutputFile=present4w.pdf present.pdf

session:
	make -iBs pdf
	bibtex present
	#make -iBs WmoviesTransfer
	make -iBs pdf
	make -iBs pdf
	#bibtex present
	#make -iBs mmovies
	make clean

all:
	make -iBs bibtex
	make clean
	ls -all

mmovies:
	make -iB Wmovies; mv present.pdf presentWmovies.pdf
	make -iB WOmovies

Wmovies: # plati jen na mem pocitaci ....
	pdflatex "\def\GWinclMovie{1}\input{present.tex}"
		
WOmovies:
	pdflatex -shell-escape  "\def\GWinclMovie{0}\input{present.tex}"
	
WmoviesTransfer: # videa nutno nosit s sebou ...
	pdflatex "\def\GWinclMovie{2}\input{present.tex}"
	make clean
	zip -j -0 present present.pdf /GW/Presentations/Commons/GOLEMmovies/*.mp4	



pdf:
	make -iBs WOmovies


pdfse:
	pdflatex --shell-escape golem.tex 
	
	
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

archiv:
	mkdir -p archiv
	zip archiv/`date '+%d%m%y'` base/*.tex *.tex makefile


view:
	okular $(DOCUM).pdf &


F12:
	echo "xterm -hold -e make -C $$PWD" >~/bin/F12
	#echo "ssh -X svoboda@bn xterm -hold -e make -C $$PWD" >~/bin/F12


bibtex:
	#rsync -ve ssh bn:/home/svoboda/GOLEM/wikidata/root/golem.bib .
	pdflatex $(DOCUM);bibtex $(DOCUM);pdflatex "\def\GWinclMovie{0}\input{present.tex}";pdflatex "\def\GWinclMovie{0}\input{present.tex}"

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

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




thumbnail:
	convert -thumbnail x300 -background white -alpha remove present.pdf[2] present_thb.png
	
clean:
	ls ${DOCUM}.*|grep -v pdf|grep -v tex|grep -v zip|xargs rm
