summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/doc/latex/fancytooltips/examples/fancy-preview2/fancy-preview
blob: 7fa28f5f20e93386340b7420324bd0be9d15e537 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
#!/bin/bash
#

FILENAME=$1

if [ "$COLOR" == "" ]; then
   COLOR="0.8,0.8,0.8";
fi

if [ "$PREVIEW" == "" ]; then
PREVIEW="\PreviewEnvironment{definice} \PreviewEnvironment{veta} \PreviewEnvironment{Theorem} \PreviewEnvironment{definition} \PreviewEnvironment{figure} \PreviewEnvironment{theorem} \setlength\PreviewBorder{5pt}";
fi

if [ "$FBOXLENGTHS" == "" ]; then
    FBOXLENGTHS="\fboxrule=5pt\fboxsep=10pt";
fi

if [ "$FANCYOPTIONS" == "" ]; then
    FANCYOPTIONS="mouseover,movetips";
fi

echo "--------------------------"
echo "------ pdflatex ----------"
echo "--------------------------"
pdflatex $FILENAME.tex 
echo "-------------------------------------------"
echo "------ pdflatex with preview.sty ----------"
echo "-------------------------------------------"
pdflatex "\AtBeginDocument{\usepackage[pdftex,active,tightpage,floats,displaymath]{preview} $PREVIEW \definecolor{backgroundcolor}{rgb}{$COLOR}\pagecolor{backgroundcolor}\definecolor{shadethmcolor}{rgb}{$COLOR} \definecolor{shaderulecolor}{rgb}{$COLOR}} \input $FILENAME.tex"

grep '\\newlabel{' $FILENAME.aux > $FILENAME.tmp
mv $FILENAME.pdf $FILENAME-tmp.pdf

echo "----------------------------------------------"
echo "------ pdflatex genearting tooltips ----------"
echo "----------------------------------------------"
pdflatex "\documentclass{minimal}\usepackage[papersize={5in,5in},margin=1pt]{geometry}\usepackage[createtips]{fancytooltips}\usepackage{color,graphicx}\begin{document} $FBOXLENGTHS\relax \definecolor{backgroundcolor}{rgb}{$COLOR}\gdef\savemaplabels#1#2#3#4{\xdef\temp{#2}} \def\maplabelstoall#1#2{\savemaplabels#2 \setbox0=\hbox{\colorbox{backgroundcolor}{\includegraphics[page=\temp]{$FILENAME-tmp.pdf}}}\pdfpagewidth=\wd0 \pdfpageheight=\ht0 \advance \pdfpageheight by \dp0 \copy0 \keytip{#1}\newpage} \let\newlabel\maplabelstoall \input $FILENAME.tmp\end{document}"
mv $FILENAME.tips minimal.tip

echo "----------------------------------------------"
echo "------ pdflatex final compilation 1 ----------"
echo "----------------------------------------------"
pdflatex "\PassOptionsToPackage{active,filename=minimal,$FANCYOPTIONS}{fancytooltips}\input $FILENAME.tex"
echo "----------------------------------------------"
echo "------ pdflatex final compilation 2 ----------"
echo "----------------------------------------------"
pdflatex "\PassOptionsToPackage{active,filename=minimal,$FANCYOPTIONS}{fancytooltips}\input $FILENAME.tex"
echo "----------------------------------------------"
echo "------ pdflatex final compilation 3 ----------"
echo "----------------------------------------------"
pdflatex "\PassOptionsToPackage{active,filename=minimal,$FANCYOPTIONS}{fancytooltips}\input $FILENAME.tex"
echo "----------------------------------------------"
echo "------ pdflatex final compilation 4 ----------"
echo "----------------------------------------------"
pdflatex "\PassOptionsToPackage{active,filename=minimal,$FANCYOPTIONS}{fancytooltips}\input $FILENAME.tex"