-
Notifications
You must be signed in to change notification settings - Fork 3
/
G2-104-68.sty
141 lines (132 loc) · 4.25 KB
/
G2-104-68.sty
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
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
\NeedsTeXFormat{LaTeX2e}
\RequirePackage{ifthen}
\RequirePackage{eso-pic}
\RequirePackage{graphicx}
\RequirePackage{everyshi}
\RequirePackage{lastpage}
\RequirePackage{epsfig}
\RequirePackage{psfrag}
\ProvidesPackage{G2-104-68}
[2002/12/12 v0.01 GOST Frames]
%%% Íàñòðîéêè äëÿ ôîíîâûõ ðàìîê
\newcommand\BackgroundPicture[2]{%
\setlength{\unitlength}{1pt}%
\put(0,\strip@pt\paperheight){%
\parbox[t][\paperheight]{\paperwidth}{%
\vfill
\hfill\includegraphics[angle=#2]{#1}\hspace{0.5cm}
\vfill
}}} %
\newcommand\BackgroundTitlePicture[2]{%
\setlength{\unitlength}{1pt}%
\put(0,\strip@pt\paperheight){%
\parbox[t][\paperheight]{\paperwidth}{%
\vfill
\centering\includegraphics[angle=#2]{#1}\hspace{-1cm}
\vfill
}}} %
\newcounter{gostszv}
\newcounter{gostszvv}
\newlength{\gostorigline}%
\newlength{\gostadnomin}%
\newsavebox{\newgostboxik}%
% Äëÿ âûâîäà òåêñòà â áîêñ ñ óêàçàííûìè êîîðäèíàòàìè óãëîâ
% 1,2 êîîðäèíàòû x,y ëåâîãî íèæíåãî óãëà, 3,4 ïðàâîãî âåðõíåãî óãëà
% 5 âûðàâíèâàíèå 6 òåêñò
\def\spbox#1#2#3#4#5#6{%
\put(#1,#2){%
\setcounter{gostszv}{#3}%
\setcounter{gostszvv}{#4}%
\setcounter{gostszv}{\value{gostszv}-#1}%
\setcounter{gostszvv}{\value{gostszvv}-#2}%
\makebox(\value{gostszv},\value{gostszvv})[#5]{#6}%
}%
}
\def\spformedbox#1#2#3#4#5#6{%
\setcounter{gostszv}{#3}%
\setcounter{gostszvv}{#4}%
\setcounter{gostszv}{\value{gostszv}-#1}%
\setcounter{gostszvv}{\value{gostszvv}-#2}%
\setlength{\gostadnomin}{#3pt - #1pt}%øèðèíà ïîëÿ
{%
\sbox{\newgostboxik}{#6}%
\settowidth{\gostorigline}{\usebox{\newgostboxik}}%
\put(#1,#2){%
\ifthenelse{\lengthtest{\gostorigline<\gostadnomin}}%
{\makebox(\value{gostszv},\value{gostszvv})[#5]%
{\usebox{\newgostboxik}}}%
{\makebox(\value{gostszv},\value{gostszvv})[#5]%
{\resizebox{\gostadnomin}{\height}{\usebox{\newgostboxik}}}}%
}%
}%
}
% Âûâîä òåêñòà â âåðòèêàëüíûé áîêñ
\def\vspbox#1#2#3#4#5#6{%
\put(#1,#2){%
\setcounter{gostszv}{#3}%
\setcounter{gostszvv}{#4}%
\setcounter{gostszv}{\value{gostszv}-#1}%
\setcounter{gostszvv}{\value{gostszvv}-#2}%
\begin{sideways}%
\makebox(\value{gostszv},\value{gostszvv})[#5]{#6}%
\end{sideways}%
}%
}%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Íèæíèé êîëîíòèòóë. Çàïîëíÿåì ðàìêè òåêñòîì.
% Êîîðäèíàòû çàäàþòñÿ â pt, ñîîòâåòñòâóþùèå êîîðäèíàòàì â ïðîñìîòðå
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\let\@oldoddfoot\@oddfoot
\def\@oddfoot{%
\unitlength=1pt
\begin{picture}(0,0)(105,82)
\renewcommand\Large{\@setfontsize\LARGE{10}{11}}
\ifnum \thepage = 1
\else
\ifnum \thepage = 3
% Âòîðàÿ ñòðàíèöà
\spbox{539}{66}{594}{79}{c}{\pageref{LastPage}}
\spbox{496}{66}{537}{79}{c}{\thepage}
\spformedbox{118}{77}{184}{93}{l}{\textsl{\small\@gostrazrabotchik}}
\spformedbox{118}{62}{184}{80}{l}{\textsl{\small\@gostproveril}}
\spformedbox{118}{35}{184}{51}{l}{\textsl{\small\@gostnormokontroler}}
\spformedbox{118}{20}{184}{37}{l}{\textsl{\small\@gostutverdil}}
\spbox{261}{90}{593}{140}{c}{\LARGE{\@gostklgi}}
\spbox{258}{22}{444}{99}{c}{\parbox{65mm}{\centering\small{\@gosttitleobject \\ \@gosttitledocument}}}
\spbox{504}{19}{540}{69}{c}{\parbox{40mm}{\centering\small{\@gosttitlecompany}}}
\spbox{460}{70}{460}{74}{c}{\@gostlitera}
\else
% Ïîñëåäóþùèå ñòðàíèöû
\spbox{523}{22}{553}{45}{c}{\thepage}
\spbox{558}{22}{590}{45}{c}{\pageref{LastPage}}
\spbox{227}{22}{564}{65}{c}{\LARGE{\@gostklgi}}
\spbox{70}{770}{268}{865}{c}{\LARGE{\rotatebox{180}{\@gostklgi}}}
\fi
\fi
\end{picture}
}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%% Ïîñëå âûâîäà êàæäîé ñòðàíèöû âûïîëíÿåì ñëåäóþùèé êîä
%% Äëÿ âûâîäà ðàìîê
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\def\pathtosharedresource{frames/}
\EveryShipout{%
\ClearShipoutPicture{%
\ifnum \thepage = 1
% \AddToShipoutPicture{\BackgroundTitlePicture{\pathtosharedresource title_7.eps}{0}}
\else
\ifnum \thepage = 2
% \AddToShipoutPicture{\BackgroundTitlePicture{\pathtosharedresource title_7.eps}{0}}
\else
\ifnum \thepage = 3
%ïàðàìåòðû âòîðîãî ëèñòà
\AddToShipoutPicture{\BackgroundPicture{\pathtosharedresource itmo_frame_1_2}{0}}
\else
%ïàðàìåòðû îñòàëüíûõ ëèñòîâ
\AddToShipoutPicture{\BackgroundPicture{\pathtosharedresource itmo_frame_2_2}{0}}
\fi
\fi
}%
}
\let\@evenfoot\@oddfoot
\let\@evenhead\@oddhead