diff options
author | Norbert Preining <norbert@preining.info> | 2019-09-02 13:46:59 +0900 |
---|---|---|
committer | Norbert Preining <norbert@preining.info> | 2019-09-02 13:46:59 +0900 |
commit | e0c6872cf40896c7be36b11dcc744620f10adf1d (patch) | |
tree | 60335e10d2f4354b0674ec22d7b53f0f8abee672 /macros/latex209/contrib/dropcaps |
Initial commit
Diffstat (limited to 'macros/latex209/contrib/dropcaps')
-rw-r--r-- | macros/latex209/contrib/dropcaps/dropcaps.sty | 130 | ||||
-rw-r--r-- | macros/latex209/contrib/dropcaps/dropdoc.tex | 143 | ||||
-rw-r--r-- | macros/latex209/contrib/dropcaps/droptest.tex | 70 | ||||
-rw-r--r-- | macros/latex209/contrib/dropcaps/ttn2n1a.sty | 135 |
4 files changed, 478 insertions, 0 deletions
diff --git a/macros/latex209/contrib/dropcaps/dropcaps.sty b/macros/latex209/contrib/dropcaps/dropcaps.sty new file mode 100644 index 0000000000..b1675580e8 --- /dev/null +++ b/macros/latex209/contrib/dropcaps/dropcaps.sty @@ -0,0 +1,130 @@ +%% +%% Style-option `dropcaps' for use with LaTeX v2.09 +%% +\def\fileversion{0.30} +\def\filedate{13 Sep 1993} +\def\docdate{\filedate} +%% +%% Copyright (C) 1993 by Fred J. Lauwers, fred@dutspf.tudelft.nl . +%% All rights reserved. +%% +%% THANKS +%% Jeremy Gibbons +%% +%% DESCRIPTION: +%% dropcaps.sty contains a macro for dropping caps in LaTeX. +%% +%% INSTALLATION: +%% Put this file where your TeX looks for inputs, +%% under the name dropcaps.sty. +%% +%% DOCUMENTATION: +%% dropcaps.tex +%% +%% COPYING: +%% Copying of part or all of this file is allowed under the following +%% conditions only: +%% (1) You may freely distribute unchanged copies of the file. Please +%% include the documentation when you do so. +%% (2) You may modify a renamed copy of the file, but only for personal +%% use or use within an organization. +%% (3) You may copy fragments from the file, for personal use or for +%% distribution, as long as credit is given where credit is due. +%% +%% You are NOT ALLOWED to take money for the distribution or use of +%% this file or modified versions or fragments thereof, except for +%% a nominal charge for copying etc. +%% +\typeout{\space\space Style option: 'dropcaps' v\fileversion \space\space + <\filedate> \space\space (FJL)}% + +\font\fredfont=cmbxsl10 +\def\fred{F\kern-.25em\j\kern-.1emL} + +\def\yes{y }\def\no{n }\newif\ifdvips +\message{*** Are you using Rokicki's DVIPS [y/n] ? } +\read-1 to \answer +\ifx\answer\yes\dvipstrue +\else\dvipsfalse\fi + +\newcount\bigscale +\ifdvips\typeout{*** Good choice.}% +% +% DVIPS users +% +\newcount\wantedcount\newcount\actualcount% +\newdimen\actualheight% +\def\findsize#1#2{% +\bigscale=1000% +\font\BIG=#1 scaled \bigscale% +\setbox0=\hbox{\BIG #2\/}% +\actualheight=\ht0% +\typeout{*** Needed height: \the\wantedheight, + \space Unscaled height: \the\actualheight}% +\wantedcount=\wantedheight \actualcount=\actualheight% +\advance\actualcount by 50% +\divide\actualcount by 100% +\multiply\wantedcount by 10% +\divide\wantedcount by \actualcount% +\font\BIG=#1 scaled \wantedcount% +\setbox0=\hbox{\BIG #2\/}% +\bigscale=\wantedcount% +} +\else\typeout{*** OK, prepare for bad output...}% +% +% non-DVIPS users +% +\def\nextmagstep#1#2#3{% +\bigscale=#3% +\font\BIG=#1 scaled \bigscale% +\setbox0=\hbox{\BIG #2\/}}% +\def\findsize#1#2{% +\typeout{*** Needed height: \the\wantedheight}% +\nextmagstep{#1}{#2}{\magstep0}% +\ifdim\ht0<\wantedheight% +\nextmagstep{#1}{#2}{\magstephalf}% +\ifdim\ht0<\wantedheight% +\nextmagstep{#1}{#2}{\magstep1}% +\ifdim\ht0<\wantedheight% +\nextmagstep{#1}{#2}{\magstep2}% +\ifdim\ht0<\wantedheight% +\nextmagstep{#1}{#2}{\magstep3}% +\ifdim\ht0<\wantedheight% +\nextmagstep{#1}{#2}{\magstep4}% +\ifdim\ht0<\wantedheight% +\nextmagstep{#1}{#2}{\magstep5}% +\fi\fi\fi\fi\fi\fi% +}\fi + +\newcount\down +\newdimen\saveunitlength +\newdimen\wantedheight +\def\bigdrop#1#2#3#4{% +\saveunitlength=\unitlength% +\unitlength=\baselineskip% +\setbox1=\hbox{\the\font I}% +\wantedheight=#2\baselineskip \advance\wantedheight by -\baselineskip% +\advance\wantedheight by \ht1% +\findsize{#3}{#4}% +\advance\wantedheight by -\ht0% only for typeout... +\typeout{*** #3 scaled \the\bigscale \space ==> height: + \the\ht0 \space (error: \the\wantedheight).}% +\hangindent=\wd0 \advance\hangindent by #1% +\hangafter=-#2% +\ifdim\dp0>0.25\baselineskip% 0pt ? + \typeout{*** extra line(s) indented: non-zero depth: \the\dp0} + \loop\ifdim\dp0>\baselineskip + \advance\baselineskip by \baselineskip + \advance\hangafter by -1 + \repeat + \advance\hangafter by -1 + \baselineskip=\unitlength +\fi% +\noindent% +\down=-#2 \advance\down by 1% +\begin{picture}(0,0)% +\put(0,\down){\makebox(0,0)[br]{\box0}}% +\end{picture}% +\unitlength=\saveunitlength} + +\endinput diff --git a/macros/latex209/contrib/dropcaps/dropdoc.tex b/macros/latex209/contrib/dropcaps/dropdoc.tex new file mode 100644 index 0000000000..940e812ed7 --- /dev/null +++ b/macros/latex209/contrib/dropcaps/dropdoc.tex @@ -0,0 +1,143 @@ +% DROPDOC.TEX -- 13-09-1993 +% +\documentstyle[dropcaps]{ttn2n1a} +\begin{document} + +\Section{{\huge {\tt dropcaps.sty}}\\ + a style file for dropping caps (\fred)} + +\bigdrop{-10pt}{3}{cmsl10}{I}n a previous issue of \TTN\ +(vol. 1, No. 4, 1992), Peter Flynn dedicates a subsection of +{\sl Typographer's Inn\/} to the problem of dropped capitals. This is +my answer to some of his questions. Basically, I don't start with the +capital, but I let the capital's size depend on the chosen design. +I wrote a dropped caps macro for use with \LaTeX, and took these +design decisions: +\begin{itemize} +\item First, let the writer choose her favourite design, within certain + limitations though, and let the macro do the dirty work: adjusting + the cap to the optimal size. +\item Let the writer decide how many lines she wants to dropindent. Let + her also decide in which font the cap should appear, whether to + start the cap {\em at\/} the left margin, or somewhat to the left + (into the white space) or to the right (into text direction). Let + her decide what she puts into dropped caps: a single character, or + even one or more whole words, or without caps at all. +\item The limitations: Let the cap's baseline be aligned with the baseline + of the lowest of the indenting lines. Let the cap's top line be + aligned with the top line of the first of the indenting lines. + Don't let the writer mess with this! +\end{itemize} + +\Subsection{Usage} + +\bigdrop{-10pt}{3}{cmsl10}{M}y {\tt dropcaps.sty} is a \LaTeX\ style +file, that defines a macro command \verb+\bigdrop+ that enables you to +drop capitals at the beginning of a paragraph. The layout can be +controlled in various ways, with four parameters (not optional). For +instance, the current paragraph started with\\ [2pt] +\verb+\bigdrop{-10pt}{3}{cmsl10}{M}y ...+\\ [2pt] +The required parameters are: +\begin{enumerate} +\item a {\em length}, that denotes the distance from the left margin + (to the left or to the right) at which the dropped capital starts, + in this case 10pt into the left margin: {\tt -10pt}. +\item an integer value, that denotes the number of lines to be indented, + in this case {\tt 3} lines. +\item the font to be used for the dropped capital, in this case {\tt cmsl10}. +\item the character or text to be dropped, in this case a single {\tt M}. +\end{enumerate} + +\Subsection{The messy details} + +\bigdrop{-10pt}{3}{cmsl10}{W}hen the macro \verb+\bigdrop+ is called +(with four parameters), this is what happens. First, a capital "I" is +typeset in the current text font and put in a box (\verb+box1+). The +desired font height (\verb+\wantedheight+) is then computed from +\verb|(n-1)*\baselineskip+\ht1|, where {\tt n} is the number of lines +to indent. Then the procedure differs, depending on the choice for DVIPS +or not.\\ [8pt] +% +{\fredfont DVIPS users}\\ +% +In this case the text to be capitalized, typeset in the chosen font +(at scale \verb+1000+), is put in a box (\verb+box0+), with height +\verb+\actualheight+ $=$ \verb+\ht0+. Now, the scaling factor for this +font can be computed from dividing \verb+\wantedheight+ by +\verb+\actualheight+ and multiplying this by \verb+1000+. Because +divisions are integer, the heights are first put in count registers, +and then, to prevent from rounding errors and overflow, +\verb+\wantedheight*10+ is divided by \verb+\actualheight/100+. The +outcome of this is the scale at which the chosen font is typeset.\\ [8pt] +% +{\fredfont non-DVIPS users}\\ +% +Without DVIPS things are less elegant, for only the standard magsteps +are available for scaling fonts\footnote{The \verb+magstep+'s {\tt 0}, +{\tt half}, {\tt 1}, {\tt 2}, {\tt 3}, {\tt 4}, and {\tt 5}.}. The text +to be capitalized in the chosen font, is first typeset at +\verb|\magstep 0| and put in a box (\verb+box0+), with height \verb+\ht0+. + +If \verb+\wantedheight+ is bigger then \verb+\ht0+, the text is typeset +at \verb|\magstephalf|, and put in \verb+box0+ again. If +\verb+\wantedheight+ is still bigger then \verb+\ht0+, again the +\verb|\magstep| is increased one step, et cetera. This process is +repeated until \verb+\wantedheight+ is smaller then \verb+\ht0+.\\ [8pt] +% +{\fredfont both}\\ +% +The result of the computation can be observed on the screen and in the +{\tt .log} file. Each time a capital is dropped, two lines like\\ [2pt] +\verb|*** Needed height: 30.83331pt, Unscaled height: 6.83331pt|\\ +\verb|*** cmsl10 scaled 4512 ==> height: 30.83195pt (error: 0.00136pt).|\\ [2pt] +appear. This example is from processing this document with {\tt n = 3} +and font {\tt cmsl10}. + +At the end of the computation {\tt box0} contains the text, typeset in +the desired font and scaled such that \verb+\ht0+ equals the height of +the indenting lines. Then, \verb+\hangindent+ and \verb+\hangafter+ are +set according to {\tt box0} and the parameter values: +\verb|\hangindent:=\wd0+#1|, and \verb|\hangafter:=-#2|. +Precautions are taken for the case that \verb+\dp0+ is not equal to +zero\footnote{An extra line is indented, if overlap occurs, the test file +{\tt droptest.tex} shows an example of this.}. Finally, in a \LaTeX\ +picture environment, the text is placed where we want it. + +\Subsection{Requirements} + +\bigdrop{-10pt}{3}{cmsl10}{I}n order to use this style file, a big +version of \LaTeX\ is needed, because almost always fonts have to be +generated, and already from 4 indenting lines, they tend to become very +large. I tested this with em\TeX's \TeX386 (with emx) on a 486DX33 PC, +and with em\TeX's b\TeX186 on a AT286 PC. + +Also needed is a version of {\bf DVIPS} by Tomas Rokicki with {\bf MakeTeXPK} +running, so the generation of fonts will be done automatically. For me +the recently uploaded {\bf DVIPS 5.518} works great on both machines. + +All this is necessary because the implemented procedure in this macro +automatically leads to non-standard fonts. So, for optimal pleasure, +use a big \TeX\ and Rokicki's {\bf DVIPS}. + +\Subsection{Alternatives} + +\bigdrop{-10pt}{3}{cmsl10}{O}nly one style file that does something +similar is listed in \TeX--index v1.06 by David M. Jones, namely +{\tt drop.sty} by David G. Cantor. The latest version is dated +17--02--1988. This style file also defines a macro to drop capitals, +but has no possibilities to accept controlling parameters, except for +the choice of font. You are not able to choose the desired height by +supplying the number of lines to be indented. + +The dropped capital has a fixed size, namely \verb+\magstep5+, and +always two lines are indented. This font height is somewhat smaller +than the height of two indenting lines, so the vertical placement of +the dropped capital's baseline lies not at the same height as the +vertical placement of the baseline of the second indenting line (next +to it). The advantage of this is that everyone has this font. + +\vspace{2cm} +\leftline{Fred J. Lauwers ({\sl \fred\/})} +\leftline{\tt fred@dutspf.tudelft.nl} + +\end{document} diff --git a/macros/latex209/contrib/dropcaps/droptest.tex b/macros/latex209/contrib/dropcaps/droptest.tex new file mode 100644 index 0000000000..9e2e1f9b1d --- /dev/null +++ b/macros/latex209/contrib/dropcaps/droptest.tex @@ -0,0 +1,70 @@ +% DROPTEST.TEX -- 13-09-1993 +% +\documentstyle[dropcaps]{ttn2n1a} +\begin{document} + +\Section{{\huge {\tt bigdrop}}\\ + a macro for dropping caps (\fred)} + +\Subsection{Watch the caps!} + +\bigdrop{25pt}{1}{cmbx12}{T}his is the first example of the +\verb+\bigdrop+ macro. This time the macro is used like this: +\verb+\bigdrop{25pt}{1}{cmbx12}{T}his is...+ The first parameter +says that the dropped capital starts {\tt 25pt} from the left margin. +The second parameter says that only one line is indenting, and the +third is there to choose the wished font {\tt cmbx12}. The fourth is +just the character to be dropped. Note: this example can also be done +without this macro, with a small effort to get the 12pt character +10pt high. + +\bigdrop{0pt}{2}{cmsl10}{I'}m happy to show another example of this +\verb+\bigdrop+ macro. This time it is used like this: +\verb+\bigdrop{0pt}{2}{cmsl10}{I'}m happy...+ The first parameter says +that the dropped capital starts at the left margin. The second parameter +says that two lines are indenting, the third is the wanted font for the +cap, and the fourth is just the text to be dropped. Note: this can be +more than one character. + +\Subsection{And again!} + +\bigdrop{0pt}{3}{cmr10}{\TeX}is a beautiful program, with a lot +of possibilities. Take this nice example of the \verb+\bigdrop+ macro, +this time called with \verb+\bigdrop{0pt}{3}{cmr10}{\TeX}is a...+\\ +The first parameter says that the dropped capital starts at the left +margin. The second parameter says that three lines are indented, the +third is the chosen font, and the fourth is the text to be dropped. +Note: there are four lines indented instead of the requested three. +To explain why we take a look at the next example. + +\bigdrop{0pt}{3}{cmr10}{TEX}is a beautiful program, even when the +macro is called with \verb+\bigdrop{0pt}{3}{cmr10}{TEX}is a...+\\ +We see something remarkable here: in both cases the number of indenting +lines is three, but in the previous example four lines are indented! +The reason for this is that in the first case the string \verb+\TeX+ +has non--zero depth, as opposed to the second case --- and the first +two examples --- where the string fits exactly in the reserved space. +The author could have chosen to fit the logo in the three--lines--space, +but in that case the font would have been smaller, and to the author's +opinion the best outcome is obtained by equal numbers of indenting lines +with equal font heights in any document. +So, when a non--zero depth is met, the macro automatically determines +whether an extra indenting line (or maybe more) is needed. + +\bigdrop{-20pt}{5}{cmsl10}{A}s a last example we make a very big +dropped cap. What? You did not know you could make such big +fonts? Of course you can, just use Rokicki's {\bf DVIPS} with running +{\bf MakeTeXPK}, then the fonts are generated automatically! +In this example the macro is called with +\verb+\bigdrop{-20pt}{5}{cmsl10}{A}s a last...+ +Note that the fonts automatically get bigger: +the height depends on the number of lines to be indented, the current +text font, the current baselineskip, and the chosen font. The +\verb+\bigdrop+ macro computes the needed height of the font, so you +don't have to worry about that. + +\vspace{2cm} +\leftline{Fred J. Lauwers ({\sl \fred\/})} +\leftline{\tt fred@dutspf.tudelft.nl} + +\end{document} diff --git a/macros/latex209/contrib/dropcaps/ttn2n1a.sty b/macros/latex209/contrib/dropcaps/ttn2n1a.sty new file mode 100644 index 0000000000..f0efbe33af --- /dev/null +++ b/macros/latex209/contrib/dropcaps/ttn2n1a.sty @@ -0,0 +1,135 @@ +%% IMPORTANT NOTICE: You *MUST* use this version 2.1 of tugnews.sty +%% dated Jan. 1993 in order to run vol.2, no.1 of +%% _TeX and TUG NEWS_. (Ch. Thiele, Editor, TTN). +%% + +\input report.sty %% default report style, 10pt font + +\typeout{Version 2.1 -- Jan. 93} + +\textwidth=29pc +\textheight=43pc +\voffset=-2pc +\overfullrule=0pt \hfuzz=5pt + +\font\Sectionfont=cmbxsl10 scaled \magstep2 %% \Large = 14.40pt +%% \Subsectionfont and \bsl aren't used in TTN 1,3: +\font\Subsectionfont=cmbxsl10 scaled \magstep1 %% \large = 12pt +\font\subsectionbit=cmbxti10 scaled\magstep1 %% bold italic 12pt +%% \font\bsl=cmbxsl10 %% bold slant 10pt +\font\unsl=cmu10 %% unslant 10pt for + %% upright pound sign +%test for nfss as suggested by Johannes Braams (cjc, 1992.10) + \ifx\undefined\selectfont + % If NFSS is not preloaded, do nothing. + \else + % If NFSS has been preloaded, we need the following: + % \font\tenmi=cmmi10 % or better yet: + \def\tenmi{\fontfamily{cmm}\fontseries{m}\fontshape{it}% + \fontsize{10}{12pt}\selectfont} + \fi + + +\newcommand{\Section}[1]{\section*{\centering% + \hrule\hrule \vskip.5pc + {\Sectionfont #1} + \vskip.5pc \hrule\hrule + \vskip1pc + } + } +%% The following macro hasn't been used since the prototype: +%% Reggie's \Subsection (6 MAY 91): %% 15 JAN 92: not used in 1,1 +\newcommand{\Subsection}[1]{\subsection*{\centering% + \centerline{\vrule width 6cm height .5pt} \vskip 6pt + {{\Subsectionfont #1}} + \centerline{\vrule width 6cm height .5pt} \vskip 6pt + } + } + + +%% 11 JAN 92: added \bibentry, a hanging indent biblio style (Ch.) +\newcommand{\bibentry}{\hangindent=\parindent + \hangafter=1 + \noindent \sloppy + \clubpenalty500 \widowpenalty500 + \frenchspacing + } + +%% 3 FEB 92: Jackie Damrau provided this: +\newenvironment{Address}{\begin{verse}}% + {\end{verse}} + + +%% Abbreviations and Logos (some copped from tugboat.cmn): + +%% for the METAFONT logo font: +\font\manual=manfnt %% logo10 +\def\MF{{\manual META}\-{\manual FONT}} + +\def\PS{{\sc Post\-Script}} + +\def\TUG{\TeX{} Users Group} +\def\tug{{\small TUG}} %% added 30 SEP 92 (Ch.) +\def\TUB{{\sl TUGboat\/}} +\def\TTN{{\sl\TeX{} and TUG NEWS\/}} +\def\ttn{{\small TTN}} %% added 30 SEP 92 (Ch.) +\def\isbn{{\small ISBN}} %% added 30 SEP 92 (Ch.) +\def\issn{{\small ISSN}} %% added 30 SEP 92 (Ch.) +\def\nfss{{\small NFSS}} %% added 30 SEP 92 (Ch.) +\def\uk{{\small UK}} %% added 15 OCT 92 (Ch.) +\def\fax{{\small FAX}} %% added 15 OCT 92 (Ch.) + +\def\pounds{{\unsl\$}} %% added 15 OCT 92 (Ch.) + +\def\GUTenberg{{\small GUT}enberg} %% added 2 FEB 93 (Ch.) + + +%% 4 FEB 92: improved versions of LaTeX, and (La)TeX macros: + +\newcount\TestCount +\def\La{\TestCount=\the\fam \leavevmode L\raise.42ex + \hbox{$\fam\TestCount\scriptstyle\kern-.3em A$}} + +\def\LaTeX{\La\kern-.15em\TeX} + +\def\AllTeX{{(\La)\TeX}} + +\def\AmSTeX{{\the\textfont2 A}\kern-.1667em\lower.5ex\hbox + {\the\textfont2 M}\kern-.125em{\the\textfont2 S}-\TeX} + +\def\AmSLaTeX{{\the\textfont2 A}\kern-.1667em\lower.5ex\hbox + {\the\textfont2 M}\kern-.125em{\the\textfont2 S}-\LaTeX} + +\def\BibTeX{{\rm B\kern-.05em{\sc i\kern-.025emb}\kern-.08em\TeX}} + +\def\careof{\leavevmode\hbox{\raise.75ex\hbox{c}\kern-.15em + /\kern-.125em\smash{\lower.3ex\hbox{o}}} \ignorespaces} + +\def\ILaTeX{I\LaTeX} + +\def\TeCH{{\rm T\kern-.1667em\lower.7ex\hbox{E}\kern-.125em{\sf CH}}} + +\def\TeXline{{\TeX\kern-0.1em line}} + +%% 28 JAN 93: from Phil Taylor: + +\def\UK-TuG{UK-T\lower0.5ex\hbox{U}G} + + +%% Miscellaneous: + +\hyphenation{Karls-ruhe} + +\let\ts=\thinspace +\let\nl=\newline + + +%% CHANGES FROM ttn1-1.sty TO ttn1-2.sty: + +%% 25 MAY 92: changed \smc to \sc in \BiBTeX def'n (Ch.) +%% added \AmSLaTeX def'n (Ch.) +%% 14 JUN 92: added \TeXline def (Ch.) + +%% CHANGES from ttn1-2.sty TO ttn1-3.sty: +%% 10 SEP 92: Jackie added {ttnlist} + |