summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/source/support/bib2gls/src/datatool2bib.pod
blob: 230afc13053d0aecdc21fe412388a3799afce9ea (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
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
=head1 SYNOPSIS

B<datatool2bib> [I<option>]+ I<in-file> I<bibfile>

=head1 DESCRIPTION

Converts a F<.tex> file containing F<datatool.sty> databases to 
a F<.bib> file in the format required for B<bib2gls>. 
Distributed with F<bib2gls>.

The TeX Parser Library is used to parse the input, which may be 
a DTLTEX or DBTEX file or a file that contains
database construction commands, such as 
C<\DTLnewdb> or C<\DTLaction>. The input file may also be a CSV file
if used with B<--read>.

The B<datatool> and B<datagidx> are automatically implemented so the
input file does not need to include either them with C<\usepackage>.
In general, it's best not to include the entire document but instead
input a file that just contains the database construction commands,
as the TeX Parser Library only has a limited set of commands that it
recognises.

=head1 OPTIONS

=head2 GENERAL OPTIONS

=over 4

=item B<--help> or B<-h>

Display help message and exit.

=item B<--version> or B<-v>

Display version information and exit.

=item B<--silent> or B<--quiet> or B<-q>

Suppress all messages except for errors.

=item B<--verbose>

Switch on verbose mode.

=item B<--no-verbose>

Switch off verbose mode.

=item B<--debug> [I<n>]

Display debugging messages.

=item B<--debug-mode> I<setting>

May be used instead of B<--debug> where the level number is
difficult to remember. Value same as for B<bib2gls>'s
B<--debug-mode> option.

=item B<--no-debug>

Switch off debugging mode. Equivalent to B<--debug> B<0>.

=item B<--log-file> I<filename>

Log messages to given file. Intended primarily for debugging messages so
enabling debug mode will automatically create a transcript file, but otherwise
a file won't be created unless this option is used.

=back

=head2 ENCOSING AND LOCALISATION OPTIONS

=over 4

=item B<--texenc> I<name>

Set the character encoding to I<name> for the input B<.tex> files.

=item B<--bibenc> I<name>

Set the character encoding to I<name> for the output B<.bib> files.

=item B<--locale> I<lang tag>

Use the language resource files associated with the given language
tag I<lang tag>. If there isn't an appropriate file, the B<en>
(English) file will be used.

=back

=head2 FILTERING OPTIONS

=over 4

=item B<--preamble-only> or B<-p>

Only parse the document preamble. That is, stop parsing if
C<\begin{document}> encountered.

=item B<--no-preamble-only>

Parse the entire document (default).

=item B<--ignore-fields> I<list> or B<-f> I<list>

Ignore all the fields in the comma-separated I<list>. 
Each item in the list should identify
the field by its original case-sensitive column key.

This option is cumulative.

=item B<--no-ignore-fields>

Cancels the effect of B<--ignore-fields>.

=item B<--skip-datagidx>

Skip the special B<datagidx> internal database.
(Default.)

=item B<--no-skip-datagidx>

Don't skip the special B<datagidx> internal database.

=back

=head2 OUTPUT FILE OPTIONS

=over 4

=item B<--overwrite>

Overwrite existing .bib files.

=item B<--no-overwrite>

Don't overwrite existing .bib files.

=item B<--split>

Split the entries into separate files according to the database.

=item B<--no-split>

Don't split the entries into separate files (default).

=back

=head2 ADJUSTMENT OPTIONS

=over 4

=item B<--space-sub> I<value> or B<-s> I<value>

Substitute spaces in labels with I<value>.

=item B<--field-map> I<mappings> or B<-m> I<mappings>

Add source column key to destination field label mappings. The argument
should be a comma-separated list of I<col-key>=I<bib-field>
pairs. This option is cumulative.

=item B<--no-field-map>

Cancels all mappings applied with B<--field-map>.

=item B<--index-conversion> or B<-i>

Any entries that would normally be converted to C<@entry> that don't
have a B<description> field will be converted to C<@index>.

=item B<--no-index-conversion> 

Don't replace C<@entry> with C<@index> if the description is missing (default).

=item B<--detect-symbols>

Attempt to detect entries that should be C<@symbol> or C<@number>
based on the value of the B<name> field.

=item B<--no-detect-symbols>

Don't attempt symbol detection (default).


=item B<--label> I<col-key> or B<-L>

Use column identified by I<col-key> for the entry label. The default
column key is B<Label> so if the database doesn't have a column with
this key, you will either need to specify a column with B<--label>
or use B<--auto-label>. This option is ignored with B<--auto-label>.

=item B<--auto-label> or B<-a>

Auto-generate entry labels instead of using a column value.

=item B<--no-auto-label>

Don't auto-generate entry labels. Use the column identified by
B<--label> for the entry label. (Default.)

=item B<--auto-label-prefix> I<prefix>

Use I<prefix> when auto-generating entry labels. Ignored with
B<--no-auto-label>.

=item B<--adjust-gls>

Adjust labels in commands like C<\gls> in field values. (Default.)
This will also replace the F<datagidx.sty> commands like C<\glsnl>
with the closest F<glossaries.sty> equivalent.

=item B<--no-adjust-gls>

Don't adjust labels in commands like C<\gls> in field values.

=item B<--dependency-field> I<field-name>

Sets the name of the dependency field. Has no effect with
B<--no-strip-glsadd>. With B<--strip-glsadd>, the label from the
stripped C<\glsadd> argument will be added to the field identified
by I<field-name>. The default is B<dependency> which will be ignored
by B<bib2gls> unless instructed otherwise (via field aliasing etc).

=item B<--no-dependency-field>

Don't save labels from any stripped C<\glsadd> instances.

=item B<--strip>

Switch on all strip options.

=item B<--no-strip>

Switch off all strip options.

=item B<--strip-glsadd>

Strip C<\glsadd> and its argument from field values. (Default.)

=item B<--no-strip-glsadd>

Don't strip C<\glsadd> from field values.

=item B<--strip-acronym-font>

Strip C<\acronymfont> from field values. (Default.)

=item B<--no-strip-acronym-font>

Don't strip C<\acronymfont> from field values.

=item B<--strip-acronym-text>

Strip B<text> field for acronyms identified by C<\newacro>.
(Default.)

=item B<--no-strip-acronym-text>

Don't strip B<text> field for acronyms.

=item B<--strip-acronym-name>

Strip B<name> field for acronyms identified by C<\newacro>.
(Default.)

=item B<--no-strip-acronym-name>

Don't strip B<name> field for acronyms.

=item B<--strip-case-change>

Strip known case-changing commands (such as C<\makefirstuc> or C<\capitalisewords>)
from field values.

=item B<--nostrip-case-change>

Don't strip case-changing commands.  (Default.)

=back

=head2 OTHER OPTIONS

These options correspond to features introduced to F<datatool.sty>
version 3.0, which has a setting that stores the numeric value and
currency symbol (where applicable) when parsing data. The original
string (formatted number), numeric value and currency symbol are
stored in a special datum format, which ordinarily expands to its
original formatted text but also allows the previously parsed
information to be easily extracted without having to reparse the
data.

=over 4

=item B<--setup> I<options>

Implement C<\DTLsetup{>I<options>C<}> at the start. This can include
options such as C<store-datum>, C<new-value-expand>,
C<new-value-trim> and C<default-name>.

=item B<--read> I<options>

Instead of simply parsing the input file as a normal F<.tex> file,
the source is presented to the TeX parser as 
C<\DTLread[>I<options>C<]{>I<in-file>C<}> where the options can be
used to specify the file format (for example, C<format=tsv>).

If the I<options> list is empty (after trimming white space) then
this becomes equivalent to B<--no-read>.

=item B<--no-read>

The input file is parsed as a normal F<.tex> file, which may be the
complete document or a file that can be C<\input> into a document.
(Default.)

=item B<--save-value> I<suffix>

If a field value is parsed and identified as numeric, the
unformatted numeric value will be saved in a field whose name is
constructed from the original field name followed by the given
I<suffix>.

=item B<--no-save-value>

Don't save numeric value in a separate field. (Default.)

=item B<--save-currency> I<suffix>

If a field value is parsed and identified as currency data, the
currency symbol will be saved in a field whose name is
constructed from the original field name followed by the given
I<suffix>.

=item B<--no-save-currency>

Don't save currency symbol in a separate field. (Default.)

=item B<--save-datum>

Equivalent to:

	--save-value '-value' --save-currency '-currency'

=item B<--no-save-datum>

Equivalent to B<--no-save-value> B<--no-save-currency>.

=back

=head1 REQUIRES

Java 8 and a TeX distribution.

=head1 LICENSE

License GPLv3+: GNU GPL version 3 or later
<http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.

=head1 RECOMMENDED READING

The bib2gls manual:

        texdoc bib2gls

The glossaries-extra manual:

        texdoc glossaries-extra

The glossaries manual:

        texdoc glossaries

The datatool manual:

        texdoc datatool

=head1 AUTHOR

Nicola L. C. Talbot,
L<https://www.dickimaw-books.com/>

=cut