Formatting references in the ADS Abstract Service


Last updated: 19 July 2001
The reference formatting capability allows the user to specify a format in which the reference is returned. The format is a string similar to a format in a printf statement. The format consists of text and format instructions. Text will be printed out as it appears in the format. The '\' character is used to specify special characters, as in a printf format (\n is a newline, \t is a tab, \\ is a backslash).

A default format can be set in the User Preferences.

Some of the common formatting strings include the following:

AASTeX: \\bibitem%[\4n]%{R} %\8l %\Y,%\j,%\V,%\p\n

Icarus: \\bibitem%[\2N]%{R} %\10I %\Y.%\t.%\j %\V,%\p%-\P\n

MNRAS: \\bibitem%[\2h]%{R} %\8.3g,%\Y,%\j, %\V,%\p\n

Or you can build one of your own using the abbreviations listed below. For example, the default format is:

\\bibitem%[N]%{R} %8a %Y,%T,%j,%V,%P\n

which produces a reference of the form:

\bibitem[Rester et al. 1989]{1989ApJ...342L..71R} Rester, A. C., Coldwell, R. L., Dunnam, F. E., Eichhorn, G., Trombka, J. I., Starr, R., and Lasche, G. P. 1989, Gamma-ray observations of SN 1987A from Antarctica, \apjl, 342, L71

To create one of your own, use the format:

%[s][c][n.m]f[e]

where:

s: Starting character (optional).
This character will be printed before the string specified by the format character is printed. If the starting character is one of ',', '.', ';', ':', it will be followed by a space. This character is only printed if the field itself is available. This can be any non-alphanumeric character except '=', '&', and '\' (the encoding characters).

c: Encoding (optional).
This character specifies what encoding scheme to use. Options are:
&: SGML encoding.
This encoding converts the characters '&', '<', '>', and '"' to &amp;, &lt;, &gt;, and &quot;, respectively.
=: Hex encoding.
This encoding converts all characters with hex values less than 0x20 and all characters with hex values greater or equal to 0x7F into the form %XX where XX are the two hex digits.
\: Tex/Latex encoding.
This encoding converts all special Tex characters into their Tex escape sequences. For instance '\' is converted to '$\backslash$', '$' is converted into '\$', '^' is converted into '\^{}', etc.

n.m: Maximum number of entries in field (optional).
This is implemented for the author field. If the number of authors in the list is larger than n, the list will be truncated and returned as "author1, author2, ..., authorm, et al.". If .m is not specified, n.1 is assumed.

