root/GW4reports/GW2reports.sh

#!/bin/bash

#LatexCommand="pdflatex -shell-escape pool.tex "
#LatexCommand="pdflatex --interaction=nonstopmode pool.tex "
LatexCommand="pdflatex pool.tex"


GWpath="/GW";\
if [ -f latexsrc.page ]; then 
# JDE O SLIDE
rm slide.html slide.pdf
if [ `grep 'GWslide{' latexsrc.page |wc -l` -eq 1 ]; then \
{ echo "\def\GW{$GWpath}\def\GWinclMovie{0}\def\visibility{true}"; cat /GW/root/GW4reports/GWlatexBeamerHead.tex ; echo "\\begin{document} " ; cat latexsrc.page ; echo "\GWslide\bibliographystyle{apalike}\bibliography{/GW/root/bibtex/golem,/GW/root/bibtex/others}\\end{document}" ; } >pool.tex
$LatexCommand
$LatexCommand
#BIBTEX stuff
if grep -q  citation pool.aux
then 
   echo "CIT OK";
  bibtex latexsrc #BIBTEX line
   bibtex pool #BIBTEX line
   $LatexCommand;$LatexCommand
   #pdflatex pool.tex;pdflatex pool.tex
fi
mv pool.pdf slide.pdf;\
rm slide*.jpg # old stuff
echo "<html><body><embed src='slide.pdf#view=fit&toolbar=0&navpanes=0&scrollbar=0' type='application/pdf' width='100%' height='100%'></embed></body></html>">slide.html
#rm $file.pdf;\	
fi;
# JDE O PASAZ
rm pargrph.html pargrph.pdf
if [ `grep default latexsrc.page |wc -l` -ge 1 ]; then \
{ echo "\def\GW{$GWpath}\def\visibility{true}"; cat /GW/root/GW4reports/GWlatexPargrphHead.tex ; echo "\usepackage[a4paper, margin=2cm,portrait]{geometry}\\begin{document}" ; cat latexsrc.page ; echo "{\Large\bf \title}\newline\default\references\\end{document}" ; } > pool.tex;
$LatexCommand;$LatexCommand
#pdflatex pool.tex
#BIBTEX stuff
if grep -q  citation pool.aux
then 
   echo "CIT OK";
   bibtex pool #BIBTEX line
   #biber pool #BIBTEX line
   $LatexCommand;$LatexCommand
   #pdflatex pool.tex;pdflatex pool.tex
fi
mv pool.pdf pargrph.pdf;\
echo "<html><body><embed src='pargrph.pdf#view=fit&toolbar=0&navpanes=0&scrollbar=0' type='application/pdf' width='100%' height='100%'></embed></body></html>">pargrph.html
fi
fi
if [ -f FIGdescr.page ]; then
# JDE O Figure
rm figure.html figure.pdf
{ echo "\def\GW{$GWpath}\def\visibility{true}"; cat /GW/root/GW4reports/GWlatexPargrphHead.tex ; echo "\usepackage[a4paper, total={170mm,257mm}, left=20mm, top=20mm,]{geometry}\\begin{document}" ; cat FIGdescr.page ; echo "\begin{figure}[h]\centering\href{http://golem.fjfi.cvut.cz/wiki/\FGpath}{\includegraphics[width=0.8\tw]{\FGpath}}\caption{\FGcapt}\label{\FGlabel}\end{figure}\bibliographystyle{apalike}\bibliography{/GW/root/bibtex/golem,/GW/root/bibtex/others}\\end{document}" ; } > pool.tex;
#{ echo "\def\GW{$GWpath}\def\visibility{true}"; cat /GW/root/GW4reports/GWlatexPargrphHead.tex ; echo "\usepackage[a4paper, total={170mm,257mm}, left=20mm, top=20mm,]{geometry}\\begin{document}" ; cat FIGdescr.page ; echo "\centering\href{http://golem.fjfi.cvut.cz/wiki/\FGpath}{\includegraphics[width=0.8\tw]{\FGpath}}\newline Figure: \FGcapt\bibliographystyle{apalike}\bibliography{/GW/root/bibtex/golem,/GW/root/bibtex/others}\\end{document}" ; } > pool.tex;
$LatexCommand
#pdflatex pool.tex
#BIBTEX stuff
if grep -q  citation pool.aux
then 
   echo "CIT OK";
   bibtex pool #BIBTEX line
   $LatexCommand;$LatexCommand
   #pdflatex pool.tex;pdflatex pool.tex
fi
mv pool.pdf figure.pdf;\
echo "<html><body><embed src='figure.pdf#view=fit&toolbar=0&navpanes=0&scrollbar=0' type='application/pdf' width='100%' height='100%'></embed></body></html>">figure.html
fi

if [ -f DFIGdescr.page ]; then
# JDE O DFigure
rm figure.html figure.pdf
{ echo "\def\GW{$GWpath}\def\visibility{true}"; cat /GW/root/GW4reports/GWlatexPargrphHead.tex ; echo "\usepackage[a4paper, total={170mm,257mm}, left=20mm, top=20mm,]{geometry}\\begin{document}" ; cat DFIGdescr.page ; echo "\begin{figure}[h]\centering\href{http://golem.fjfi.cvut.cz/wiki/\FGpathA}{\includegraphics[width=0.45\tw]{\FGpathA}}\href{http://golem.fjfi.cvut.cz/wiki/\FGpathB}{\includegraphics[width=0.45\tw]{\FGpathB}}\caption{\FGcapt}\label{\FGlabel}\end{figure}\bibliographystyle{apalike}\bibliography{/GW/root/bibtex/golem,/GW/root/bibtex/others}\\end{document}" ; } > pool.tex;
$LatexCommand
#pdflatex pool.tex 
#BIBTEX stuff
if grep -q  citation pool.aux
then 
   echo "CIT OK";
   bibtex pool #BIBTEX line
   $LatexCommand;$LatexCommand
   #pdflatex pool.tex;pdflatex pool.tex
fi
mv pool.pdf figure.pdf;\
echo "<html><body><embed src='figure.pdf#view=fit&toolbar=0&navpanes=0&scrollbar=0' type='application/pdf' width='100%' height='100%'></embed></body></html>">figure.html
fi



rm pool.tex;
rm *.aux  *.log *.run.xml *.nav *.out *.snm *.toc *.bbl *.blg *.pyg; \
echo "xterm -e \"cd $PWD;bash /GW/root/GW4reports/GW2reports.sh $1\"">/home/svoboda/Produkce/AdHocF12.sh #F12
echo Hotovo!

exit