diff options
author | Karl Berry <karl@freefriends.org> | 2006-01-12 23:46:46 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2006-01-12 23:46:46 +0000 |
commit | b1c871653d37d9c6fd0f97b048dca051b5b1db27 (patch) | |
tree | 3f925e95aa3461b9ecb75df861259a7f71bc3f23 /Master/texmf-dist/tex/plain/gustlib | |
parent | 82770e7491344072d5dd54ce9a78546eebe99c3f (diff) |
trunk/Master/texmf-dist/tex/plain
git-svn-id: svn://tug.org/texlive/trunk@621 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/plain/gustlib')
23 files changed, 5172 insertions, 0 deletions
diff --git a/Master/texmf-dist/tex/plain/gustlib/biblotex/biblotex.tex b/Master/texmf-dist/tex/plain/gustlib/biblotex/biblotex.tex new file mode 100644 index 00000000000..50a6d5f247c --- /dev/null +++ b/Master/texmf-dist/tex/plain/gustlib/biblotex/biblotex.tex @@ -0,0 +1,316 @@ +% 2 IX 1994 +% ========= +% +% To jest: +% BibloTeX ver.1.0 +% +% system makr do generowania bibliografii w systemie plain-TeX +% +% adaptacja: B.Licho¤ski 1994 +%----------------------------------- begin BibloTeX ---------------------- +%% @texfile{ +%% author = "Bogus/law Licho/nski", +%% version = "1.0", +%% date = "30 Mar 1994", +%% filename = "biblotex.tex", +%% address = "Gdynia ul. Kameliowa 17", +%% codetable = "ISO/ASCII", +%% supported = "yes", +%% docstring = "Definicje makr plain TeX dla programu BibTeX", +%% } +\edef\cite{\the\catcode`@}% +\catcode`@ = 11 +\let\@oldatcatcode = \cite +\chardef\@letter = 11 +\chardef\@other = 12 +\def\@innerdef#1#2{\edef#1{\expandafter\noexpand\csname #2\endcsname}}% +\@innerdef\@innernewcount{newcount}% +\@innerdef\@innernewdimen{newdimen}% +\@innerdef\@innernewif{newif}% +\@innerdef\@innernewwrite{newwrite}% +\def\@gobble#1{}% +\ifx\inputlineno\@undefined + \let\@linenumber = \empty % Pre-3.0. +\else + \def\@linenumber{\the\inputlineno:\space}% +\fi +\def\@futurenonspacelet#1{\def\cs{#1}% + \afterassignment\@stepone\let\@nexttoken= +}% +\begingroup % The grouping here avoids stepping on an outside use of `\\'. +\def\\{\global\let\@stoken= }% +\\ % now \@stoken is a space token (\\ is a control symbol, so that + % space after it is seen). +\endgroup +\def\@stepone{\expandafter\futurelet\cs\@steptwo}% +\def\@steptwo{\expandafter\ifx\cs\@stoken\let\@@next=\@stepthree + \else\let\@@next=\@nexttoken\fi \@@next}% +\def\@stepthree{\afterassignment\@stepone\let\@@next= }% +\def\@getoptionalarg#1{% + \let\@optionaltemp = #1% + \let\@optionalnext = \relax + \@futurenonspacelet\@optionalnext\@bracketcheck +}% +\def\@bracketcheck{% + \ifx [\@optionalnext + \expandafter\@@getoptionalarg + \else + \let\@optionalarg = \empty + \expandafter\@optionaltemp + \fi +}% +\def\@@getoptionalarg[#1]{% + \def\@optionalarg{#1}% + \@optionaltemp +}% +% +% From LaTeX. +% +\def\@nnil{\@nil}% +\def\@fornoop#1\@@#2#3{}% +\def\@for#1:=#2\do#3{% + \edef\@fortmp{#2}% + \ifx\@fortmp\empty \else + \expandafter\@forloop#2,\@nil,\@nil\@@#1{#3}% + \fi +}% +\def\@forloop#1,#2,#3\@@#4#5{\def#4{#1}\ifx #4\@nnil \else + #5\def#4{#2}\ifx #4\@nnil \else#5\@iforloop #3\@@#4{#5}\fi\fi +}% +\def\@iforloop#1,#2\@@#3#4{\def#3{#1}\ifx #3\@nnil + \let\@nextwhile=\@fornoop \else + #4\relax\let\@nextwhile=\@iforloop\fi\@nextwhile#2\@@#3{#4}% +}% +\@innernewif\if@fileexists +\def\@testfileexistence{\@getoptionalarg\@finishtestfileexistence}% +\def\@finishtestfileexistence#1{% + \begingroup + \def\extension{#1}% + \immediate\openin0 = + \ifx\@optionalarg\empty\jobname\else\@optionalarg\fi + \ifx\extension\empty \else .#1\fi + \space + \ifeof 0 + \global\@fileexistsfalse + \else + \global\@fileexiststrue + \fi + \immediate\closein0 + \endgroup +}% +\toks0 = {% +\def\bibliographystyle#1{% + \@readauxfile + \@writeaux{\string\bibstyle{#1}}% +}% +\let\bibstyle = \@gobble +\let\bblfilebasename = \jobname +\def\bibliography#1{% + \@readauxfile + \@writeaux{\string\bibdata{#1}}% + \@testfileexistence[\bblfilebasename]{bbl}% + \if@fileexists + \nobreak + \@readbblfile + \fi +}% +\let\bibdata = \@gobble +\def\nocite#1{% + \@readauxfile + \@writeaux{\string\citation{#1}}% +}% +\@innernewif\if@notfirstcitation +\def\cite{\@getoptionalarg\@cite}% +\def\@cite#1{% + \let\@citenotetext = \@optionalarg + \printcitestart + \nocite{#1}% + \@notfirstcitationfalse + \@for \@citation :=#1\do + {% + \expandafter\@onecitation\@citation\@@ + }% + \ifx\empty\@citenotetext\else + \printcitenote{\@citenotetext}% + \fi + \printcitefinish +}% +\def\@onecitation#1\@@{% + \if@notfirstcitation + \printbetweencitations + \fi + \expandafter \ifx \csname\@citelabel{#1}\endcsname \relax + \if@citewarning + \message{\@linenumber Undefined citation `#1'.}% + \fi + \expandafter\gdef\csname\@citelabel{#1}\endcsname{% + {\tt + \escapechar = -1 + \nobreak\hskip0pt + \expandafter\string\csname#1\endcsname + \nobreak\hskip0pt + }% + }% + \fi + \csname\@citelabel{#1}\endcsname + \@notfirstcitationtrue +}% +\def\@citelabel#1{b@#1}% +\def\@citedef#1#2{\expandafter\gdef\csname\@citelabel{#1}\endcsname{#2}}% +\def\@readbblfile{% + \ifx\@itemnum\@undefined + \@innernewcount\@itemnum + \fi + \begingroup + \def\begin##1##2{% + \setbox0 = \hbox{\biblabelcontents{##2}}% + \biblabelwidth = \wd0 + }% + \def\end##1{}% ##1 is `thebibliography' again. + \@itemnum = 0 + \def\bibitem{\@getoptionalarg\@bibitem}% + \def\@bibitem{% + \ifx\@optionalarg\empty + \expandafter\@numberedbibitem + \else + \expandafter\@alphabibitem + \fi + }% + \def\@alphabibitem##1{% + \expandafter \xdef\csname\@citelabel{##1}\endcsname {\@optionalarg}% + \ifx\biblabelprecontents\@undefined + \let\biblabelprecontents = \relax + \fi + \ifx\biblabelpostcontents\@undefined + \let\biblabelpostcontents = \hss + \fi + \@finishbibitem{##1}% + }% + \def\@numberedbibitem##1{% + \advance\@itemnum by 1 + \expandafter \xdef\csname\@citelabel{##1}\endcsname{\number\@itemnum}% + \ifx\biblabelprecontents\@undefined + \let\biblabelprecontents = \hss + \fi + \ifx\biblabelpostcontents\@undefined + \let\biblabelpostcontents = \relax + \fi + \@finishbibitem{##1}% + }% + \def\@finishbibitem##1{% + \biblabelprint{\csname\@citelabel{##1}\endcsname}% + \@writeaux{\string\@citedef{##1}{\csname\@citelabel{##1}\endcsname}}% + \ignorespaces + }% + \let\em = \bblem + \let\newblock = \bblnewblock + \let\sc = \bblsc + \frenchspacing + \clubpenalty = 4000 \widowpenalty = 4000 + \tolerance = 10000 \hfuzz = .5pt + \everypar = {\hangindent = \biblabelwidth + \advance\hangindent by \biblabelextraspace}% + \bblrm + \parskip = 1.5ex plus .5ex minus .5ex + \biblabelextraspace = .5em + \bblhook + \input \bblfilebasename.bbl + \endgroup +}% +\@innernewdimen\biblabelwidth +\@innernewdimen\biblabelextraspace +\def\biblabelprint#1{% + \noindent + \hbox to \biblabelwidth{% + \biblabelprecontents + \biblabelcontents{#1}% + \biblabelpostcontents + }% + \kern\biblabelextraspace +}% +\def\biblabelcontents#1{{\bblrm [#1]}}% +\def\bblrm{\rm}% +\def\bblem{\it}% +\def\bblsc{\ifx\@scfont\@undefined + \font\@scfont = plcsc10 + \fi + \@scfont +}% +\def\bblnewblock{\hskip .11em plus .33em minus .07em }% +\let\bblhook = \empty +\def\printcitestart{[}% left bracket +\def\printcitefinish{]}% right bracket +\def\printbetweencitations{, }% comma, space +\def\printcitenote#1{, #1}% comma, space, note (if it exists) +\let\citation = \@gobble +\@innernewcount\@numparams +\def\newcommand#1{% + \def\@commandname{#1}% + \@getoptionalarg\@continuenewcommand +}% +\def\@continuenewcommand{% + \@numparams = \ifx\@optionalarg\empty 0\else\@optionalarg \fi \relax + \@newcommand +}% +\def\@newcommand#1{% + \def\@startdef{\expandafter\edef\@commandname}% + \ifnum\@numparams=0 + \let\@paramdef = \empty + \else + \ifnum\@numparams>9 + \errmessage{\the\@numparams\space is too many parameters}% + \else + \ifnum\@numparams<0 + \errmessage{\the\@numparams\space is too few parameters}% + \else + \edef\@paramdef{% + \ifcase\@numparams + \empty No arguments. + \or ####1% + \or ####1####2% + \or ####1####2####3% + \or ####1####2####3####4% + \or ####1####2####3####4####5% + \or ####1####2####3####4####5####6% + \or ####1####2####3####4####5####6####7% + \or ####1####2####3####4####5####6####7####8% + \or ####1####2####3####4####5####6####7####8####9% + \fi + }% + \fi + \fi + \fi + \expandafter\@startdef\@paramdef{#1}% +}% +}% +\ifx\nobibtex\@undefined \the\toks0 \fi +\def\@readauxfile{% + \if@auxfiledone \else % remember: \@auxfiledonetrue if \noauxfile is defined + \global\@auxfiledonetrue + \@testfileexistence{aux}% + \if@fileexists + \begingroup + \endlinechar = -1 + \catcode`@ = 11 + \input \jobname.aux + \endgroup + \else + \message{\@undefinedmessage}% + \global\@citewarningfalse + \fi + \immediate\openout\@auxfile = \jobname.aux + \fi +}% +\newif\if@auxfiledone +\ifx\noauxfile\@undefined \else \@auxfiledonetrue\fi +\@innernewwrite\@auxfile +\def\@writeaux#1{\ifx\noauxfile\@undefined \write\@auxfile{#1}\fi}% +\ifx\@undefinedmessage\@undefined + \def\@undefinedmessage{No .aux file; I won't give you warnings about + undefined citations.}% +\fi +\@innernewif\if@citewarning +\ifx\noauxfile\@undefined \@citewarningtrue\fi +\catcode`@ = \@oldatcatcode +\prefixing +%----------------------------------- end BibloTeX ------------------------- diff --git a/Master/texmf-dist/tex/plain/gustlib/infr-ex.tex b/Master/texmf-dist/tex/plain/gustlib/infr-ex.tex new file mode 100644 index 00000000000..dae0428affa --- /dev/null +++ b/Master/texmf-dist/tex/plain/gustlib/infr-ex.tex @@ -0,0 +1,6 @@ +%% u/zycie: \infram <gr.ramki> <odl.od ramki> {tre/s/c (materia/l pionowy)} +%% usage: \infram <thickness> <distance> {contents (vertical stuff)} +\input infram +\infram 1.8pt 3mm {\hbox{tekst w ramce (text in a frame)}} +\end + diff --git a/Master/texmf-dist/tex/plain/gustlib/infram.tex b/Master/texmf-dist/tex/plain/gustlib/infram.tex new file mode 100644 index 00000000000..8aae4ebae8d --- /dev/null +++ b/Master/texmf-dist/tex/plain/gustlib/infram.tex @@ -0,0 +1,11 @@ +%% u/zycie: \infram <gr.ramki> <odl.od ramki> {tre/s/c (materia/l pionowy)} +%% usage: \infram <thickness> <distance> {contents (vertical stuff)} +\newdimen\frth \newdimen\frdi +\long\def\infram{\vbox\bgroup \afterassignment\inframa \frth = } +\def\inframa{\afterassignment\inframb \frdi = } +\long\def\inframb#1{\hrule height\frth + \hbox{\vrule width\frth + \kern\frdi \vbox{\kern\frdi#1\kern\frdi}\kern\frdi + \vrule width\frth} + \hrule height\frth\egroup} +\endinput diff --git a/Master/texmf-dist/tex/plain/gustlib/licz/licz-tst.mex b/Master/texmf-dist/tex/plain/gustlib/licz/licz-tst.mex new file mode 100644 index 00000000000..dc20aa7dc77 --- /dev/null +++ b/Master/texmf-dist/tex/plain/gustlib/licz/licz-tst.mex @@ -0,0 +1,101 @@ +% Test zestawu makr LICZ (Mazovia) +% wersja 4.0 +% 27.04.96 19:49 + +\input licz.mex + + +\let\ad\advance + +\def\tl + % testline + #1% + {% + \edef\s’ownie{\licz{#1}}% + \item{\bf\number#1}(\s’ownie)\endgraf + \immediate\write16{\number#1}% + } + +\def\tloop + #1% from + #2% step + #3% to + {{% + \n #1\relax + \k #3\relax \ad\k1 + \loop + \tl\n + \ad\n#2\relax + \ifnum\n<\k + \repeat + }} +\newcount\n +\newcount\k + +\let\rm\fiverm +\font\bf plbx5 +\baselineskip7pt +\rm +\raggedright +\nopagenumbers +\raggedbottom +\vsize9.9in +\parindent1.5cm + +\def\test + {% + \liczspace{ } + + \tl{1} + \tl{12} + \tl{20} + \tl{21} + \tl{34} + \tl{234} + + \tl{123} + \tl{1234} + \tl{12345} + \tl{1234546} + \tl{12345678} + \tl{123456789} + \tl{1234567891} + + \bigskip + najmniejsza liczba w \TeX-u: + \tl{-2147483647} + najwi‘ksza liczba w \TeX-u: + \tl{2147483647} + + \bigskip + {% + \tloop + {1} + {1} + {250} + } + + \bigskip + \liczspace{\=} + \tl{1001001001} + \tl{1000000001} + \tl{1000000000} + \tl{1000030000} + + \bigskip + {\liczspace{\hrulefill} + \line{\licz{174568}}} + + \liczspace{ } + \message{12345 = \licz{12345}} + \vfill + \eject + } + +\prefixing +\test + +\nonprefixing +\test + +\end diff --git a/Master/texmf-dist/tex/plain/gustlib/licz/licz.mex b/Master/texmf-dist/tex/plain/gustlib/licz/licz.mex new file mode 100644 index 00000000000..1e336015f30 --- /dev/null +++ b/Master/texmf-dist/tex/plain/gustlib/licz/licz.mex @@ -0,0 +1,529 @@ +% zestaw makr LICZ.MEX +% makro \licz podaj/ace s/lownie po polsku liczb/e +% wraz z makrami pomocniczymi + +% autor: Marek Ry/cko + +% wersja 0.0, 11 sierpnia 1993 r. +% wersja 0.1, 12 sierpnia 1993 r. +% -- wszystko na poziomie rozwiajania +% wersja 0.2, 13 sierpnia 1993 r. (pi/atek!) +% -- pewne optymalizacje czasowe zwi/azane ze sposobem realizacji +% dope/lniania zerami (na poziomie makr) +% wersja 0.3, 23 sierpnia 1993 r. +% -- jedynie troch/e zmieniony program testuj/acy +% wersja 0.4, 25//26 stycznia 1994 r. +% -- istotna poprawka makra \lead_zeroo (dzi/eki BJ) +% wersja 0.5, 18 lutego 1995 r. (po wyk/ladzie o rozwijaniu /zeton/ow) +% -- poprawki pomy/lek w komentarzach +% -- uzupe/lnienie brakuj/acego procentu w \licz_err +% wersja 0.6, 27 kwietnia 1996 r. (przygotowanie do Bachotka 96) +% -- oparcie tylko na MEX-u +% -- uniezale/znienie od rodzaju stosowanej notacji polskich liter + +% OPIS: + +% \licz{<liczba>} +% rozwija si/e do liczby wyra/zonej s/lownie po polsku +% \liczspace{<cokolwiek>} +% powoduje, /ze <cokolwiek> b/edzie wstawiane jako +% odst/ep separuj/acy s/lowa (domy/slnie: <cokolwiek>=zwyk/ly odst/ep) + +% to do: +% -- parametryczne pisanie ,,jeden'' przed tysi/acami itp. +% -- ewentualnie zamieni/c \lead_zero na og/olniejsze makro dope/lniaj/ace czym/s... + +% makra normalnie zawarte w formacie ,,Do'': +\let\e\expandafter +\let\expi\e +\def\expii{\e\expi\e} +\def\expiii{\e\expii\e} +\def\expiv{\e\expiii\e} +\def\letter{11} + +\edef\liczundcatcode{\the\catcode`\_} +\catcode`\_\letter +\edef\liczatcatcode{\the\catcode`\@} +\catcode`\@\letter + +% zapami/etanie dotychczasowej ,,prefiksyjno/sci'': +\let\liczprefix\pr@fix +\if\liczprefix F\prefixing\fi + +% nast/epne dzia/ly zawieraj/a rozmaite makra podr/eczne: + +\def\expfull + % four times expansion of \expfull{...} expands fully ... + #1% a sequence of tokens expanding to characters only + {% + % triple expansion of the following expands fully #1 + \e\e\e\gobble_first + % the following expands at the 2-nd level to the sequence of characters + % preceded by backslash + \e\string\csname#1\endcsname + \end_gobble + } +\def\gobble_first#1#2\end_gobble{#2} + +\def\lead_zero + % zamienia liczb/e nieujemn/a na 10-cyfrow/a liczb/e dope/lnion/a zerami + #1% positive number (any) + {% + % apply \lead_zeroo to the already calculated sequence of digits: + \e\lead_zeroo\e{\number#1}% + } +\def\lead_zeroo + #1% positive number (sequence of digits) + {% + \ifnum#1<10 000000000\else + \ifnum#1<100 00000000\else + \ifnum#1<1000 0000000\else + \ifnum#1<10000 000000\else + \ifnum#1<100000 00000\else + \ifnum#1<1000000 0000\else + \ifnum#1<10000000 000\else + \ifnum#1<100000000 00\else + \ifnum#1<1000000000 0\else + \fi\fi\fi\fi\fi\fi\fi\fi\fi + #1} + +\def\div_ten_to + % expands to a number (a sequence of decimal digits) + % without the last #2 decimal digits + #1% nonnegative number (<=9 999 999 999) + #2% divided by ten to #2 (>=0 <=9) + {% + \number % normalize the result (no leading zeros) + \ifcase#2 + % 0: + #1% + \or + % 1: + \apply_take\take_ix{#1}% + \or + % 2: + \apply_take\take_viii{#1}% + \or + % 3: + \apply_take\take_vii{#1}% + \or + % 4: + \apply_take\take_vi{#1}% + \or + % 5: + \apply_take\take_v{#1}% + \or + % 6: + \apply_take\take_iv{#1}% + \or + % 7: + \apply_take\take_iii{#1}% + \or + % 8: + \apply_take\take_ii{#1}% + \or + % 9: + \apply_take\take_i{#1}% + \else + \licz_err{dzielenie przez 10 do b/l/ednej pot/egi}% + \fi + } + +\def\mod_ten_to + % expands to the last #2 decimal digits + % of a number (a sequence of decimal digits) + #1% nonnegative number (<=9 999 999 999) + #2% modulo ten to #2 (>=0 <=9) + {% + \number % normalize the result (no leading zeros) + \ifcase#2 + % 0: + 0% + \or + % 1: + \apply_take\gob_ix{#1}% + \or + % 2: + \apply_take\gob_viii{#1}% + \or + % 3: + \apply_take\gob_vii{#1}% + \or + % 4: + \apply_take\gob_vi{#1}% + \or + % 5: + \apply_take\gob_v{#1}% + \or + % 6: + \apply_take\gob_iv{#1}% + \or + % 7: + \apply_take\gob_iii{#1}% + \or + % 8: + \apply_take\gob_ii{#1}% + \or + % 9: + \apply_take\gob_i{#1}% + \else + \licz_err{dzielenie przez 10 do b/l/ednej pot/egi}% + \fi + } + +\def\apply_take + #1% np. \take_ix + #2% number + {\e\apply_takee\e#1\e{\number#2}} +\def\apply_takee + #1% np. \take_ix + #2% number + {\expiv#1\expfull{\lead_zero{#2}}\end_take} + +\def\take_ix #1{#1\take_viii} +\def\take_viii #1{#1\take_vii} +\def\take_vii #1{#1\take_vi} +\def\take_vi #1{#1\take_v} +\def\take_v #1{#1\take_iv} +\def\take_iv #1{#1\take_iii} +\def\take_iii #1{#1\take_ii} +\def\take_ii #1{#1\take_i} +\def\take_i #1{#1\take_zero} +\def\take_zero {\gob_rest} +\def\gob_rest#1\end_take{} + +\def\gob_ix #1{\gob_viii} +\def\gob_viii #1{\gob_vii} +\def\gob_vii #1{\gob_vi} +\def\gob_vi #1{\gob_v} +\def\gob_v #1{\gob_iv} +\def\gob_iv #1{\gob_iii} +\def\gob_iii #1{\gob_ii} +\def\gob_ii #1{\gob_i} +\def\gob_i #1{\gob_zero} +\def\gob_zero {\take_rest} +\def\take_rest#1\end_take{#1} + +% koniec makr pomocniczych og/olnego u/zytku + +\def\licz + #1% number (jest obliczany jednokrotnie) + {\e\licz_licz\e{\number#1}} +\def\licz_licz + #1% number + {% + \ifnum#1=0 + zero% + \else + % <> 0 + \ifnum#1<0 + % < 0 + minus\licz_space\licz_dod{-#1}% + \else + % > 0 + \licz_dod{#1}% + \fi + \fi + } + +\def\licz_sep + #1% liczba >=0 + {% first calculate the number, then apply + \e\licz_sepp\e{\number#1}} +\def\licz_sepp + #1% liczba >=0 (ju/z obliczona) + #2% separacja modulo 10 do pot/egi #2 + {% first calculate the mod separation, then apply + \e\licz_seppp\e{\number\mod_ten_to{#1}{#2}}% + {#1}{#2}% powtarzamy parametry + } +\def\licz_seppp + #1% modulo ju/z wyliczone (patrz wy/zej) + #2% liczba >=0 (ju/z obliczona) + #3% separacja modulo 10 do pot/egi #3 + {% first calculate the div separation, then apply + \e\licz_sepppp\e{\number\div_ten_to{#2}{#3}}% + {#1}% modulo ju/z wyliczone + } +\def\licz_sepppp + #1% div + #2% mod + #3% makro dla du/zych + #4% makro dla ko/nc/owki + {% + \ifnum#1>0 + #3{#1}% + \licz_mk_space{#1}{#2}% + \fi + #4{#2}% + } + +\def\licz_dod + #1% liczba dodatnia (w dowolnym zapisie w sensie TeX-a) + {\licz_sep{#1}3\licz_tys\licz_dotys} + +\def\licz_tys + #1% liczba dodatnia + {\licz_sep{#1}3\licz_miliony + {\licz_tylko{tysi}{/ac}{/ace}{/ecy}}}% + +\def\licz_miliony + #1% liczba dodatnia + {\licz_sep{#1}3\licz_miliardy + {\licz_tylko{milion}{}{y}{/ow}}}% + +\def\licz_miliardy + #1% liczba dodatnia + {\licz_sep{#1}3\licz_overflow + {\licz_tylko{miliard}{}{y}{/ow}}}% + +\def\licz_overflow + #1% + {\ifnum#1>0 \licz_err{za du/za liczba}\fi} + +\def\licz_tylko + #1% rdze/n + #2#3#4% ko/nc/owki 1, 2, 5 + #5% liczba tego + {% + \ifnum#5>0 + \licz_dod{#5}\licz_space + \licz_odm{#5}{#1}{#2}{#3}{#4}% + \else + % nic + \fi + } + +\def\licz_dotys + #1% >=1, <=999 + {\licz_sep{#1}2\licz_setki\licz_dostu} + +\def\licz_dostu + #1% + {% + % + \ifnum#1<10 + \licz_jedn{#1}% + \else + % #1 >= 10 + \ifnum#1<20 + % 10 <= #1 <= 19 + \licz_at_least_ten{#1}% + \else + % #1 >= 20 + \ifnum#1<100 + % 20 <= #1 <= 99 + \licz_sep{#1}1\licz_at_least_twenty\licz_jedn + \else + % #1 >= 100 + \licz_err{mia/lo by/c do stu}% + \fi + \fi + \fi + } + +\def\licz_jedn + #1% + {% + \ifcase\number#1\space\space + % 0: + % nic + \or % 1: + jeden% + \or % 2: + dwa% + \or % 3: + trzy% + \or % 4: + cztery% + \or % 5: + pi/e/c% + \or % 6: + sze/s/c% + \or % 7: + siedem% + \or % 8: + osiem% + \or % 9: + dziewi/e/c% + \else + \licz_err{cyfra > 9}% + \fi + } + +\def\licz_at_least_ten + #1% + {% + \ifcase \number\mod_ten_to{#1}{1}\space\space + % 10: + dziesi/e/c% + \or % 11: + jedena/scie% + \or % 12: + dwana/scie% + \or % 13: + trzyna/scie% + \or % 14: + czterna/scie% + \or % 15: + pi/etna/scie% + \or % 16: + szesna/scie% + \or % 17: + siedemna/scie% + \or % 18: + osiemna/scie% + \or % 19: + dziewi/etna/scie% + \else + \licz_err{na/scie > 19}% + \fi + } + +\def\licz_at_least_twenty + #1% + {% + % 2 <= #1 <= 9 + % sk/ladamy dziesi/atki: + \ifcase \number#1\space\space + % 0: + \licz_err{dzie/scia < 10}% + \or % 1: + \licz_err{dzie/scia < 20}% + \or % 2: + dwadzie/scia% + \or % 3: + trzydzie/sci% + \or % 4: + czterdzie/sci% + \or % 5: + pi/e/cdziesi/at% + \or % 6: + sze/s/cdziesi/at% + \or % 7: + siedemdziesi/at% + \or % 8: + osiemdziesi/at% + \or % 9: + dziewi/e/cdziesi/at% + \else + % > 9 + \licz_err{dzie/scia > 99}% + \fi + % dziesi/atki z/lo/zone + } + +\def\licz_setki + #1% + {% + % 0 <= #1 <= 9 + % sk/ladamy setki: + \ifcase\number#1\space\space + % 0: + % nic + \or % 1: + sto% + \or % 2: + dwie/scie% + \or % 3: + trzysta% + \or % 4: + czterysta% + \or % 5: + pi/e/cset% + \or % 6: + sze/s/cset% + \or % 7: + siedemset% + \or % 8: + osiemset% + \or % 9: + dziewi/e/cset% + \else + % > 9 + \licz_err{setki > 9}% + \fi + } + +\def\licz_mk_space + #1#2% je/sli obie liczby >0, to rozwi/n si/e do odst/epu + {% + \ifnum#1>0 + \ifnum#2>0 + \licz_space + \fi + \fi + } + +\def\licz_odm + #1% liczba >=1 + #2% rdze/n + #3% ko/nc/owka 1 + #4% ko/nc/owka 2, 3, 4 + #5% ko/nc/owka 5, 6, 7, 8, 9, 0 + {% + \ifcase\number\mod_ten_to{#1}{1}\space\space + % 0: + #2#5% + \or % 1: + \ifnum#1=1 + #2#3% + \else + #2#5% + \fi + \or % 2: + \ifnum\mod_ten_to{#1}{2}=12 + #2#5% + \else + #2#4% + \fi + \or % 3: + \ifnum\mod_ten_to{#1}{2}=13 + #2#5% + \else + #2#4% + \fi + \or % 4: + \ifnum\mod_ten_to{#1}{2}=14 + #2#5% + \else + #2#4% + \fi + \or % 5: + #2#5% + \or % 6: + #2#5% + \or % 7: + #2#5% + \or % 8: + #2#5% + \or % 9: + #2#5% + \else + % > 9 + \licz_err{modulo w odmianie nie dzia/la}% + \fi + } + +% w poni/zszym makrze u/zyty jest jawny parametr, ze wzgl/edu na mo/zliwo/s/c +% u/zycia np. w formie \liczspace\space (bez nawias/ow klamrowych) +\def\liczspace + #1% cokolwiek + {\def\licz_space{#1}} + +\def\licz_err + #1% + {{% + \newlinechar`\@% + \errhelp{Co/s jest nie tak w makrach obs/luguj/acych liczenie.@% + Najlepiej zawiadomi/c autora, bo to pewnie jego wina.}% + \errmessage{B/l/ad w liczeniu: #1}% + }} + +\catcode`\_\liczundcatcode\space +\catcode`\@\liczatcatcode\space +\if\liczprefix F\nonprefixing\fi + +% domy/slnie: +\liczspace\space +\endinput diff --git a/Master/texmf-dist/tex/plain/gustlib/map/map.tex b/Master/texmf-dist/tex/plain/gustlib/map/map.tex new file mode 100644 index 00000000000..779ef6ae3c7 --- /dev/null +++ b/Master/texmf-dist/tex/plain/gustlib/map/map.tex @@ -0,0 +1,63 @@ +% MAP.TEX + +% Marek Ry\'cko + +% Macro \map +% for applying operations to token sequences + +% uses SPLIT.TEX + +% version 0.0 24.07.1993 +% version 0.1 1.5.1996 +% -- english description + +\def\map + % for each element E of the token list #2 + % ``execute'' the token list #1 + % possibly making use of the following macros: + % \mappre the token list before E (without E) + % \mapcur the token E + % \mappost the token list after E (without E) + % \mapupto the token list from the beginning till and including E + % \mapfrom the token list from and including E till the end + % \mapent the entire token list + % + % -------------\mapent---------------- + % ---\mapfrom--------- + % ----\mapupto----- + % ................E................... + % ----\mappre----- ---\mappost-------- + % + % | + % | + % \mapcur + % + #1% operation + #2% token list + {{% + \def\mapent{#2}% + \def\mappre{}% + \let\mapfrom\mapent + % \mappre contains already processed sequence + % \mapfrom contains the sequence to be processed + % while nonempty \mapfrom do: + \ifx\empty\mapfrom \mapcontfalse \else \mapconttrue \fi + \loop \ifmapcont + % \mapfrom nonempty, so it can be split: + % split \mapfrom to head and tail: + \split\mapfrom\mapcur\mappost + % set \mapupto as the concatenation of \mappre and \mapcur: + \expandafter\expandafter\expandafter + \def\expandafter\expandafter\expandafter + \mapupto\expandafter\expandafter\expandafter + {\expandafter\mappre\mapcur}% + % execute operation(s): + #1% + % define new values of \mappre and \mapfrom + \expandafter\def\expandafter\mappre\expandafter{\mapupto}% + \expandafter\def\expandafter\mapfrom\expandafter{\mappost}% + % \mappre contains already processed sequence + % \mapfrom contains the sequence to be processed + \ifx\empty\mapfrom \mapcontfalse \else \mapconttrue \fi + \repeat}}% +\newif\ifmapcont diff --git a/Master/texmf-dist/tex/plain/gustlib/map/split.tex b/Master/texmf-dist/tex/plain/gustlib/map/split.tex new file mode 100644 index 00000000000..252f1d358b1 --- /dev/null +++ b/Master/texmf-dist/tex/plain/gustlib/map/split.tex @@ -0,0 +1,63 @@ +% SPLIT.TEX + +% Marek Ry\'cko + +% Macro \split (and auxiliary macros) +% for splitting token sequences +% Macro \hdtl + +% version 0.0 24.07.1993 +% version 0.1 31.12.94 +% version 0.2 1.5.1996 +% -- english description + +\def\hdtl + #1% inp. t.s. (nonempty, poss blanks) + #2% outp. -- head + #3% outp. -- tail + {\let\reshead=#2% synonims for token-register names + \let\restail=#3% + \expandafter\gethead\the#1\endoftokens} +\def\gethead + {\futurelet\thehead\analysehead} +\def\analysehead + {\ifcat \noexpand\thehead \space + \let\followby=\followbyspace + \else + \let\followby=\followbynospace + \fi + \followby} +\def\followbyspace + {\reshead={ }% space token + \afterassignment\gettail + \let\swallow= }% swallowing the head-space +\def\gettail + #1\endoftokens + {\restail={#1}} +\def\followbynospace + #1#2\endoftokens + {\reshead={#1}% + \restail={#2}} +\def\split + #1% input macro name (should expand to nonemty token sequence) + #2% macro head (name) + #3% macro tail (name) + {% + % define + % #2 as the first token (with nested braces) of #1 + % #3 as the tail (with nested braces) of #1 + \expandafter\splithdtl\expandafter{#1}% + \expandafter\def\expandafter\splittest\expandafter{\the\splithdtl}% + \ifx\splittest\empty + \gdef#2{}% + \gdef#3{}% + \else + \hdtl\splithdtl\splithd\splittl + \expandafter\gdef\expandafter#2\expandafter{\the\splithd}% + \expandafter\gdef\expandafter#3\expandafter{\the\splittl}% + \fi + } +\newtoks\splithdtl +\newtoks\splithd +\newtoks\splittl + diff --git a/Master/texmf-dist/tex/plain/gustlib/map/tsp-tst.mex b/Master/texmf-dist/tex/plain/gustlib/map/tsp-tst.mex new file mode 100644 index 00000000000..bb887172a97 --- /dev/null +++ b/Master/texmf-dist/tex/plain/gustlib/map/tsp-tst.mex @@ -0,0 +1,68 @@ +% TSP-TEST.MEX + +% test zestawu makr TSP + +% Bogus/law Jackowski i Marek Ry/cko +% 24 lipca 1993 r., dotkni/ete 14 lutego 1997 r. + +\input split +\input map +\input tsp +\prefixing + +\def\wlaz + {% + Wlaz/l pies do kuchni + {i\nobreak} porwa/l mi/esa /cwier{/c,} + {a\nobreak} jaki/s kucharz g/lupi + zar/aba/l go na /smier{/c.} + {A\nobreak} drugi kucharz m/adr{y,} + co lito/s/c {w\nobreak} sercu mia/l + postawi/l mu nagrobek + {i\nobreak} taki napis da} +\edef\lista + {\wlaz{/l:} \wlaz{/l...}} + +\def\test + #1% odst/ep zamiast spacji + #2% odst/ep mi/edzy literami + {% + \def\paramtest{#1#2} + \ifx\paramtest\empty\else + % odst/ep zamiast spacji: + \def\tspsp {#1} + % odst/ep mi/edzy literami: + \def\tsplet {#2} + \fi + \leftline{\tt \string\def\string\tspsp\{\tspsp\}\space\space + \string\def\string\tsplet\{\tsplet\}} + \vskip2pt + \expandafter\tsp\expandafter{\lista} + \vskip6pt + \message{.} + } + +\font\xxx plr12 scaled \magstep1 \xxx +\baselineskip16.4pt +\vsize24.7cm +\nopagenumbers +\chardef\{"7B +\chardef\}"7D + +\message{Prosz/e czeka/c.} + +{\tenrm +\line{Test makra {\tt\string\tsp}\hss + 1 maja 1996 r.} +\smallskip +\hrule +\vfill +} +\test {} {}% standard +\test {0.555em plus.2777em minus.111em} {.1em}% +\test {0.28em plus.1em minus.111em} {-.05em}% +\test {0.22em plus.1em minus.111em} {-.06em}% +\test {0.333em plus.167em minus.111em} {0em}% +\leftline{\tt zwyk/ly tekst:}\vskip2pt +\tsp {\lista}% bez u/zycia makra +\eject\end diff --git a/Master/texmf-dist/tex/plain/gustlib/map/tsp.tex b/Master/texmf-dist/tex/plain/gustlib/map/tsp.tex new file mode 100644 index 00000000000..e140ed624de --- /dev/null +++ b/Master/texmf-dist/tex/plain/gustlib/map/tsp.tex @@ -0,0 +1,49 @@ +% TSP.TEX + +% Marek Ry\'cko + +% Macro \tsp +% Text SPace + +% uses SPLIT.TEX + +% version 0.0 24.07.1993 +% version 0.2, 8.10.1993 +% -- no \input map +% version 0.3 1.5.1996 +% -- english description + + +% uses SPLIT +% uses MAP + + +\def\tsp + %#1% + {\map + {\ifx\mapcur\space + \hskip\tspsp\relax + \else + \mapcur + % if it is not the last element -- join using kern: + \ifx\mappost\empty \else + % ``future'' is nonempty; + % we put interletter spacing only if + % next character is not space: + \split\mappost\tsptest\fool + \ifx\tsptest\space + % will be space, don't put glue: + \else + % not kern to make it streachable: + \nobreak\hskip\tsplet\relax + \fi + \fi + \fi + }% the end of first parameter + %{#1}% + } +% default parameters: +% the amount of space in place of the space character: + \def\tspsp {0.9em plus.3em minus.2em} +% distance between letters: + \def\tsplet {.1666667em}% diff --git a/Master/texmf-dist/tex/plain/gustlib/map/tun-test.mex b/Master/texmf-dist/tex/plain/gustlib/map/tun-test.mex new file mode 100644 index 00000000000..9034c81ef90 --- /dev/null +++ b/Master/texmf-dist/tex/plain/gustlib/map/tun-test.mex @@ -0,0 +1,51 @@ +% TUN-TEST.MEX (Mazovia) + +% test zestawu makr TSP + +% Bogus/law Jackowski i Marek Ry/cko +% 9.10.94, dotkni/ete 14 lutego 1997 r. + +\input split +\input map +\input tun +\prefixing + +\def\zda + {Moim zdaniem ten tekst powinien by{/c} podkre{/s}lony...} +\edef\aka + {% + \zda\ + \zda\ + \zda\ + \zda\ + \zda + } +\def\tes#1% + {\expandafter\tun\expandafter{#1}\vskip5pt} +\def\uf{\afterassignment\tunfont\font\tunfont} +\footline{\hfill\tenrm\expandafter\tun\expandafter{\the\pageno}\hfill} +\pageno1001 + +%\def\tunsep {.25ex}% +%\def\tunwd {.1ex}% +\def\tunfac {1.1}% + +\tes\zda + +\uf plr17 + +\tes\zda + +\uf plb10 + +\tes\zda + +\uf plr17 scaled\magstep1 +\baselineskip22.4pt + +\tes\zda + +%\edef\param{\licz{157}} +%\expandafter\tun\expandafter{\param} + +\end diff --git a/Master/texmf-dist/tex/plain/gustlib/map/tun.tex b/Master/texmf-dist/tex/plain/gustlib/map/tun.tex new file mode 100644 index 00000000000..275135adb97 --- /dev/null +++ b/Master/texmf-dist/tex/plain/gustlib/map/tun.tex @@ -0,0 +1,51 @@ +% TUN.TEX + +% Marek Ry\'cko + +% Macro \tun +% Text UNderline + +% version 0.1, 9.10.94 +% version 0.3, 1.5.1996 +% -- english description + + +% uses SPLIT +% uses MAP + + +\newbox\boxA +\newdimen\dimenA +\newdimen\dimenB + + +\def\tun + %#1% + {\map + {\ifx\mapcur\space + \space + \else + \tunel\mapcur + \fi + }% + %{#1}% + } +\def\tunel + #1% what to underline + {{% + #1% + \setbox\boxA\hbox{#1}% + \dimenA-\tunsep + \dimenB-\dimenA \advance\dimenB\tunwd + \llap{\hbox to\wd\boxA{\hss + \vrule height\dimenA depth\dimenB width\tunfac\wd\boxA + \hss}}% + }} + +% default parameters: +% underline separator width + \def\tunsep {.25ex}% +% underline width + \def\tunwd {.09ex}% +% underline factor of letter width: + \def\tunfac {1}% diff --git a/Master/texmf-dist/tex/plain/gustlib/mcol-ex.tex b/Master/texmf-dist/tex/plain/gustlib/mcol-ex.tex new file mode 100644 index 00000000000..0992ef39131 --- /dev/null +++ b/Master/texmf-dist/tex/plain/gustlib/mcol-ex.tex @@ -0,0 +1,149 @@ +%%% przyklad skladu wielokolumnowego, | an example of multicolumn for plain +%%% oops... wielo/lamowego +%%% (opr. Staszek Wawrykiewicz) +\input mimulcol +%--------------------------------------------------------------------- + +%% sk/lad 1 /lamowy | 1 column +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 + +\columnsep=24pt % odleg/lo/s/c mi/edzy /lamami| distance between columns +\columnseprule=0.4pt % opcjonalna pionowa | optional vertical rule + % krecha mi/edzy lamami | between columns +\multicolbaselineskip=0pt plus 0.2pt % opcjonalna | + % korekta | optional correction of + % \baselineskip +%\raggedcolumns % opcjonalne wy/l/aczenie | optional toggle to turn + % wyr/ownywania prawego | off balancing of the right + % /lamu | column + +%% a teraz 3 /lamy | now 3 columns +\beginmulticols 3[{{\bf TITLE}}] % opcjonalny tekst |optional text (e.g. title) + +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\footnote{**}{% +This is a small footnote. +This is a small footnote. +This is a small footnote.} +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 262 263 264 265 266 267 268 269 270 +271 272 273 274 275 276 277 278 279 280 +281 282 283 284 285 286 287 288 289 290 +291 292 293 294 295 296 297 298 299 300 + +301 302 303 304 305 306 307 308 309 310 +311 312 313 314 315 316 317 318 319 320 +321 322 323 324 325 326 327 328 329 330 +331 332 333 334 335 336 337 338 339 340 +341 342 343 344 345 346 347 348 349 350 +351 352 353 354 355 356 357 358 359 360 +361 362 363 364 365 366 367 368 369 370 +371 372 373 374 375 376 377 378 379 380 +381 382 383 384 385 386 387 388 389 390 +391 392 393 394 395 396 397 398 399 400 + +401 402 403 404 405 406 407 408 409 410 +411 412 413 414 415 416 417 418 419 420 +421 422 423 424 425 426 427 428 429 430 +431 432 433 434 435 436 437 438 439 440 +441 442 443 444 445 446 447 448 449 450 +451 452 453 454 455 456 457 458 459 460 +461 462 463 464 465 466 467 468 469 470 +471 472 473 474 475 476 477 478 479 480 +481 482 483 484 485 486 487 488 489 490 +491 492 493 494 495 496 497 498 499 500 + +501 502 503 504 505 506 507 508 509 510 +511 512 513 514 515 516 517 518 519 520 +521 522 523 524 525 526 527 528 529 530 +531 532 533 534 535 536 537 538 539 540 +541 542 543 544 545 546 547 548 549 550 +551 552 553 554 555 556 557 558 559 560 +561 562 563 564 565 566 567 568 569 570 +571 572 573 574 575 576 577 578 579 580 +581 582 583 584 585 586 587 588 589 590 +591 592 593 594 595 596 597 598 599 600 +\endmulticols + +%Ponownie 1 /lam % Again 1 column +601 602 603 604 605 606 607 608 609 610 +611 612 613 614 615 616 617 618 619 620 +621 622 623 624 625 626 627 628 629 630 +631 632 633 634 635 636 637 638 639 640 +641 642 643 644 645 646 647 648 649 650 +651 652 653 654 655 656 657 658 659 660 +661 662 663 664 665 666 667 668 669 670 +671 672 673 674 675 676 677 678 679 680 +681 682 683 684 685 686 687 688 689 690 +691 692 693 694 695 696 697 698 699 700 + +%% a teraz 2 /lamy % Then 2 columns +\beginmulticols 2 +701 702 703 704 705 706 707 708 709 710 +711 712 713 714 715 716 717 718 719 720 +721 722 723 724 725 726 727 728 729 730 +731 732 733 734 735 736 737 738 739 740 +741 742 743 744 745 746 747 748 749 750 +751 752 753 754 755 756 757 758 759 760 +761 762 763 764 765 766 767 768 769 770 +771 772 773 774 775 776 777 778 779 780 +781 782 783 784 785 786 787 788 789 790 +791 792 793 794 795 796 797 798 799 800 + +801 802 803 804 805 806 807 808 809 810 +811 812 813 814 815 816 817 818 819 820 +821 822 823 824 825 826 827 828 829 830 +831 832 833 834 835 836 837 838 839 840 +841 842 843 844 845 846 847 848 849 850 +851 852 853 854 855 856 857 858 859 860 +861 862 863 864 865 866 867 868 869 870 +871 872 873 874 875 876 877 878 879 880 +881 882 883 884 885 886 887 888 889 890 +891 892 893 894 895 896 897 898 899 900 + +901 902 903 904 905 906 907 908 909 910 +911 912 913 914 915 916 917 918 919 920 +921 922 923 924 925 926 927 928 929 930 +931 932 933 934 935 936 937 938 939 940 +941 942 943 944 945 946 947 948 949 950 +951 952 953 954 955 956 957 958 959 960 +961 962 963 964 965 966 967 968 969 970 +971 972 973 974 975 976 977 978 979 980 +981 982 983 984 985 986 987 988 989 990 +991 992 993 994 995 996 997 998 999 1000 +\endmulticols + +%% a teraz 1 /lam % and again 1 column +1001 1002 1003 1004 1005 1006 1007 1008 1009 1010 +1011 1012 1013 1014 1015 1016 1017 1018 1019 1020 +1021 1022 1023 1024 1025 1026 1027 1028 1029 1030 +1031 1032 1033 1034 1035 1036 1037 1038 1039 1040 +1041 1042 1043 1044 1045 1046 1047 1048 1049 1050 +1051 1052 1053 1054 1055 1056 1057 1058 1059 1060 +1061 1062 1063 1064 1065 1066 1067 1068 1069 1070 +1071 1072 1073 1074 1075 1076 + +\bye diff --git a/Master/texmf-dist/tex/plain/gustlib/meashor.tex b/Master/texmf-dist/tex/plain/gustlib/meashor.tex new file mode 100644 index 00000000000..59ef7db314d --- /dev/null +++ b/Master/texmf-dist/tex/plain/gustlib/meashor.tex @@ -0,0 +1,71 @@ +% =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= +% Autor: | Author: +% Bogus\l{}aw Jackowski, 22 V 1990 + email: B.Jackowski@gust.org.pl +% Sprawdzone i udost/epnione: | Revised and released: +% 18 II 1997 +% =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= +% Makro \meashor umieszczone | Macro \meashor, when used in +% w akapicie nadaje warto/s/c | a paragraph, assigns values to +% dw/om zmiennym: \measnum i \measdim, | two registers: \measnum and +% oznaczaj/acym odpowiednio numer | \measdim (number of the line +% wiersza akapitu w kt/orym pojawi/lo | of the paragraph from which the +% si/e makro \meashor i odleg/lo/s/c | macro was invoked and the distance +% punktu pomiaru od lewego skraju | of the measuring point from the +% akapitu. | left edge of the paragraph, resp.). +% Przyk/lad: | Example: +% Fragment programu | The piece of code +% Ala\meashor\ ma kota | Alice\meashor\ has a cat +% spowoduje nadanie zmiennym | results in assigning the +% nast/epuj/acych warto/sci: | following values +% \measnum=1 | \measnum=1 +% \measdim=35.27782pt (parindent | \measdim=41.94447pt (parindent +% plus d/lugo/s/c s/lowa Ala | plus the length of the word Alice +% dla fontu CMR10). | for the font CMR10). +% Autor b/edzie wdzi/eczny za | The author will be grateful for +% poinformowanie o zgrabnych | informing him about neat +% zastosowaniach makra \meashor. | applications of the macro \meashor. +% =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= +\newif\ifmeasdisp % ,,kosmetyka'' | cosmetic powder +\measdispfalse % ustawienie domy/slne | default +\newcount\measnum % wynik | result +\newdimen\measdim % wynik | result +\def\meashor{% + \ifhmode + \bgroup % zmiany parametr/ow s/a lokalne | parameters settings are local + \leftskip0pt \rightskip0pt + \parfillskip=0pt plus 1fil + \predisplaypenalty=10000 + \postdisplaypenalty=10000 + \displaywidowpenalty=\widowpenalty + \abovedisplayskip=-\baselineskip + \belowdisplayskip=-\baselineskip + \abovedisplayshortskip=-\baselineskip + \belowdisplayshortskip=-\baselineskip + \null % pozostaw poprzedzaj/ac/a spacj/e | leave preceding space + $$\global\measdim=\predisplaysize$$% + \ifnum\prevgraf=0 + \immediate\write16{! + perhaps restricted hmode: + MEASURING IGNORED}% + \else + \global\advance\measdim by -2em + \global\measnum=\prevgraf + \global\advance\measnum by -3 + \ifmeasdisp + \immediate\write16{>> + \the\measnum: \the\measdim}% + \fi +% \advance\prevgraf to operacja zabroniona | \advance\prevgraf is forbidden + \global\advance\measnum by -1 + \global\prevgraf=\measnum + \global\advance\measnum by 1 + \kern\measdim + \fi + \egroup + \else + \immediate\write16{! vmode: + MEASURING IGNORED}% + \fi +}% +\endinput diff --git a/Master/texmf-dist/tex/plain/gustlib/mimulcol.tex b/Master/texmf-dist/tex/plain/gustlib/mimulcol.tex new file mode 100644 index 00000000000..9ea91182ca6 --- /dev/null +++ b/Master/texmf-dist/tex/plain/gustlib/mimulcol.tex @@ -0,0 +1,286 @@ +% copied from TUGboat, Vol.10 (1989) No.3 p.409--415 (B.J.) +% MULTICOLUMN LaTeX environement. +% Author: F. Mittelbach +% Quick adaptation to PLAIN: B. Jackowski (Ver. 0.9); alterations are +% marked by `(B.J.)' +% +% Since I do not understand floats I assume that they are +% not used while multicolumning. Maybe some other day... +% +% ======================================================================== +% --------------------- PSEUDO-LaTeX ENVIRONEMENT ------------------------ +% ======================================================================== +\catcode`\@=11 +\newtoks\@uteroutput % (P.P.) +\@uteroutput\output % +% -------------------------- +\def\adjust@PLAIN{% + \newlinechar=`\^^J + \columnwidth\hsize \textwidth\hsize + \@colht\vsize \@colroom\vsize % NO FLOATs PLEASE! + \def\makefootline{\baselineskip24\p@\hbox to \textwidth{\the\footline}} + \def\pagebody{\vbox to\@colht{\boxmaxdepth\maxdepth \pagecontents}} + \def\vfootnote##1{\insert\footins\bgroup + \hsize=\textwidth + \interlinepenalty\interfootnotelinepenalty + \splittopskip\ht\strutbox % top baseline for broken footnotes + \splitmaxdepth\dp\strutbox \floatingpenalty\@MM + \leftskip\z@skip \rightskip\z@skip \spaceskip\z@skip \xspaceskip\z@skip + \textindent{##1}\footstrut\futurelet\next\fo@t} +} +% -------------------------- +\mathchardef\@Mi=10001 +\newcount\@tempcnta % temporary count register +% ------ These four macros differ from their LaTeX twins ------ +\def\thepage{\number\pageno} +\def\addvspace#1{\vskip#1\relax} +\def\typeout#1{\immediate\write\z@{#1}} +\def\@warning#1{\typeout{WARNING: #1.}} +% -------------------------- +\def\newpage{\par\vfil\penalty -\@M} +\long\def\@ifundefined#1#2#3{\expandafter\ifx\csname + #1\endcsname\relax#2\else#3\fi} +\def\@ifnextchar#1#2#3{\let\@tempe #1\def\@tempa{#2}\def\@tempb{#3}\futurelet + \@tempc\@ifnch} +\def\@ifnch{\ifx \@tempc \@sptoken \let\@tempd\@xifnch + \else \ifx \@tempc \@tempe\let\@tempd\@tempa\else\let\@tempd\@tempb\fi + \fi \@tempd} +\def\:{\let\@sptoken= } \: % this makes \@sptoken a space token +\def\:{\@xifnch} \expandafter\def\: {\futurelet\@tempc\@ifnch} +% -------------------------- +\def\@spaces{\space\space\space\space} +\def\@width{width} +\newdimen\@colroom +\newdimen\@colht +\newdimen\columnwidth +\newdimen\textwidth +% -------------------------- +\newdimen\columnsep \columnsep=24pt +\newdimen\columnseprule \columnseprule = 0pt +% ======================================================================== +% -------------------- MITTELBACH's MACROS ------------------------------- +% ======================================================================== +\newcount\unbalance \unbalance = 0 +\newcount\collectmore \collectmore = 0 +\newcount\tracingmulticols \tracingmulticols = 0 +\newcount\col@number +\newcount\doublecol@number +\newcount\multicoltolerance \multicoltolerance = 9999 +\newdimen\page@free +\newdimen\premulticols \premulticols = 50pt +\newdimen\postmulticols \postmulticols = 20pt +\newskip\multicolsep \multicolsep = 12pt plus 4pt minus 3pt +\newskip\multicolbaselineskip \multicolbaselineskip = 0pt +\newbox\partial@page +\newif\ifshr@nking +% +\@ifundefined{mult@cols}{}{\endinput} +\ifnum\tracingmulticols>\z@ % <--------------------------------- added (B.J.) + \typeout{% + MULTI COLUMN format designed by Frank Mittelbach --- see TUGboat} + \typeout{% + Vol.10 (1989) No.3 pp.407--415> for doc.; PLAIN ver. 0.9 by B. Jackowski} +\fi +% +\def\beginmulticols{\begingroup\multicols}% <--- substitute of LaTeX's phrase + % \begin{...} ... \end{...} (B.J.) +% +\def\multicols#1{\col@number#1\relax + % + \adjust@PLAIN + % + \ifnum\col@number<\@ne + \@warning{Using `number\col@number' + columns doesn't seem a good idea.^^J + \@spaces\@spaces I therefore use two columns instead}% + \col@number\tw@ \fi + \@ifnextchar[\mult@cols{\mult@cols[]}} +% +\def\mult@cols[#1]{\@ifnextchar[% + {\mult@@cols{#1}}% + {\mult@@cols{#1}[\premulticols]}} +% +\def\mult@@cols#1[#2]{% + \ifnum\tracingmulticols>\z@ + \typeout{^^J^^JStarting multicolumn + output with \the\col@number + \space columns:^^J}\fi + \enough@room#2% + {#1}\par % <-------------- instead of #1\par---it seems more natural (B.J.) + % the more so, as outer {} braces inside [] brackets are gobbled: + % \multicols{...}[cosik] is equivalent to \multicols{...}[{cosik}] + \addvspace\multicolsep + \begingroup + \prepare@multicols\ignorespaces} +% +\def\enough@room#1{\par \penalty\z@ + \page@free \pagegoal + \advance \page@free -\pagetotal + \ifnum \tracingmulticols>\z@ + \typeout{Current page:}% + \message{\@spaces goal height=% + \the\pagegoal: used \the\pagetotal + \space -> free\the\page@free}% + \typeout{\@spaces needed \the#1 + (for \string#1)}\fi + \ifdim \page@free <#1\newpage \fi} +% +\def\prepare@multicols{% + \output{\global\setbox\partial@page + \vbox{\unvbox\@cclv}}\eject + \vbadness9999 \hbadness5000 + \tolerance\multicoltolerance + \doublecol@number\col@number + \multiply\doublecol@number\tw@ + \advance\baselineskip\multicolbaselineskip + \advance\@colroom-\ht\partial@page + \vsize\col@number\@colroom + \advance\vsize\collectmore\baselineskip + \hsize\columnwidth \advance\hsize\columnsep + \advance\hsize-\col@number\columnsep + \divide\hsize\col@number +% \linewidth\hsize % <----------------- it seems unnecessary in PLAIN (B.J.) + \output{\multi@columnout}% + \multiply\count\footins\col@number + \multiply\skip \footins\col@number + \reinsert@footnotes} +% +\def\endmulticols{\par\penalty\z@ + \output{\balance@columns}\eject + \endgroup \reinsert@footnotes + \global\unbalance\z@ + \enough@room\postmulticols + \addvspace\multicolsep + \nointerlineskip % <------------------------------------------ added (B.J.) + \ifnum \tracingmulticols>\z@ + \typeout{^^JEnding multicolumn + output.^^J^^J}\fi + \endgroup} +% +\def\process@cols#1#2{\count@#1\relax + \loop #2% + \advance\count@\tw@ + \ifnum\count@<\doublecol@number + \repeat} +% +\def\page@sofar{\unvbox\partial@page + \process@cols\z@{\wd\count@\hsize}% + \hbox to \textwidth{% + \process@cols\tw@{\box\count@ + \hss\vrule\@width\columnseprule\hss}% + \box\z@}} +% +\def\reinsert@footnotes{\ifvoid\footins\else + \insert\footins{\unvbox\footins}\fi} +% +\def\multi@columnout{% + \ifnum\outputpenalty <-\@Mi + \speci@ls + \else + \splittopskip\topskip + \splitmaxdepth\maxdepth + \dimen@\@colroom + \divide\skip\footins\col@number + \ifvoid\footins \else + \advance\dimen@-\skip\footins + \advance\dimen@-\ht\footins \fi + \process@cols\tw@{\setbox\count@ + \vsplit\@cclv to\dimen@}% + \setbox\z@\vsplit\@cclv to\dimen@ + \ifvoid\@cclv \else + \unvbox\@cclv + \penalty\outputpenalty + \ifnum \tracingmulticols>\tw@ + \hrule\allowbreak \fi + \ifvoid\footins\else % <----------------------------------- added (B.J.) + \@warning{I moved some lines to the next page.^^J + \@spaces\@spaces Footnotes on page \thepage\space + might be wrong}\fi\fi + \setbox\@cclv\vbox{\page@sofar}% +% \plainoutput % <---------------- instead of \@makecol\@outputpage (B.J.) + \the\@uteroutput % <------------- instead of \plainoutput (P.P.) + \global\@colroom\@colht + \process@deferreds + \ifnum\tracingmulticols>\@ne + \typeout{Colroom: \the\@colht\space after float + space removed = \the\@colroom}\fi + \global\vsize\col@number\@colroom + \global\advance\vsize \collectmore\baselineskip + \multiply\skip\footins\col@number + \fi} +% +\def\speci@ls{% + \typeout{Floats and marginpars not allowed inside + `multicols' environement!}% + \unvbox\@cclv\reinsert@footnotes +% \gdef\@currlist{}% <----------------------------- not used in PLAIN (B.J.) + } +% +\def\process@deferreds{}% <---------- instead of the `percented' macro (B.J.) + % (temporarily: until I'll learn what all that + % mumbling means) +%\def\process@deferreds{% +% \@floatplacement +% \begingroup +% \let\@tempb\@deferlist +% \gdef\@deferlist{}% +% \let\@elt\@scoelt +% \@tempb \endgroup} +% +% Originally: <------------------------------------------------------- (B.J.) +%\def\raggedcolumns{\@bsphack\shr@nkingtrue\@esphack} +%\def\flushcolumns{\@bsphack\shr@nkingfalse\@esphack} +% +\def\raggedcolumns{\shr@nkingtrue} +\def\flushcolumns{\shr@nkingfalse} +% +\def\balance@columns{% + \splittopskip\topskip + \splitmaxdepth\maxdepth + \setbox\z@\vbox{\unvbox\@cclv}\dimen@\ht\z@ + \advance\dimen@ \col@number\topskip + \advance\dimen@ -\col@number\baselineskip + \divide\dimen@ \col@number + \advance\dimen@ \unbalance\baselineskip + \ifnum\tracingmulticols>\@ne + \typeout{Balance columns: \ifnum\unbalance=\z@\else + (off balance=\number\unbalance)\fi}% + \fi + {\vbadness\@M + \loop + {\process@cols\@ne{\global\setbox\count@\box\voidb@x}}% + \global\setbox\@ne\copy\z@ + {\process@cols\thr@@{\global\setbox\count@ + \vsplit\@ne to\dimen@}}% + % + % ... After \process@cols has done its job we have the following situation: + % box0 <-- all material + % box3 <-- first column + % box5 <-- second column + % ... + % box1 <-- last column ... + % + \ifnum\tracingmulticols>\@ne + \message{\@spaces First column = \the\ht\thr@@}\fi + \ifshr@nking \global\setbox\thr@@\vbox{\unvbox\thr@@}% + \ifnum\tracingmulticols>\@ne + \message{ after shrinking \the\ht\thr@@}\fi\fi + \ifnum\tracingmulticols>\@ne + \message{<> last column = \the\ht\@ne}% + \typeout{}\fi + \ifdim\ht\@ne > \ht\thr@@ + \global\advance\dimen@\p@ + \repeat}% + \dimen@\ht\thr@@ + \process@cols\z@{\@tempcnta\count@ + \advance\@tempcnta\@ne + \setbox\count@\vtop to\dimen@ + {\unvbox\@tempcnta + \ifshr@nking\vfill\fi}}% + \global\vsize\@colroom + \global\advance\vsize\ht\partial@page + \page@sofar} +% ======================================================================== +\catcode`\@=12 % default PLAIN value +% ======================================================================== +\endinput diff --git a/Master/texmf-dist/tex/plain/gustlib/plbtx993/plbtxbst.doc b/Master/texmf-dist/tex/plain/gustlib/plbtx993/plbtxbst.doc new file mode 100644 index 00000000000..24f6fc34ca7 --- /dev/null +++ b/Master/texmf-dist/tex/plain/gustlib/plbtx993/plbtxbst.doc @@ -0,0 +1,2605 @@ +% 22 X 1997 +% ========= +% +% To jest: +% PLBTXBST v.0.99.3[a-z] +% +% system polskich styli bibliograficznych dla programu BibTeX 0.99[a-z] +% +% autor: (c) B.Licho\'nski 1994 +% +% historia: v.0.99[a-z] 2 Paz 1994 -- pierwsze wydanie +% v.0.99.1[a-z] 9 Paz 1997 -- poprawka polegaj/aca na usuni/eciu +% sp/ojnika "i" przy wyliczaniu +% autor/ow +% v.0.99.2[a-z] 10 Paz 1997 -- poprawka polegaj/aca na usuni/eciu +% angielskiej nazwy Master's thesis +% na polsk/a ,,Praca magisterska'' +% v.0.99.3[a-z] 22 Paz 1997 -- poprawka polegaj/aca na dopisywaniu +% przecinka mi/edzy dwoma nazwiskami +% autor/ow +%% @texfile{ +%% author = "Bogus{\l}aw Licho\'nski", +%% version = "PLBTXBST v.0.99.3[a-z]", +%% date = "22 Paz 1994", +%% filename = "plbtxbst.doc", +%% address = "Gdynia ul. Kameliowa 17", +%% codetable = "ISO/ASCII", +%% supported = "yes", +%% docstring = "Definicje polskich styli bibliograficznych +%% dla programu BibTeX 0.99[a-z].", +%% } +% BibTeX `plain' Polish family + % version 0.99a for BibTeX versions 0.99a or later, LaTeX version 2.09. + % Copyright (C) 1985, all rights reserved by Oren Patashnik. + % Copyright (C) 1994, all rights reserved by Bogus/law Licho/nski. + % Copying of this file is authorized only if either + % (1) you make absolutely no changes to your copy, including name, or + % (2) if you do make changes, you name it something other than + % plbtxbst.doc, plplain.bst, plunsrt.bst, plalpha.bst, and plabbrv.bst. + % This restriction helps ensure that all standard polish styles are identical. + % The file plbtxbst.doc has the documentation for this style. +% Please notify Bogus/law Licho/nski of any bugs in +% these polish standard styles or in this documentation file. +% +% This is file plbtxbst.doc; it helps document bibliography styles, +% and is also a template file that you can use to make +% several different style files, if you have access to a C preprocessor. +% For example, the standard styles were made by doing something like +% cpp -P -DPLPLAIN plbtxbst.doc plplain.txt +% cpp -P -DPLUNSRT plbtxbst.doc plunsrt.txt +% cpp -P -DPLALPHA plbtxbst.doc plalpha.txt +% cpp -P -DPLABBRV plbtxbst.doc plabbrv.txt +% and then renaming after removing unwanted comments and blank lines. +% If you don't have access, you can edit this file by hand to imitate +% the preprocessor, with the following explanation of the C preprocessor +% constructs used here. +% +% The output of the preprocessor is the same as the input, except that certain +% lines will be excluded (and some blank lines will be added). The sequence +% #if VAR +% lines to be included when VAR is not zero +% #else +% lines to be included when VAR is zero +% #endif +% (with the #-signs appearing in column 1) means that one set or the other of +% the lines are to be included depending on the value of VAR. +% The #else part is optional. Comments can be added after #else and #endif. +% Variables can be set by +% #define VAR value +% and one can also use #ifdef VAR to see if VAR has any value, and #ifndef +% to see if it has none. +% Another #if form used in this file is #if !VAR, which includes the lines +% after the #if only if VAR is zero. +% +% Convention: Use all uppercase identifiers for these preprocessor variables +% so you can spot them easily +% +% The command line to the preprocessor should define one of PLPLAIN, PLUNSRT, +% PLALPHA or PLABBRV (though PLPLAIN will be used by default if none is given), +% and the following lines will set various boolean variables to control the +% various lines that are chosen from the rest of the file. +% Each boolean variable should be set true (1) or false (0) in each style. +% Here are the current variables, and their meanings: +% LAB_ALPH: an alphabetic label is used (if false then a numeric +% label is used) +% SORTED: the entries should be sorted by label (if nonnumeric) +% and other info, like authors (if false, then +% entries remain in order of occurrence) +% NAME_FULL: the authors, editors, etc., get the full names as +% given in the bibliography file (if false, the first +% names become initials) +% ATIT_LOWER: titles of non-"books" (e.g., articles) should be +% converted to lower-case, except the first letter or +% first letter after a colon +% (if false then they appear as in the database) +% MONTH_FULL: months are spelled out in full (if false, then +% they're abbreviated) +% JOUR_FULL: macro journal names are spelled out in full +% (if false then they are abbreviated, currently +% as they appear in ACM publications) +#ifndef PLUNSRT +# ifndef PLALPHA +# ifndef PLABBRV +# define PLPLAIN 1 +# endif +# endif +#endif +#ifdef PLPLAIN +% plain style (sorted numbers) +# define LAB_ALPH 0 +# define SORTED 1 +# define NAME_FULL 1 +# define ATIT_LOWER 1 +# define MONTH_FULL 1 +# define JOUR_FULL 1 +#endif +#ifdef PLUNSRT +% unsrt style (unsorted numbers) +# define LAB_ALPH 0 +# define SORTED 0 +# define NAME_FULL 1 +# define ATIT_LOWER 1 +# define MONTH_FULL 1 +# define JOUR_FULL 1 +#endif +#ifdef PLALPHA +% alpha style (sorted short alphabetics) +# define LAB_ALPH 1 +# define SORTED 1 +# define NAME_FULL 1 +# define ATIT_LOWER 1 +# define MONTH_FULL 1 +# define JOUR_FULL 1 +#endif +#ifdef PLABBRV +% abbrv style (sorted numbers, with abbreviations) +# define LAB_ALPH 0 +# define SORTED 1 +# define NAME_FULL 0 +# define ATIT_LOWER 1 +# define MONTH_FULL 0 +# define JOUR_FULL 0 +#endif +% +% Entry formatting: Similar to that recommended by Mary-Claire van Leunen +% in "A Handbook for Scholars". Book-like titles are italicized +% (emphasized) and non-book titles are converted to sentence +% capitilization (and not enclosed in quotes). +% This file outputs a \newblock between major blocks of an entry +% (the name \newblock is analogous to the names \newline and \newpage) +% so that the user can obtain an "open" format, which has a line break +% before each block and lines after the first are indented within blocks, +% by giving the optional \documentstyle argument `openbib'; +% The default is the "closed" format---blocks runs together. +% +% Citation alphabetic label format: +% [Knu73] for single author (or editor or key) +% [AHU83] (first letters of last names) for multiple authors +% +% Citation label numberic format: +% [number] +% +% Reference list ordering for sorted, alphabetic lables: +% alphabetical by citation label, then by author(s) or whatever +% passes for author in the absence of one, then by year, +% then title +% +% Reference list ordering for sorted, numeric lables: +% alphabetical by author(s) or whatever passes +% for author in the absence of one, then by year, then title +% +% Reference list ordering for unsorted: +% by the order cited in the text +% +% History +% 12/16/84 (HWT) Original `plain' version, by Howard Trickey. +% 12/23/84 (LL) Some comments made by Leslie Lamport. +% 2/16/85 (OP) Changes based on LL's comments, Oren Patashnik. +% 2/17/85 (HWT) Template file and other standard styles made. +% 3/28/85 (OP) First release, version 0.98b for BibTeX 0.98f. +% 5/ 9/85 (OP) Version 0.98c for BibTeX 0.98i: +% fixed Theoretical Computer Science macro name; +% fixed the format.vol.num.pages function. +% 1/24/88 (OP) Version 0.99a for BibTeX 0.99a, main changes: +% assignment operator (:=) arguments reversed; +% the preamble$ function outputs the database PREAMBLE; +% entry.max$ and global.max$ (built-in) variables replace +% entry.string.max and global.string.max functions; +% alphabetizing by year then title, not just title; +% many unnecessary ties removed; \it ==> \em; +% the `alpha' style uses a superscripted `+' instead of a +% `*' for unnamed names in constructing the label; +% the `abbrv' style now uses "Mar." and "Sept."; +% the functions calc.label and presort now look at just +% the fields they're supposed to; +% BOOKLET, MASTERSTHESIS, TECHREPORT use nonbook titles; +% INBOOK and INCOLLECTION take an optional type (e.g. +% type = "Section"), overriding the default "chapter"; +% BOOK, INBOOK, INCOLLECTION, and PROCEEDINGS now allow +% either volume or number, not just volume; +% INCOLLECTION now allows an edition and series field; +% PROCEEDINGS and INPROCEEDINGS now use the address field +% to tell where a conference was held; +% INPROCEEDINGS and PROCEEDINGS now allow either volume +% or number, and also a series field; +% MASTERSTHESIS and PHDTHESIS accept types other than +% "Master's thesis" and "PhD thesis"; +% UNPUBLISHED now outputs, in one block, note then date; +% MANUAL now prints out the organization in +% the first block if the author field is empty; +% MISC can't be empty---it requires some optional field. +% 6/6/94 (BL) Polish PLPLAIN styles by Bogus/law Licho/nski. +% +% The ENTRY declaration +% Like Scribe's (according to pages 231-2 of the April '84 edition), +% but no fullauthor or editors fields because BibTeX does name handling. +% The annote field is commented out here because this family doesn't +% include an annotated bibliography style. And in addition to the fields +% listed here, BibTeX has a built-in crossref field, explained later. + +ENTRY +% Fields: + { address +% Usually the address of a publisher or other type of organization. +% Put information in this field only if it helps the reader find the +% thing---for example you should omit the address of a major +% publisher entirely. For a PROCEEDINGS or an INPROCEEDINGS, +% however, it's the address of the conference; for those two entry +% types, include the publisher's or organization's address, if +% necessary, in the publisher or organization field. +% annote +% Long annotation---for annotated bibliographies (begins sentence). + author +% Name(s) of author(s), in BibTeX name format. + booktitle +% Book title when the thing being referenced isn't the whole book. +% For book entries, the title field should be used instead. + chapter +% Chapter (or section or whatever) number. + edition +% Edition of a book---should be an ordinal (e.g., "Second"). + editor +% Name(s) of editor(s), in BibTeX name format. +% If there is also an author field, then the editor field should be +% for the book or collection that the work appears in. + howpublished +% How something strange has been published (begins sentence). + institution +% Sponsoring institution of a technical report. + journal +% Journal name (macros are provided for many). + key +% Alphabetizing, labeling, and cross-referencing key +% (needed when an entry has no author or editor). + month +% Month (macros are provided). + note +% To help the reader find a reference (begins sentence). + number +% Number of a journal or technical report, or of a work in a series. + organization +% Organization sponsoring a conference (or publishing a manual); if +% the editor (or author) is empty, and if the organization produces +% an awkward label or cross reference, you should put appropriately +% condensed organization information in the key field as well. + pages +% Page number or numbers (use `--' to separate a range, use `+' +% to indicate pages following that don't form a simple range). + publisher +% Publisher name. + school +% School name (for theses). + series +% The name of a series or set of books. +% An individual book will will also have it's own title. + title +% The title of the thing you're referred to. + type +% Type of a Techreport (e.g., "Research Note") to be used instead of +% the default "Technical Report"; or, similarly, the type of a +% thesis; or of a part of a book. + volume +% The volume number of a journal or multivolume work. + year +% The year should contain only numerals (technically, it should end +% with four numerals, after purification; doesn't a begin sentence). + } +% There are no integer entry variables + {} +% These string entry variables are used to form the citation label. +% In a storage pinch, sort.label can be easily computed on the fly. +#if LAB_ALPH +#if SORTED + { label extra.label sort.label } +#else !SORTED +% It doesn't seem like a good idea to use an order-of-citation +% reference list when using alphabetic labels, but when this happens +% we do things a little differently + { label } +#endif SORTED +#else !LAB_ALPH + { label } +#endif LAB_ALPH + +% Each entry function starts by calling output.bibitem, to write the +% \bibitem and its arguments to the .BBL file. Then the various fields +% are formatted and printed by output or output.check. Those functions +% handle the writing of separators (commas, periods, \newblock's), +% taking care not to do so when they are passed a null string. +% Finally, fin.entry is called to add the final period and finish the +% entry. +% +% A bibliographic reference is formatted into a number of `blocks': +% in the open format, a block begins on a new line and subsequent +% lines of the block are indented. A block may contain more than +% one sentence (well, not a grammatical sentence, but something to +% be ended with a sentence ending period). The entry functions should +% call new.block whenever a block other than the first is about to be +% started. They should call new.sentence whenever a new sentence is +% to be started. The output functions will ensure that if two +% new.sentence's occur without any non-null string being output between +% them then there won't be two periods output. Similarly for two +% successive new.block's. +% +% The output routines don't write their argument immediately. +% Instead, by convention, that argument is saved on the stack to be +% output next time (when we'll know what separator needs to come +% after it). Meanwhile, the output routine has to pop the pending +% output off the stack, append any needed separator, and write it. +% +% To tell which separator is needed, we maintain an output.state. +% It will be one of these values: +% before.all just after the \bibitem +% mid.sentence in the middle of a sentence: comma needed +% if more sentence is output +% after.sentence just after a sentence: period needed +% after.block just after a block (and sentence): +% period and \newblock needed. +% Note: These styles don't use after.sentence +% +% VAR: output.state : INTEGER -- state variable for output +% +% The output.nonnull function saves its argument (assumed to be nonnull) +% on the stack, and writes the old saved value followed by any needed +% separator. The ordering of the tests is decreasing frequency of +% occurrence. +% +% output.nonnull(s) == +% BEGIN +% s := argument on stack +% if output.state = mid.sentence then +% write$(pop() * ", ") +% -- "pop" isn't a function: just use stack top +% else +% if output.state = after.block then +% write$(add.period$(pop())) +% newline$ +% write$("\newblock ") +% else +% if output.state = before.all then +% write$(pop()) +% else -- output.state should be after.sentence +% write$(add.period$(pop()) * " ") +% fi +% fi +% output.state := mid.sentence +% fi +% push s on stack +% END +% +% The output function calls output.nonnull if its argument is non-empty; +% its argument may be a missing field (thus, not necessarily a string) +% +% output(s) == +% BEGIN +% if not empty$(s) then output.nonnull(s) +% fi +% END +% +% The output.check function is the same as the output function except that, if +% necessary, output.check warns the user that the t field shouldn't be empty +% (this is because it probably won't be a good reference without the field; +% the entry functions try to make the formatting look reasonable even when +% such fields are empty). +% +% output.check(s,t) == +% BEGIN +% if empty$(s) then +% warning$("empty " * t * " in " * cite$) +% else output.nonnull(s) +% fi +% END +% +% The output.bibitem function writes the \bibitem for the current entry +% (the label should already have been set up), and sets up the separator +% state for the output functions. And, it leaves a string on the stack +% as per the output convention. +% +% output.bibitem == +% BEGIN +% newline$ +% write$("\bibitem[") % for alphabetic labels, +% write$(label) % these three lines +% write$("]{") % are used +% write$("\bibitem{") % this line for numeric labels +% write$(cite$) +% write$("}") +% push "" on stack +% output.state := before.all +% END +% +% The fin.entry function finishes off an entry by adding a period to the +% string remaining on the stack. If the state is still before.all +% then nothing was produced for this entry, so the result will look bad, +% but the user deserves it. (We don't omit the whole entry because the +% entry was cited, and a bibitem is needed to define the citation label.) +% +% fin.entry == +% BEGIN +% write$(add.period$(pop())) +% newline$ +% END +% +% The new.block function prepares for a new block to be output, and +% new.sentence prepares for a new sentence. +% +% new.block == +% BEGIN +% if output.state <> before.all then +% output.state := after.block +% fi +% END +% +% new.sentence == +% BEGIN +% if output.state <> after.block then +% if output.state <> before.all then +% output.state := after.sentence +% fi +% fi +% END +% + +INTEGERS { output.state before.all mid.sentence after.sentence after.block } + +FUNCTION {init.state.consts} +{ #0 'before.all := + #1 'mid.sentence := + #2 'after.sentence := + #3 'after.block := +} + +% the variables s and t are temporary string holders + +STRINGS { s t } + +FUNCTION {output.nonnull} +{ 's := + output.state mid.sentence = + { ", " * write$ } + { output.state after.block = + { add.period$ write$ + newline$ + "\newblock " write$ + } + { output.state before.all = + 'write$ + { add.period$ " " * write$ } + if$ + } + if$ + mid.sentence 'output.state := + } + if$ + s +} + +FUNCTION {output} +{ duplicate$ empty$ + 'pop$ + 'output.nonnull + if$ +} + +FUNCTION {output.check} +{ 't := + duplicate$ empty$ + { pop$ "empty " t * " in " * cite$ * warning$ } + 'output.nonnull + if$ +} + +FUNCTION {output.bibitem} +{ newline$ +#if LAB_ALPH + "\bibitem[" write$ + label write$ + "]{" write$ +#else + "\bibitem{" write$ +#endif LAB_ALPH + cite$ write$ + "}" write$ + newline$ + "" + before.all 'output.state := +} + +% This function finishes all entries. + +FUNCTION {fin.entry} +{ add.period$ + write$ + newline$ +} + +FUNCTION {new.block} +{ output.state before.all = + 'skip$ + { after.block 'output.state := } + if$ +} + +FUNCTION {new.sentence} +{ output.state after.block = + 'skip$ + { output.state before.all = + 'skip$ + { after.sentence 'output.state := } + if$ + } + if$ +} + +% These three functions pop one or two (integer) arguments from the stack +% and push a single one, either 0 or 1. +% The 'skip$ in the `and' and `or' functions are used because +% the corresponding if$ would be idempotent + +FUNCTION {not} +{ { #0 } + { #1 } + if$ +} + +FUNCTION {and} +{ 'skip$ + { pop$ #0 } + if$ +} + +FUNCTION {or} +{ { pop$ #1 } + 'skip$ + if$ +} + +% Sometimes we begin a new block only if the block will be big enough. The +% new.block.checka function issues a new.block if its argument is nonempty; +% new.block.checkb does the same if either of its TWO arguments is nonempty. + +FUNCTION {new.block.checka} +{ empty$ + 'skip$ + 'new.block + if$ +} + +FUNCTION {new.block.checkb} +{ empty$ + swap$ empty$ + and + 'skip$ + 'new.block + if$ +} + +% The new.sentence.check functions are analogous. + +FUNCTION {new.sentence.checka} +{ empty$ + 'skip$ + 'new.sentence + if$ +} + +FUNCTION {new.sentence.checkb} +{ empty$ + swap$ empty$ + and + 'skip$ + 'new.sentence + if$ +} + +% Here are some functions for formatting chunks of an entry. +% By convention they either produce a string that can be followed by +% a comma or period (using add.period$, so it is OK to end in a period), +% or they produce the null string. +% +% A useful utility is the field.or.null function, which checks if the +% argument is the result of pushing a `missing' field (one for which no +% assignment was made when the current entry was read in from the database) +% or the result of pushing a string having no non-white-space characters. +% It returns the null string if so, otherwise it returns the field string. +% Its main (but not only) purpose is to guarantee that what's left on the +% stack is a string rather than a missing field. +% +% field.or.null(s) == +% BEGIN +% if empty$(s) then return "" +% else return s +% END +% +% Another helper function is emphasize, which returns the argument emphazised, +% if that is non-empty, otherwise it returns the null string. Italic +% corrections aren't used, so this function should be used when punctation +% will follow the result. +% +% emphasize(s) == +% BEGIN +% if empty$(s) then return "" +% else return "{\em " * s * "}" +% +% The format.names function formats the argument (which should be in +% BibTeX name format) into "First Von Last, Junior", separated by commas +% and with an "and" before the last (but ending with "et~al." if the last +% of multiple authors is "others"). This function's argument should always +% contain at least one name. +% +% VAR: nameptr, namesleft, numnames: INTEGER +% pseudoVAR: nameresult: STRING (it's what's accumulated on the stack) +% +% format.names(s) == +% BEGIN +% nameptr := 1 +% numnames := num.names$(s) +% namesleft := numnames +% while namesleft > 0 +% do +% % for full names: +% t := format.name$(s, nameptr, "{ff~}{vv~}{ll}{, jj}") +% % for abbreviated first names: +% t := format.name$(s, nameptr, "{f.~}{vv~}{ll}{, jj}") +% if nameptr > 1 then +% if namesleft > 1 then nameresult := nameresult * ", " * t +% else if numnames > 2 +% then nameresult := nameresult * "," +% fi +% if t = "others" +% then nameresult := nameresult * " et~al." +% else nameresult := nameresult * " and " * t +% fi +% fi +% else nameresult := t +% fi +% nameptr := nameptr + 1 +% namesleft := namesleft - 1 +% od +% return nameresult +% END +% +% The format.authors function returns the result of format.names(author) +% if the author is present, or else it returns the null string +% +% format.authors == +% BEGIN +% if empty$(author) then return "" +% else return format.names(author) +% fi +% END +% +% Format.editors is like format.authors, but it uses the editor field, +% and appends ", editor" or ", editors" +% +% format.editors == +% BEGIN +% if empty$(editor) then return "" +% else +% if num.names$(editor) > 1 then +% return format.names(editor) * ", editors" +% else +% return format.names(editor) * ", editor" +% fi +% fi +% END +% +% Other formatting functions are similar, so no "comment version" will be +% given for them. +% +% The `pop$' in this function gets rid of the duplicate `empty' value and +% the `skip$' returns the duplicate field value + +FUNCTION {field.or.null} +{ duplicate$ empty$ + { pop$ "" } + 'skip$ + if$ +} + +FUNCTION {emphasize} +{ duplicate$ empty$ + { pop$ "" } + { "{\em " swap$ * "}" * } + if$ +} + +INTEGERS { nameptr namesleft numnames } + +FUNCTION {format.names} +{ 's := + #1 'nameptr := + s num.names$ 'numnames := + numnames 'namesleft := + { namesleft #0 > } +#if NAME_FULL + { s nameptr "{ff~}{vv~}{ll}{, jj}" format.name$ 't := +#else + { s nameptr "{f.~}{vv~}{ll}{, jj}" format.name$ 't := +#endif NAME_FULL + nameptr #1 > + { numnames #2 = % %BL poprawka 22.10.97 (przecinek mi/edzy 2 autor/ow) + { ", " * } % + 'skip$ % + if$ % + namesleft #1 > + { ", " * t * } + { numnames #2 > + { "," * } + 'skip$ + if$ + t "others" = + { " i~in." * } %BL + { " " * t * } %BL poprawka 9.10.97 + if$ + } + if$ + } + 't + if$ + nameptr #1 + 'nameptr := + namesleft #1 - 'namesleft := + } + while$ +} + +FUNCTION {format.authors} +{ author empty$ + { "" } + { author format.names } + if$ +} + +FUNCTION {format.editors} +{ editor empty$ + { "" } + { editor format.names + editor num.names$ #1 > + { ", redaktorzy" * } %BL + { ", redaktor" * } %BL + if$ + } + if$ +} + +% The format.title function is used for non-book-like titles. +% For most styles we convert to lowercase (except for the very first letter, +% and except for the first one after a colon (followed by whitespace)), +% and hope the user has brace-surrounded words that need to stay capitilized; +% for some styles, however, we leave it as it is in the database. + +FUNCTION {format.title} +{ title empty$ + { "" } +#if ATIT_LOWER + { title "t" change.case$ } +#else + 'title +#endif ATIT_LOWER + if$ +} + +% By default, BibTeX sets the global integer variable global.max$ to the BibTeX +% constant glob_str_size, the maximum length of a global string variable. +% Analogously, BibTeX sets the global integer variable entry.max$ to +% ent_str_size, the maximum length of an entry string variable. +% The style designer may change these if necessary (but this is unlikely) + +% The n.dashify function makes each single `-' in a string a double `--' +% if it's not already +% +% pseudoVAR: pageresult: STRING (it's what's accumulated on the stack) +% +% n.dashify(s) == +% BEGIN +% t := s +% pageresult := "" +% while (not empty$(t)) +% do +% if (first character of t = "-") +% then +% if (next character isn't) +% then +% pageresult := pageresult * "--" +% t := t with the "-" removed +% else +% while (first character of t = "-") +% do +% pageresult := pageresult * "-" +% t := t with the "-" removed +% od +% fi +% else +% pageresult := pageresult * the first character +% t := t with the first character removed +% fi +% od +% return pageresult +% END + +FUNCTION {n.dashify} +{ 't := + "" + { t empty$ not } + { t #1 #1 substring$ "-" = + { t #1 #2 substring$ "--" = not + { "--" * + t #2 global.max$ substring$ 't := + } + { { t #1 #1 substring$ "-" = } + { "-" * + t #2 global.max$ substring$ 't := + } + while$ + } + if$ + } + { t #1 #1 substring$ * + t #2 global.max$ substring$ 't := + } + if$ + } + while$ +} + +% The format.date function is for the month and year, but we give a warning if +% there's an empty year but the month is there, and we return the empty string +% if they're both empty. + +FUNCTION {format.date} +{ year empty$ + { month empty$ + { "" } + { "there's a month but no year in " cite$ * warning$ + month + } + if$ + } + { month empty$ + 'year + { month " " * year * } + if$ + } + if$ +} + +% The format.btitle is for formatting the title field when it is a book-like +% entry---the style used here keeps it in uppers-and-lowers and emphasizes it. + +FUNCTION {format.btitle} +{ title emphasize +} + +% For several functions we'll need to connect two strings with a +% tie (~) if the second one isn't very long (fewer than 3 characters). +% The tie.or.space.connect function does that. It concatenates the two +% strings on top of the stack, along with either a tie or space between +% them, and puts this concatenation back onto the stack: +% +% tie.or.space.connect(str1,str2) == +% BEGIN +% if text.length$(str2) < 3 +% then return the concatenation of str1, "~", and str2 +% else return the concatenation of str1, " ", and str2 +% END + +FUNCTION {tie.or.space.connect} +{ duplicate$ text.length$ #3 < + { "~" } + { " " } + if$ + swap$ * * +} + +% The either.or.check function complains if both fields or an either-or pair +% are nonempty. +% +% either.or.check(t,s) == +% BEGIN +% if empty$(s) then +% warning$(can't use both " * t * " fields in " * cite$) +% fi +% END + +FUNCTION {either.or.check} +{ empty$ + 'pop$ + { "can't use both " swap$ * " fields in " * cite$ * warning$ } + if$ +} + +% The format.bvolume function is for formatting the volume and perhaps +% series name of a multivolume work. If both a volume and a series field +% are there, we assume the series field is the title of the whole multivolume +% work (the title field should be the title of the thing being referred to), +% and we add an "of <series>". This function is called in mid-sentence. + +FUNCTION {format.bvolume} +{ volume empty$ + { "" } + { "wolumen" volume tie.or.space.connect %BL + series empty$ + 'skip$ + { " serii " * series emphasize * } + if$ + "volume and number" number either.or.check + } + if$ +} + +% The format.number.series function is for formatting the series name +% and perhaps number of a work in a series. This function is similar to +% format.bvolume, although for this one the series must exist (and the +% volume must not exist). If the number field is empty we output either +% the series field unchanged if it exists or else the null string. +% If both the number and series fields are there we assume the series field +% gives the name of the whole series (the title field should be the title +% of the work being one referred to), and we add an "in <series>". +% We capitilize Number when this function is used at the beginning of a block. + +FUNCTION {format.number.series} +{ volume empty$ + { number empty$ + { series field.or.null } + { output.state mid.sentence = + { "number" } %tu skon. + { "Number" } + if$ + number tie.or.space.connect + series empty$ + { "there's a number but no series in " cite$ * warning$ } + { " serii " * series * } + if$ + } + if$ + } + { "" } + if$ +} + +% The format.edition function appends " edition" to the edition, if present. +% We lowercase the edition (it should be something like "Third"), because +% this doesn't start a sentence. + +FUNCTION {format.edition} +{ edition empty$ + { "" } + { output.state mid.sentence = + { "wydanie " edition "l" change.case$ * } + { "wydanie " edition "t" change.case$ * } + if$ + } + if$ +} + +% The format.pages function is used for formatting a page range in a book +% (and in rare circumstances, an article). +% +% The multi.page.check function examines the page field for a "-" or "," or "+" +% so that format.pages can use "page" instead of "pages" if none exists. +% Note: global.max$ here means "take the rest of the string" +% +% VAR: multiresult: INTEGER (actually, a boolean) +% +% multi.page.check(s) == +% BEGIN +% t := s +% multiresult := false +% while ((not multiresult) and (not empty$(t))) +% do +% if (first character of t = "-" or "," or "+") +% then multiresult := true +% else t := t with the first character removed +% fi +% od +% return multiresult +% END + +INTEGERS { multiresult } + +FUNCTION {multi.page.check} +{ 't := + #0 'multiresult := + { multiresult not + t empty$ not + and + } + { t #1 #1 substring$ + duplicate$ "-" = + swap$ duplicate$ "," = + swap$ "+" = + or or + { #1 'multiresult := } + { t #2 global.max$ substring$ 't := } + if$ + } + while$ + multiresult +} + +% This function doesn't begin a sentence so "pages" isn't capitalized. +% Other functions that use this should keep that in mind. + +FUNCTION {format.pages} +{ pages empty$ + { "" } + { pages multi.page.check + { "strony" pages n.dashify tie.or.space.connect } + { "strona" pages tie.or.space.connect } + if$ + } + if$ +} + +% The format.vol.num.pages function is for the volume, number, and page range +% of a journal article. We use the format: vol(number):pages, with some +% variations for empty fields. This doesn't begin a sentence. + +FUNCTION {format.vol.num.pages} +{ volume field.or.null + number empty$ + 'skip$ + { "(" number * ")" * * + volume empty$ + { "there's a number but no volume in " cite$ * warning$ } + 'skip$ + if$ } if$ pages empty$ 'skip$ { duplicate$ empty$ { pop$ + format.pages } { ":" * pages n.dashify * } if$ } if$ } + + +% The format.chapter.pages, if the chapter is present, puts whatever is in the +% type field (or else "chapter" if type is empty) in front of a chapter number. +% It then appends the pages, if present. This doesn't begin a sentence. + +FUNCTION {format.chapter.pages} +{ chapter empty$ + 'format.pages + { type empty$ + { "rozdzia/l" } %problem +%%% { "chapter" } %problem + { type "l" change.case$ } + if$ + chapter tie.or.space.connect + pages empty$ + 'skip$ + { ", " * format.pages * } + if$ + } + if$ +} + +% The format.in.ed.booktitle function is used for starting out a sentence +% that begins "In <booktitle>", putting an editor before the title if one +% exists. + +FUNCTION {format.in.ed.booktitle} +{ booktitle empty$ + { "" } + { editor empty$ + { "" booktitle emphasize * } %BL wywali/lem In + { "" format.editors * ", " * booktitle emphasize * } %BL + if$ + } + if$ +} + +% The function empty.misc.check complains if all six fields are empty, and +% if there's been no sorting or alphabetic-label complaint. + +FUNCTION {empty.misc.check} +{ author empty$ title empty$ howpublished empty$ + month empty$ year empty$ note empty$ + and and and and and +#if SORTED + key empty$ not and +#else !SORTED +#if LAB_ALPH + key empty$ not and +#endif LAB_ALPH +#endif SORTED + { "all relevant fields are empty in " cite$ * warning$ } + 'skip$ + if$ +} + +% The function format.thesis.type returns either the (case-changed) type field, +% if it is defined, or else the default string already on the stack +% (like "Master's thesis" or "PhD thesis"). + +FUNCTION {format.thesis.type} +{ type empty$ + 'skip$ + { pop$ + type "t" change.case$ + } + if$ +} + +% The function format.tr.number makes a string starting with "Technical Report" +% (or type, if that field is defined), followed by the number if there is one; +% it returns the starting part (with a case change) even if there is no number. +% This is used at the beginning of a sentence. + +FUNCTION {format.tr.number} +{ type empty$ + { "Raport instytutowy" } + 'type + if$ + number empty$ + { "t" change.case$ } + { number tie.or.space.connect } + if$ +} + +% Now come the cross-referencing functions (these are invoked because +% one entry in the database file(s) cross-references another, by giving +% the other entry's database key in a `crossref' field). This feature +% allows one or more titled things that are part of a larger titled +% thing to cross-reference the larger thing. These styles allow for +% five posibilities: (1) an ARTICLE may cross-reference an ARTICLE; +% (2) a BOOK, (3) INBOOK, or (4) INCOLLECTION may cross-reference a BOOK; +% or (5) an INPROCEEDINGS may cross-reference a PROCEEDINGS. +% Each of these is explained in more detail later. +% +% An ARTICLE entry type may cross reference another ARTICLE (this is +% intended for when an entire journal is devoted to a single topic--- +% but since there is no JOURNAL entry type, the journal, too, should be +% classified as an ARTICLE but without the author and title fields). +% This will result in two warning messages for the journal's entry +% if it's included in the reference list, but such is life. +% +% format.article.crossref == +% BEGIN +% if empty$(key) then +% if empty$(journal) then +% warning$("need key or journal for " * cite$ * +% " to crossref " * crossref) +% return(" \cite{" * crossref * "}") +% else +% return("In " * emphazise.correct (journal) * +% " \cite{" * crossref * "}") +% fi +% else +% return("In " * key * " \cite{" * crossref * "}") +% fi +% END +% +% The other cross-referencing functions are similar, so no "comment version" +% will be given for them. + +FUNCTION {format.article.crossref} +{ key empty$ + { journal empty$ + { "need key or journal for " cite$ * " to crossref " * crossref * + warning$ + "" + } + { "Patrz {\em " journal * "\/}" * } %BL + if$ + } + { "Patrz " key * } + if$ + " \cite{" * crossref * "}" * +} + +% We use just the last names of editors for a cross reference: either +% "editor", or "editor1 and editor2", or "editor1 et~al." depending on +% whether there are one, or two, or more than two editors. + +FUNCTION {format.crossref.editor} +{ editor #1 "{vv~}{ll}" format.name$ + editor num.names$ duplicate$ + #2 > + { pop$ " i~in." * } + { #2 < + 'skip$ + { editor #2 "{ff }{vv }{ll}{ jj}" format.name$ "others" = + { " i~in." * } + { " i~" * editor #2 "{vv~}{ll}" format.name$ * } + if$ + } + if$ + } + if$ +} + +% A BOOK (or INBOOK) entry type (assumed to be for a single volume in a +% multivolume work) may cross reference another BOOK (the entire multivolume). +% Usually there will be an editor, in which case we use that to construct the +% cross reference; otherwise we use a nonempty key field or else the series +% field (since the series gives the title of the multivolume work). + +FUNCTION {format.book.crossref} +{ volume empty$ + { "empty volume in " cite$ * "'s crossref of " * crossref * warning$ + "Patrz " %BL + } + { "Wolumen" volume tie.or.space.connect + " serii " * + } + if$ + editor empty$ + editor field.or.null author field.or.null = + or + { key empty$ + { series empty$ + { "need editor, key, or series for " cite$ * " to crossref " * + crossref * warning$ + "" * + } + { "{\em " * series * "\/}" * } + if$ + } + { key * } + if$ + } + { format.crossref.editor * } + if$ + " \cite{" * crossref * "}" * +} + +% An INCOLLECTION entry type may cross reference a BOOK (assumed to be the +% collection), or an INPROCEEDINGS may cross reference a PROCEEDINGS. +% Often there will be an editor, in which case we use that to construct +% the cross reference; otherwise we use a nonempty key field or else +% the booktitle field (which gives the cross-referenced work's title). + +FUNCTION {format.incoll.inproc.crossref} +{ editor empty$ + editor field.or.null author field.or.null = + or + { key empty$ + { booktitle empty$ + { "need editor, key, or booktitle for " cite$ * " to crossref " * + crossref * warning$ + "" + } + { "Patrz {\em " booktitle * "\/}" * } %BL + if$ + } + { "Patrz " key * } %BL + if$ + } + { "Patrz " format.crossref.editor * } %BL + if$ + " \cite{" * crossref * "}" * +} + +% Now we define the type functions for all entry types that may appear +% in the .BIB file---e.g., functions like `article' and `book'. These +% are the routines that actually generate the .BBL-file output for +% the entry. These must all precede the READ command. In addition, the +% style designer should have a function `default.type' for unknown types. +% Note: The fields (within each list) are listed in order of appearance, +% except as described for an `inbook' or a `proceedings'. +% +% The article function is for an article in a journal. An article may +% CROSSREF another article. +% Required fields: author, title, journal, year +% Optional fields: volume, number, pages, month, note +% +% article == +% BEGIN +% output.bibitem +% output.check(format.authors,"author") +% new.block +% output.check(format.title,"title") +% new.block +% if missing$(crossref) then +% output.check(emphasize(journal),"journal") +% output(format.vol.num.pages) +% output.check(format.date,"year") +% else +% output.nonnull(format.article.crossref) +% output(format.pages) +% fi +% new.block +% output(note) +% fin.entry +% END +% +% The book function is for a whole book. A book may CROSSREF another book. +% Required fields: author or editor, title, publisher, year +% Optional fields: volume or number, series, address, edition, month, +% note +% +% book == +% BEGIN +% if empty$(author) then output.check(format.editors,"author and editor") +% else output.check(format.authors,"author") +% if missing$(crossref) then +% either.or.check("author and editor",editor) +% fi +% fi +% new.block +% output.check(format.btitle,"title") +% if missing$(crossref) then +% output(format.bvolume) +% new.block +% output(format.number.series) +% new.sentence +% output.check(publisher,"publisher") +% output(address) +% else +% new.block +% output.nonnull(format.book.crossref) +% fi +% output(format.edition) +% output.check(format.date,"year") +% new.block +% output(note) +% fin.entry +% END +% +% The other entry functions are all quite similar, so no "comment version" +% will be given for them. + +FUNCTION {article} +{ output.bibitem + format.authors "author" output.check + new.block + format.title "title" output.check + new.block + crossref missing$ + { journal emphasize "journal" output.check + format.vol.num.pages output + format.date "year" output.check + } + { format.article.crossref output.nonnull + format.pages output + } + if$ + new.block + note output + fin.entry +} + +FUNCTION {book} +{ output.bibitem + author empty$ + { format.editors "author and editor" output.check } + { format.authors output.nonnull + crossref missing$ + { "author and editor" editor either.or.check } + 'skip$ + if$ + } + if$ + new.block + format.btitle "title" output.check + crossref missing$ + { format.bvolume output + new.block + format.number.series output + new.sentence + publisher "publisher" output.check + address output + } + { new.block + format.book.crossref output.nonnull + } + if$ + format.edition output + format.date "year" output.check + new.block + note output + fin.entry +} + +% A booklet is a bound thing without a publisher or sponsoring institution. +% Required: title +% Optional: author, howpublished, address, month, year, note + +FUNCTION {booklet} +{ output.bibitem + format.authors output + new.block + format.title "title" output.check + howpublished address new.block.checkb + howpublished output + address output + format.date output + new.block + note output + fin.entry +} + +% For the conference entry type, see inproceedings. + +% An inbook is a piece of a book: either a chapter and/or a page range. +% It may CROSSREF a book. If there's no volume field, the type field +% will come before number and series. +% Required: author or editor, title, chapter and/or pages, publisher,year +% Optional: volume or number, series, type, address, edition, month, note + +FUNCTION {inbook} +{ output.bibitem + author empty$ + { format.editors "author and editor" output.check } + { format.authors output.nonnull + crossref missing$ + { "author and editor" editor either.or.check } + 'skip$ + if$ + } + if$ + new.block + format.btitle "title" output.check + crossref missing$ + { format.bvolume output + format.chapter.pages "chapter and pages" output.check + new.block + format.number.series output + new.sentence + publisher "publisher" output.check + address output + } + { format.chapter.pages "chapter and pages" output.check + new.block + format.book.crossref output.nonnull + } + if$ + format.edition output + format.date "year" output.check + new.block + note output + fin.entry +} + +% An incollection is like inbook, but where there is a separate title +% for the referenced thing (and perhaps an editor for the whole). +% An incollection may CROSSREF a book. +% Required: author, title, booktitle, publisher, year +% Optional: editor, volume or number, series, type, chapter, pages, +% address, edition, month, note + +FUNCTION {incollection} +{ output.bibitem + format.authors "author" output.check + new.block + format.title "title" output.check + new.block + crossref missing$ + { format.in.ed.booktitle "booktitle" output.check + format.bvolume output + format.number.series output + format.chapter.pages output + new.sentence + publisher "publisher" output.check + address output + format.edition output + format.date "year" output.check + } + { format.incoll.inproc.crossref output.nonnull + format.chapter.pages output + } + if$ + new.block + note output + fin.entry +} + +% An inproceedings is an article in a conference proceedings, and it may +% CROSSREF a proceedings. If there's no address field, the month (& year) +% will appear just before note. +% Required: author, title, booktitle, year +% Optional: editor, volume or number, series, pages, address, month, +% organization, publisher, note + +FUNCTION {inproceedings} +{ output.bibitem + format.authors "author" output.check + new.block + format.title "title" output.check + new.block + crossref missing$ + { format.in.ed.booktitle "booktitle" output.check + format.bvolume output + format.number.series output + format.pages output + address empty$ + { organization publisher new.sentence.checkb + organization output + publisher output + format.date "year" output.check + } + { address output.nonnull + format.date "year" output.check + new.sentence + organization output + publisher output + } + if$ + } + { format.incoll.inproc.crossref output.nonnull + format.pages output + } + if$ + new.block + note output + fin.entry +} + +% The conference function is included for Scribe compatibility. + +FUNCTION {conference} { inproceedings } + +% A manual is technical documentation. +% Required: title +% Optional: author, organization, address, edition, month, year, note + +FUNCTION {manual} +{ output.bibitem + author empty$ + { organization empty$ + 'skip$ + { organization output.nonnull + address output + } + if$ + } + { format.authors output.nonnull } + if$ + new.block + format.btitle "title" output.check + author empty$ + { organization empty$ + { address new.block.checka + address output + } + 'skip$ + if$ + } + { organization address new.block.checkb + organization output + address output + } + if$ + format.edition output + format.date output + new.block + note output + fin.entry +} + +% A mastersthesis is a Master's thesis. +% Required: author, title, school, year +% Optional: type, address, month, note + +FUNCTION {mastersthesis} +{ output.bibitem + format.authors "author" output.check + new.block + format.title "title" output.check + new.block + "Praca magisterska" format.thesis.type output.nonnull + school "school" output.check + address output + format.date "year" output.check + new.block + note output + fin.entry +} + +% A misc is something that doesn't fit elsewhere. +% Required: at least one of the `optional' fields +% Optional: author, title, howpublished, month, year, note + +FUNCTION {misc} +{ output.bibitem + format.authors output + title howpublished new.block.checkb + format.title output + howpublished new.block.checka + howpublished output + format.date output + new.block + note output + fin.entry + empty.misc.check +} + +% A phdthesis is like a mastersthesis. +% Required: author, title, school, year +% Optional: type, address, month, note + +FUNCTION {phdthesis} +{ output.bibitem + format.authors "author" output.check + new.block + format.btitle "title" output.check + new.block + "Praca doktorska" format.thesis.type output.nonnull + school "school" output.check + address output + format.date "year" output.check + new.block + note output + fin.entry +} + +% A proceedings is a conference proceedings. +% If there is an organization but no editor field, the organization will +% appear as the first optional field (we try to make the first block nonempty); +% if there's no address field, the month (& year) will appear just before note. +% Required: title, year +% Optional: editor, volume or number, series, address, month, +% organization, publisher, note + +FUNCTION {proceedings} +{ output.bibitem + editor empty$ + { organization output } + { format.editors output.nonnull } + if$ + new.block + format.btitle "title" output.check + format.bvolume output + format.number.series output + address empty$ + { editor empty$ + { publisher new.sentence.checka } + { organization publisher new.sentence.checkb + organization output + } + if$ + publisher output + format.date "year" output.check + } + { address output.nonnull + format.date "year" output.check + new.sentence + editor empty$ + 'skip$ + { organization output } + if$ + publisher output + } + if$ + new.block + note output + fin.entry +} + +% A techreport is a technical report. +% Required: author, title, institution, year +% Optional: type, number, address, month, note + +FUNCTION {techreport} +{ output.bibitem + format.authors "author" output.check + new.block + format.title "title" output.check + new.block + format.tr.number output.nonnull + institution "institution" output.check + address output + format.date "year" output.check + new.block + note output + fin.entry +} + +% An unpublished is something that hasn't been published. +% Required: author, title, note +% Optional: month, year + +FUNCTION {unpublished} +{ output.bibitem + format.authors "author" output.check + new.block + format.title "title" output.check + new.block + note "note" output.check + format.date output + fin.entry +} + +% We use entry type `misc' for an unknown type; BibTeX gives a warning. + +FUNCTION {default.type} { misc } + +% Here are macros for common things that may vary from style to style. +% Users are encouraged to use these macros. +% +% Months are either written out in full or abbreviated + +#if MONTH_FULL + +MACRO {jan} {"Stycze/n"} + +MACRO {feb} {"Luty"} + +MACRO {mar} {"Marzec"} + +MACRO {apr} {"Kwiecie/n"} + +MACRO {may} {"Maj"} + +MACRO {jun} {"Czerwiec"} + +MACRO {jul} {"Lipiec"} + +MACRO {aug} {"Sierpie/n"} + +MACRO {sep} {"Wrzesie/n"} + +MACRO {oct} {"Pa/xdziernik"} + +MACRO {nov} {"Listopad"} + +MACRO {dec} {"Grudzie/n"} + +MACRO {sty} {"Stycze/n"} + +MACRO {lut} {"Luty"} + +%MACRO {mar} {"Marzec"} + +MACRO {kwi} {"Kwiecie/n"} + +MACRO {maj} {"Maj"} + +MACRO {cze} {"Czerwiec"} + +MACRO {lip} {"Lipiec"} + +MACRO {sie} {"Sierpie/n"} + +MACRO {wrz} {"Wrzesie/n"} + +MACRO {paz} {"Pa/xdziernik"} + +MACRO {lis} {"Listopad"} + +MACRO {gru} {"Grudzie/n"} + +#else !MONTH_FULL + +MACRO {jan} {"Sty."} + +MACRO {feb} {"Luty"} + +MACRO {mar} {"Mar."} + +MACRO {apr} {"Kwi."} + +MACRO {may} {"Maj"} + +MACRO {jun} {"Czerw."} + +MACRO {jul} {"Lip."} + +MACRO {aug} {"Sier."} + +MACRO {sep} {"Wrze."} + +MACRO {oct} {"Paz."} + +MACRO {nov} {"List."} + +MACRO {dec} {"Gru."} + +MACRO {sty} {"Sty."} + +MACRO {lut} {"Luty"} + +%MACRO {mar}{"Mar."} + +MACRO {kwi} {"Kwi."} + +MACRO {maj} {"Maj"} + +MACRO {cze} {"Czerw."} + +MACRO {lip} {"Lip."} + +MACRO {sie} {"Sier."} + +MACRO {wrz} {"Wrze."} + +MACRO {paz} {"Paz."} + +MACRO {lis} {"List."} + +MACRO {gru} {"Gru."} + + +#endif MONTH_FULL + +% Journals are either written out in full or abbreviated; +% the abbreviations are like those found in ACM publications. +% +% To get a completely different set of abbreviations, it may be best to make +% a separate .bib file with nothing but those abbreviations; users could then +% include that file name as the first argument to the \bibliography command + +#if JOUR_FULL + +MACRO {acmcs} {"ACM Computing Surveys"} + +MACRO {acta} {"Acta Informatica"} + +MACRO {cacm} {"Communications of the ACM"} + +MACRO {ibmjrd} {"IBM Journal of Research and Development"} + +MACRO {ibmsj} {"IBM Systems Journal"} + +MACRO {ieeese} {"IEEE Transactions on Software Engineering"} + +MACRO {ieeetc} {"IEEE Transactions on Computers"} + +MACRO {ieeetcad} + {"IEEE Transactions on Computer-Aided Design of Integrated Circuits"} + +MACRO {ipl} {"Information Processing Letters"} + +MACRO {jacm} {"Journal of the ACM"} + +MACRO {jcss} {"Journal of Computer and System Sciences"} + +MACRO {scp} {"Science of Computer Programming"} + +MACRO {sicomp} {"SIAM Journal on Computing"} + +MACRO {tocs} {"ACM Transactions on Computer Systems"} + +MACRO {tods} {"ACM Transactions on Database Systems"} + +MACRO {tog} {"ACM Transactions on Graphics"} + +MACRO {toms} {"ACM Transactions on Mathematical Software"} + +MACRO {toois} {"ACM Transactions on Office Information Systems"} + +MACRO {toplas} {"ACM Transactions on Programming Languages and Systems"} + +MACRO {tcs} {"Theoretical Computer Science"} + +MACRO {gust} {"Grupa U/zytkownik/ow Systemu \TeX"} + +#else !JOUR_FULL + +MACRO {acmcs} {"ACM Comput. Surv."} + +MACRO {acta} {"Acta Inf."} + +MACRO {cacm} {"Commun. ACM"} + +MACRO {ibmjrd} {"IBM J. Res. Dev."} + +MACRO {ibmsj} {"IBM Syst.~J."} + +MACRO {ieeese} {"IEEE Trans. Softw. Eng."} + +MACRO {ieeetc} {"IEEE Trans. Comput."} + +MACRO {ieeetcad} + {"IEEE Trans. Comput.-Aided Design Integrated Circuits"} + +MACRO {ipl} {"Inf. Process. Lett."} + +MACRO {jacm} {"J.~ACM"} + +MACRO {jcss} {"J.~Comput. Syst. Sci."} + +MACRO {scp} {"Sci. Comput. Programming"} + +MACRO {sicomp} {"SIAM J. Comput."} + +MACRO {tocs} {"ACM Trans. Comput. Syst."} + +MACRO {tods} {"ACM Trans. Database Syst."} + +MACRO {tog} {"ACM Trans. Gr."} + +MACRO {toms} {"ACM Trans. Math. Softw."} + +MACRO {toois} {"ACM Trans. Office Inf. Syst."} + +MACRO {toplas} {"ACM Trans. Prog. Lang. Syst."} + +MACRO {tcs} {"Theoretical Comput. Sci."} + +MACRO {gust} {"G.U.S.T."} + +#endif JOUR_FULL + +% Now we read in the .BIB entries. + +READ + +% The sortify function converts to lower case after purify$ing; it's +% used in sorting and in computing alphabetic labels after sorting +% +% The chop.word(w,len,s) function returns either s or, if the first len +% letters of s equals w (this comparison is done in the third line of the +% function's definition), it returns that part of s after w. + +#if SORTED + +FUNCTION {sortify} +{ purify$ + "l" change.case$ +} + +INTEGERS { len } + +FUNCTION {chop.word} +{ 's := + 'len := + s #1 len substring$ = + { s len #1 + global.max$ substring$ } + 's + if$ +} + +#else !SORTED +#if LAB_ALPH + +% We need the chop.word stuff for the dubious unsorted-list-with-labels case. + +INTEGERS { len } + +FUNCTION {chop.word} +{ 's := + 'len := + s #1 len substring$ = + { s len #1 + global.max$ substring$ } + 's + if$ +} + +#endif LAB_ALPH +#endif SORTED + +% This long comment applies only to alphabetic labels +% +% The format.lab.names function makes a short label by using the initials of +% the von and Last parts of the names (but if there are more than four names, +% (i.e., people) it truncates after three and adds a superscripted "+"; +% it also adds such a "+" if the last of multiple authors is "others"). +% If there is only one name, and its von and Last parts combined have just +% a single name-token ("Knuth" has a single token, "Brinch Hansen" has two), +% we take the first three letters of the last name. The boolean +% et.al.char.used tells whether we've used a superscripted "+", so that we +% know whether to include a LaTeX macro for it. +% +% format.lab.names(s) == +% BEGIN +% numnames := num.names$(s) +% if numnames > 1 then +% if numnames > 4 then +% namesleft := 3 +% else +% namesleft := numnames +% nameptr := 1 +% nameresult := "" +% while namesleft > 0 +% do +% if (name_ptr = numnames) and +% format.name$(s, nameptr, "{ff }{vv }{ll}{ jj}") = "others" +% then nameresult := nameresult * "{\etalchar{+}}" +% et.al.char.used := true +% else nameresult := nameresult * +% format.name$(s, nameptr, "{v{}}{l{}}") +% nameptr := nameptr + 1 +% namesleft := namesleft - 1 +% od +% if numnames > 4 then +% nameresult := nameresult * "{\etalchar{+}}" +% et.al.char.used := true +% else +% t := format.name$(s, 1, "{v{}}{l{}}") +% if text.length$(t) < 2 then % there's just one name-token +% nameresult := text.prefix$(format.name$(s,1,"{ll}"),3) +% else +% nameresult := t +% fi +% fi +% return nameresult +% END +% +% Exactly what fields we look at in constructing the primary part of the label +% depends on the entry type; this selectivity (as opposed to, say, always +% looking at author, then editor, then key) helps ensure that "ignored" fields, +% as described in the LaTeX book, really are ignored. Note that MISC is part +% of the deepest `else' clause in the nested part of calc.label; thus, any +% unrecognized entry type in the database is handled correctly. +% +% There is one auxiliary function for each of the four different sequences of +% fields we use. The first of these functions looks at the author field, and +% then, if necessary, the key field. The other three functions, which might +% look at two fields and the key field, are similar, except that the key field +% takes precedence over the organization field (for labels---not for sorting). +% +% The calc.label function calculates the preliminary label of an entry, which +% is formed by taking three letters of information from the author or editor or +% key or organization field (depending on the entry type and on what's empty, +% but ignoring a leading "The " in the organization), and appending the last +% two characters (digits) of the year. It is an error if the appropriate fields +% among author, editor, organization, and key are missing, and we use +% the first three letters of the cite$ in desperation when this happens. +% The resulting label has the year part, but not the name part, purify$ed +% (purify$ing the year allows some sorting shenanigans by the user). +% +% This function also calculates the version of the label to be used in sorting. +% +% The final label may need a trailing 'a', 'b', etc., to distinguish it from +% otherwise identical labels, but we can't calculated those "extra.label"s +% until after sorting. +% +% calc.label == +% BEGIN +% if type$ = "book" or "inbook" then +% author.editor.key.label +% else if type$ = "proceedings" then +% editor.key.organization.label +% else if type$ = "manual" then +% author.key.organization.label +% else +% author.key.label +% fi fi fi +% label := label * substring$(purify$(field.or.null(year)), -1, 2) +% % assuming we will also sort, we calculate a sort.label +% sort.label := sortify(label), but use the last four, not two, digits +% END + +#if LAB_ALPH + +INTEGERS { et.al.char.used } + +FUNCTION {initialize.et.al.char.used} +{ #0 'et.al.char.used := +} + +EXECUTE {initialize.et.al.char.used} + +FUNCTION {format.lab.names} +{ 's := + s num.names$ 'numnames := + numnames #1 > + { numnames #4 > + { #3 'namesleft := } + { numnames 'namesleft := } + if$ + #1 'nameptr := + "" + { namesleft #0 > } + { nameptr numnames = + { s nameptr "{ff }{vv }{ll}{ jj}" format.name$ "others" = + { "{\etalchar{+}}" * + #1 'et.al.char.used := + } + { s nameptr "{v{}}{l{}}" format.name$ * } + if$ + } + { s nameptr "{v{}}{l{}}" format.name$ * } + if$ + nameptr #1 + 'nameptr := + namesleft #1 - 'namesleft := + } + while$ + numnames #4 > + { "{\etalchar{+}}" * + #1 'et.al.char.used := + } + 'skip$ + if$ + } + { s #1 "{v{}}{l{}}" format.name$ + duplicate$ text.length$ #2 < + { pop$ s #1 "{ll}" format.name$ #3 text.prefix$ } + 'skip$ + if$ + } + if$ +} + +FUNCTION {author.key.label} +{ author empty$ + { key empty$ +#if SORTED + { cite$ #1 #3 substring$ } +#else !SORTED % need warning here because we won't give it later + { "for label, need author or key in " cite$ * warning$ + cite$ #1 #3 substring$ + } +#endif SORTED + { key #3 text.prefix$ } + if$ + } + { author format.lab.names } + if$ +} + +FUNCTION {author.editor.key.label} +{ author empty$ + { editor empty$ + { key empty$ +#if SORTED + { cite$ #1 #3 substring$ } +#else !SORTED % need warning here because we won't give it later + { "for label, need author, editor, or key in " cite$ * warning$ + cite #1 #3 substring$ + } +#endif SORTED + { key #3 text.prefix$ } + if$ + } + { editor format.lab.names } + if$ + } + { author format.lab.names } + if$ +} + +FUNCTION {author.key.organization.label} +{ author empty$ + { key empty$ + { organization empty$ +#if SORTED + { cite$ #1 #3 substring$ } +#else !SORTED % need warning here because we won't give it later + { "for label, need author, key, or organization in " cite$ * + warning$ + cite #1 #3 substring$ + } +#endif SORTED + { "The " #4 organization chop.word #3 text.prefix$ } + if$ + } + { key #3 text.prefix$ } + if$ + } + { author format.lab.names } + if$ +} + +FUNCTION {editor.key.organization.label} +{ editor empty$ + { key empty$ + { organization empty$ +#if SORTED + { cite$ #1 #3 substring$ } +#else !SORTED % need warning here because we won't give it later + { "for label, need editor, key, or organization in " cite$ * + warning$ + cite #1 #3 substring$ + } +#endif SORTED + { "The " #4 organization chop.word #3 text.prefix$ } + if$ + } + { key #3 text.prefix$ } + if$ + } + { editor format.lab.names } + if$ +} + +FUNCTION {calc.label} +{ type$ "book" = + type$ "inbook" = + or + 'author.editor.key.label + { type$ "proceedings" = + 'editor.key.organization.label + { type$ "manual" = + 'author.key.organization.label + 'author.key.label + if$ + } + if$ + } + if$ + duplicate$ + year field.or.null purify$ #-1 #2 substring$ + * + 'label := + year field.or.null purify$ #-1 #4 substring$ + * + sortify 'sort.label := +} + +% It doesn't seem like a particularly good idea to use an order-of-citation +% reference list when using alphabetic labels, but we need to have a +% special pass to calculate labels when this happens. + +#if !SORTED + +ITERATE {calc.label} + +#endif !SORTED + +#endif LAB_ALPH + +% When sorting, we compute the sortkey by executing "presort" on each entry. +% The presort key contains a number of "sortify"ed strings, concatenated +% with multiple blanks between them. This makes things like "brinch per" +% come before "brinch hansen per". +% +% The fields used here are: the sort.label for alphabetic labels (as set by +% calc.label), followed by the author names (or editor names or organization +% (with a leading "The " removed) or key field, depending on entry type and on +% what's empty), followed by year, followed by the first bit of the title +% (chopping off a leading "The ", "A ", or "An "). +% Names are formatted: Von Last First Junior. +% The names within a part will be separated by a single blank +% (such as "brinch hansen"), two will separate the name parts themselves +% (except the von and last), three will separate the names, +% four will separate the names from year (and from label, if alphabetic), +% and four will separate year from title. +% +% The sort.format.names function takes an argument that should be in +% BibTeX name format, and returns a string containing " "-separated +% names in the format described above. The function is almost the same +% as format.names. + +#if SORTED + +FUNCTION {sort.format.names} +{ 's := + #1 'nameptr := + "" + s num.names$ 'numnames := + numnames 'namesleft := + { namesleft #0 > } + { nameptr #1 > + { " " * } + 'skip$ + if$ +#if NAME_FULL + s nameptr "{vv{ } }{ll{ }}{ ff{ }}{ jj{ }}" format.name$ 't := +#else + s nameptr "{vv{ } }{ll{ }}{ f{ }}{ jj{ }}" format.name$ 't := +#endif NAME_FULL + nameptr numnames = t "others" = and + { "i~in" * } %BL + { t sortify * } + if$ + nameptr #1 + 'nameptr := + namesleft #1 - 'namesleft := + } + while$ +} + +% The sort.format.title function returns the argument, +% but first any leading "A "'s, "An "'s, or "The "'s are removed. +% The chop.word function uses s, so we need another string variable, t + +FUNCTION {sort.format.title} +{ 't := + "A " #2 + "An " #3 + "The " #4 t chop.word + chop.word + chop.word + sortify + #1 global.max$ substring$ +} + +% The auxiliary functions here, for the presort function, are analogous to +% the ones for calc.label; the same comments apply, except that the +% organization field takes precedence here over the key field. For sorting +% purposes, we still remove a leading "The " from the organization field. + +FUNCTION {author.sort} +{ author empty$ + { key empty$ + { "to sort, need author or key in " cite$ * warning$ + "" + } + { key sortify } + if$ + } + { author sort.format.names } + if$ +} + +FUNCTION {author.editor.sort} +{ author empty$ + { editor empty$ + { key empty$ + { "to sort, need author, editor, or key in " cite$ * warning$ + "" + } + { key sortify } + if$ + } + { editor sort.format.names } + if$ + } + { author sort.format.names } + if$ +} + +FUNCTION {author.organization.sort} +{ author empty$ + { organization empty$ + { key empty$ + { "to sort, need author, organization, or key in " cite$ * warning$ + "" + } + { key sortify } + if$ + } + { "The " #4 organization chop.word sortify } + if$ + } + { author sort.format.names } + if$ +} + +FUNCTION {editor.organization.sort} +{ editor empty$ + { organization empty$ + { key empty$ + { "to sort, need editor, organization, or key in " cite$ * warning$ + "" + } + { key sortify } + if$ + } + { "The " #4 organization chop.word sortify } + if$ + } + { editor sort.format.names } + if$ +} + +% There is a limit, entry.max$, on the length of an entry string variable +% (which is what its sort.key$ is), so we take at most that many characters +% of the constructed key, and hope there aren't many references that match +% to that many characters! + +FUNCTION {presort} +#if LAB_ALPH +{ calc.label + sort.label + " " + * + type$ "book" = +#else !LAB_ALPH +{ type$ "book" = +#endif LAB_ALPH + type$ "inbook" = + or + 'author.editor.sort + { type$ "proceedings" = + 'editor.organization.sort + { type$ "manual" = + 'author.organization.sort + 'author.sort + if$ + } + if$ + } + if$ +#if LAB_ALPH + * +#endif LAB_ALPH + " " + * + year field.or.null sortify + * + " " + * + title field.or.null + sort.format.title + * + #1 entry.max$ substring$ + 'sort.key$ := +} + +ITERATE {presort} + +% And now we can sort + +SORT + +#endif SORTED + +% This long comment applies only to alphabetic labels, when sorted +% +% Now comes the final computation for alphabetic labels, putting in the 'a's +% and 'b's and so forth if required. This involves two passes: a forward +% pass to put in the 'b's, 'c's and so on, and a backwards pass +% to put in the 'a's (we don't want to put in 'a's unless we know there +% are 'b's). +% We have to keep track of the longest (in width$ terms) label, for use +% by the "thebibliography" environment. +% +% VAR: longest.label, last.sort.label, next.extra: string +% longest.label.width, last.extra.num: integer +% +% initialize.longest.label == +% BEGIN +% longest.label := "" +% last.sort.label := int.to.chr$(0) +% next.extra := "" +% longest.label.width := 0 +% last.extra.num := 0 +% END +% +% forward.pass == +% BEGIN +% if last.sort.label = sort.label then +% last.extra.num := last.extra.num + 1 +% extra.label := int.to.chr$(last.extra.num) +% else +% last.extra.num := chr.to.int$("a") +% extra.label := "" +% last.sort.label := sort.label +% fi +% END +% +% reverse.pass == +% BEGIN +% if next.extra = "b" then +% extra.label := "a" +% fi +% label := label * extra.label +% if width$(label) > longest.label.width then +% longest.label := label +% longest.label.width := width$(label) +% fi +% next.extra := extra.label +% END + +#if LAB_ALPH + +#if SORTED + +STRINGS { longest.label last.sort.label next.extra } + +INTEGERS { longest.label.width last.extra.num } + +FUNCTION {initialize.longest.label} +{ "" 'longest.label := + #0 int.to.chr$ 'last.sort.label := + "" 'next.extra := + #0 'longest.label.width := + #0 'last.extra.num := +} + +FUNCTION {forward.pass} +{ last.sort.label sort.label = + { last.extra.num #1 + 'last.extra.num := + last.extra.num int.to.chr$ 'extra.label := + } + { "a" chr.to.int$ 'last.extra.num := + "" 'extra.label := + sort.label 'last.sort.label := + } + if$ +} + +FUNCTION {reverse.pass} +{ next.extra "b" = + { "a" 'extra.label := } + 'skip$ + if$ + label extra.label * 'label := + label width$ longest.label.width > + { label 'longest.label := + label width$ 'longest.label.width := + } + 'skip$ + if$ + extra.label 'next.extra := +} + +EXECUTE {initialize.longest.label} + +ITERATE {forward.pass} + +REVERSE {reverse.pass} + +#else !SORTED + +% It still doesn't seem like a good idea to use an order-of-citation +% reference list when using alphabetic labels, but when this happens we +% must compute the longest label + +STRINGS { longest.label } + +INTEGERS { longest.label.width } + +FUNCTION {initialize.longest.label} +{ "" 'longest.label := + #0 'longest.label.width := +} + +FUNCTION {longest.label.pass} +{ label width$ longest.label.width > + { label 'longest.label := + label width$ 'longest.label.width := + } + 'skip$ + if$ +} + +EXECUTE {initialize.longest.label} + +ITERATE {longest.label.pass} + +#endif SORTED + +#else !LAB_ALPH + +% Now comes the computation for numeric labels. +% We use either the sorted order or original order. +% We still have to keep track of the longest (in width$ terms) label, for use +% by the "thebibliography" environment. + +STRINGS { longest.label } + +INTEGERS { number.label longest.label.width } + +FUNCTION {initialize.longest.label} +{ "" 'longest.label := + #1 'number.label := + #0 'longest.label.width := +} + +FUNCTION {longest.label.pass} +{ number.label int.to.str$ 'label := + number.label #1 + 'number.label := + label width$ longest.label.width > + { label 'longest.label := + label width$ 'longest.label.width := + } + 'skip$ + if$ +} + +EXECUTE {initialize.longest.label} + +ITERATE {longest.label.pass} + +#endif LAB_ALPH + +% Now we're ready to start writing the .BBL file. +% We begin, if necessary, with a LaTeX macro for unnamed names in an alphabetic +% label; next comes stuff from the `preamble' command in the database files. +% Then we give an incantation containing the command +% \begin{thebibliography}{...} +% where the `...' is the longest label. +% +% We also call init.state.consts, for use by the output routines. + +FUNCTION {begin.bib} +#if LAB_ALPH +{ et.al.char.used + { "\newcommand{\etalchar}[1]{$^{#1}$}" write$ newline$ } + 'skip$ + if$ + preamble$ empty$ +#else !LAB_ALPH +{ preamble$ empty$ +#endif LAB_ALPH + 'skip$ + { preamble$ write$ newline$ } + if$ + "\begin{thebibliography}{" longest.label * "}" * write$ newline$ +} + +EXECUTE {begin.bib} + +EXECUTE {init.state.consts} + +% Now we produce the output for all the entries + +ITERATE {call.type$} + +% Finally, we finish up by writing the `\end{thebibliography}' command. + +FUNCTION {end.bib} +{ newline$ + "\end{thebibliography}" write$ newline$ +} + +EXECUTE {end.bib} diff --git a/Master/texmf-dist/tex/plain/gustlib/plbtx993/test.mex b/Master/texmf-dist/tex/plain/gustlib/plbtx993/test.mex new file mode 100644 index 00000000000..8ff961ac62a --- /dev/null +++ b/Master/texmf-dist/tex/plain/gustlib/plbtx993/test.mex @@ -0,0 +1,19 @@ +% To jest plik /xr/od/lowy dla systemu TeX z formatym MeX + +\input biblotex + +\prefixing + +Program X posiada wszystkie mo/zliwo/sci programu +(ang. upward compatible). Szczeg/o/lowe informacje o~mo/zliwo/sciach obu +program/ow znale/x/c mo/zna w~pracy~\cite{test}. + +\bibliography{test} % Use *.bib to resolve the labels. + +\bibliographystyle{plunsrt} % Number the references. +%\bibliographystyle{plabbrv} % Number the references. +%\bibliographystyle{plplain} % Number the references. +%\bibliographystyle{plalpha} % Number the references. + +\bye + diff --git a/Master/texmf-dist/tex/plain/gustlib/plmac218/plidxmac.tex b/Master/texmf-dist/tex/plain/gustlib/plmac218/plidxmac.tex new file mode 100644 index 00000000000..0d0d4859346 --- /dev/null +++ b/Master/texmf-dist/tex/plain/gustlib/plmac218/plidxmac.tex @@ -0,0 +1,266 @@ +% 2 X 1993 +% ======== +% +% To jest: +% PLIDXMAC ver.2.18 +% +% system makr do tworzenia indeks/ow w systemie plain-TeX +% +% adaptacja: B.Licho/nski 1993 +%----------------------------------- begin PLIDXMAC ---------------------- +%% @texfile{ +%% author = "Bogus/law Licho/nski", +%% version = "2.18", +%% date = "2 Paz 1993", +%% filename = "plidxmac.tex", +%% address = "Gdynia ul. Kameliowa 17", +%% codetable = "ISO/ASCII", +%% supported = "yes", +%% docstring = "Definicje makr plain TeX dla programu PLindex", +%% } +% +% Most of the code in this file are excerpts from latex.tex and manmac.tex. +% The actual style of the index environment \beginindex ... \endindex +% at the end of this file is left empty. +% +% +\def\makeatletter{\catcode`\@=11\relax} +\def\makeatother{\catcode`\@=12\relax} +\makeatletter +\def\newwrite{\alloc@7\write\chardef\sixt@@n}% added by B.L. 1.X.93 Gdynia 16:47:02 +\newif\ifignore% added by B.L. 1.X.93 Gdynia 16:47:02 +\newif\if@filesw \@fileswtrue +\newif\if@nobreak \@nobreakfalse +\def\@makeother#1{\catcode`#112\relax} +\def\newwrite{\alloc@7\write\chardef\sixt@@n} +\newwrite\@unused +\def\typeout#1{{\let\protect\string\immediate\write\@unused{#1}}} + +% **************************************** +% * PAGE NUMBERING * +% **************************************** +% +% Page numbers are produced by a page counter, used just like any other +% counter. The only difference is that \c@page contains the number of +% the next page to be output (the one currently being produced), rather +% than one minus it. Thus, it is normally initialized to 1 rather than +% 0. \c@page is defined to be \count0, rather than a count assigned by +% \newcount. +% +% The user sets the pagenumber style with the \pagenumbering{FOO} +% command, which sets the page counter to 1 and defines \thepage to be +% \FOO. For example, \pagenumbering{roman} causes pages to be numbered +% i, ii, etc. + +% Numbering commands for definitions of \theCOUNTER and \list arguments. +% \fnsymbol produces the standard footnoting symbols: asterisk, dagger, etc. +% They can be used only in math mode. + +% \@nameuse{NAME} : Expands to \NAME . +\def\@nameuse#1{\csname #1\endcsname} + +\def\arabic#1{\@arabic{\@nameuse{c@#1}}} +\def\roman#1{\@roman{\@nameuse{c@#1}}} +\def\Roman#1{\@Roman{\@nameuse{c@#1}}} +\def\alph#1{\@alph{\@nameuse{c@#1}}} +\def\Alph#1{\@Alph{\@nameuse{c@#1}}} +%\def\fnsymbol#1{\@fnsymbol{\@nameuse{c@#1}}} + +\def\@arabic#1{\ifnum #1>0 \number #1\fi} +\def\@roman#1{\romannumeral #1} +\def\@Roman#1{\expandafter\uppercase\expandafter{\romannumeral #1}} +\def\@alph#1{\ifcase#1\or a\or b\or c\or d\else\@ialph{#1}\fi} +\def\@ialph#1{\ifcase#1\or \or \or \or \or e\or f\or g\or h\or i\or j\or + k\or l\or m\or n\or o\or p\or q\or r\or s\or t\or u\or v\or w\or x\or y\or + z\else\@ctrerr\fi} +\def\@Alph#1{\ifcase#1\or A\or B\or C\or D\else\@Ialph{#1}\fi} +\def\@Ialph#1{\ifcase#1\or \or \or \or \or E\or F\or G\or H\or I\or J\or + K\or L\or M\or N\or O\or P\or Q\or R\or S\or T\or U\or V\or W\or X\or Y\or + Z\else\@ctrerr\fi} +%\def\@fnsymbol#1{\ifcase#1\or *\or \dagger\or \ddagger\or +% \mathchar "278\or \mathchar "27B\or \|\or **\or \dagger\dagger +% \or \ddagger\ddagger \else\@ctrerr\fi\relax} + +\countdef\c@page=0 \c@page=1 +\def\cl@page{} +\def\pagenumbering#1{\global\c@page \@ne \gdef\thepage{\csname @#1\endcsname + \c@page}} +\pagenumbering{arabic} + +% \@bsphack ... \@esphack +% used by macros such as \index and \begin{@float} ... \end{@float} +% that want to be invisible -- i.e., +% not leave any extra space when used in the middle of text. Such +% a macro should begin with \@bsphack and end with \@esphack +% The macro in question should not create any text, nor change the +% mode. +% +% \@bsphack == +% BEGIN +% \dimen\@savsk := \lastskip +% if hmode then \@savsf := \spacefactor fi +% END +% +% \@esphack == +% BEGIN +% if hmode +% then \spacefactor := \@savsf +% if \dimen\@savsk > 0pt then \ignorespaces +% \global\ignoretrue fi +% fi +% END +% + +\newdimen\@savsk +\newcount\@savsf + +\def\@bsphack{\@savsk\lastskip + \ifhmode\@savsf\spacefactor\fi} + +\def\@esphack{\relax\ifhmode\spacefactor\@savsf + {}\ifdim \@savsk >\z@ \global\ignoretrue \ignorespaces + \fi \fi} + +% The command \@sanitize changes the catcode of all special characters +% except for braces to 'other'. It can be used for commands like +% \index that want to write their arguments verbatim. Needless to +% say, this command should only be executed within a group, or chaos +% will ensue. + +\def\@sanitize{\@makeother\ \@makeother\\\@makeother\$\@makeother\&% +\@makeother\#\@makeother\^\@makeother\^^K\@makeother\_\@makeother\^^A% +\@makeother\%\@makeother\~} + +% **************************************** +% * INDEX COMMANDS * +% **************************************** +% +% \makeindex == +% BEGIN +% if \@filesw = T +% then open file \jobname.IDX as \indexfile +% \index == BEGIN \@bsphack +% \begingroup +% re-\catcode special characters to 'other' +% \wrindex +% fi +% END +% +% \wrindex{ITEM} == +% BEGIN +% write of {\indexentry{ITEM}{page number}} +% \endgroup +% \@esphack +% END + +% INITIALIZATION: +% +% \index == BEGIN \@bsphack +% \begingroup +% re-\catcode special characters (in case '%' there) +% \index +% END +% +% \index{ITEM} == BEGIN \endgroup \@esphack END +% +\def\makeindex{\if@filesw \newwrite\@indexfile + \immediate\openout\@indexfile=\jobname.idx + \def\index{\@bsphack\begingroup\@sanitize\@wrindex\@indexfile} + \typeout{Writing index file \jobname.idx }\fi} + +\def\@wrindex#1#2{\let\thepage\relax + \xdef\gtempa{\write#1{\string + \indexentry{#2}{\thepage}}}\endgroup\gtempa + \if@nobreak \ifvmode\@nobreak\fi\fi\@esphack} + +\def\index{\@bsphack\begingroup\@sanitize\@index} +\def\@index#1{\endgroup\@esphack} + +\def\makeglossary{\if@@filesw \newwrite\@glossaryfile + \immediate\openout\@glossaryfile=\jobname.glo + \def\glossary{\@bsphack\begingroup\@sanitize\@wrindex\@glossaryfile}\typeout + {Writing glossary file \jobname.glo }\fi} + +\def\glossary{\@bsphack\begingroup\@sanitize\index} + + +% Doublecolumns formatting +\newdimen\pagewidth +\pagewidth=\hsize +\newbox\partialpage +\def\begindoublecolumns{\begingroup + \output={\global\setbox\partialpage=\vbox{\unvbox255\bigskip}}\eject + \output={\doublecolumnout} \hsize=14pc \vsize=89pc + \let\item\@idxitem} +\def\enddoublecolumns{\output={\balancecolumns}\eject + \endgroup \pagegoal=\vsize} +\def\doublecolumnout{\splittopskip=\topskip \splitmaxdepth=\maxdepth + \dimen@=44pc \advance\dimen@ by-\ht\partialpage + \setbox0=\vsplit255 to\dimen@ \setbox2=\vsplit255 to\dimen@ + \onepageout\pagesofar + \unvbox255 \penalty\outputpenalty} +\def\pagesofar{\unvbox\partialpage + \wd0=\hsize \wd2=\hsize \hbox to\pagewidth{\box0\hfil\box2}} +\def\balancecolumns{\setbox0=\vbox{\unvbox255} \dimen@=\ht0 + \advance\dimen@ by\topskip \advance\dimen@ by-\baselineskip + \divide\dimen@ by2 \splittopskip=\topskip + {\vbadness=10000 \loop \global\setbox3=\copy0 + \global\setbox1=\vsplit3 to\dimen@ + \ifdim\ht3>\dimen@ \global\advance\dimen@ by1pt \repeat} + \setbox0=\vbox to\dimen@{\unvbox1} + \setbox2=\vbox to\dimen@{\unvbox3} + \pagesofar} + +%%%%%%%%%%%% do/lo/zy/lem z texinfo 20:26:54 +\newdimen \bindingoffset \bindingoffset=0pt +\newdimen \normaloffset \normaloffset=\hoffset +\def\onepageout#1{\hoffset=\normaloffset +\ifodd\pageno \advance\hoffset by \bindingoffset +\else \advance\hoffset by -\bindingoffset\fi +{\escapechar=`\\\relax % makes sure backslash is used in output files. +\shipout\vbox{{\let\hsize=\pagewidth \makeheadline} \pagebody{#1}% +{\let\hsize=\pagewidth \makefootline}}}% +\advancepageno \ifnum\outputpenalty>-20000 \else\dosupereject\fi} +%%%%%%%%%%%%%%%%%%%%%% + +\def\@idxitem{\par\hangindent 40pt} +\def\subitem{\par\hangindent 40pt \hskip 20pt} +\def\subsubitem{\par\hangindent 40pt \hskip 30pt} +\def\indexspace{\par \vskip 10pt plus 5pt minus 3pt\relax} + +\def\indexemdashes{% +\def\@idxitem{\par\hangindent 0pt} +\def\subitem{\par\hangindent 0pt --- } +\def\subsubitem{\par\hangindent 0pt --- --- } +\def\indexspace{\par \vskip 10pt plus 5pt minus 3pt\relax}} + + + \def\beginindex{\begingroup\let\item\@idxitem + % Output opening routines go here + } + \def\endindex{ + % Output closing routines go here. + \endgroup} + +% \@ifundefined{NAME}{YES}{NO} +% : If \NAME is undefined then it executes YES, +% otherwise it executes NO. More precisely, +% true if \NAME either undefined or = \relax. +\long\def\@ifundefined#1#2#3{\expandafter\ifx\csname + #1\endcsname\relax#2\else#3\fi} +\@ifundefined{seeterm}{\def\seeterm{see}}{} +\@ifundefined{zobterm}{\def\zobterm{zob.}}{} +\def\see#1#2{{\it \seeterm\/} #1} +\def\zob#1#2{{\it \zobterm\/} #1} + +\def\Input#1{\openin1 #1 \ifeof1 \typeout + {I cannot find file #1.}\else\closein1 \relax\input #1 \fi} +\def\printindex{\Input{\jobname.ind}} +\def\printtheindex#1{\Input{#1}} +% above added by B.L. 1.X.93 Gdynia 16:47:03 + +\def\endindex{ +% Output closing routines go here. +\endgroup} + +\makeatother diff --git a/Master/texmf-dist/tex/plain/gustlib/plmac218/plind.bat b/Master/texmf-dist/tex/plain/gustlib/plmac218/plind.bat new file mode 100644 index 00000000000..f3ca45dbca2 --- /dev/null +++ b/Master/texmf-dist/tex/plain/gustlib/plmac218/plind.bat @@ -0,0 +1,6 @@ +@echo off
+rem Przyk/ladowy batch. (StaW)
+rem PLindex sortuje plik przyklad.idx zapisany w standardzie Mazovii,
+rem daj/ac wyj/sciowy plik przyklad.ind
+rem U/zycie stylu plaintex.ist pozwala na sk/lad formatem MeX/Plain
+plindex.exe -z mazovia -s plaintex.ist przyklad.idx
diff --git a/Master/texmf-dist/tex/plain/gustlib/plmac218/przyklad.tex b/Master/texmf-dist/tex/plain/gustlib/plmac218/przyklad.tex new file mode 100644 index 00000000000..63849c3b260 --- /dev/null +++ b/Master/texmf-dist/tex/plain/gustlib/plmac218/przyklad.tex @@ -0,0 +1,10 @@ +% plik test.tex (kodowanie Mazovia) +\input plidxmac.tex +\makeindex +Kot\index{kot} poluje na kanarka\index{kanarek}, a~pies\index{pies} +poluje na kota\index{kot}. Z~kolei §˘’w\index{§˘’w} to strasznie powolne +zwierz‘% +\index{zwierz‘}. +\vfil\eject +\printindex +\bye diff --git a/Master/texmf-dist/tex/plain/gustlib/rbox-ex.tex b/Master/texmf-dist/tex/plain/gustlib/rbox-ex.tex new file mode 100644 index 00000000000..913f2a51b6e --- /dev/null +++ b/Master/texmf-dist/tex/plain/gustlib/rbox-ex.tex @@ -0,0 +1,56 @@ +%% przyk/lad u/zycia ramek zaokr/aglonych | rounded frames example +%% (opr. St. Wawrykiewicz) +\input roundbox +\def\bsl{{\tt\char'134}} +\setcorners 2 % +\roundbox width 9cm height 9cm {Some text} + % ramka o gr. linii 0.4pt | frame of 0.4pt thickness + % parametry: szer. i wys. {tekst} | parameters: width height {contents} + % tre/s/c umieszczona centralnie | the contents is centered in the frame + % w ramce | + +\def\\{\par} + % w parametrze makra nie mo/ze | in macro parameter \par or newline + % by/c \par b/ad/x wolnej linii!!! | is not allowed +\Roundbox width 9cm {%ramka o gr. 0.8pt | 0.8pt thickness of the frame +\vbox{\hsize=0.45\hsize \bf +\parindent=0pt +Some text in rounded frame, in the column of +0.45 ({\tt \bsl hsize}). +\\ \bigskip +Next paragraph after {\tt\bsl bigskip}. +All typeset in boldface. +}} + +\vfill\eject +\message{Next page} +\roundbox width 9cm height 9cm {% %% wymiary ramki | frame dimensions +\vbox to9cm{\hsize=9cm\parindent=0pt %% wymiary pude/lka| box dimensions + %% w ramce | +\vss % \vss rozmieszcza tre/s/c +\leftline{left} % r/ownomiernie +\rightline{right} % +\vss % +\centerline{center} % +\vss +\leftline{left} +\rightline{right} +\vss}} + +\medskip + +\roundbox width 9cm height 9cm { % wymiary ramki | frame dimentions +\vbox to9cm{\hsize=9cm\parindent=0pt % wymiary pude/lka | box dimentions +\parskip=0pt +Test of text. Test of text. Test of text. Test of text. Test of text. +Test of text.\\ +\vbox to 3cm{% +\vss +\centerline{centered in 3cm height of space} +\vss} +Test of text. Test of text. Test of text. Test of text. +Test of text. Test of text. Test of text. Test of text. +Everything flushed from bottom. +\vss}} % to w/la/snie dopych od do/lu!! |\vss flush from bottom + +\bye diff --git a/Master/texmf-dist/tex/plain/gustlib/roundbox.tex b/Master/texmf-dist/tex/plain/gustlib/roundbox.tex new file mode 100644 index 00000000000..f512bf01786 --- /dev/null +++ b/Master/texmf-dist/tex/plain/gustlib/roundbox.tex @@ -0,0 +1,233 @@ +% FILE ROUNDBOX.TEX, version 1.1 (14.VIII.1990) +% ------------------------------------------------------------------------ +% AUTHOR: +% Garry Glendown (see in TUGboat Vol. 10 (1989) no.3 pp.386--387) +% ------------------------------------------------------------------------ +% MODIFICATOR: +% B. Jackowski, Tatrza\'nska 6/1, 80-331 Gda\'nsk, POLAND +% +% Modification includes shadow boxes, possibility of defining outer +% sizes (vertical and horizontal), and possibility of choosing various +% set of corners. +% ``Degenerated'' roundboxes (rectangles) are also available, +% although because of round-off errors (or BJ errors?) they don't +% look nice sometimes. +% ------------------------------------------------------------------------ +% USAGE: +% 1) thin frame (.4pt): +% \roundbox <outer size(s)> {<text>} +% \shadowbox <outer size(s)> {<text>} +% 2) thick frame (.85pt) --- see remark 4: +% \Roundbox <outer size(s)> {<text>} +% \Shadowbox <outer size(s)> {<text>} +% Outer size is optional and can have the form either `height <dimen>' or +% `width <dimen>', or both---the order does not matter. This convention +% is identical to that of `\hrule' and `\vrule'. You can even specify +% depth; however, it is ignored. +% +% Usage of these commands can be preceeded by fixing an appropriate set +% of corners: +% \setcorners <number> +% where +% -1 <= <number> <= 7 +% and +% size of corner = 2*(1+<number>)pt for <number> >= 0. +% +% +% REMARKS: +% 1. <outer size(s)> is/are optional and MUST NOT appear in braces. +% 2. Errors in this parameter are not checked, hence odd results may occur. +% 3. I made some names longer and add \@ as a letter, otherwise they +% might interfere. +% 4. Thick corners are said to have line thickness 0.8pt, however the +% corrected value 0.85pt yields better results (for 300dpi fonts). +% 5. Shadows do not change the size of the box (my shadow does not increase +% my weight). +% 6. I'm not very happy about the elegancy of the code. I hope that some day +% I or somebody else will improve it. +% 7. Is it reasonable to employ also scaled circle fonts? +% ------------------------------------------------------------------------ +% +\catcode`\@=11 +% +% ------------------------------------------------------------------------ +% DECLARATIONS +% ------------------------------------------------------------------------ +% +\newbox\t@mpb@x +\newdimen\t@mpwd +\newdimen\t@mpht +\newdimen\t@mpth +% +\newdimen\xt@mpwd % used for making +\newdimen\xt@mpht % shadows instead +\newdimen\xt@mpdp % of phantoms +% +\newdimen\c@rnwd % width of corner (first --- doubled, finally --- true) +\newdimen\c@frwd % doubled width of corner + width of frame +\newdimen\c@rnsh % corner shift +\newdimen\sh@dsh % shadow shift +% +% ------------------------------------------------------------------------ +% QUARTER CIRCLES: +% ------------------------------------------------------------------------ +%\font\circle=circle10 \font\circlew=circlew10 +\font\circle=lcircle1 \font\circlew=lcirclew +% ------------------------------------------------------------------------ +\newcount\cornern@ +\def\@vailcorn{\immediate + \write16{! AVAILABLE CORNER SETS: -1,0,1,2,...,9 --- 4th set assumed}% + \cornern@=4} +\def\s@tc@rn@rs{% + \ifnum\cornern@<-1\@vailcorn\fi + \ifnum\cornern@>9\@vailcorn\fi + \ifnum\cornern@=-1 + % degenerated corner set; + % in fact, only the width of \luq@tr is important, the corners are + % not drawn, simply the rules are longer. + \def\Ph@ntc@rn{\vbox to 0.8pt{\vss\hbox to 1.6pt{}}}% + \def\ph@ntc@rn{\vbox to 0.4pt{\vss\hbox to 0.8pt{}}}% + \def\luq@tr{\ifx\cf\circlew \Ph@ntc@rn \else \ph@ntc@rn \fi}% + \else + \multiply\cornern@4 + \edef\ruq@tr{{\noexpand\cf\char\the\cornern@}}% right upper qtr + \advance\cornern@ 1 + \edef\rlq@tr{{\noexpand\cf\char\the\cornern@}}% left upper qtr + \advance\cornern@ 1 + \edef\llq@tr{{\noexpand\cf\char\the\cornern@}}% left lower qtr + \advance\cornern@ 1 + \edef\luq@tr{{\noexpand\cf\char\the\cornern@}}% left upper qtr + \fi} +\def\setcorners{\afterassignment\s@tc@rn@rs \cornern@ = } +\setcorners 4 % G. Glendown preferred set no 2 +% ------------------------------------------------------------------------ +% ROUND BOXES: +% ------------------------------------------------------------------------ +% +\def\RB@x#1#2{% #1 - rule thickness, #2 - text +% known: +% \t@mpwd \t@mpht + \t@mpth=#1\relax + \setbox\t@mpb@x=\hbox{\luq@tr}\c@rnwd=\wd\t@mpb@x + \ifdim\c@rnwd=\z@ \c@rnwd=2\t@mpth\fi + \c@frwd=\t@mpth % \c@frwd is globally copied to \sh@dsh in + % \s(S)hadowB@x + \advance \c@frwd \c@rnwd + \c@rnsh=-\t@mpth\advance \c@rnsh \c@rnwd + \setbox\t@mpb@x=\hbox{#2}% + \xt@mpht=\ht\t@mpb@x % pha + \xt@mpwd=\wd\t@mpb@x % nt + \xt@mpdp=\dp\t@mpb@x % om... + \setbox\t@mpb@x=\hbox \ifdim\t@mpwd<\c@frwd + spread \c@rnwd + \else + to \t@mpwd + \fi + {\hss\box\t@mpb@x\hss}% + \advance\t@mpht-\c@frwd \ifdim\t@mpht<\z@ \t@mpht=\z@\fi + \setbox\t@mpb@x=\hbox to \wd\t@mpb@x{\vrule width\t@mpth\hss + \vbox \ifdim\t@mpht>\z@ to \t@mpht\fi + {\vss\box\t@mpb@x\vss}% + \hss\vrule width\t@mpth}% + \c@rnwd=0.5\c@rnwd + \t@mpwd=\wd\t@mpb@x + \vbox spread -\c@rnsh{% + \offinterlineskip + \vss + \hbox to \t@mpwd{\ifnum\cornern@=-1 \else + \hbox to \c@rnwd{\luq@tr\hss}% + \fi + \leaders\hrule height\t@mpth\hfil + \ifnum\cornern@=-1 \else + \hbox to \c@rnwd{\hss\ruq@tr\kern-\c@rnsh}% + \fi} + \box\t@mpb@x + \hbox to \t@mpwd{\ifnum\cornern@=-1 \else + \hbox to \c@rnwd{\llq@tr\hss}% + \fi + \leaders\hrule height\t@mpth\hfil + \ifnum\cornern@=-1 \else + \hbox to \c@rnwd{\hss\rlq@tr\kern-\c@rnsh}% + \fi} + \vss + }% + }% end \def\RB@x +% +\def\roundbox#1#{\setbox\t@mpb@x=\hbox{\vrule #1}% Attention! trick! + \t@mpwd=\wd\t@mpb@x \t@mpht=\ht\t@mpb@x + \roundB@x} +\def\roundB@x#1{\font\cf=lcircle1 \RB@x{.4pt}{#1}} +% +\def\Roundbox#1#{\setbox\t@mpb@x=\hbox{\vrule #1}% Attention! trick! + \t@mpwd=\wd\t@mpb@x \t@mpht=\ht\t@mpb@x + \RoundB@x} +\def\RoundB@x#1{\font\cf=lcirclew \RB@x{.85pt}{#1}} +% +% ------------------------------------------------------------------------ +% SHADOW BOXES: +% ------------------------------------------------------------------------ +% +\def\RShB@x#1{% #1 - rule thickness +% known: +% \t@mpwd \t@mpht +% \xt@mpwd \xt@mpht \xt@mpdp + \t@mpth=#1\relax + \setbox\t@mpb@x=\hbox{\luq@tr}\c@rnwd=\wd\t@mpb@x + \ifdim\c@rnwd=\z@ \c@rnwd=2\t@mpth\fi + \c@frwd=\t@mpth % \c@frwd is globally copied to \sh@dsh in + % \s(S)hadowB@x + \advance \c@frwd \c@rnwd + \c@rnsh=-\t@mpth\advance \c@rnsh \c@rnwd + \setbox\t@mpb@x=\hbox \ifdim\t@mpwd<\c@frwd + spread \c@rnwd + \else + to \t@mpwd + \fi + {\hss\vrule width \z@ height\xt@mpht depth\xt@mpdp + \hskip\xt@mpwd\hss}% + \setbox\t@mpb@x=\vbox \ifdim\t@mpht>\z@ to \t@mpht\fi + {\vss\box\t@mpb@x\vss}% + \c@rnwd=0.5\c@rnwd + \t@mpwd=\wd\t@mpb@x + \setbox\t@mpb@x=\hbox to \t@mpwd{\vbox \ifnum\cornern@=-1 spread\c@rnwd \fi + {\vss\box\t@mpb@x}\hss\vrule width\t@mpth}% + \vbox spread -\c@rnsh{% + \offinterlineskip + \vss + \hbox to \t@mpwd{\hfil + \ifnum\cornern@=-1 \else + \hbox to \c@rnwd{\hss\ruq@tr\kern-\c@rnsh}% + \fi} + \box\t@mpb@x + \hbox to \t@mpwd{\ifnum\cornern@=-1 \else + \hbox to \c@rnwd{\llq@tr\hss}% + \fi + \leaders\hrule height\t@mpth\hfil + \ifnum\cornern@=-1 \else + \hbox to \c@rnwd{\hss\rlq@tr\kern-\c@rnsh}% + \fi} + \vss + }% + }% end \def\RShB@x +% +\def\shadowbox#1#{\def\p@r@m{#1}\shadowB@x} +\def\shadowB@x#1{\vbox{\hbox{\roundbox\p@r@m{#1}\global\sh@dsh\c@frwd + \kern-\t@mpwd \kern0.5\sh@dsh \lower0.5\sh@dsh + \hbox{\font\cf=lcircle1 \RShB@x{.4pt}}% + \kern-0.5\sh@dsh} \kern-0.5\sh@dsh}} +% +\def\Shadowbox#1#{\def\p@r@m{#1}\ShadowB@x} +\def\ShadowB@x#1{\vbox{\hbox{\Roundbox\p@r@m{#1}\global\sh@dsh\c@frwd + \kern-\t@mpwd \kern0.5\sh@dsh \lower0.5\sh@dsh + \hbox{\font\cf=lcirclew \RShB@x{.85pt}}% + \kern-0.5\sh@dsh} \kern-0.5\sh@dsh}} +% +% ------------------------------------------------------------------------ +% +\catcode`\@=12 +% +% ------------------------------------------------------------------------ +\endinput +% ------------------------------------------------------------------------ +% END OF ROUNDBOX.TEX +% ------------------------------------------------------------------------ diff --git a/Master/texmf-dist/tex/plain/gustlib/tp-crf.tex b/Master/texmf-dist/tex/plain/gustlib/tp-crf.tex new file mode 100644 index 00000000000..164c86d2fed --- /dev/null +++ b/Master/texmf-dist/tex/plain/gustlib/tp-crf.tex @@ -0,0 +1,115 @@ +% ------------------------------------------------------------------ +% TP-CRF: cross-reference generic macros. +% Author: Tomasz Przechlewski <ekotp@halina.univ.gda.pl>. +% Date: 02.01.1997. Version 0.5 +% +% This macros are described in detail in the article ,,Odsy{\l}acze'', +% GUST bulletin, number 5, 1995 +% -------------- +% User commands: +% -------------- +% \ref, \pageref = insert cross-reference, insert page number. +% \defreference = define cross-reference. +% \makecrfile = write references to auxilliary (*.crf) file. +% \nocrfile = suppress writing to auxilliary file. +% \nocrwarnings = suppress warning messages. +% +% ------------------------------------------------------------------ + +\catcode`@=11 + +\def\@crwrn#1{\if@crwrns\immediate\write16{#1}\fi} +\def\@markmissingcr{\relax} +%\def\@markmissingcr{{\bf ??}\@marginmarker} +%\def\@marginmarker{\vadjust{\vbox to0pt{% +%\kern-.77\normalbaselineskip +%\hbox{{\it\kern\hsize\kern15pt?}}\vss}}} + +\newif\if@crwrns \global\@crwrnstrue % default + +\def\nocrfile{\global\@crfilefalse} +\def\nocrwarnings{\global\@crwrnsfalse} + +\def\@car#1#2{#1} \def\@cdr#1#2{#2} + +\long\def\@ifundefined#1#2#3{\expandafter\ifx\csname + #1\endcsname\relax#2\else#3\fi} + +\def\namedef#1{\expandafter \def\csname #1\endcsname} + +\def\newlabel#1#2{\@ifundefined{#1}{}% +{\@crwrn{!WARNING: LABEL #1 REPEATED}}% +\global\namedef{#1}{#2}} + +\newread\crfile + +\openin\crfile=\jobname.crf +\ifeof\crfile + \@crwrn{FILE \jobname.crf NOT FOUND} + \else + \@crwrn{READING REFS FROM \jobname.crf} + \input \jobname.crf +\fi + +\closein\crfile +\newwrite\crfile + +\def\makecrfile{\@crwrn{STARTING CR-FILE: \jobname.crf}% +\immediate \openout\crfile=\jobname.crf} +\def\nocrfile{\@crwrn{CR-FILE \jobname.crf NOT CREATED}\def\crfile{-1}} + +\def\ref#1{\@nextcrf\@ifundefined{#1}{\@markmissingcr +\@crwrn{!WARNING: UNDEFINED REFERENCE \string#1}}% +{\edef\@tempa{\csname #1\endcsname}\expandafter \@car\@tempa}} + +\def\pageref#1{\@nextpcrf \@ifundefined{#1}{\@markmissingcr +\@crwrn{!WARNING: UNDEFINED REFERENCE \string#1}}% +{\edef\@tempa{\csname #1\endcsname}\expandafter \@cdr\@tempa}} + +\def\defreference#1#2{\@nextdrf +\edef\save{\string\newlabel{#1}% +{{#2}{\noexpand\folio}}}\write\crfile\expandafter{\save}% +\ignorespaces} + +\newcount\@crfC \newcount\@pcrfC \newcount\@dcrfC + +\def\@nextdrf{\global\advance\@dcrfC1\relax} +\def\@nextcrf{\global\advance\@crfC1} +\def\@nextpcrf{\global\advance\@pcrfC1} +\def\crstatistics{% +\@crwrn{==============================} +\@crwrn{= REFERENCE STATISTICS =======} +\@crwrn{= refs defined.... \the\@dcrfC} +\@crwrn{= refs used....... \the\@crfC} +\@crwrn{= page refs used.. \the\@pcrfC} +\@crwrn{==============================}} + +\outer\def\bye{\crstatistics\end} +\catcode`@=12 + +\endinput +%% +%% Example: +%% ======= +%\input tp-crf +%\makecrfile +% +%\newcount\SecC +%\def\label#1{\defreference{#1}{\the\SecC}} +%\def\sec#1{\vskip\baselineskip\global\advance\SecC1 +%\leftline{\bf\the\SecC.~#1}\par\nobreak\smallskip} +% +%\sec{First section} +%\label{sec:first} +%This is section~\ref{sec:first} on page~\pageref{sec:first}. +%Compare section~\ref{sec:second} on page~\pageref{sec:second}. +% +%\vfill\eject +% +%\sec{Second section} +%\label{sec:second} +%This is section~\ref{sec:second} on page~\pageref{sec:second}. +%Compare section~\ref{sec:first} on page~\pageref{sec:first}. +% +%\bye +%% diff --git a/Master/texmf-dist/tex/plain/gustlib/verbatim.tex b/Master/texmf-dist/tex/plain/gustlib/verbatim.tex new file mode 100644 index 00000000000..ed2aa700b9c --- /dev/null +++ b/Master/texmf-dist/tex/plain/gustlib/verbatim.tex @@ -0,0 +1,48 @@ +% F I L E V E R B A T I M . T E X +% +% THIS SET OF MACROs IS TAKEN FROM D.E.K.'s TeXBook +% AND PROVIDES AN EASY WAY OF TYPESETTING TEXTS VERBATIM: +% +% 1. \verbatim<character><text without that character><character> +% causes the text to be set verbatim using \tt font; +% 2. if the text uses up all the alphabet, \doubleverbatim macro +% can be used instead; this is similar to the previous one but +% a pair of characters is now used as a delimiter; +% 3. in case of emergency \tripleverbatim macro may be of help... +% +%--------------------------------------------- +\def\uncatcodespecials % see D.E.K., pp. 344 and 380 + {\def\do##1{\catcode`##1=12}\dospecials}% +%--------------------------------------------- +{\catcode`\^^I=\active \gdef^^I{\ \ \ \ }% TAB character is replaced by + % 4 spaces; it is better than + % nothing, but it does not mimic + % true tabbing satisfactorily---maybe + % some nice day... + \catcode`\`=\active\gdef`{\relax\lq}}% this line inhibits Spanish + % ligatures ?` and !` of \tt font +\def\setupverbatim % see D.E.K., p. 381 + {\tt % + \spaceskip=0pt \xspaceskip=0pt % just in case... + \catcode`\^^I=\active % + \catcode`\`=\active % + \def\par{\leavevmode\endgraf}% this causes that empty lines aren't + % skipped + \obeylines \uncatcodespecials \obeyspaces}% +{\obeyspaces \global\let =\ }% this causes that leading blanks aren't + % skipped; cf. also def's of \space, \endgraf, + % \lq, \obeyspaces, and \obeylines, + % D.E.K., pp. 351--352 +%--------------------------------------------- +% see D.E.K., p. 382 +\def\doverbatim#1{\def\next##1#1{##1\endgroup}\next}% +\def\verbatim{\begingroup\setupverbatim\doverbatim}% +%---------- +\def\dodoubleverbatim#1#2{\def\next##1#1#2{##1\endgroup}\next}% +\def\doubleverbatim{\begingroup\setupverbatim\dodoubleverbatim}% +%---------- +\def\dotripleverbatim#1#2#3{\def\next##1#1#2#3{##1\endgroup}\next}% +\def\tripleverbatim{\begingroup\setupverbatim\dotripleverbatim}% +%--------------------------------------------- +\endinput + |