f: Output field specifier.
This character specifies which field is to be printed with this format specification. These are the valid field specifiers:
A: Authors
This field prints out the author list as it is in the database. If the maximum number of entries in the field is specified, the output will be truncated to first author, et al. if there are more than n authors. The last author is separated by 'and'.
a: Authors
This field prints out the author list as it is in the database. If the maximum number of entries in the field is specified, the output will be truncated to first author, et al. if there are more than n authors. The last author is separated by '&'.
G: Authors (last names first)
This field prints out the author list. The author first names are truncated to first initials. The authors are written as 'lastname f. i.' (no comma separator for f. i.). If the maximum number of entries in the field is specified, the output will be truncated to author1 f. i., author2 f. i., author3 f. i., et al. if there are more than n authors. The last author has no special separator.
g: Authors (last names first)
This field prints out the author list. The author first names are truncated to first initials. The authors are written as 'lastname f. i.' (no comma separator for f. i.). If the maximum number of entries in the field is specified, the output will be truncated to author1 f. i., et al. if there are more than n authors. The last author has no special separator.
H: Reference Name
This field prints out the reference name if available. The reference name is the citation that is used in the article text. It consists of either "Lastname year" (for one-author articles), or "Lastname1 and Lastname2 year" (for 2 author articles), "Lastname1 Lastname2 and Lastname3 year" (for 3 to n-1 author articles), or "Lastname1 et al. year" (for articles with more than n authors). Default for n is 3. It can be changed for instance to 5 with %5n.
h: Reference Name
Same as N, except it uses '&' before the last author instead of 'and'.
I: Authors (initials first)
This field prints out the author list. The author first names are truncated to first initials. The first author is written as 'lastname, f. i.', subsequent authors are written as 'f. i. lastname'. If the maximum number of entries in the field is specified, the output will be truncated to "first author, and xx colleagues" if there are more than n authors. The last author is separated by 'and'.
i: Authors (initials first)
This field prints out the author list. The author first names are truncated to first initials. The first author is written as 'lastname, f. i.', subsequent authors are written as 'f. i. lastname'. If the maximum number of entries in the field is specified, the output will be truncated to first author, et al. if there are more than n authors. The last author is separated by '&'.
L: Authors (last names first)
This field prints out the author list. The author first names are truncated to first initials. The authors are written as 'lastname, f. i.'. If the maximum number of entries in the field is specified, the output will be truncated to "first author, and xx colleagues" if there are more than n authors. The last author is separated by 'and'.
l: Authors (last names first)
This field prints out the author list. The author first names are truncated to first initials. The authors are written as 'lastname, f. i.'. If the maximum number of entries in the field is specified, the output will be truncated to first author, et al. if there are more than n authors. The last author is separated by '&'.
M: Author list (last names only)
This field prints out the last names of the authors if available. The reference name is the citation that is used in the article text. It consists of either "Lastname" (for one-author articles), or "Lastname1 and Lastname2" (for 2 author articles), "Lastname1, Lastname2 and Lastname3" (for 3 to n-1 author articles), or "Lastname1 et al." (for articles with more than n authors). Default for n is 0, meaning no truncation. It can be changed for instance to 5 with %5n.
m: Author list (last names only)
Same as M, except it uses '&' before the last author instead of 'and'.
N: Reference Name
This field prints out the reference name if available. The reference name is the citation that is used in the article text. It consists of either "Lastname(year)" (for one-author articles), or "Lastname1 and Lastname2(year)" (for 2 author articles), "Lastname1 Lastname2 and Lastname3(year)" (for 3 to n-1 author articles), or "Lastname1 et al.(year)" (for articles with more than n authors). Default for n is 3. It can be changed for instance to 5 with %5n.
n: Reference Name
Same as N, except it uses '&' before the last author instead of 'and'.
B: Abstract
This field prints out the abstract if it is available.
b: Abstract
Same as B.
C: Copyright
This field prints out the copyright statement if available.
c: Copyright
Same as C.
D: Publication Date
This field prints out the Publication date if available.
d: Publication Date
Same as D.
E: Electronic Data Table Address
This field prints out the electronic data table address if available.
e: Electronic Data Table Address
Same as E.
F: Author Affiliation
This field prints out the Author affiliation if available.
f: Author Affiliation
Same as F.
J: Journal
This field prints out journal the if available.
j: Journal
This field prints out journal the if available. If an AASTeX macro for the journal is available, this macro is printed instead.
K: Keywords
This field prints out the keywords if available.
k: Keywords
Same as K.
O: Object Names
This field prints out the object names if available.
o: Object Names
Same as O.
P: Last Page
This field prints out the last page number of the article if available.
p: First Page
This field prints out the first page number of the article if available.
R: Bibliographic Code
This field prints out the bibliographic code if available.
r: Bibliographic Code
Same as R.
S: Reference Source
This field prints out the reference source if available.
s: Reference Source
Same as S.
T: Title
This field prints out the title if available.
t: Title
Same as T.
U: URL
This field prints out the URL of the abstract as a complete hyperlink with the bibcode as the anchor in the form <a href="url">bibcode</a>
u: URL
This field prints out the URL of the abstract in the form http://cdsads.u-strasbg.fr/cgi-bin/bib_query?bibcode=bibcode
V: Volume
This field prints out the volume if available.
v: Volume
Same as V.
W: Publication Category
This field prints the publication category. Currently available categories are:
MISC
BOOK
INBOOK
PROCEEDINGS
INPROCEEDINGS
ARTICLE
PHDTHESIS
MASTERSTHESIS
TECHREPORT

w: Publication Category
Same as W.
X: Comments
This field prints out the comments if available.
x: Comments
Same as X.
Y: Publication Year
This field prints out the publication year if available.
y: Publication Year
Same as Y.

e: Ending character (optional).
This character will be printed after the string specified by the format character is printed. If the ending character is one of ',', '.', ';', ':', it will be followed by a space. This character is only printed if the field itself is available. This can be any non-alphanumeric character except '%' and '\'.

The default format is: \\bibitem%[N]%{R} %8a %Y,%T,%j,%V,%P\n

This format produces a reference of the form:

\bibitem[Rester et al. 1989]{1989ApJ...342L..71R} Rester, A. C., Coldwell, R. L., Dunnam, F. E., Eichhorn, G., Trombka, J. I., Starr, R., and Lasche, G. P. 1989, Gamma-ray observations of SN 1987A from Antarctica, \apjl, 342, L71


The reason for including the starting and ending character within the format specification is to handle cases where the output field is not available. For instance to print the year followed by the comment in parenthesis you can specify:

%Y (%X)

or

%Y %(X)

If there is no comment field available, the first format will print:

1998 ()

whereas the second format will print:

1998

ABSTRACT SERVICE    HELP