summaryrefslogtreecommitdiff
path: root/macros/texsis/styles/paradox.txs
blob: 7c60c94ad7d806d72188cb8bad60cff13ecdb93c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
%% file: paradox.txs  (TeXsis version 2.17)
%  $Revision: 1.3 $  :  $Date: 1996/12/20 18:17:30 $  : Author: T.C. Pearce
%========================================================================*
%  FILE - PARADOX.TXS     AUTHOR - T.C. PEARCE   
%  Engineering Department, University of Derby. (t.c.pearce@derby.ac.uk)
%
%  These macros have been created for the interpretation of literature
%  database info from Borland Paradox 3.5. It is intended for use under 
%  TeXsis 2.17 where a reference has the following form. However, they may
%  be used for any database that can be persuaded to output fields in the 
%  following format
%
%  \referencelist                             % } Standard Texsis Reference
%   % ..................
%  \reference{Tag Identifier for reference}   % } format   
%  % Begin reference text or in the case of these macros assign fields to 
%  % appropriate macros definitions
%  
%  \Authors .....\EndAuthors % List all authors in following format 
%                            % Pearce T.C., Burrows W.S., , for all authors
%                            % ** Entry must end with , ,
%                            % use of \etaltrue will omit all but the first
%                            % author. Defaults to false i.e. all authors 
%                            % listed
%
%  
%  \ReferenceType.....\EndReferenceType
%                            % States desired type of reference
%                            % Two forms :
%                            % Journal - Gives Author, Journal, Year,
%                            %                 Volume, Part*, Pages
%                            % (English style journal citations)
%                            % Book - Gives    Author [et al] in BookTitle,
%                            %                 Volume*, Part*, Host Editors*, 
%                            %                 Pages in Book, Place of 
%                            %                 Publication*, Publishers*, 
%                            %                 Year.
%                            % (English style article-in-book citations)              
%                            % * Optional inclusions. Essential fields will
%                            %   cause WARNINGS during compilation and ????
%                            %   under reference if absent !
%                            % Must be specified precisely as Journal or Book
%
%  
%  \Title.....\EndTitle      % Title of Article in Journal or Book
%                            % Normally suppressed unless \AddTitles is called
%                            % in which case it is inserted in with 
%                            % the reference after the author
%  
%  \JournalBook....\EndJournalBook
%                            % Name of Journal or Book Title
%  \Place....\EndPlace       % Place of publication (Only does anything for 
%                            % Books)
%  \Publisher.....\EndPublisher
%                            % Publishing organisation (Only does anything for
%                            % Books)
%  \Year....\EndYear         % Year of publication
%  \Volume...\EndYear        % Volume Number
%  \Part...\EndPart          % Part Number
%  \Pages....\EndPages       % Pages Numbers
%  \HostAuthor....\EndHostAuthor
%                            % Host Editors (Only does anything for Books)
%  \CompileReference         % Command to format this reference
%  \endreference
%    % ................
%  \endreferencelist
%
%
%   Example of a straightforward journal reference :
%
% \reference{Abe,Automated}\Authors Abe H., Yoshimura T., ,\EndAuthors
% \ReferenceType Journal\EndReferenceType\Title Automated odor-sensing system 
% based on plural semiconductor gas sensors and computerized pattern recognition 
% techniques\EndTitle
% \JournalBook Analytica Chimica Acta\EndJournalBook\Part \EndPart
% \Publisher [NOT NEEDED]\EndPublisher\Year 1987\EndYear\Volume 
% 194\EndVolume\Place [NOT NEEDED]\EndPlace
% \Pages 1-9\EndPages\HostAuthor [NOT NEEDED]\EndHostAuthor
% \CompileReference\endreference
%
%   Example of article in a book reference :
%
% \reference{Eric,Sensory ne}\Authors Erickson R.P., ,\EndAuthors
% \ReferenceType Book\EndReferenceType\Title Sensory neural patterns and 
% gustation\EndTitle
% \JournalBook Olfaction \& Taste\EndJournalBook\Part \EndPart
% \Publisher Pergamon Press\EndPublisher\Year 1963\EndYear
% \Volume \EndVolume\Place New York\EndPlace
% \Pages 205-213\EndPages\HostAuthor Zotterman, Y. (ed.)\EndHostAuthor
% \CompileReference\endreference
%
%
% NOTE - CALLS TO these macros should be made even if fields are empty!
%        This is in accordance with Paradox and most other databases.
%
% (C) Copyright 1997 by T.C. Pearce, all rights reserved.
%======================================================================*
\message{[Paradox --> Texsis 2.17 Translation Macros  T.C.P. 18.12.96]}
%

