| 1 |
% $Id: biblist.doc,v 1.4 1992/01/13 16:35:56 schrod Exp schrod $ |
| 2 |
%---------------------------------------------------------------------- |
| 3 |
% Copyright (c) 1991 by J.Schrod <[email protected]>. |
| 4 |
% Distributed under the terms of the GNU General Public License. |
| 5 |
|
| 6 |
% |
| 7 |
% LaTeX style option biblist for article style |
| 8 |
% |
| 9 |
% [LaTeX in MAKEPROG] |
| 10 |
|
| 11 |
|
| 12 |
% |
| 13 |
% $Log: biblist.doc,v $ |
| 14 |
% Revision 1.4 1992/01/13 16:35:56 schrod |
| 15 |
% Added examples, repaired headline. |
| 16 |
% Called \reset@font where appropriate. |
| 17 |
% October 91 version of LaTeX was delayed until December 91. Readers |
| 18 |
% might be disturbed if there is the notion of a nonexistant version. |
| 19 |
% |
| 20 |
% Revision 1.3 1991/10/14 14:10:21 schrod |
| 21 |
% mentioned that this option is supported. |
| 22 |
% moved local guide section to separate file. |
| 23 |
% |
| 24 |
% Revision 1.2 1991/10/10 16:13:31 schrod |
| 25 |
% changed email address. |
| 26 |
% mentioned LaTeX 2.09 <Oct 91> (just announced). |
| 27 |
% |
| 28 |
% Revision 1.1 1991/04/13 15:03:08 schrod |
| 29 |
% Initial revision |
| 30 |
% |
| 31 |
|
| 32 |
|
| 33 |
|
| 34 |
|
| 35 |
\documentstyle[progltx,a4-9,rcs,names,biblist]{article} |
| 36 |
|
| 37 |
|
| 38 |
% We need biblist for the examples and do therefore include it. But it |
| 39 |
% sets the headline (see below ;-). So we just reset it again to the |
| 40 |
% value it had before. Well, it's a kind of a kludge, but it works... |
| 41 |
\pagestyle{plain} |
| 42 |
|
| 43 |
% The examples will consist of framed pseudo-output. We'll need a |
| 44 |
% variable for the width of these examples. |
| 45 |
\newdimen\examplewidth |
| 46 |
|
| 47 |
|
| 48 |
\nofiles % don't need an aux file |
| 49 |
|
| 50 |
|
| 51 |
\begin{document} |
| 52 |
|
| 53 |
|
| 54 |
\title{The {\tt biblist\/} Style Option} |
| 55 |
\author{% % LaTeX does not discard unnecessary glue... |
| 56 |
Joachim Schrod% |
| 57 |
\thanks{% |
| 58 |
TU~Darmstadt, Alexanderstr.~10, D-6100 Darmstadt, Germany.\newline |
| 59 |
Email: {\tt [email protected]}.% |
| 60 |
}% |
| 61 |
} |
| 62 |
\RCSdate $Date: 1992/01/13 16:35:56 $ |
| 63 |
|
| 64 |
\maketitle |
| 65 |
|
| 66 |
|
| 67 |
|
| 68 |
\chap What's this style option for?. |
| 69 |
|
| 70 |
This style option is appropriate to create a typeset listing of a |
| 71 |
(possibly large) \BibTeX{} input file. With such large files -- |
| 72 |
especially, if the cite keys are long -- the needed string space is |
| 73 |
often exceeded. Often a Big\TeX{} is available to circumstance this |
| 74 |
problem, but with this style option each \TeX{} will do it. |
| 75 |
|
| 76 |
You have to prepare a \LaTeX{} document which uses the |article| |
| 77 |
style and the |biblist| style option. You may add almost all other |
| 78 |
style options, as you wish, e.g., |twoside|, |german| (or other |
| 79 |
language style options), |a4|, etc. This style option must be used |
| 80 |
with a ragged bottom; this has the effect, that it cannot be used with |
| 81 |
|twocolumn| or |multicol|. |
| 82 |
|
| 83 |
You must issue a |\bibliography| tag which names all \BibTeX{} |
| 84 |
databases which you want to print. You may issue a |
| 85 |
|\bibliographystyle| tag to specify how \BibTeX{} will process its |
| 86 |
databases. (In fact, you usually must issue it since the default |
| 87 |
bibliography style is not available on most installations; see |
| 88 |
below.) You may issue |\nocite| commands if you want to print only |
| 89 |
selected entries from the databases. |
| 90 |
|
| 91 |
|
| 92 |
\sect If you have not issued the |\bibliographystyle| tag, the |
| 93 |
|biblist| bibliography style will be used. This is a non-abbreviating |
| 94 |
style which does not do any sorting and no case conversion to titles. |
| 95 |
The field |isbn| is recognized for books (and parts of), and the |
| 96 |
field |issn| is recognized for articles and such. In addition, it |
| 97 |
provides the additional fields |library| and |annote| for all entry |
| 98 |
types. The usage of these fields depends on the definition of |
| 99 |
appropriate \TeX{} macros (which are supplied by this style option). |
| 100 |
|
| 101 |
On interest I can provide a diff to |btxbst.doc|. |
| 102 |
|
| 103 |
|
| 104 |
\sect A ``bug'' you may encounter is that |\cite| tags within |
| 105 |
\BibTeX{} entries will not be processed. Instead the cite key itself |
| 106 |
will be printed. Note that this is not a bug, this is a feature! You |
| 107 |
have to use |\nocite| tags for {\it all\/} entries that shall be |
| 108 |
included in the listing. If you do not give any |\nocite| tag at all, |
| 109 |
a listing with all entries is created. |
| 110 |
|
| 111 |
Note that this style option assumes that you use either a version of |
| 112 |
\LaTeX{}~2.09 after December~1991, I\LaTeX{}, or the {\sf babel} |
| 113 |
system. Particulary, it requires the definition of |\refname| (i.e., |
| 114 |
the title of the ``references section'') which is supplied by these |
| 115 |
systems. (Of course, you may supply this definition by yourself.) |
| 116 |
|
| 117 |
|
| 118 |
\sect The entries in the resulting listing are formatted as follows: |
| 119 |
% |
| 120 |
\begin{description} |
| 121 |
|
| 122 |
\item[\tt cite key] \leavevmode \null \dotfill \quad {\sf (Library info)}\break |
| 123 |
Author(s).\\ |
| 124 |
Title.\\ |
| 125 |
Publication info.\\ |
| 126 |
Notes.\\ |
| 127 |
\null \qquad {\footnotesize Annotation} |
| 128 |
|
| 129 |
\end{description} |
| 130 |
% |
| 131 |
I.e., an open format is used. Although this needs more space I think |
| 132 |
the enhanced legibility pays back. |
| 133 |
|
| 134 |
Note that you will not get the `Library info' and the `Annotation' in |
| 135 |
the above format if your bibliography style does not supply this |
| 136 |
information with the assumed markup. (See above for the |biblist| |
| 137 |
bibliography style.) The parenthesis around the library info are |
| 138 |
produced by this style option, not by \BibTeX{}. |
| 139 |
|
| 140 |
|
| 141 |
\sect {\it Example\/}:\quad Suppose, there is a file |typography.bib| |
| 142 |
with references on typography. |
| 143 |
% |
| 144 |
\begin{quote} |
| 145 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 146 |
\begin{verbatim} |
| 147 |
% typography.bib 13 Jan 92 |
| 148 |
%------------------------------------------------------------ |
| 149 |
|
| 150 |
% |
| 151 |
% References on Typographie, Typesetting, and Book Design |
| 152 |
% |
| 153 |
|
| 154 |
% !!!! This is a kludge for biblist.doc !!!! |
| 155 |
@preamble{" |
| 156 |
\font\tenlogo=logo10 |
| 157 |
\let\logo=\tenlogo |
| 158 |
\def\MF{{\logo META}\-{\logo FONT}} |
| 159 |
"} |
| 160 |
|
| 161 |
@book{typo:tschichold:selected, |
| 162 |
author = {Jan Tschichold}, |
| 163 |
title = {Ausgew\"ahlte Aufs\"atze \"uber Fragen der Gestalt des |
| 164 |
Buches und der Typographie}, |
| 165 |
publisher = {Birkh\"auser}, |
| 166 |
address = {Basel}, |
| 167 |
year = 1975, |
| 168 |
isbn = {3-7643-1946-1}, |
| 169 |
note = {A second, unchanged, edition appeared in~1987.}, |
| 170 |
library = {}, |
| 171 |
annote = {A collection of his ``classic'' papers. The best book on |
| 172 |
typographic principles read so far. A definitive `{\it |
| 173 |
must\/}' for everyone interested in typography, book design, |
| 174 |
or typesetting.} |
| 175 |
} |
| 176 |
|
| 177 |
@article{typo:blostein:music, |
| 178 |
author = {Dorothea Blostein}, |
| 179 |
title = {Justification of Printed Music}, |
| 180 |
journal = cacm, |
| 181 |
volume = 34, |
| 182 |
number = 3, |
| 183 |
month = mar, |
| 184 |
year = 1991, |
| 185 |
pages = {88-99}, |
| 186 |
annote = {Presents problems and solutions of the task to create a |
| 187 |
correct spacing while setting notes. The proposed method also |
| 188 |
takes the temporal relationship of notes into account. |
| 189 |
Handles two-dimensional layout, e.g., staffs and texts.} |
| 190 |
} |
| 191 |
|
| 192 |
@book{typo:sta:zapf, |
| 193 |
title = {Herrman Zapf and his Design Philosophy}, |
| 194 |
publisher = {Society of Typographic Arts}, |
| 195 |
address = {Chicago}, |
| 196 |
year = 1987, |
| 197 |
isbn = {0-941447-00-6}, |
| 198 |
note = {}, |
| 199 |
library = {}, |
| 200 |
annote = {A valuable book. A chapter on his work around \MF{} is |
| 201 |
included. Was among the most beautiful books of the year.} |
| 202 |
} |
| 203 |
\end{verbatim} |
| 204 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 205 |
\end{quote} |
| 206 |
% |
| 207 |
Furthermore assume that the bibliography style |biblist| is |
| 208 |
available. Then the \LaTeX{} file |
| 209 |
% |
| 210 |
\begin{verbatim} |
| 211 |
\documentstyle[biblist]{article} |
| 212 |
|
| 213 |
\begin{document} |
| 214 |
|
| 215 |
\bibliography{typography} |
| 216 |
|
| 217 |
\end{document} |
| 218 |
\end{verbatim} |
| 219 |
% |
| 220 |
may be used to create a listing with all entries. You have to run |
| 221 |
\LaTeX{}, \BibTeX{}, and \LaTeX{}. (Careful readers will note that |
| 222 |
there will be a \BibTeX{} warning about a missing author or editor in |
| 223 |
the Zapf entry.) You do {\it not\/} need to run \LaTeX{} twice after |
| 224 |
the \BibTeX{} run. The result looks like this: |
| 225 |
% |
| 226 |
\begin{quote} |
| 227 |
\examplewidth=\linewidth |
| 228 |
\advance\examplewidth by -2\fboxrule |
| 229 |
\advance\examplewidth by -2\fboxsep |
| 230 |
\fbox{% |
| 231 |
\begin{minipage}{\examplewidth} |
| 232 |
\section*{References} |
| 233 |
|
| 234 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 235 |
% |
| 236 |
% We must fake a little bit to include it here. \bibitem gobbles the |
| 237 |
% next character since it thinks it's a line end. (This might be a |
| 238 |
% problem for itself, but untill now all bibliography styles put |
| 239 |
% \bibitem on an own line.) We must supply a token which might be |
| 240 |
% eaten by \bibitem. Best to use a \relax for this. |
| 241 |
% |
| 242 |
\font\tenlogo=logo10 \let\logo=\tenlogo \def\MF{{\logo META}\-{\logo FONT}} |
| 243 |
\begin{thebibliography}{1} |
| 244 |
|
| 245 |
\bibitem{typo:tschichold:selected}\relax |
| 246 |
Jan Tschichold. |
| 247 |
\newblock {\it Ausgew\"ahlte Aufs\"atze \"uber Fragen der Gestalt des Buches |
| 248 |
und der Typographie}. |
| 249 |
\newblock Birkh\"auser, Basel, 1975. ISBN~3-7643-1946-1. |
| 250 |
\newblock A second, unchanged, edition appeared in~1987. |
| 251 |
\newblock |
| 252 |
\annote A collection of his ``classic'' papers. The best book on typographic |
| 253 |
principles read so far. A definitive `{\it must\/}' for everyone interested |
| 254 |
in typography, book design, or typesetting. |
| 255 |
\endannote. |
| 256 |
|
| 257 |
\bibitem{typo:blostein:music}\relax |
| 258 |
Dorothea Blostein. |
| 259 |
\newblock Justification of Printed Music. |
| 260 |
\newblock {\it Communications of the ACM}, 34(3):88--99, March 1991. |
| 261 |
\newblock |
| 262 |
\annote Presents problems and solutions of the task to create a correct spacing |
| 263 |
while setting notes. The proposed method also takes the temporal relationship |
| 264 |
of notes into account. Handles two-dimensional layout, e.g., staffs and |
| 265 |
texts. |
| 266 |
\endannote. |
| 267 |
|
| 268 |
\bibitem{typo:sta:zapf}\relax |
| 269 |
{\it Herrman Zapf and his Design Philosophy}. |
| 270 |
\newblock Society of Typographic Arts, Chicago, 1987. ISBN~0-941447-00-6. |
| 271 |
\newblock |
| 272 |
\annote A valuable book. A chapter on his work around \MF{} is included. Was |
| 273 |
among the most beautiful books of the year. |
| 274 |
\endannote. |
| 275 |
|
| 276 |
\end{thebibliography} |
| 277 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 278 |
\end{minipage}% |
| 279 |
} |
| 280 |
\end{quote} |
| 281 |
|
| 282 |
\bigskip |
| 283 |
|
| 284 |
Otherwise -- without the |biblist| bibliography style -- you must issue |
| 285 |
an appopriate tag. The following result was produced with |unsrt|: |
| 286 |
% |
| 287 |
\begin{quote} |
| 288 |
\examplewidth=\linewidth |
| 289 |
\advance\examplewidth by -2\fboxrule |
| 290 |
\advance\examplewidth by -2\fboxsep |
| 291 |
\fbox{% |
| 292 |
\begin{minipage}{\examplewidth} |
| 293 |
\section*{References} |
| 294 |
|
| 295 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 296 |
% |
| 297 |
% Here the same reason for inserting \relax'es as in the previous |
| 298 |
% example applies. |
| 299 |
% |
| 300 |
\font\tenlogo=logo10 \let\logo=\tenlogo \def\MF{{\logo META}\-{\logo FONT}} |
| 301 |
\begin{thebibliography}{1} |
| 302 |
|
| 303 |
\bibitem{typo:tschichold:selected}\relax |
| 304 |
Jan Tschichold. |
| 305 |
\newblock {\em Ausgew\"ahlte Aufs\"atze \"uber Fragen der Gestalt des Buches |
| 306 |
und der Typographie}. |
| 307 |
\newblock Birkh\"auser, Basel, 1975. |
| 308 |
\newblock A second, unchanged, edition appeared in~1987. |
| 309 |
|
| 310 |
\bibitem{typo:blostein:music}\relax |
| 311 |
Dorothea Blostein. |
| 312 |
\newblock Justification of printed music. |
| 313 |
\newblock {\em Communications of the ACM}, 34(3):88--99, March 1991. |
| 314 |
|
| 315 |
\bibitem{typo:sta:zapf}\relax |
| 316 |
{\em Herrman Zapf and his Design Philosophy}. |
| 317 |
\newblock Society of Typographic Arts, Chicago, 1987. |
| 318 |
|
| 319 |
\end{thebibliography} |
| 320 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 321 |
\end{minipage}% |
| 322 |
} |
| 323 |
\end{quote} |
| 324 |
|
| 325 |
Of course, the ISBN numbers and the annotations are missing, since |
| 326 |
|unsrt| does not extract them from the database. (Careful readers |
| 327 |
will notice another difference: The |biblist| bibliography style does |
| 328 |
not lower titles of articles as the standard styles do.) |
| 329 |
|
| 330 |
|
| 331 |
\sect The preferred style for this style option is |article|. In fact, |
| 332 |
all styles which use |\raggedbottom| will work. This is because a page |
| 333 |
break within an entry is not allowed and the flexibility at the page |
| 334 |
bottom is needed. |
| 335 |
|
| 336 |
|
| 337 |
\sect As a future enhancement one could place an info on the starting |
| 338 |
and the finishing entry on this page in the headline, like in a |
| 339 |
dictionary. |
| 340 |
|
| 341 |
|
| 342 |
\sect This program is free software; you can redistribute it and/or |
| 343 |
modify it under the terms of the GNU General Public License as |
| 344 |
published by the Free Software Foundation; either version~1, or (at your |
| 345 |
option) any later version. |
| 346 |
|
| 347 |
This program is distributed in the hope that it will be useful, but |
| 348 |
{\bf without any warranty\/}; without even the implied warranty of |
| 349 |
{\bf merchantability\/} or {\bf fitness for a particular purpose}. See |
| 350 |
the GNU General Public License for more details. |
| 351 |
|
| 352 |
You should have received a copy of the GNU General Public License |
| 353 |
along with this program; if not, write to the Free Software Foundation, |
| 354 |
Inc., 675~Mass Ave, Cambridge, MA~02139, USA. |
| 355 |
|
| 356 |
|
| 357 |
\sect This style option is supported. Send bug reports, comments and |
| 358 |
repairs. |
| 359 |
|
| 360 |
|
| 361 |
|
| 362 |
|
| 363 |
\chap Implementation. |
| 364 |
|
| 365 |
The main work is to supply the environment |thebibliography|; in |
| 366 |
fact, we implement it as a |description| environment. The environment |
| 367 |
gets an (unused) argument. In addition we have to supply a correct |
| 368 |
expansion for the |\bibitem| tag which takes the cite key as its |
| 369 |
argument. Of course, this will result in an |\item|. After the |
| 370 |
|\bibitem| a |\library| tag may follow, with one parameter followed |
| 371 |
by a period. Then comes the reference, the (optional) annotation is |
| 372 |
an own block, enclosed in |\annote| and |\endannote|. After |
| 373 |
|\endannote| comes a period which should be discarded. (This should |
| 374 |
be done in the \BibTeX{} style, but nevertheless\,\dots) |
| 375 |
|
| 376 |
Later we will look for the things which would not be needed, but make |
| 377 |
life easier. |
| 378 |
|
| 379 |
|
| 380 |
\sect Before we start we declare some shorthands for category codes. |
| 381 |
By declaring the underscore~`(|_|)' as letter we can use it in our |
| 382 |
macros. (I agree with {\sc D.~Knuth} that |
| 383 |
|\identifier_several_words_long| is more readable than |
| 384 |
|\IdentifierSeveralWordsLong| and in every case better than |
| 385 |
|\p@@@s|.) As this is a \LaTeX{} style option the at sign is a letter |
| 386 |
anyhow; so we can use the ``private'' Plain and \LaTeX{} macros; and |
| 387 |
with the underscore we can make our own macros more readable. But as |
| 388 |
we have to restore this category code at the end of this macro file |
| 389 |
we store its former value in the control sequence |\uscode|. This |
| 390 |
method is better than to use a group because not all macros have to |
| 391 |
be defined global this way. |
| 392 |
|
| 393 |
\beginprog |
| 394 |
\chardef\escape=0 |
| 395 |
\chardef\open=1 |
| 396 |
\chardef\close=2 |
| 397 |
\chardef\letter=11 |
| 398 |
\chardef\other=12 |
| 399 |
%\chardef\active=13 % is defined in Plain already |
| 400 |
|
| 401 |
\chardef\uscode=\catcode`\_ % top level macro file! |
| 402 |
|
| 403 |
\catcode`\_=\letter |
| 404 |
\endprog |
| 405 |
|
| 406 |
|
| 407 |
\sect Another care activity is needed: Users of the New Font |
| 408 |
Selection Scheme (NFSS) will perhaps change the fonts in an |
| 409 |
unexpected manner. \LaTeX{} since December~1991 (and, of course, NFSS |
| 410 |
itself) provides the macro |\reset@font| to reset the font selection |
| 411 |
stuff to a defined state. Since this style might be used with older |
| 412 |
\LaTeX{} versions (e.g., with I\LaTeX{}) we will provide this macro. |
| 413 |
|
| 414 |
\beginprog |
| 415 |
\ifx \reset@font\undefined |
| 416 |
\let\reset@font\relax |
| 417 |
\fi |
| 418 |
\endprog |
| 419 |
|
| 420 |
|
| 421 |
\sect Within an entry we use a ragged right margin. To break within an |
| 422 |
entry is always difficult and is made easier in this way. After all, |
| 423 |
the open format we use gives a ragged impression anyhow. Within an |
| 424 |
entry we dissallow page breaks and we do not treat periods as full |
| 425 |
stops. |
| 426 |
|
| 427 |
\beginprog |
| 428 |
\def\thebibliography#1{% |
| 429 |
\description |
| 430 |
\rightskip \z@ plus 2em |
| 431 |
\interlinepenalty\@M |
| 432 |
\sfcode`\.=\@m |
| 433 |
} |
| 434 |
\let\endthebibliography=\enddescription |
| 435 |
\endprog |
| 436 |
|
| 437 |
|
| 438 |
\sect |\bibitem| should look for the next token: If a library info |
| 439 |
exists it must go in the same line, otherwise a line break must be |
| 440 |
issued. |
| 441 |
|
| 442 |
But |\bibitem| itself is not of interest, it looks only for the |
| 443 |
optional argument. We have to redefine |\@bibitem|. If an |
| 444 |
bibliography style like |alpha| is used, |\bibitem| will be supplied |
| 445 |
an optional argument. Then it expands to |\@lbibitem|; we will define |
| 446 |
this to |\@bibitem| as well -- we ignore the print label supplied by |
| 447 |
\BibTeX{}. |
| 448 |
|
| 449 |
After the argument(s) of |\bibitem| a line end occurs in any case. The |
| 450 |
optional |\library| tag will follow on the next line. This means we |
| 451 |
first have to gobble the line end char |^^M|, and have to check the |
| 452 |
next token afterwards. If this next token is |\library| we will do |
| 453 |
nothing since |\library| will itself end the line. Otherwise we do a |
| 454 |
line break. Experiments have shown that the dotted line at the start |
| 455 |
on every entry helps finding the different entries. |
| 456 |
|
| 457 |
\beginprog |
| 458 |
\def\@lbibitem[#1]{\@bibitem} |
| 459 |
|
| 460 |
\def\@bibitem#1{% |
| 461 |
\item[\tt #1]\leavevmode |
| 462 |
\null \dotfill |
| 463 |
\begingroup |
| 464 |
\obeylines |
| 465 |
\afterassignment\prepare_check_library |
| 466 |
\let\next % gobble following ^^M |
| 467 |
} |
| 468 |
\def\prepare_check_library{% |
| 469 |
\futurelet\next \check_library |
| 470 |
} |
| 471 |
\def\check_library{% |
| 472 |
\ifx \next\library |
| 473 |
\else \break |
| 474 |
\fi |
| 475 |
\endgroup |
| 476 |
} |
| 477 |
\endprog |
| 478 |
|
| 479 |
|
| 480 |
\sect We assume that the library info and the cite key will fit into |
| 481 |
one line. If this is not true, a two line solution must be set up. |
| 482 |
|
| 483 |
\beginprog |
| 484 |
\def\library#1#2.{% #2 is only needed to gobble the period |
| 485 |
\quad {\sf (#1)}\break |
| 486 |
} |
| 487 |
\endprog |
| 488 |
|
| 489 |
|
| 490 |
\sect A reference is divided into blocks starting with |\newblock|. |
| 491 |
Each block shall start a new line, we use |\newline| for this. A |
| 492 |
special block is the one with an annotation in it. Since we want to |
| 493 |
indent this block once more we must change the parshape. But then we |
| 494 |
have to finish the paragraph first. The annotation block starts with |
| 495 |
|\annote| and may be easily recognized in this way. |
| 496 |
|
| 497 |
\beginprog |
| 498 |
\def\newblock{% |
| 499 |
\futurelet\next \@checkAnnote |
| 500 |
} |
| 501 |
\def\@checkAnnote{% |
| 502 |
\ifx \next\annote |
| 503 |
\else \newline |
| 504 |
\fi |
| 505 |
} |
| 506 |
\endprog |
| 507 |
|
| 508 |
|
| 509 |
\sect The annotation is an own paragraph indented by |\leftmargin|. |
| 510 |
Since it is not a paragraph in the logical sense we do not insert |
| 511 |
vertical glue (i.e., |\parskip|) at the top. The annotation is typeset |
| 512 |
in a smaller size. We assume that it consists of full sentences which |
| 513 |
might be made up in a proper way. Therefore we don't use a ragged |
| 514 |
margin here. |
| 515 |
|
| 516 |
The change of |\parshape| have to be reset after the group -- these |
| 517 |
changes are not local. |
| 518 |
|
| 519 |
\beginprog |
| 520 |
\def\annote{% |
| 521 |
\endgraf |
| 522 |
\vskip -\parsep |
| 523 |
\begingroup |
| 524 |
\reset@font\footnotesize |
| 525 |
\rightskip \z@skip |
| 526 |
\advance\linewidth -\leftmargin |
| 527 |
\advance\@totalleftmargin \leftmargin |
| 528 |
\parshape \@ne \@totalleftmargin \linewidth |
| 529 |
} |
| 530 |
\def\endannote#1.{% #1 is only needed to gobble the period |
| 531 |
\endgraf |
| 532 |
\endgroup |
| 533 |
\parshape \@ne \@totalleftmargin \linewidth |
| 534 |
} |
| 535 |
\endprog |
| 536 |
|
| 537 |
|
| 538 |
\sect In our files |\cite| will print the cite key in typewriter with |
| 539 |
a framed box around. In fact, |\cite| expands to |\@citex|, which has |
| 540 |
an optional argument. The flag |@tempswa| shows if this optional |
| 541 |
argument is there. |
| 542 |
|
| 543 |
\beginprog |
| 544 |
\def\@citex[#1]#2{\fbox{{\tt #2}\if@tempswa , #1\fi}} |
| 545 |
\endprog |
| 546 |
|
| 547 |
|
| 548 |
|
| 549 |
|
| 550 |
\sect Bells and Whistles. |
| 551 |
|
| 552 |
Since the task we want to support most is the print of complete |
| 553 |
\BibTeX{} databases with the |biblist| bibliography style, we supply |
| 554 |
appropriate |\nocite| and |\bibliographystyle| tags, if they are |
| 555 |
missing. The |\bibliography| command shall create a heading as well. |
| 556 |
|
| 557 |
Furthermore we set up a headline. |
| 558 |
|
| 559 |
|
| 560 |
\sect First the original meanings of the to-be-redefined control |
| 561 |
sequences are saved. We define two macros which will issue the |
| 562 |
default tags given above. These macros are not private, but |
| 563 |
protected; a knowing user may redefine the `default bibliography |
| 564 |
style' in this way. |
| 565 |
|
| 566 |
\beginprog |
| 567 |
\let\@@nocite=\nocite |
| 568 |
\let\@@bibliographystyle=\bibliographystyle |
| 569 |
\let\@@bibliography=\bibliography |
| 570 |
|
| 571 |
\def\AddNocite{\nocite{*}} |
| 572 |
\def\AddBibliographystyle{\bibliographystyle{biblist}} |
| 573 |
\endprog |
| 574 |
|
| 575 |
|
| 576 |
\sect If |\nocite| or |\bibliographystyle| is issued, the default |
| 577 |
tags are discarded, the original meaning is restored, and the control |
| 578 |
sequence is reissued again. |
| 579 |
|
| 580 |
\beginprog |
| 581 |
\def\nocite{% |
| 582 |
\let\AddNocite\relax |
| 583 |
\let\nocite\@@nocite |
| 584 |
\nocite |
| 585 |
} |
| 586 |
\def\bibliographystyle{% |
| 587 |
\let\AddBibliographystyle\relax |
| 588 |
\let\bibliographystyle\@@bibliographystyle |
| 589 |
\bibliographystyle |
| 590 |
} |
| 591 |
\endprog |
| 592 |
|
| 593 |
|
| 594 |
\sect The |\bibliography| tag will first issue the missing default |
| 595 |
tags, will produce a heading afterwards, will setup the headline, and |
| 596 |
will create the bibliography itself. For the heading we use |\refname| |
| 597 |
which should be available -- either because the new \LaTeX{}, |
| 598 |
I\LaTeX{}, or the {\sf babel} system is used. |
| 599 |
|
| 600 |
\beginprog |
| 601 |
\def\bibliography#1{% |
| 602 |
\AddNocite |
| 603 |
\AddBibliographystyle |
| 604 |
\section*{\refname}% |
| 605 |
\mark_for_headline{#1}% |
| 606 |
\@@bibliography{#1}% |
| 607 |
} |
| 608 |
\endprog |
| 609 |
|
| 610 |
|
| 611 |
\sect The headline will consist of the database names given in the |
| 612 |
|\bibliography| tag and the current date. We ignore the database name |
| 613 |
|abbrev|, since this name is used for |@string| definitions at our |
| 614 |
site. |
| 615 |
|
| 616 |
We do not issue a warning of no file name is given -- this will be |
| 617 |
done by |\@@bibliography|. When a file name exists a comma and a |
| 618 |
space will be prepended at the very beginning of |\bib_list|. The |
| 619 |
comma is discarded after the loop. But when there was no file name |
| 620 |
|\bib_list| will expand to an empty list, we supply a |\relax| as a |
| 621 |
catch-up argument for |\@gobble|. |
| 622 |
|
| 623 |
\beginprog |
| 624 |
\def\AbbrevFileName{abbrev} |
| 625 |
|
| 626 |
\def\mark_for_headline#1{% |
| 627 |
\def\bib_list{}% |
| 628 |
\@for \bib_file :=#1\do {% |
| 629 |
\ifx \bib_file\AbbrevFileName |
| 630 |
\else \edef\bib_list{\bib_list, \bib_file.bib}% |
| 631 |
\fi |
| 632 |
}% |
| 633 |
\edef\bib_list{\expandafter\@gobble\bib_list \relax}% |
| 634 |
\markboth{{\reset@font\tt \bib_list}}{{\reset@font\tt \bib_list}}% |
| 635 |
} |
| 636 |
|
| 637 |
\def\@oddhead{\reset@font\rm \hfil \leftmark \quad (\today)} |
| 638 |
\def\@evenhead{\reset@font\rm (\today)\quad \ignorespaces \rightmark \hfil} |
| 639 |
\endprog |
| 640 |
|
| 641 |
|
| 642 |
\sect We must restore our catcode and are finished. |
| 643 |
|
| 644 |
\beginprog |
| 645 |
\catcode`\_=\uscode |
| 646 |
|
| 647 |
\endinput |
| 648 |
\endprog |
| 649 |
|
| 650 |
|
| 651 |
|
| 652 |
|
| 653 |
\end{document} |