![]() ![]() ![]() ![]() |
BibTool Manual![]() ![]() ![]() |
The next component of formats are made up formating instructions which are starting with a % character. The general idea has been inspired by formating facilities of C. Since there are several different types of information in a BibTeX entry we provide several primitives for formating. The simplest form is for instance
%N(author)
The % character is followed by a single character --- here N
--- which indicates the way of formating and the name of the field to be
formatted enclosed in parenthesis. The example above requests to format the
field author
according to formatting rules for names (N
).
The general form is
In this specification sign is + or -. + means that all characters will be translated to upper case. - means that all characters will be translated to lower case. If no sign is given, the case of the field is preserved.
pre and post are positive integers whose meaning depends on
the format letter letter. qualifier letter is a one letter
specification indicating the desired formatting type optionally preceded by
the qualifier #
. Possible values are as described in the following
list:
pre defaults to 2 and post defaults to 0.
See section Name Formatting for a description of how to specify name formats.
Example
author = {A. U. Thor and S. O. Meone and others}
With the above item we get the following results:
%p(author) Thor.Meone.ea %1p(author) Thor.ea %-2p(author) thor.meone.ea %+1p(author) THOR.EA
pre defaults to 2 and post defaults to 0.
This is the same as using the p format specifier with the post value of 0. The post value of the n specifier is used as the len value of the first item of the name format specifier. (See also section Name Formatting)
Example
author = {A. U. Thor and S. O. Meone and others}
With the above item we get the following results:
%n(author) Thor.Meone.ea %1n(author) Thor.ea %-2n(author) thor.meone.ea %+1n(author) THOR.EA %.3n(author) Tho.Meo.ea
pre defaults to 2 and post defaults to 0.
This is the same as using the p format specifier with the post value of 1. The post value of the n specifier is used as the len value of the first item of the name format specifier. (See also section Name Formatting)
Example
author = {A. U. Thor and S. O. Meone and others}
With the above item we get the following results:
%N(author) Thor.AU.Meone.SO.ea %1N(author) Thor.AU.ea %-2N(author) thor.au.meone.so.ea %+1N(author) THOR.AU.EA %.3N(author) Tho.AU.Meo.SO.ea
pre defaults to a large number except in when the negative sign is present. Then it defaults to 1.
If no number is contained in the field then this specifier fails. Thus the specifier %0d can be used to check for a number.
Positive and negative signs make no sense in specifying translations since numbers have no uppercase or lowercase counterparts. Thus they have a different meaning in this context.
If the positive sign is given then the specifier does not fail
at all. Instead of failing a single 0
is used.
If the negative sign is given then the result is padded with
0
if required. In this case the specifier does not fail
at all. Even if no number is found then an appropriate number
of 0
s is used.
Example
pages = {89--123}
With the above item we get the following results:
%d(pages) 89 %1d(pages) 9 %4d(pages) 89 %-4d(pages) 0089 %-5.2d(pages) 00123 %.3d(pages) fails %+.3d(pages) 0 %0d(pages) succeeds with empty result
Example
pages = {89--123}
With the above item we get the following results:
%D(pages) 89 %1D(pages) 89 %4D(pages) 89 %-4D(pages) 0089 %-5.2D(pages) 00123 %.3D(pages) fails %+.3D(pages) 0 %0D(pages) 89
pre defaults to a large number.
Example
author = {A. U. Thor and S. O. Meone and others}
With the above item we get the following results:
%s(author) A.-U.-Thor-and-S.-O.-Meone-and-others %8s(author) A.-U.-Th %-8s(author) a.-u.-th %+8s(author) A.-U.-TH %0s(author) succeeds with empty result
New words to be ignored can be added with the resource ignored.word.
pre defaults to 1 and post defaults to 0.
Example
title = {The Whole Title}
With the above item we get the following results:
%T(title) Whole %2T(title) Whole-Title %2.1T(title) W-T %-T(title) whole %+T(title) WHOLE
pre defaults to 1 and post defaults to 0.
Example
title = {The Whole Title}
With the above item we get the following results:
%t(title) The %2t(title) The-Whole %2.1t(title) T-W %-t(title) the %+t(title) THE
Example
title = {The Whole Title}
With the above item we get the following results:
%W(title) Whole %2W(title) WholeTitle %2.1W(title) WT %-W(title) whole %+W(title) WHOLE
Example
title = {The Whole Title}
With the above item we get the following results:
%w(title) The %2w(title) TheWhole %2.1w(title) TW %-w(title) the %+w(title) THE
If no sign is given or the sign is +
then
the following rules apply. If the count is less than pre
or the count is greater than post then this specifier fails.
Otherwise it succeeds without adding something to the key.
The construction and others
, which indicates an unspecified
number of additional authors, counts as one single author.
If the sign is -
then the specifier succeeds if
and only if the specifier without this sign fails. Thus the
-
acts like a negation of the condition.
If post has the value 0 than this is treated like \infty .
If a is the number of names separated by and then
%l.h#p succeeds if and only if
l <= a <= h.
%-l.h#p succeeds if and only if
l>a or a>h.
pre and post both defaults to 0.
Example
author = {A. U. Thor and S. O. Meone and others}
With the above item we get the following results:
%2#p(author) succeeds with empty result %4#p(author) fails %-4#p(author) succeeds with empty result %3.4#p(author) succeeds with empty result %-3.4#p(author) fails
If no sign is given or the sign is +
then
the following rules apply. If the count is less than pre
or the count is greater than post then this specifier fails.
Otherwise it succeeds without adding something to the key.
If the sign is -
then the specifier succeeds if
and only if the specifier without this sign fails. Thus the
-
acts like a negation of the condition.
If post has the value 0 than this is treated like \infty .
pre and post both default to 0.
If a is the number of allowed characters then
%l.h#p succeeds if and only if
l <= a <= h.
%-l.h#p succeeds if and only if
l>a or a>h.
Example
title = {The Whole Title}
With the above item we get the following results:
%#s(title) succeeds with empty result %13,13#s(title) succeeds with empty result %10,16#s(title) succeeds with empty result %-10,16#s(title) fails
If no sign is given or the sign is +
then
the following rules apply. If the count is less than pre
or the count is greater than post then this specifier fails.
Otherwise it succeeds without adding something to the key.
If the sign is -
then the specifier succeeds if
and only if the specifier without this sign succeeds. Thus the
-
acts like a negation of the condition.
If post has the value 0 than this is treated like \infty .
pre and post both default to 0.
If a is the number of words separated by whitespace then
%l.h#p succeeds if and only if
l <= a <= h.
%-l.h#p succeeds if and only if
l>a or a>h.
Example
title = {The Whole Title}
With the above item we get the following results:
%#w(title) succeeds with empty result %3,3#w(title) succeeds with empty result %1,6#w(title) succeeds with empty result %-1,1#w(title) fails
If no sign is given or the sign is +
then
the following rules apply. If the count is less than pre
or the count is greater than post then this specifier fails.
Otherwise it succeeds without adding something to the key.
If the sign is -
then the specifier succeeds if
and only if the specifier without this sign fails. Thus the
-
acts like a negation of the condition.
If post has the value 0 than this is treated like \infty .
pre and post both default to 0.
If a is the number of words separated by whitespace which are
not marked to be ignored then
%l.h#p succeeds if and only if
l <= a <= h.
%-l.h#p succeeds if and only if
l>a or a>h.
Example
title = {The Whole Title}
With the above item we get the following results:
%#W(title) succeeds with empty result %2,2#W(title) succeeds with empty result %1,6#W(title) succeeds with empty result %-1,6#W(title) fails
The field specification (field) selects the field of the entry to be formatted. As usual in BibTeX the case of the letters is ignored. If the field does not exist then the formatting fails and continues at the next alternative (see below).
But the field is not only sought in the current entry. According to the behaviour of BibTeX the special field crossref is taken into account. If a field is missing them the entry named in the crossref field is also considered. Since this dereferencing contains the potential danger of an infinite loop the number of dereferencing steps is restricted by the numeric resource crossref.limit. The number of uses of the crossref field is limited by the value of this resource. The default of this resource is 32.
Usually a value of 1 would be sufficient for BibTeX files conforming to the standard styles. Nevertheless other applications can be imagined where a higher value is desirable.
To turn off the crossref feature complete you can set the value of crossref.limit to 0. In this case only the fields found in the entry itself are considered.
![]() ![]() ![]() ![]() |
BibTool Manual![]() ![]() ![]() |