\def\Comma{,}
\def\etal{{\it et al.}}
\def\JournalReference{Journal}
\def\ReferenceType#1\EndReferenceType{\def\RReferenceType{#1}}
\def\Authors#1,#2,\EndAuthors{%
        \def\FFirstAuthor{#1}\def\OOtherAuthors{#2}\FFirstAuthor}
\def\Title#1\EndTitle{\def\TTitle{#1}}
\def\JournalBook#1\EndJournalBook{\def\JJournalBook{#1}}
\def\Place#1\EndPlace{\def\PPlace{#1}} 
\def\Publisher#1\EndPublisher{\def\PPublisher{#1}}
\def\Year#1\EndYear{\def\YYear{#1}}
\def\Volume#1\EndVolume{\def\VVolume{#1}}
\def\Part#1\EndPart{\def\PPart{#1}}
\def\Pages#1\EndPages{\def\PPages{#1}}
\def\HostAuthor#1\EndHostAuthor{\def\HHostAuthor{#1}}

\newif\ifJournal
\newif\ifTitles
\newif\ifAllAuthors
\newif\ifetal
\etalfalse
\Titlestrue
\AllAuthorstrue
\newif\ifSingleAuthor

\def\AddTitles{\Titlestrue}
\def\TTestJournal{\ifx\JournalReference\RReferenceType\Journaltrue 
        \else\Journalfalse\fi}
\def\CompileReference{\TTestJournal\ifJournal\CCompileJournal 
        \else\CCompileBook\fi}

\def\CCompileJournal{%
  \TTestSingleAuthor\ifetal{\ifSingleAuthor\space \else\space\etal,  \fi}%
        \else{\ifSingleAuthor\space  \else , \OOtherAuthors\space\fi}\fi
  \ifTitles\TTitle ,\space \fi
  \ifx\JJournalBook\empty\relax\message{[WARNING - No Journal for reference]}%
        \else{\it\JJournalBook, }\fi
  \ifx\YYear\empty\relax\message{[WARNING - No Year for reference]}%
        \else\YYear. \fi
  \ifx\VVolume\empty\relax\message{[WARNING - No Volume for reference]}%
        \else{\bf\VVolume}\fi
  \ifx\PPart\empty{\ifx\VVolume\empty\relax \else . \fi}\else (\PPart). \fi 
  \ifx\PPages\empty\message{[WARNING - No Page numbers for reference]}%
        \else\PPages\fi}

\def\CCompileBook{%
   \TTestSingleAuthor\ifetal{\ifSingleAuthor\space\else\space\etal , \fi}%
        \else{\ifSingleAuthor\space  \else , \OOtherAuthors\space\fi}\fi
   \ifTitles{\ifx\TTitle\empty\else\TTitle ,\space\fi}\fi
   \ifx\JJournalBook\empty{\message{[WARNING - No Book Name for reference]}}%
       \else{\ifx\TTitle\empty\relax \else in \fi\booktitle{\JJournalBook}}\fi 
   \ifx\VVolume\empty\relax\else , Vol.\VVolume\fi 
   \ifx\PPart\empty . \else (\PPart). \fi
   \ifx\HHostAuthor\empty\relax\else\HHostAuthor, \fi 
   \ifx\PPages\empty{\ifx\TTitle\empty\relax\else ????. 
        \message{[WARNING - No Page numbers for reference]}\fi}%
        \else p.\PPages. \fi 
   \ifx\Place\empty\relax \else\PPlace\begingroup\ifx\Publisher\empty  
        \else: \fi\endgroup\fi 
   \ifx\PPublisher\empty\relax \else\PPublisher, \fi
   \ifx\YYear\empty\relax\message{[WARNING - No Year for reference]}%
        \else\stripblanks\YYear\endlist\tok\fi}

\def\TTestSingleAuthor{\ifx\OOtherAuthors\Comma\SingleAuthortrue
        \else\SingleAuthorfalse\fi}

%>>> EOF paradox.txs <<<