First,many thanks for writing the bit of code that defines
\usebibentry. It have been implementing it and, basically, it works
wonderfully --- and is far (!) superior to having to use \citealias
for every relevant title.
In the course of working with it, I have noticed two properties that
have become a bit of a problem. I keep all my citations in various
*.bib files that are generated by a wonderful (free) data manager
called JabRef (http://jabref.sourceforge.net/index.php). Many of my
colleagues also use JabRef, so we can exchange *.bib files with the
assurance that all such files, whoever most recently originated or
modified them, can be used in JabRef. In the LaTeX file, I simply call
the *.bib files I need to use in my \bibliography{} statement. Now I
also call the files using your \bibinput{} statement. This works
splendidly.
The problems are the following. First, JabRef automatically puts a few
lines of internal documentation at the top of each *.bib file it
creates --- information like the date of latest revision and so forth.
Each of these lines begin with a %, so LaTeX ignores them. For some
reason, however, these lines appear in my LaTeX *.dvi output at
whatever place I insert a \bibinput{} statement. Moreover, LaTeX
won't let me put my \bibinput{} statements in the preamble; it issues
an error message to the effect that the \begin{document} statement is
missing. The reason, of course, it that for some reason it is ignoring
the % and treating lines that JabRef has "commented out" using % as
though they were actual input. That, of course, is also why they are
printed in my output.
Second, often JabRef produces BibTeX entries in a *.bib file that
contain blank lines. This typically happens in the abstract, but
sometimes it occurs elsewhere. Whenever \bibinput{} tries to load a
file, it gives an error message if that file contains a blank line
anywhere inside a BibTeX entry. Since such lines can appear anywhere,
the only way I can currently figure out to solve the problem is to go
through each *.bib file produced by JabRef by hand and remove the
blank lines (and, while I'm at it, I could remove the % documentation
lines at the front). The trouble with this approach is that (a) it's
extremely time consuming; and (b) I would have to do it every time I
modify any *.bib file via JabRef, because I can never tell whether or
not doing so will insert one or more blank lines somewhere, and in any
case JabRef will definitely insert its preliminary % documentation
lines at the start of each modified *.bib file.
The idea solution would be for that (a) treat lines that begin with %
as comment lines, so LaTeX will ignore tham, and (b) to ignore blank
lines. Do you have any ideas or suggestions?
Incidentally, this capability is so useful that I also wanted to
encourage you to consider making this code available to other users
through CTAN. I have several friends and a bunch of graduate students
who would love to have such a capability, and I've been hoping that
someone would just include it in an update of natbib.sty. It looks,
however, like that is not going to be done.
Thanks again for your help. --- Michael
> First,many thanks for writing the bit of code that defines
> \usebibentry. It have been implementing it and, basically, it works
> wonderfully --- and is far (!) superior to having to use \citealias
> for every relevant title.
It's memory intensive, though.
I really don't remember why I set % to have catcode 12; if you
don't use % in entries it should be safe to delete the line
\catcode`\%=12
In its place you can put
\catcode`\^^M=10
that will treat end-of-lines as spaces.
> Incidentally, this capability is so useful that I also wanted to
> encourage you to consider making this code available to other users
> through CTAN. I have several friends and a bunch of graduate students
> who would love to have such a capability, and I've been hoping that
> someone would just include it in an update of natbib.sty. It looks,
> however, like that is not going to be done.
>
> Thanks again for your help. --- Michael
I might make a package out of it, now that at least two people
use the macros.
Ciao
Enrico
This is a standing defect in all BIBTeX packages I have seen (except
Jurabib). I think it is solved in biblatex.
///Peter