BibTeX, biblatex and biberAn introduction within the bibliography

Information and discussion about BiBTeX - the bibliography tool for LaTeX documents.
Post Reply
SkippyleGrandGourou
Posts: 7
Joined: Wed Sep 01, 2010 3:58 pm

An introduction within the bibliography

Post by SkippyleGrandGourou »

Hi,

I have certainly badly searched but keywords "latex introduction bibliography" constantly lead me to noise, so forgive me.

I would like my bibliography to be preceeded by an introduction. That is, between the title of the bibliography and the first entry. Is there a command for this ?

I guess I could edit the .bbl file but since it is overwritten at each compilation it would be quite painful…

Thanks.
Last edited by SkippyleGrandGourou on Sat Sep 18, 2010 6:01 pm, edited 1 time in total.

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

NEW: TikZ book now 40% off at Amazon.com for a short time.

meho_r
Posts: 823
Joined: Tue Aug 07, 2007 5:28 pm

An introduction within the bibliography

Post by meho_r »

You may try with bibtopic.

I attached an example which shows a simple use of this package.
Attachments
Example.zip
(565 Bytes) Downloaded 149 times
User avatar
gmedina
Posts: 2313
Joined: Wed Jul 11, 2007 11:45 pm

An introduction within the bibliography

Post by gmedina »

As an alternative, it is easy to achieve this without any packages; however, SkippyleGrandGourou forgot to mention crucial information: the document class used. Assuming the class is article, all you have to do is to add the following lines to the preamble (and change the text in the argument of the \Bibliocomment command):

Code: Select all

\newcommand\Bibliocomment{This is some text that will appear before the entries in the bibliography.}
\makeatletter
\renewenvironment{thebibliography}[1]
     {\section*{\refname}%
      \@mkboth{\MakeUppercase\refname}{\MakeUppercase\refname}%
      \Bibliocomment
      \list{\@biblabel{\@arabic\c@enumiv}}%
           {\settowidth\labelwidth{\@biblabel{#1}}%
            \leftmargin\labelwidth
            \advance\leftmargin\labelsep
            \@openbib@code
            \usecounter{enumiv}%
            \let\p@enumiv\@empty
            \renewcommand\theenumiv{\@arabic\c@enumiv}}%
      \sloppy
      \clubpenalty4000
      \@clubpenalty \clubpenalty
      \widowpenalty4000%
      \sfcode`\.\@m}
     {\def\@noitemerr
       {\@latex@warning{Empty `thebibliography' environment}}%
      \endlist}
\makeatother
1,1,2,3,5,8,13,21,34,55,89,144,233,...
SkippyleGrandGourou
Posts: 7
Joined: Wed Sep 01, 2010 3:58 pm

An introduction within the bibliography

Post by SkippyleGrandGourou »

Thanks for the replies. I am using a customised class derived from the book class. Another point I did not mention is that I am already using the multibib package, so the solution suggested by meho_r won't work.

gmedina's suggestion would work if I would like the same text to be printed in both bibliography sections — however I would like the introduction only on one section (or equivalently, a different one for each).

Anyway, I understand from this reply that there is no out-of-the-box solution. I will try to elaborate from this suggestion when I have time to investigate.
meho_r
Posts: 823
Joined: Tue Aug 07, 2007 5:28 pm

An introduction within the bibliography

Post by meho_r »

Please read Board Rules and Avoidable mistakes. You originally provided exactly 0 infos needed to solve the problem. When you provide a Minimal Working Example (MWE) maybe someone provides a solution.
SkippyleGrandGourou
Posts: 7
Joined: Wed Sep 01, 2010 3:58 pm

Re: An introduction within the bibliography

Post by SkippyleGrandGourou »

Hey, cool down please. The original question was clear and self-sufficient : "is there a command for preceeding the bibliography by an introduction ?" Without more information one can safely assume a basic environment. You suggestion was a good one and may be useful to someone else trying to achieve the same purpose, and you would probably not have provided it had I mentioned that I was using multibib. Sorry if the "LaTeX Community" forums are to be taken as a LaTeX support tool, I was mistaken by its name and thought it was a community where one could just asks for suggestions and not only "solutions".
SkippyleGrandGourou
Posts: 7
Joined: Wed Sep 01, 2010 3:58 pm

An introduction within the bibliography

Post by SkippyleGrandGourou »

BTW, here is a workaround that seems to work — well, actually it works in my case, since I use different bibliography styles for the different bibliography sections : add to the .bst file the function

Code: Select all

FUNCTION {mypreamble}
{
  "\item[]" write$ newline$
  "Some text." write$ newline$
}
Replace "Some text." with whatever you want — I suggest to read part 1, section 4.3 of Tame the BeaST for the page setting. The call to \item is needed to prevent compilation error, since \thebibliography is a list environment (read Tame the BeaST).

Then, add the command

Code: Select all

EXECUTE {mypreamble}
in the .bst file, just after the command

Code: Select all

EXECUTE {begin.bib}
(where begin.bib is the function that writes \begin{thebibliography}, I guess its name must be used by most styles ?).

Finaly, enjoy. :)

PS : I'll mark this topic as solved, even though one could probably elaborate on that and make things more clean and flexible, as it is sufficient for my purposes.
meho_r
Posts: 823
Joined: Tue Aug 07, 2007 5:28 pm

Re: An introduction within the bibliography

Post by meho_r »

I apologize if you were offended, it wasn't my intention at all. I just pointed out that, although this is a LaTeX community, there are rules which should be followed, and which are in interest of all of us, especially those who actually ask the question. A Minimal working example is simply a must, not only because it saves a lot of time and unnecessary guessing to those who would test the code and probably suggest a solution, but it also provides all necessary infos and reveal potential errors/problems which otherwise may stay hidden.
SkippyleGrandGourou
Posts: 7
Joined: Wed Sep 01, 2010 3:58 pm

An introduction within the bibliography

Post by SkippyleGrandGourou »

I agree on the need to give an example when there is a problem to solve, which is exactly what I did here. But in the present case there was no specific problem, just a vague question on the possible means to achieve some goal, which does not need any (code) example, and to which any suggestion may help.

Apologies accepted, but next time do not bite the newcomers. ;)
Post Reply