summaryrefslogtreecommitdiff
path: root/support/crossrefware/ltx2crossrefxml.1
diff options
context:
space:
mode:
Diffstat (limited to 'support/crossrefware/ltx2crossrefxml.1')
-rw-r--r--support/crossrefware/ltx2crossrefxml.1248
1 files changed, 222 insertions, 26 deletions
diff --git a/support/crossrefware/ltx2crossrefxml.1 b/support/crossrefware/ltx2crossrefxml.1
index a938c22130..cb8343aa60 100644
--- a/support/crossrefware/ltx2crossrefxml.1
+++ b/support/crossrefware/ltx2crossrefxml.1
@@ -1,4 +1,4 @@
-.\" Automatically generated by Pod::Man 2.27 (Pod::Simple 3.28)
+.\" Automatically generated by Pod::Man 4.14 (Pod::Simple 3.40)
.\"
.\" Standard preamble:
.\" ========================================================================
@@ -46,7 +46,7 @@
.ie \n(.g .ds Aq \(aq
.el .ds Aq '
.\"
-.\" If the F register is turned on, we'll generate index entries on stderr for
+.\" If the F register is >0, we'll generate index entries on stderr for
.\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index
.\" entries marked with X<> in POD. Of course, you'll have to process the
.\" output yourself in some meaningful fashion.
@@ -56,12 +56,12 @@
..
.nr rF 0
.if \n(.g .if rF .nr rF 1
-.if (\n(rF:(\n(.g==0)) \{
-. if \nF \{
+.if (\n(rF:(\n(.g==0)) \{\
+. if \nF \{\
. de IX
. tm Index:\\$1\t\\n%\t"\\$2"
..
-. if !\nF==2 \{
+. if !\nF==2 \{\
. nr % 0
. nr F 2
. \}
@@ -133,57 +133,253 @@
.\" ========================================================================
.\"
.IX Title "ltx2crossrefxml 1"
-.TH ltx2crossrefxml 1 "2017-11-18" "" "CROSSREF LIBRARY"
+.TH ltx2crossrefxml 1 "2021-10-02" "" "LATEX CROSSREFWARE"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
.nh
.SH "NAME"
-ltx2crossrefxml.pl \- a tool for creation of XML files for submitting to crossref.
+ltx2crossrefxml.pl \- create XML files for submitting to crossref.org
.SH "SYNOPSIS"
.IX Header "SYNOPSIS"
-ltx2crossrefxml [\fB\-c\fR \fIconfig_file\fR] [\fB\-o\fR \fIoutput\fR] \fIlatex_file\fR \fIlatex_file\fR ...
+ltx2crossrefxml [\fB\-c\fR \fIconfig_file\fR] [\fB\-o\fR \fIoutput_file\fR] [\fB\-input\-is\-xml\fR]
+ \fIlatex_file1\fR \fIlatex_file2\fR ...
.SH "OPTIONS"
.IX Header "OPTIONS"
.IP "\fB\-c\fR \fIconfig_file\fR" 4
.IX Item "-c config_file"
-Configuration file. If this file is absent, some defaults are used.
+Configuration file. If this file is absent, defaults are used.
See below for its format.
-.IP "\fB\-o\fR \fIoutput\fR" 4
-.IX Item "-o output"
+.IP "\fB\-o\fR \fIoutput_file\fR" 4
+.IX Item "-o output_file"
Output file. If this option is not used, the \s-1XML\s0 is output to stdout.
+.IP "\fB\-rpi\-is\-xml\fR" 4
+.IX Item "-rpi-is-xml"
+Do not transform author and title input strings, assume they are valid \s-1XML.\s0
+.PP
+The usual \f(CW\*(C`\-\-help\*(C'\fR and \f(CW\*(C`\-\-version\*(C'\fR options are also supported. Options
+can begin with either \f(CW\*(C`\-\*(C'\fR or \f(CW\*(C`\-\-\*(C'\fR, and ordered arbitrarily.
.SH "DESCRIPTION"
.IX Header "DESCRIPTION"
-The script takes a number of latex files and produces an \s-1XML\s0 file
-ready for submission to Crossref. Each file must be previously processed
-by LaTeX with the newest \f(CW\*(C`resphilosophica\*(C'\fR package: the package creates
-the file \f(CW\*(C`.rti\*(C'\fR wtih the information about the bibliography.
+For each given \fIlatex_file\fR, this script reads \f(CW\*(C`.rpi\*(C'\fR and (if they
+exist) \f(CW\*(C`.bbl\*(C'\fR files and outputs corresponding \s-1XML\s0 that can be uploaded
+to Crossref (<https://crossref.org>). Any extension of \fIlatex_file\fR is
+ignored, and \fIlatex_file\fR itself is not read (and need not even exist).
+.PP
+Each \f(CW\*(C`.rpi\*(C'\fR file specifies the metadata for a single article to be
+uploaded to Crossref (a \f(CW\*(C`journal_article\*(C'\fR element in their schema); an
+example is below. These files are output by the \f(CW\*(C`resphilosophica\*(C'\fR
+package (<https://ctan.org/pkg/resphilosophica>), but (as always) can
+also be created by hand or by whatever other method you implement.
+.PP
+Any \f(CW\*(C`.bbl\*(C'\fR files present are used for the citation information in the
+output \s-1XML.\s0 See the \s-1CITATIONS\s0 section below.
.PP
-The processing of reference list is at present rather limited: only so
-called unstructured references are produced.
+Unless \f(CW\*(C`\-\-rpi\-is\-xml\*(C'\fR is specified, for all text (authors, title,
+citations), standard TeX control sequences are replaced with plain text
+or \s-1UTF\-8\s0 or eliminated, as appropriate. The \f(CW\*(C`LaTeX::ToUnicode::convert\*(C'\fR
+routine is used for this (<https://ctan.org/pkg/bibtexperllibs>).
+Tricky TeX control sequences will almost surely not be handled
+correctly. If \f(CW\*(C`\-\-rpi\-is\-xml\*(C'\fR is given, the author and title strings
+from the rpi files are output as-is, assuming they are valid \s-1XML\s0; no
+checking is done. Citation text from \f(CW\*(C`.bbl\*(C'\fR files is always converted
+from LaTeX to plain text.
+.PP
+This script just writes an \s-1XML\s0 file. It's up to you to actually do the
+uploading to Crossref; for example, you can use their Java tool
+\&\f(CW\*(C`crossref\-upload\-tool.jar\*(C'\fR
+(<https://www.crossref.org/education/member\-setup/direct\-deposit\-xml/https\-post>).
+For the definition of their schema, see
+<https://data.crossref.org/reports/help/schema_doc/4.4.2/index.html>
+(this is the schema version currently followed by this script).
.SH "CONFIGURATION FILE FORMAT"
.IX Header "CONFIGURATION FILE FORMAT"
-The configuration file is mostly self-explanatory: it has comments
-(starting with \f(CW\*(C`#\*(C'\fR) and assginments in the form
+The configuration file is read as Perl code. Thus, comment lines
+starting with \f(CW\*(C`#\*(C'\fR and blank lines are ignored. The other lines are
+typically assignments in the form (spaces are optional):
.PP
.Vb 1
-\& $field = value ;
+\& $variable = value ;
+.Ve
+.PP
+Usually the value is a \f(CW"string"\fR enclosed in \s-1ASCII\s0 double-quote or
+single-quote characters, per Perl syntax. The idea is to specify the
+user-specific and journal-specific values needed for the Crossref
+upload. The variables which are used are these:
+.PP
+.Vb 7
+\& $depositorName = "Depositor Name";
+\& $depositorEmail = \*(Aqdepositor@example.org\*(Aq;
+\& $registrant = \*(AqRegistrant\*(Aq; # organization name
+\& $fullTitle = "FULL TITLE"; # journal name
+\& $issn = "1234\-5678"; # required
+\& $abbrevTitle = "ABBR. TTL."; # optional
+\& $coden = "CODEN"; # optional
+.Ve
+.PP
+For a given run, all \f(CW\*(C`.rpi\*(C'\fR data read is assumed to belong to the
+journal that is specified in the configuration file. More precisely, the
+configuration data is written as a \f(CW\*(C`journal_metadata\*(C'\fR element, with
+given \f(CW\*(C`full_title\*(C'\fR, \f(CW\*(C`issn\*(C'\fR, etc., and then each \f(CW\*(C`.rpi\*(C'\fR is written as
+\&\f(CW\*(C`journal_issue\*(C'\fR plus \f(CW\*(C`journal_article\*(C'\fR elements.
+.PP
+The configuration file can also define one Perl function:
+\&\f(CW\*(C`LaTeX_ToUnicode_convert_hook\*(C'\fR. If it is defined, it is called at the
+beginning of the procedure that converts LaTeX text to Unicode, which is
+done with the LaTeX::ToUnicode module, from the \f(CW\*(C`bibtexperllibs\*(C'\fR
+package (<https://ctan.org/pkg/bibtexperllibs>). The function must
+accept one string (the LaTeX text), and return one string (presumably
+the transformed string). The standard conversions are then applied to
+the returned string, so the configured function need only handle special
+cases, such as control sequences particular to the journal at hand.
+.SH "RPI FILE FORMAT"
+.IX Header "RPI FILE FORMAT"
+Here's the (relevant part of the) \f(CW\*(C`.rpi\*(C'\fR file corresponding to the
+\&\f(CW\*(C`rpsample.tex\*(C'\fR example in the \f(CW\*(C`resphilosophica\*(C'\fR package
+(<https://ctan.org/pkg/resphilosophica>):
+.PP
+.Vb 10
+\& %authors=Boris Veytsman\eand A. U. Th{\eo }r\eand C. O. R\e"espondent
+\& %title=A Sample Paper:\e\e \eemph {A Template}
+\& %year=2012
+\& %volume=90
+\& %issue=1\-\-2
+\& %startpage=1
+\& %endpage=1
+\& %doi=10.11612/resphil.A31245
+\& %paperUrl=http://borisv.lk.net/paper12
+\& %publicationType=full_text
+.Ve
+.PP
+Other lines, some not beginning with %, are ignored (and not shown).
+For more details on processing, see the code.
+.PP
+The \f(CW%paperUrl\fR value is what will be associated with the given \f(CW%doi\fR
+(output as the \f(CW\*(C`resource\*(C'\fR element). Crossref strongly recommends that
+the url be for a so-called landing page, and not directly for a pdf
+(<https://www.crossref.org/education/member\-setup/creating\-a\-landing\-page/>).
+Special case: if the url is not specified,
+and the journal is \fIRes\ Philosophica\fR,
+a special-purpose search url using pdcnet.org is returned.
+Any other journal must always specify this.
+.PP
+The \f(CW%authors\fR field is split at \f(CW\*(C`\eand\*(C'\fR (ignoring whitespace before
+and after), and output as the \f(CW\*(C`contributors\*(C'\fR element, using
+\&\f(CW\*(C`sequence="first"\*(C'\fR for the first listed, \f(CW\*(C`sequence="additional"\*(C'\fR for
+the remainder.
+.PP
+If the \f(CW%publicationType\fR is not specified, it defaults to
+\&\f(CW\*(C`full_text\*(C'\fR, since that has historically been the case; \f(CW\*(C`full_text\*(C'\fR
+can also be given explicitly. The other values allowed by the Crossref
+schema are \f(CW\*(C`abstract_only\*(C'\fR and \f(CW\*(C`bibliographic_record\*(C'\fR. Finally, if the
+value is \f(CW\*(C`omit\*(C'\fR, the \f(CW\*(C`publication_type\*(C'\fR attribute is omitted entirely
+from the given \f(CW\*(C`journal_article\*(C'\fR element.
+.PP
+Each \f(CW\*(C`.rpi\*(C'\fR must contain information for only one article, but multiple
+files can be read in a single run. It would not be difficult to support
+multiple articles in a single \f(CW\*(C`.rpi\*(C'\fR file, but it makes debugging and
+error correction easier when each uploaded \s-1XML\s0 contains a single
+article.
+.SS "\s-1MORE ABOUT AUTHOR NAMES\s0"
+.IX Subsection "MORE ABOUT AUTHOR NAMES"
+The three formats for names recognized are (not coincidentally) the same
+as BibTeX:
+.PP
+.Vb 3
+\& First von Last
+\& von Last, First
+\& von Last, Jr., First
.Ve
+.PP
+The forms can be freely intermixed within a single \f(CW%authors\fR line,
+separated with \f(CW\*(C`\eand\*(C'\fR (including the backslash). Commas as name
+separators are not supported, unlike BibTeX.
+.PP
+In short, you may almost always use the first form; you shouldn't if
+either there's a Jr part, or the Last part has multiple tokens but
+there's no von part. See the \f(CW\*(C`btxdoc\*(C'\fR (``BibTeXing'' by Oren Patashnik)
+document for details.
+.PP
+In the \f(CW%authors\fR line of a \f(CW\*(C`.rpi\*(C'\fR file, some secondary directives are
+recognized, indicated by \f(CW\*(C`|\*(C'\fR characters. Easiest to explain with an
+example:
+.PP
+.Vb 1
+\& %authors=|organization|\eLaTeX\e Project Team \eand Alex Brown|orcid=123
+.Ve
+.PP
+Thus: 1) if \f(CW\*(C`|organization|\*(C'\fR is specified, the author name will be output
+as an \f(CW\*(C`organization\*(C'\fR contributor, instead of the usual \f(CW\*(C`person_name\*(C'\fR,
+as the Crossref schema requires.
+.PP
+2) If \f(CW\*(C`|orcid=\f(CIvalue\f(CW|\*(C'\fR is specified, the \fIvalue\fR is output as an
+\&\f(CW\*(C`ORCID\*(C'\fR element for that \f(CW\*(C`person_name\*(C'\fR.
+.PP
+These two directives, \f(CW\*(C`|organization\*(C'\fR| and \f(CW\*(C`|orcid|\*(C'\fR are mutually
+exclusive, because that's how the Crossref schema defines them. The \f(CW\*(C`=\*(C'\fR
+sign after \f(CW\*(C`orcid\*(C'\fR is required, while all spaces after the \f(CW\*(C`orcid\*(C'\fR
+keyword are ignored. Other than that, the \s-1ORCID\s0 value is output
+literally. (E.g., the \s-1ORCID\s0 value of \f(CW123\fR above is clearly invalid,
+but it would be output anyway, with no warning.)
+.PP
+Extra \f(CW\*(C`|\*(C'\fR characters, at the beginning or end of the entire \f(CW%authors\fR
+string, or doubled in the middle, are accepted and ignored. Whitespace
+is ignored around all \f(CW\*(C`|\*(C'\fR characters.
+.SH "CITATIONS"
+.IX Header "CITATIONS"
+Each \f(CW\*(C`.bbl\*(C'\fR file corresponding to an input \f(CW\*(C`.rpi\*(C'\fR file is read and
+used to output a \f(CW\*(C`citation_list\*(C'\fR element for that \f(CW\*(C`journal_article\*(C'\fR in
+the output \s-1XML.\s0 If no \f(CW\*(C`.bbl\*(C'\fR file exists for a given \f(CW\*(C`.rpi\*(C'\fR,
+no \f(CW\*(C`citation_list\*(C'\fR is output for that article.
+.PP
+The \f(CW\*(C`.bbl\*(C'\fR processing is rudimentary: only so-called
+\&\f(CW\*(C`unstructured_citation\*(C'\fR references are produced for Crossref, that is,
+the contents of the citation (each paragraph in the \f(CW\*(C`.bbl\*(C'\fR) is dumped
+as a single flat string without markup.
+.PP
+Bibliography text is unconditionally converted from TeX to \s-1XML,\s0 via the
+method described above. It is not unusual for the conversion to be
+incomplete or incorrect. It is up to you to check for this; e.g., if
+any backslashes remain in the output, it is most likely an error.
+.PP
+Furthermore, it is assumed that the \f(CW\*(C`.bbl\*(C'\fR file contains a sequence of
+references, each starting with \f(CW\*(C`\ebibitem{\f(CIKEY\f(CW}\*(C'\fR (which itself must be
+at the beginning of a line, preceded only by whitespace), and the whole
+bibliography ending with \f(CW\*(C`\eend{thebibliography}\*(C'\fR (similarly at the
+beginning of a line). A bibliography not following this format will not
+produce useful results. Bibliographies can be created by hand, or with
+BibTeX, or any other method.
+.PP
+The \f(CW\*(C`key\*(C'\fR attribute for the \f(CW\*(C`citation\*(C'\fR element is taken as the \fI\s-1KEY\s0\fR
+argument to the \f(CW\*(C`\ebibitem\*(C'\fR command. The sequential number of the
+citation (1, 2, ...) is appended. The argument to \f(CW\*(C`\ebibitem\*(C'\fR can be
+empty (\f(CW\*(C`\ebibitem{}\*(C'\fR, and the sequence number will be used on its own.
+Although TeX will not handle empty \f(CW\*(C`\ebibitem\*(C'\fR keys, it can be
+convenient when creating a \f(CW\*(C`.bbl\*(C'\fR purely for Crossref.
+.PP
+The \f(CW\*(C`.rpi\*(C'\fR file is also checked for the bibliography information, in
+this same format.
+.PP
+Feature request: if anyone is interested in figuring out how to generate
+structured citations
+(<https://data.crossref.org/reports/help/schema_doc/4.4.2/schema_4_4_2.html#citation>)
+instead of these flat text dumps, that would be great.
.SH "EXAMPLES"
.IX Header "EXAMPLES"
-.Vb 1
-\& ltx2crossrefxml.pl ../paper1/paper1.tex ../paper2/paper2.tex \-o result.xml
+.Vb 2
+\& ltx2crossrefxml.pl ../paper1/paper1.tex ../paper2/paper2.tex \e
+\& \-o result.xml
\&
-\& ltx2crossrefxml.pl \-c myconfig.cnf paper.tex \-o paper.xml
+\& ltx2crossrefxml.pl \-c myconfig.cfg paper.tex \-o paper.xml
.Ve
.SH "AUTHOR"
.IX Header "AUTHOR"
-Boris Veytsman
+Boris Veytsman <https://github.com/borisveytsman/crossrefware>
.SH "COPYRIGHT AND LICENSE"
.IX Header "COPYRIGHT AND LICENSE"
-Copyright (C) 2012\-2016 Boris Veytsman
+Copyright (C) 2012\-2021 Boris Veytsman
.PP
This is free software. You may redistribute copies of it under the
terms of the \s-1GNU\s0 General Public License
-<http://www.gnu.org/licenses/gpl.html>. There is \s-1NO WARRANTY,\s0 to the
+<https://www.gnu.org/licenses/gpl.html>. There is \s-1NO WARRANTY,\s0 to the
extent permitted by law.