summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/platex/base/tascmac.sty
blob: 3d5d9e1f8eecf66e4e43dfde656c7e5d04b17de3 (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
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
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
%%
%% This is file `tascmac.sty',
%% generated with the docstrip utility.
%%
%% The original source files were:
%%
%% ascmac.dtx  (with options: `tascmac')
%% 
%% Copyright (c) 2010 ASCII MEDIA WORKS
%% Copyright (c) 2016 Japanese TeX Development Community
%% 
%% This file is part of the pLaTeX2e system (community edition).
%% -------------------------------------------------------------
%% 
%% "tascmac" document style option for tate gumi.
%%
%% Original version:
%%   Copyright (C) by 1993, ASCII Corporation & Impress Corporation.
%%   (Last update: 2006/07/14)
%% Modified by Japanese TeX Development Community, since 2016.
%%
%% (ChangeLog has moved to the source file ``ascmac.dtx'')
%%
\NeedsTeXFormat{LaTeX2e}
\ProvidesPackage{tascmac}
  [2016/08/21 v2.0c
  ascmac package (community edition)
  ]
%%
%% Originally `ascmac' and `tascmac' can be used only in
%% pLaTeX, upLaTeX or LuaLaTeX with LuaTeX-ja support.
%% We (texjporg) started to support other engines, such as
%% pdfLaTeX, XeLaTeX and LuaLaTeX (even without LuaTeX-ja).
%%
\newif\ifascmac@ptex \ascmac@ptextrue
\ifx\kanjiskip\@undefined
  \@ifpackageloaded{luatexja}{%
    \PackageInfo{tascmac}{%
      Patch from LuaTeX-ja will be applied}%
  }{%
    \PackageInfo{tascmac}{%
      Assuming pdfLaTeX, XeLaTeX or LuaLaTeX}%
    \ascmac@ptexfalse
  }%
\fi
\chardef\ascmac@q@catcode=\catcode`\Q\relax
\ifascmac@ptex
  \catcode`\Q=9\relax
\else
  \catcode`\Q=14\relax
\fi
%%
%% Use Type1 font for ascgrp (pdfLaTeX, LuaLaTeX)
\ifascmac@ptex\else
  \ifdefined\pdfextension
    % LuaTeX (>=0.85)
    \pdfextension mapline{+ascgrp <ascgrp.pfb}
    \pdfextension mapline{+ascii10 <ascii10.pfb}
    \pdfextension mapline{+ascii36 <ascii36.pfb}
  \else\ifdefined\pdfmapline
    % pdfTeX, LuaTeX (<=0.81)
    \pdfmapline{+ascgrp <ascgrp.pfb}
    \pdfmapline{+ascii10 <ascii10.pfb}
    \pdfmapline{+ascii36 <ascii36.pfb}
  \fi\fi
\fi
%%
%% ascmac.sty 10/28 '88
%% ASCII special macros
Q \ifx\@savetbaselineshift\@undefined \newdimen\@savetbaselineshift \fi
Q \ifx\@saveybaselineshift\@undefined \newdimen\@saveybaselineshift \fi
%%
%% ASCII logo
\def\@@ASCII#1#2#3{\shortstack{#1 ASCII \\[#3]
  \fontsize{#2}{\z@}\usefont{OT1}{cmss}{m}{n}ASCII CORPORATION}}
\def\ascii{\@ifundefined{@ascii}{\font\@ascii=ascii10 scaled \magstep4}{}%
  \@@ASCII\@ascii{5pt}{-6pt}}
\def\Ascii{\@ifundefined{@Ascii}{\font\@Ascii=ascii10 scaled \magstep5}{}%
  \@@ASCII\@Ascii{6pt}{-7pt}}
\def\ASCII{\@ifundefined{@ASCII}{\font\@ASCII=ascii36}{}%
  \@@ASCII\@ASCII{9pt}{-9pt}}
%%
%% boxnote environment
\font\@ascgrp=ascgrp
\newbox\scb@x \newbox\scscb@x
\newdimen\@bw\newbox\@nbox\newbox\@nbody
\def\boxnote{\par\vspace{.3\baselineskip}%
Q \@saveybaselineshift\ybaselineshift\ybaselineshift\z@
Q \@savetbaselineshift\tbaselineshift\tbaselineshift\z@
  \setbox\@nbox=\hbox{\@ascgrp\vrule width1.08pt depth35pt b\hss a\hss b}
  \@whiledim \wd\@nbox<\hsize \do{
  \setbox\@nbox=\hbox{\@ascgrp\unhbox\@nbox \hss a\hss b}}
  \setbox\@nbox=\hbox to\hsize{\@ascgrp\unhbox\@nbox \hss a\hss b%
  \vrule width1.08pt depth35pt}
  \@bw=\wd\@nbox\advance\@bw -40pt
  \begin{lrbox}{\@nbody}\begin{minipage}{\@bw}% (KN:1998/02/27)
Q   \ybaselineshift\@saveybaselineshift \tbaselineshift\@savetbaselineshift
}%
\def\endboxnote{\end{minipage}\end{lrbox}%
  \vbox{\parindent=0pt\offinterlineskip\copy\@nbox
  \hbox to\wd\@nbox{\vrule width1.08pt\hfil\box\@nbody\hfil\vrule width1.08pt}
  \hbox to\wd\@nbox{\vrule width1.08pt height15pt\hfil
  \vrule width1.08pt height15pt}\hrule height1.08pt}}
%%
%% screen environment
\newdimen\@scw
\def\@hobox#1#2#3{\hbox to\@scw{\oval(#3,#3)[#1]\hfil\oval(#3,#3)[#2]%
  \dimen\z@=#3\unitlength\advance\dimen\z@\@wholewidth
  \vrule\@width\z@\@height\z@\@depth.5\dimen\z@}}
\def\@vrf@#1#2{\vskip#1\leaders\vrule width#2\vfil\vskip#1}
\def\screen{%
Q \@saveybaselineshift\ybaselineshift \ybaselineshift\z@
Q \@savetbaselineshift\tbaselineshift \tbaselineshift\z@
  \@ifnextchar[{\@screen}{\@screen[0]}}
\def\@screen[#1]{\ifcase#1\def\@r{20}\def\@s{9.8pt}\def\@sx{10pt}\or
  \def\@r{18}\def\@s{8.8pt}\def\@sx{9pt}\or
  \def\@r{16}\def\@s{7.8pt}\def\@sx{8pt}\or
  \def\@r{14}\def\@s{6.8pt}\def\@sx{7pt}\or
  \def\@r{12}\def\@s{5.8pt}\def\@sx{6pt}\or
  \def\@r{10}\def\@s{4.8pt}\def\@sx{5pt}\or
  \def\@r{8}\def\@s{3.8pt}\def\@sx{4pt}\or
  \def\@r{6}\def\@s{2.8pt}\def\@sx{3pt}\else
  \def\@r{4}\def\@s{1.8pt}\def\@sx{2pt}\fi
  \par\vspace{.3\baselineskip}\@scw\linewidth \advance\@scw -\@r pt
  \setbox\scb@x=\hbox to\@scw\bgroup\begin{minipage}{\@scw}% (KN:1998/02/27)
Q   \ybaselineshift\@saveybaselineshift \tbaselineshift\@savetbaselineshift
}%
\def\endscreen{\end{minipage}\egroup%
  \setbox\scscb@x=\hbox to\linewidth{\hfil\vbox{\offinterlineskip%
  \thinlines\setlength{\unitlength}{1pt}\hrule\kern\@s%
  \@hobox{tl}{tr}{\@r}\kern-\@sx\box\scb@x\@hobox{bl}{br}{\@r}%
  \kern-.4pt\hrule}\hfil}\dimen0=\ht\scscb@x%
  \dimen2=\@sx\advance\dimen2 .2pt
  \noindent\hbox to\linewidth{\hbox to.2pt{\vbox to\dimen0{\@vrf@{\dimen2}{.4pt}}%
  \hss}\box\scscb@x\hbox to.2pt{\hss\vbox to\dimen0{\@vrf@{\dimen2}{.4pt}}}\hss}}%
%%
%% itembox environment
%%   replace \box0 with \@iboxstr; thanks FTEXers (1998/11/27)
\newdimen\@itemh\newtoks\@iboxpos\newbox\@iboxstr
\def\@hleader{\leaders\hrule height .8pt\hfil}
\def\itembox{\@ifnextchar[{\@itembox}{\@itembox[c]}}
\def\@itembox[#1]#2{%
Q \@saveybaselineshift\ybaselineshift\ybaselineshift\z@
Q \@savetbaselineshift\tbaselineshift\tbaselineshift\z@
  \par\vspace{.3\baselineskip}%
  \setbox\@iboxstr=\hbox{%
Q \ybaselineshift\@saveybaselineshift \tbaselineshift\@savetbaselineshift
  #2}%
  \@itemh\ht\@iboxstr\advance\@itemh\dp\@iboxstr
  \vspace{.5\@itemh}\bgroup\@scw\linewidth
  \advance\@scw-20pt\@iboxpos={#1}%
  \setbox\scb@x=\hbox to\@scw\bgroup\begin{minipage}{\@scw}%
Q \ybaselineshift\@saveybaselineshift
Q \tbaselineshift\@savetbaselineshift% (KN:1998/02/27)
  \vspace*{.5\@itemh}}%
\def\enditembox{\end{minipage}\egroup%
  \setbox\scscb@x=\hbox to\linewidth{\hfil\vbox{\offinterlineskip%
  \thicklines\setlength{\unitlength}{1pt}%
  \hbox to\@scw{\if l\the\@iboxpos\else\@hleader\fi
    \space\vbox to.8pt{\vss\hbox{\box\@iboxstr}\vss}%
    \space\if r\the\@iboxpos\else \@hleader\fi}\kern9.6pt
  \@hobox{tl}{tr}{20}\kern-10pt\box\scb@x\@hobox{bl}{br}{20}%
  \kern-.8pt\hrule height.8pt}\hfil}\dimen0=\ht\scscb@x%
  \noindent\hbox to\linewidth{\hbox to.4pt{\vbox to\dimen0{\@vrf@{10.4pt}{.8pt}}%
  \hss}\box\scscb@x\hbox to.4pt{\hss\vbox to\dimen0{\@vrf@{10.4pt}{.8pt}}}%
  \hss}\egroup}
%%
%% \keytop
\def\keytop{\@ifnextchar[{\@keytop}{\@keytop[d]}}
\def\@keytop[#1]#2{%
  {\setbox0=\hbox{\shortstack{#2}}%
Q \ybaselineshift\z@ \tbaselineshift\z@
  \dimen0=\wd0\advance\dimen0 5pt\dimen1=\dp0\advance\dimen1 2.5pt%
  \setbox\scscb@x=\hbox to\dimen0{%
Q \iftdir\tate\else\yoko\fi
  \@scw\wd0\hfil\vtop{\offinterlineskip
  \thinlines\setlength{\unitlength}{1pt}\hrule\kern2.3pt\@hobox{tl}{tr}5%
  \kern-2.4pt\box0\@hobox{bl}{br}5\kern-.4pt\hrule}\hfil}%
  \dimen0=\dp\scscb@x\advance\dimen0 -.4pt
  \setbox0=\vbox{\hbox{\hbox to.2pt{\vtop to\dimen0{\@vrf@{2.3pt}{.4pt}}\hss}%
  \box\scscb@x\hbox to.2pt{\hss\vtop to\dimen0{\@vrf@{2.3pt}{.4pt}}}}}%
  \if #1c\mbox{}$\vcenter{\box0}$\mbox{}\else
  \if #1t\else\if #1b\boxmaxdepth=0pt\else
  \boxmaxdepth=\dimen1\fi\fi \mbox{}\vbox{\box0}\fi}}
%%
%% \yen
\def\yen{\leavevmode\hbox{%
Q \iftdir\yoko\fi
  \setbox0=\hbox{Y}Y\kern-.97\wd0\vbox{\hrule height.1ex width.98\wd0
  \kern.33ex\hrule height.1ex width.98\wd0\kern.45ex}}}
%%
%% return-key
\def\return{\leavevmode\hbox{%
Q \iftdir\yoko\fi
  \@ascgrp\char"20}}
\def\Return{\leavevmode\hbox{%
Q \iftdir\yoko\fi
  \@ascgrp @}}
%%
%% \mask
\newbox\@bwsp \newbox\@@bwsp\newcount\@bcal
\def\setdim@#1#2{\@bcal=#2\divide#1\@bcal\multiply#1\@bcal\advance#1 1.001#2}
\def\mask#1#2{{\setbox\@bwsp=\hbox{#1}%
  \setbox0=\hbox{%
Q \ybaselineshift\z@\tbaselineshift\z@
  \@ascgrp#2}%
  \dimen0=\wd\@bwsp\dimen1=\ht\@bwsp\advance\dimen1\dp\@bwsp\dimen2=-\dimen1
  \setdim@{\dimen0}{\wd0}\setdim@{\dimen1}{\ht0}%
  \setbox\@@bwsp=\hbox to\dimen0{\leaders
  \vtop to\dimen1{\leaders\box0\vfil}\hfil}%
  \advance\dimen2\dp\@@bwsp\divide\dimen2 2
  \advance\dimen2\dp\@bwsp\boxmaxdepth=\dimen2
  \setbox\@@bwsp=\vbox{\box\@@bwsp}%
  \mbox{}\hbox to\wd\@@bwsp{\hbox to0pt{\box\@@bwsp\hss}\hss\unhbox\@bwsp\hss}}}
%%
%% \Maskbox{width}{height}{mask_char}{pos}{rule_wid}{body}
%% \maskbox{width}{height}{mask_char}{pos}{body}
\def\@setdim#1#2{\@bcal=#2\divide#1\@bcal\multiply#1\@bcal\advance#1 .001#2}
\def\Maskbox#1#2#3#4#5#6{{%
  \setbox0=\hbox{%
Q \ybaselineshift\z@\tbaselineshift\z@
  \@ascgrp#3}%
  \dimen0=#1\@setdim{\dimen0}{\wd0}\dimen1=#2\@setdim{\dimen1}{\ht0}%
  \ifx#4c\skip0=0pt plus1fil\skip1=\skip0\fi
  \ifx#4r\skip0=0pt plus1fil\skip1=0pt\fi
  \ifx#4l\skip1=0pt plus1fil\skip0=0pt\fi
  \leavevmode
  \hbox{\hbox to0pt{\hbox to\dimen0{\leaders\vbox to\dimen1{\leaders
  \box0\vfil}\hfil}\hss}%
  \vrule width#5\vbox to\dimen1{\hrule height#5\vfil
  \dimen3=#5\advance\dimen0-2\dimen3\advance\dimen0 .15pt
  \hbox to\dimen0{\hskip\skip0\relax#6\hskip\skip1}%
  \vfil\hrule height#5}\vrule width#5}}}
\def\maskbox#1#2#3#4#5{\Maskbox{#1}{#2}{#3}{#4}{0pt}{#5}}
%%
%% shadebox environment
\newdimen\shaderule\shaderule 5pt
\def\shadebox{\par\vspace{.3\baselineskip}%
Q \@saveybaselineshift\ybaselineshift\ybaselineshift\z@
Q \@savetbaselineshift\tbaselineshift\tbaselineshift\z@
  \dimen0\linewidth \advance\dimen0-20pt
  \advance\dimen0-2\fboxrule \advance\dimen0-\shaderule
  \setbox\@tempboxa=\hbox\bgroup\minipage{\dimen0}%
Q   \ybaselineshift\@saveybaselineshift \tbaselineshift\@savetbaselineshift
}
\def\endshadebox{\endminipage\egroup\dimen0=10pt
  \setbox\@tempboxa=\hbox{\kern\dimen0\unhbox\@tempboxa\kern\dimen0}%
  \setbox0=\vbox{\hrule \@height \fboxrule
  \hbox{\vrule \@width \fboxrule
  \vbox{\vskip\fboxsep \box\@tempboxa\vskip\fboxsep}%
  \vrule \@width \fboxrule}\hrule \@height \fboxrule}%
  \dimen0=\ht0 \advance\dimen0-\shaderule
  \hbox{\hbox to \shaderule{\copy0\hss}\kern 0pt
  \vrule width\wd0 height0pt depth\shaderule\hskip-\shaderule
  \vrule width\shaderule height\dimen0}}
%%
\catcode`\Q=\ascmac@q@catcode\relax
%%
\endinput
%%
%% End of file `tascmac.sty'.