summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/latex/ncctools/nccboxes.sty
blob: fca4d4763e014773bfe5b63ebc7e959f2eff5620 (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
%%
%% This is file `nccboxes.sty',
%% generated with the docstrip utility.
%%
%% The original source files were:
%%
%% nccboxes.dtx  (with options: `package')
%% 
%% IMPORTANT NOTICE:
%% 
%% This file is a generated file from the sources of the `ncctools'
%% bundle.
%% 
%% You are not allowed to modify this file.
%% 
%% You are allowed to distribute this file if and only if
%% it is distributed with the corresponding source files in
%% the `ncctools' bundle.
%% 
%% For the copying and distribution conditions of the source files,
%% see the README file distributed with the ncctools bundle.
%%
%% File: nccboxes.dtx Copyright (C) 2002--2005 by Alexander I. Rozhenko
%%
\NeedsTeXFormat{LaTeX2e}
\ProvidesPackage{nccboxes}
         [2005/02/07 v1.2 Additional Boxes (NCC)]
\newcommand*{\addbox}[3]{%
  \@begin@tempboxa\hbox{#3}%
    \setlength\@tempdima{#1}%
    \advance\@tempdima \ht\@tempboxa
    \ht\@tempboxa \@tempdima
    \setlength\@tempdima{#2}%
    \advance\@tempdima \dp\@tempboxa
    \dp\@tempboxa \@tempdima
    \leavevmode\box\@tempboxa
  \@end@tempboxa
}
\newcommand*{\jhbox}[1]{\settowidth\@tempdima{#1}\makebox[\@tempdima]}
\newcommand*{\jvbox}[1]{%
  \setbox\z@\hbox{\color@begingroup#1\color@endgroup}%
  \setbox\z@\hbox{\vrule \@width\z@ \@height\ht\z@ \@depth\dp\z@}%
  \NCC@jvbox
}
\newcommand*{\NCC@jvbox}[2][]{%
  \setbox\@tempboxa\hbox{\color@begingroup#2\color@endgroup}%
  \let\m@t\vss \let\m@b\vss
  \@tfor\@tempa :=#1\do {%
    \expandafter\let\csname m@\@tempa\endcsname\relax}%
  \@tempdima\ht\z@ \advance\@tempdima -\ht\@tempboxa
  \ifx\m@t\relax \else
    \@tempdimb\dp\@tempboxa \advance\@tempdimb -\dp\z@
    \ifx\m@b\relax \@tempdima \@tempdimb \else
      \advance\@tempdimb \@tempdima \@tempdima .5\@tempdimb
    \fi
  \fi
  \leavevmode \box\z@ \raise\@tempdima\box\@tempboxa
}
\newcommand*{\jparbox}[1]{%
  \@ifnextchar[{\NCC@jparbox{#1}}{\NCC@jparbox{#1}[]}%
}
\long\def\NCC@jparbox#1[#2]#3#4{%
  \@begin@tempboxa\vtop{\setlength\@tempdima{#3}%
    \hsize\@tempdima\@parboxrestore#4\@@par}%
    \setlength\@tempdima{#3}% vbox containing only display equations can
    \wd\@tempboxa\@tempdima % have lesser width. We correct it here
    \jvbox{#1}[#2]{\box\@tempboxa}%
  \@end@tempboxa
}
\newcommand*{\pbox}[2][]{%
  \let\m@l\hss \let\m@r\hss \let\m@t\vss \let\m@b\vss
  \@tfor\@tempa:=#1\do{%
    \expandafter\let\csname m@\@tempa\endcsname\relax%
  }%
  \leavevmode\hbox{\color@begingroup
    $\ifx\m@t\relax \vtop  \else\ifx\m@b\relax \vbox\else \vcenter\fi\fi
    \bgroup \baselineskip\z@\lineskip\z@
      \def\\{\strut\@stackcr}%
      \halign{\m@l\ignorespaces ##\unskip\m@r\cr #2\strut\crcr}%
    \egroup$\color@endgroup
  }%
}
\newcommand*{\picbox}[1]{%
  \setbox\@tempboxa\hb@xt@\z@{\ignorespaces#1\hss}%
  \ht\@tempboxa\z@\dp\@tempboxa\z@
  \leavevmode\box\@tempboxa
}
\newcommand{\Strutletter}{A}
\newcommand{\Strutstretch}{1.5}
\newsavebox\NCC@strutbox
\newdimen\NCC@strutsep
\def\NCC@setstrut#1{%
  \setbox\NCC@strutbox\hbox{\vphantom{\Strutletter}}%
  \@tempdima\ht\strutbox \advance\@tempdima\dp\strutbox
  \NCC@strutsep \Strutstretch\@tempdima
  \advance\NCC@strutsep -\ht\NCC@strutbox
  \advance\NCC@strutsep -\dp\NCC@strutbox
  \NCC@strutsep .5\NCC@strutsep
  \@ifnextchar/{\NCC@setstrutn{#1}}{\NCC@setstrutl{#1}\z@}%
}
\def\NCC@setstrutn#1/#2/{\NCC@setstrutl{#1}{#2\@tempdima}}
\def\NCC@setstrutl#1#2{%
  \@defaultunits\@tempdima#2\relax\@nnil
  \ifdim\@tempdima>\z@
    \advance\@tempdima \ht\NCC@strutbox
    \ht\NCC@strutbox \@tempdima
  \else
    \@tempdima -\@tempdima
    \advance\@tempdima \dp\NCC@strutbox
    \dp\NCC@strutbox \@tempdima
  \fi
  #1%
}
\newcommand{\Strut}{%
  \NCC@setstrut{\leavevmode\copy\NCC@strutbox\ignorespaces}%
}
\newcommand{\tstrut}{%
  \NCC@setstrut{}\addbox\NCC@strutsep\z@{\copy\NCC@strutbox}%
}
\newcommand{\bstrut}{%
  \NCC@setstrut{}\addbox\z@\NCC@strutsep{\copy\NCC@strutbox}%
}
\newcommand{\tbstrut}{%
  \NCC@setstrut{}\addbox\NCC@strutsep\NCC@strutsep{\copy\NCC@strutbox}%
}
\newcommand{\cboxstyle}{}
\newcommand{\cbox}{%
  \@ifstar{\def\@tempa{\ht\@tempboxa\z@ \dp\@tempboxa\z@}\NCC@xcbox}%
          {\let\@tempa\relax\NCC@xcbox}%
}
\def\NCC@xcbox{%
  \leavevmode \hbox\bgroup\color@begingroup
  \cboxstyle\NCC@setstrut{\NCC@ycbox}%
}
\newcommand*{\NCC@ycbox}[2][]{%
  \setbox\@tempboxa\hbox{%
    \jvbox{\addbox\NCC@strutsep\NCC@strutsep{\copy\NCC@strutbox}}[#1]%
      {\pbox[#1t]{\tstrut\ignorespaces #2\unskip\bstrut}}}%
  \@tempa \box\@tempboxa
  \color@endgroup\egroup
}
\newcommand{\tc}[1]{\hspace*{\fill}#1\hspace*{\fill}}
\endinput
%%
%% End of file `nccboxes.sty'.