| 1 |
%% \CharacterTable |
| 2 |
%% {Upper-case \A\B\C\D\E\F\G\H\I\J\K\L\M\N\O\P\Q\R\S\T\U\V\W\X\Y\Z |
| 3 |
%% Lower-case \a\b\c\d\e\f\g\h\i\j\k\l\m\n\o\p\q\r\s\t\u\v\w\x\y\z |
| 4 |
%% Digits \0\1\2\3\4\5\6\7\8\9 |
| 5 |
%% Exclamation \! Double quote \" Hash (number) \# |
| 6 |
%% Dollar \$ Percent \% Ampersand \& |
| 7 |
%% Acute accent \' Left paren \( Right paren \) |
| 8 |
%% Asterisk \* Plus \+ Comma \, |
| 9 |
%% Minus \- Point \. Solidus \/ |
| 10 |
%% Colon \: Semicolon \; Less than \< |
| 11 |
%% Equals \= Greater than \> Question mark \? |
| 12 |
%% Commercial at \@ Left bracket \[ Backslash \\ |
| 13 |
%% Right bracket \] Circumflex \^ Underscore \_ |
| 14 |
%% Grave accent \` Left brace \{ Vertical bar \| |
| 15 |
%% Right brace \} Tilde \~} |
| 16 |
%\iffalse |
| 17 |
% |
| 18 |
% (c) copyright 2001-2004 Apostolos Syropoulos |
| 19 |
% This software is derived from original software by the LaTeX3 Project. |
| 20 |
% This program can be redistributed and/or modified under the terms |
| 21 |
% of the LaTeX Project Public License Distributed from CTAN |
| 22 |
% archives in directory macros/latex/base/lppl.txt; either |
| 23 |
% version 1 of the License, or any later version. |
| 24 |
% |
| 25 |
% Please report errors or suggestions for improvement to |
| 26 |
% |
| 27 |
% Apostolos Syropoulos |
| 28 |
% 366, 28th October Str. |
| 29 |
% GR-671 00 Xanthi, GREECE |
| 30 |
% [email protected] or [email protected] |
| 31 |
%\changes{v1.1}{2004/07/27}{Added percent symbols to avoid unnecessary |
| 32 |
% wait space.} |
| 33 |
%\fi |
| 34 |
% \CheckSum{125} |
| 35 |
% \iffalse This is a Metacomment |
| 36 |
% |
| 37 |
% \begin{macrocode} |
| 38 |
%<*driver> |
| 39 |
\documentclass{ltxdoc} |
| 40 |
\GetFileInfo{multibbl.drv} |
| 41 |
\begin{document} |
| 42 |
\DocInput{multibbl.dtx} |
| 43 |
\end{document} |
| 44 |
%</driver> |
| 45 |
% \end{macrocode} |
| 46 |
% \fi |
| 47 |
% |
| 48 |
%\title{The ``multibbl'' package} |
| 49 |
%\author{Apostolos Syropoulos\\366, 28th October Str.\\ |
| 50 |
%GR-671 00 Xanthi, HELLAS\\ |
| 51 |
%Email:\texttt{[email protected]}\\ or \\ |
| 52 |
%\hphantom{Email:}\texttt{[email protected]}} |
| 53 |
% \date{2004/07/27} |
| 54 |
%\maketitle |
| 55 |
% \begin{abstract} |
| 56 |
% The package ``multibbl'' redefines the standard commands bibliographic |
| 57 |
% commands so that one can generate multiply reference sections. Each |
| 58 |
% section has it own auxiliary file (for use with BibTeX) and title. |
| 59 |
% \end{abstract} |
| 60 |
%\MakeShortVerb{\|} |
| 61 |
%\StopEventually{} |
| 62 |
%\section{Introduction} |
| 63 |
% This package has been designed for people who write a document that |
| 64 |
% has references in languages that use different scripts. For example, |
| 65 |
% if one prepares a book in Greek, then his/her document may have |
| 66 |
% references in Greek and in English. In this particular case, it makes |
| 67 |
% no sense to sort the references and have only one bibliography section. |
| 68 |
% It is better to have two bibliography sections: one for the Greek |
| 69 |
% references and on for the English references. Moreover, it is possible |
| 70 |
% to have references in more than two scripts. Then we obviously, need |
| 71 |
% three or even more bibliography sections. By the redefining the standard |
| 72 |
% \LaTeX\ user interface commands, this package makes it possible to have |
| 73 |
% two or more bibliography sections in one document. Naturally, one can |
| 74 |
% use this package for documents that use only one script, just in case |
| 75 |
% there is a need to have multiply bibliography sections. |
| 76 |
% |
| 77 |
% \section{The code} |
| 78 |
% |
| 79 |
% As usual, we first have to identify the package: |
| 80 |
% \begin{macrocode} |
| 81 |
%<package> |
| 82 |
\NeedsTeXFormat{LaTeX2e}[1996/01/01] |
| 83 |
\ProvidesPackage{multibbl}[2007/07/27\space v1.1] |
| 84 |
\typeout{Package: `multibbl' v1.1\space <2004/07/27> (A. Syropoulos)} |
| 85 |
% \end{macrocode} |
| 86 |
% |
| 87 |
%\begin{macro}{\newbibliography} |
| 88 |
% Now we have to define a new command which has one argument: the name of |
| 89 |
% a new auxiliary file. If that file does not exist, it simply creates |
| 90 |
% this file. |
| 91 |
% \begin{macrocode} |
| 92 |
\def\newbibliography#1{\begingroup |
| 93 |
\if@filesw \expandafter\newwrite\csname #1@auxfile\endcsname |
| 94 |
\expandafter\immediate\openout \csname #1@auxfile\endcsname #1.aux\relax |
| 95 |
\typeout{Writing auxiliary file #1.aux }\fi \endgroup} |
| 96 |
% \end{macrocode} |
| 97 |
%\end{macro} |
| 98 |
% |
| 99 |
%\begin{macro}{\@citex} |
| 100 |
% The command |\@citex| is used internally to process the arguments of |
| 101 |
% the |\cite| command. Since, the later command has now two required |
| 102 |
% arguments, the name of an auxiliary file and the usual citation labels, |
| 103 |
% we have to redefine the |\@citex| command so that these labels are |
| 104 |
% written into the auxiliary file, just in case we want to generate the |
| 105 |
% bibliography with BibTeX. What we actually do is to replace the code |
| 106 |
% \begin{verbatim} |
| 107 |
% \if@filesw\immediate\write\@auxout{\string\citation{\@citeb}}\fi |
| 108 |
% \end{verbatim} |
| 109 |
% with the code |
| 110 |
% \begin{verbatim} |
| 111 |
% \@ifundefined{#2@auxfile}{}{\expandafter\immediate% |
| 112 |
% \write\csname #2@auxfile\endcsname{\string\citation{\@citeb}}}% |
| 113 |
% \end{verbatim} |
| 114 |
% This code checks whether we have defined the control sequence |
| 115 |
% |#2@auxfile|, where |#2| is the first required argument, i.e., the |
| 116 |
% name of the auxiliary file, and if it is it writes the citation |
| 117 |
% labels to this file. |
| 118 |
% \begin{macrocode} |
| 119 |
\def\@citex[#1]#2#3{% |
| 120 |
\let\@citea\@empty |
| 121 |
\@cite{\@for\@citeb:=#3\do |
| 122 |
{\@citea\def\@citea{,\penalty\@m\ }% |
| 123 |
\edef\@citeb{\expandafter\@firstofone\@citeb\@empty}% |
| 124 |
\@ifundefined{#2@auxfile}{}{\expandafter\immediate% |
| 125 |
\write\csname #2@auxfile\endcsname{\string\citation{\@citeb}}}% |
| 126 |
\@ifundefined{b@\@citeb}{\mbox{\reset@font\bfseries ?}% |
| 127 |
\G@refundefinedtrue |
| 128 |
\@latex@warning |
| 129 |
{Citation `\@citeb' on page \thepage \space undefined}}% |
| 130 |
{\hbox{\csname b@\@citeb\endcsname}}}}{#1}} |
| 131 |
% \end{macrocode} |
| 132 |
%\end{macro} |
| 133 |
% |
| 134 |
%\begin{macro}{\bibliography} |
| 135 |
% The |\bibliography| command has been redefined to take three required |
| 136 |
% arguments: the first is the name of the auxiliary file, the second is |
| 137 |
% the argument that the standard command has and the third is the |
| 138 |
% the title of the bibliographic section, i.e., what will appear |
| 139 |
% in the running heads, etc. In order to do this, we have to redefine the |
| 140 |
% commands |\bibname| and |\refname|, which are used to typeset the running |
| 141 |
% heads, etc. |
| 142 |
% \begin{macrocode} |
| 143 |
\def\bibliography#1#2#3{% |
| 144 |
\@ifundefined{#1@auxfile}{}{\expandafter\immediate% |
| 145 |
\write\csname #1@auxfile\endcsname{\string\bibdata{#2}}}% |
| 146 |
\def\bibname{#3}% |
| 147 |
\def\refname{#3}% |
| 148 |
\@input@{#1.bbl}} |
| 149 |
% \end{macrocode} |
| 150 |
%\end{macro} |
| 151 |
% |
| 152 |
%\begin{macro}{\bibliographystyle} |
| 153 |
% The |\bibliographystyle| command has two arguments: the name of an |
| 154 |
% auxiliary file and the name of a bibliographic style. With this |
| 155 |
% command one can specify the bibliographic style each bibliography section |
| 156 |
% will have. Although, at first sight it makes no sense to use different |
| 157 |
% bibliographic styles. However, we believe that this feature may be proved |
| 158 |
% useful in cases where it is not possible to distinguish to which |
| 159 |
% bibliography section each citation belongs to. |
| 160 |
% \begin{macrocode} |
| 161 |
\def\bibliographystyle#1#2{% |
| 162 |
\ifx\@begindocumenthook\@undefined\else |
| 163 |
\expandafter\AtBeginDocument |
| 164 |
\fi |
| 165 |
\@ifundefined{#1@auxfile}{}{\expandafter\immediate% |
| 166 |
\write\csname #1@auxfile\endcsname{\string\bibstyle{#2}}}}% |
| 167 |
% \end{macrocode} |
| 168 |
%\end{macro} |
| 169 |
% |
| 170 |
%\begin{macro}{\nocite} |
| 171 |
% The |\nocite| command has been redefined so that it has two required |
| 172 |
% arguments: the name of an auxiliary file and the standard argument. |
| 173 |
% \begin{macrocode} |
| 174 |
\def\nocite#1#2{\@bsphack |
| 175 |
\@for\@citeb:=#2\do{% |
| 176 |
\edef\@citeb{\expandafter\@firstofone\@citeb}% |
| 177 |
\@ifundefined{#1@auxfile}{}{\expandafter\immediate% |
| 178 |
\write\csname #1@auxfile\endcsname{\string\citation{\@citeb}}}% |
| 179 |
\@ifundefined{b@\@citeb}{\G@refundefinedtrue |
| 180 |
\@latex@warning{Citation `\@citeb' undefined}}{}}% |
| 181 |
\@esphack} |
| 182 |
% \end{macrocode} |
| 183 |
%\end{macro} |
| 184 |
% Although it is not necessary to explicitly terminate a |
| 185 |
% package, we believe it is good practice to do it. |
| 186 |
% \begin{macrocode} |
| 187 |
\endinput |
| 188 |
%</package> |
| 189 |
% \end{macrocode} |
| 190 |
% \section*{Acknowledgment} |
| 191 |
% I thank Antonis Tsolomitis for checking this usability of this package. |
| 192 |
% \section*{Dedication} |
| 193 |
% To the fond memory of my late brother Mikhail Syropoulos. |
| 194 |
% \Finale |