]> mj.ucw.cz Git - ads2.git/blob - mjipe.tex
Oprava skriptiku pro uploadovani na server.
[ads2.git] / mjipe.tex
1 % Macros for importing of IPE pictures in plain TeX
2 % (c) 2001 Martin Mares <mj@atrey.karlin.mff.cuni.cz>
3 % ------------------------------------------------------------------------------
4
5 % To access internal macros of plain TeX
6 % --------------------------------------
7
8 \def\makeatletter{\catcode`@=11 }
9 \def\makeatother{\catcode`@=12 }
10 \makeatletter
11
12 % Importing of IPE pictures
13 % -------------------------
14
15 \newdimen\unitlength
16 \newbox\picbox
17 \newdimen\picht
18
19 \def\IpeInput#1{{\def\IPEfile{#1}\latexemulation
20 \input\IPEfile\relax
21 }}
22
23 \def\latexemulation{
24 \def\newcommand##1[##2]##3{}
25 \def\@ifundefined##1##2{##2}
26 \def\begin##1(##2,##3)(##4,##5){\picht=##3\unitlength
27 \setbox\picbox=\hbox to ##2\unitlength\bgroup
28 \hskip -##4\unitlength\lower ##5\unitlength\hbox\bgroup
29 \ignorespaces}
30 \def\end##1{\egroup\hss\egroup\ht\picbox=\picht\dp\picbox=0pt\picout}
31 }
32
33 \def\picout{
34 \nointerlineskip
35 {
36 \vskip 4pt plus 1pt minus 0.5pt
37 \line{\hss\box\picbox\hss}
38 \vskip 4pt plus 1pt minus 0.5pt
39 }
40 \nointerlineskip
41 }
42 \def\killglue{\unskip}
43 \def\put(#1,#2)#3{\killglue\raise#2\unitlength\hbox to 0pt{\kern #1\unitlength #3\hss}\ignorespaces}
44
45 \let\selectfont\relax
46 \def\fontsize#1#2{}
47 \def\IPEput#1#2#3#4{\put(0,0){\special{psfile=\IPEfile}}}
48 \def\IPEmp#1#2{\MiniPagesAreNotSupported}
49 \def\IPEtext#1{\hbox{#1\special{color pop}}}
50 \def\IPEfs#1{\IPEcolfs{0 0 0}{#1}}
51 \def\IPEcolfs#1#2{\dimen0=#2pt\fontsize{#2}{1.2\dimen0}\selectfont\special{color push rgb #1}}
52 \def\IPEsize#1#2{\unitlength=1bp\ignorespaces}
53
54 \makeatother