'\" t .\" Title: bib2ris .\" Author: [see the "Author" section] .\" Generator: DocBook XSL Stylesheets v1.76.1 .\" Date: 2005-10-16 .\" Manual: RefDB Manual .\" Source: RefDB Manual .\" Language: English .\" .TH "BIB2RIS" "1" "2005\-10\-16" "RefDB Manual" "RefDB Manual" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ .\" http://bugs.debian.org/507673 .\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" ----------------------------------------------------------------- .\" * set default formatting .\" ----------------------------------------------------------------- .\" disable hyphenation .nh .\" disable justification (adjust text to left margin only) .ad l .\" ----------------------------------------------------------------- .\" * MAIN CONTENT STARTS HERE * .\" ----------------------------------------------------------------- .SH "NAME" bib2ris, bib2ris-utf8 \- converts bibtex bibliographic data to the RIS format .SH "SYNOPSIS" .HP \w'\fBbib2ris\fR\ 'u \fBbib2ris\fR [\-e\ \fIlog\-destination\fR] [\-h] [\-j] [\-l\ \fIlog\-level\fR] [\-L\ \fIlog\-file\fR] [\-q] [\-s\ \fIseparator\fR] [\-v] [\-y\ \fIconfdir\fR] \fIfile\fR .HP \w'\fBbib2ris\-utf8\fR\ 'u \fBbib2ris\-utf8\fR [\-e\ \fIlog\-destination\fR] [\-h] [\-j] [\-l\ \fIlog\-level\fR] [\-L\ \fIlog\-file\fR] [\-q] [\-s\ \fIseparator\fR] [\-v] [\-y\ \fIconfdir\fR] \fIfile\fR .SH "DESCRIPTION" .PP bib2ris converts BibTeX bibliography files into RIS files\&. Latex commands, including non\-ASCII characters written as commands, are preserved in the output\&. Importing the output of the bib2ris utility directly into RefDB is useful only if you use the data exclusively for LaTeX\&. .PP bib2ris\-utf8 is a variant which converts foreign characters to UTF\-8 and strips all other LaTeX commands by means of the refdb_latex2utf8txt (1) tool\&. The output of bib2ris\-utf8 is the preferred format for import into RefDB as it is suitable for both LaTeX and SGML/XML bibliographies\&. .PP Unfortunately the concepts underlying BibTeX and RIS bibliographic data are quite different so that BibTeX data do not readily lend themselves to a clean conversion to the RIS format\&. This is not meant as an excuse to provide a bad filter but you should be aware that a few compile\-time assumptions have to be made in order to get reasonable results\&. In any case, as the data models differ considerably, a loss\-free round\-trip conversion between the two data types is not possible: If you convert a BibTeX bibliography file to RIS and then back, the result will differ considerably from your input\&. .PP The following considerations apply to the data import into RefDB and the data export from RefDB: .sp .RS 4 .ie n \{\ \h'-04' 1.\h'+01'\c .\} .el \{\ .sp -1 .IP " 1." 4.2 .\} BibTeX input data that are not written in UTF\-8, that use formatting commands like font name, weight, or posture specifications, or that use LaTeX commands to write foreign and special characters should always be converted with bib2ris\-utf8\&. .RE .sp .RS 4 .ie n \{\ \h'-04' 2.\h'+01'\c .\} .el \{\ .sp -1 .IP " 2." 4.2 .\} BibTeX output data will have the LaTeX command characters properly escaped\&. The data will use the default encoding of your reference database unless you specifically request a different encoding with the getref command or with the refdbib tool\&. Keep in mind that recent LaTeX installations can work with UTF\-8 data using the following incantation in the prolog, allowing the easiest support for all kinds of foreign characters: .sp .if n \{\ .RS 4 .\} .nf \eusepackage[utf8]{inputenc} .fi .if n \{\ .RE .\} .RE .SH "OPTIONS" .PP \fB\-e\fR \fIlog\-destination\fR .RS 4 log\-destination can have the values 0, 1, or 2, or the equivalent strings \fIstderr\fR, \fIsyslog\fR, or \fIfile\fR, respectively\&. This value specifies where the log information goes to\&. 0 (zero) means the messages are sent to stderr\&. They are immediately available on the screen but they may interfere with command output\&. 1 will send the output to the syslog facility\&. Keep in mind that syslog must be configured to accept log messages from user programs, see the syslog(8) man page for further information\&. Unix\-like systems usually save these messages in /var/log/user\&.log\&. 2 will send the messages to a custom log file which can be specified with the \fB\-L\fR option\&. .RE .PP \fB\-h\fR .RS 4 Displays help and usage screen, then exits\&. .RE .PP \fB\-j\fR .RS 4 Force bib2ris to use \fBJO\fR RIS fields in all cases\&. If this option is not used, bib2ris tries to infer whether a journal name is an abbreviation or not\&. If the string contains at least one period, \fBJO\fR will be used, otherwise \fBJF\fR will be used\&. .RE .PP \fB\-l\fR \fIlog\-level\fR .RS 4 Specify the priority up to which events are logged\&. This is either a number between 0 and 7 or one of the strings \fIemerg\fR, \fIalert\fR, \fIcrit\fR, \fIerr\fR, \fIwarning\fR, \fInotice\fR, \fIinfo\fR, \fIdebug\fR, respectively (see also Log level definitions)\&. \fB\-1\fR disables logging completely\&. A low log level like 0 means that only the most critical messages are logged\&. A higher log level means that less critical events are logged as well\&. 7 will include debug messages\&. The latter can be verbose and abundant, so you want to avoid this log level unless you need to track down problems\&. .RE .PP \fB\-L\fR \fIlog\-file\fR .RS 4 Specify the full path to a log file that will receive the log messages\&. Typically this would be /var/log/refdba\&. .RE .PP \fB\-q\fR .RS 4 Start without reading the configuration files\&. The client will use the compile\-time defaults for all values that you do not set with command\-line switches\&. .RE .PP \fB\-s\fR \fIseparator\fR .RS 4 Specify the delimiter which separates individual keywords in a non\-standard keyword field\&. Use the string \fBspc\fR for whitespace\-separated lists (spaces and tabs)\&. .RE .PP \fB\-v\fR .RS 4 Prints version and copyright information, then exits\&. .RE .PP \fB\-y\fR \fIconfdir\fR .RS 4 Specify the directory where the global configuration files are Note: By default, all RefDB applications look for their configuration files in a directory that is specified during the configure step when building the package\&. That is, you don\*(Aqt need the \fB\-y\fR option unless you use precompiled binaries in unusual locations, e\&.g\&. by relocating a rpm package\&. .RE .PP \fIfile\fR .RS 4 If used, this parameter denotes the names of one or more bibtex files\&. If no file is specified, bib2ris tries to read the data from stdin\&. Output is always sent to stdout\&. .RE .SH "DIAGNOSTICS" .PP The exit code of \fBbib2ris\fR indicates what went wrong in general (the details can be found in the log output)\&. The code is the sum of the following error values: .PP \fI1\fR .RS 4 general error; includes out of memory situations and invalid command\-line options .RE .PP \fI2\fR .RS 4 incomplete entry (at least one essential field in an entry was missing) .RE .PP \fI4\fR .RS 4 unknown field name .RE .PP \fI8\fR .RS 4 unknown publication type .RE .PP \fI16\fR .RS 4 invalid BibTeX\->RIS type mapping .RE .PP \fI32\fR .RS 4 parse error; includes file access errors .RE .SH "CONFIGURATION" .PP \fBbib2ris\fR evaluates the file bib2risrc to initialize itself\&. .sp .it 1 an-trap .nr an-no-space-flag 1 .nr an-break-flag 1 .br .B Table\ \&1.\ \&bib2risrc .TS allbox tab(:); lB lB lB. T{ Variable T}:T{ Default T}:T{ Comment T} .T& l l l l l l l l l l l l l l l l l l l l l l l l l l l l l l l l l l l l l l l l l l l l l l l l l l l l l l l l l l l l l l l. T{ logfile T}:T{ /var/log/bib2ris\&.log T}:T{ The full path of a custom log file\&. This is used only if logdest is set appropriately\&. T} T{ logdest T}:T{ 1 T}:T{ The destination of the log information\&. 0 = print to stderr; 1 = use the syslog facility; 2 = use a custom logfile\&. The latter needs a proper setting of logfile\&. T} T{ loglevel T}:T{ 6 T}:T{ The log level up to which messages will be sent\&. A low setting (0) allows only the most important messages, a high setting (7) allows all messages including debug messages\&. \-1 means nothing will be logged\&. T} T{ abbrevfirst T}:T{ t T}:T{ If this option is set to "t", the first names of all authors and editors will be abbreviated to the initials\&. If set to "f", the first names will be used as they are found in the BibTeX bibliography file\&. T} T{ listsep T}:T{ ; T}:T{ This is the delimiter which separates individual keywords in a non\-standard keyword field\&. Use the string "spc" for whitespace\-separated lists (spaces and tabs)\&. T} T{ forcejabbrev T}:T{ f T}:T{ If this is set to "t", journal names will be wrapped in RIS "JO" entries\&. If it is set to "f", bib2ris will use "JO" entries only if the journal name contains at least one period, otherwise it will use "JF"\&. T} T{ maparticle T}:T{ JOUR T}:T{ map the BibTeX article publication type to a RIS type T} T{ mapbook T}:T{ BOOK T}:T{ map the BibTeX book publication type to a RIS type T} T{ mapbooklet T}:T{ PAMP T}:T{ map the BibTeX booklet publication type to a RIS type T} T{ mapconference T}:T{ CHAP T}:T{ map the BibTeX conference publication type to a RIS type T} T{ mapinbook T}:T{ CHAP T}:T{ map the BibTeX inbook publication type to a RIS type T} T{ mapincollection T}:T{ CHAP T}:T{ map the BibTeX incollection publication type to a RIS type T} T{ mapinproceedings T}:T{ CHAP T}:T{ map the BibTeX inproceedings publication type to a RIS type T} T{ mapmanual T}:T{ BOOK T}:T{ map the BibTeX manual publication type to a RIS type T} T{ mapmastersthesis T}:T{ THES T}:T{ map the BibTeX mastersthesis publication type to a RIS type T} T{ mapmisc T}:T{ GEN T}:T{ map the BibTeX misc publication type to a RIS type T} T{ mapphdthesis T}:T{ THES T}:T{ map the BibTeX phdthesis publication type to a RIS type T} T{ mapproceedings T}:T{ CONF T}:T{ map the BibTeX proceedings publication type to a RIS type T} T{ maptechreport T}:T{ RPRT T}:T{ map the BibTeX techreport publication type to a RIS type T} T{ mapunpublished T}:T{ UNPB T}:T{ map the BibTeX unpublished publication type to a RIS type T} T{ nsf_xyz T}:T{ (none) T}:T{ You can specify an unlimited number of these entries to map non\-standard BibTeX fields to RIS tags\&. The BibTeX field name in this variable has to be in lowercase, regardless of the case in your input data (bib2ris treats field names as case\-insensitive)\&. The two\-letter RIS tag has to be in uppercase\&. E\&.g\&. to map your BibTeX "Abstract" field to the RIS "N2" tag, the entry would read: "nsf_abstract N2"\&. T} .TE .sp 1 .SH "DATA PROCESSING" .PP This section provides a few hints about the data conversion itself and the BibTeX format requirements\&. .sp .RS 4 .ie n \{\ \h'-04'\(bu\h'+03'\c .\} .el \{\ .sp -1 .IP \(bu 2.3 .\} The parsing of the input data is done by the btparse library\&. All limitations of that library apply to bib2ris as well\&. This applies very specifically to two hardcoded settings in btparse which, simply put, limit the size and complexity (in terms of macros) of an input file that btparse can handle\&. If you run into this kind of problem (I had to pull a 2\ \&MB BibTeX bibliography from the net in order to verify this limit) you should increase the values of \fINUM_MACROS\fR and \fISTRING_SIZE\fR in the source file macros\&.c and recompile the btparse library\&. .RE .sp .RS 4 .ie n \{\ \h'-04'\(bu\h'+03'\c .\} .el \{\ .sp -1 .IP \(bu 2.3 .\} All entry names and field names in the BibTeX input file are treated as case\-insensitive, i\&.e\&. "BoOk" is the same as "book" and "AUTHOR" is the same as "aUthoR"\&. .RE .sp .RS 4 .ie n \{\ \h'-04'\(bu\h'+03'\c .\} .el \{\ .sp -1 .IP \(bu 2.3 .\} The entries are checked for completeness\&. An error is generated if an entry lacks fields which are considered essential for the particular publication type\&. .RE .sp .RS 4 .ie n \{\ \h'-04'\(bu\h'+03'\c .\} .el \{\ .sp -1 .IP \(bu 2.3 .\} Non\-standard fields can be imported in addition to the predefined BibTeX fields\&. Create an entry for each non\-standard BibTeX field name that your input data use in your bib2ris configuration file\&. The data are handled differently based on the type of RIS field they are imported to\&. If the data are imported to the RIS fields AD, N1, or N2, which basically have an unlimited size, all occurrences of these fields will be concatenated into a single AD, N1, or N2 tag line, respectively\&. If the data are mapped to the RIS KW field, the string will be tokenized based on the list separator specified in the listsep configuration variable\&. Each token will be written as a separate KW tag line\&. A special case is the RIS pseudo\-field "PY\&.day"\&. Data imported to this tag are integrated as the day part in the publication date tag line "PY" (year and month, but not day, are standard BibTeX fields and are recognized by default)\&. All other fields will be printed with their requested RIS tag\&. It is at the discretion of any RIS importing application to decide what to do with duplicate tag lines\&. Multiples are allowed for author tags (AU, A2, A3) and the keyword tag (KW)\&. refdb will use the \fIlast\fR occurrence of a tag line that does not allow multiple occurrences\&. .RE .sp .RS 4 .ie n \{\ \h'-04'\(bu\h'+03'\c .\} .el \{\ .sp -1 .IP \(bu 2.3 .\} Abbreviated journal names are detected only if they use periods\&. E\&.g\&. \(lqJ\&. Biol\&. Chem\&.\(rq will be mapped to a "JO" RIS element whereas \(lqJ Biol Chem\(rq will be (incorrectly) mapped to a "JF" element (\(lqJournal of Biological Chemistry\(rq would correctly end up here too)\&. Spaces after periods are optional\&. To capture \(lqJ Biol Chem\(rq in a "JO" element, use the \fB\-j\fR command line option or the "forcejabbrev" configuration file variable\&. .RE .sp .RS 4 .ie n \{\ \h'-04'\(bu\h'+03'\c .\} .el \{\ .sp -1 .IP \(bu 2.3 .\} The mapping of BibTeX publication types (book, inproceedings\&.\&.\&.) to RIS types as specified in the configuration file is checked for valid RIS types\&. If an invalid RIS type is specified, an error is generated and the compile\-time default is used instead\&. .RE .sp .RS 4 .ie n \{\ \h'-04'\(bu\h'+03'\c .\} .el \{\ .sp -1 .IP \(bu 2.3 .\} By default the first names of authors and editors are not abbreviated\&. If you wish you can configure \fBbib2ris\fR to abbreviate first and middle names\&. .RE .SH "FILES" .PP PREFIX/etc/refdb/bib2risrc .RS 4 The global configuration file of bib2ris\&. .RE .PP $HOME/\&.bib2risrc .RS 4 The user configuration file of bib2ris\&. .RE .SH "SEE ALSO" .PP \fBRefDB\fR (7), \fBrefdb_latex2utf8txt\fR (1), \fBdb2ris\fR (1), \fBen2ris\fR (1), \fBmarc2ris\fR (1), \fBmed2ris\fR (1)\&. .PP \fIRefDB manual (local copy) \fR PREFIX/share/doc/refdb\-/refdb\-manual/index\&.html .PP \fIRefDB manual (web) \fR <\m[blue]\fBhttp://refdb\&.sourceforge\&.net/manual/index\&.html\fR\m[]> .PP \fIRefDB on the web \fR <\m[blue]\fBhttp://refdb\&.sourceforge\&.net/\fR\m[]> .SH "AUTHOR" .PP bib2ris was written by Markus Hoenicka \&.