4

In a Beamer-Presentation I use Bibentry to print selected articles etc.

I have one problem: the title of each bibliographic entry is displayed as a hyperreference with a break afterwards.

ouput

How can I switch this off?

Here is the code:

\documentclass[10pt,a4paper]{beamer}
\ProcessOptionsBeamer
\mode<presentation>
\usepackage{natbib}
\usepackage{bibentry}
\usepackage{filecontents}
\begin{filecontents}{pwaLiterature.bib}
    @incollection{Garner2009,
        Address = {Oxford and New York, NY},
        Author = {Garner, Robert},
        Booktitle = {Introduction to Politics},
        Date-Added = {2014-10-06 07:40:47 +0000},
        Date-Modified = {2014-10-06 07:42:45 +0000},
        Editor = {Garner, Robert and Ferdinand, Peter and Lawson, Stephanie},
        Pages = {1-21},
        Publisher = {Oxford University Press},
        Title = {Introduction: The Nature of Politics and Political Analysis},
        Year = {2009}}
\end{filecontents}
\begin{document}
\nobibliography*

\frame{\frametitle{}
\begin{tabular}{p{.15\textwidth} p{.85\textwidth}}
                &   \hangindent=0.5cm \bibentry{Garner2009}.\\
\end{tabular}
}

\bibliographystyle{apalike2}
\nobibliography{pwaLiterature}
\end{document}
saldenisov
  • 2,485
feder80
  • 369
  • 4
  • 13
  • 1
    Please help us to help you and add a minimal working example (MWE) that illustrates your problem. It will be much easier for us to reproduce your situation and find out what the issue is when we see compilable code, starting with \documentclass{...} and ending with \end{document}. – samcarter_is_at_topanswers.xyz Oct 08 '14 at 09:12
  • The first edit isn't a minimal example yet. Please start by commenting out (and then removing) extra commands from the preamble, changing the bibliography style to something standard, and using a filecontents environment to show what goes in a single-item file the \bibitem is included from. It appears that the \newblock commands are responsible for the breaks, but no idea where a hyperlink would come from, or what it points to. As you make each change, see if the problem persists on recompiles. Eventually, you'll have a block of code that is much easier to analyze and test. – Mike Renfro Oct 08 '14 at 14:40
  • @MikeRenfo I've helped to feder80, I made MWE for him, but I could not help him with an answer:( – saldenisov Oct 09 '14 at 08:31
  • Thank you @saldenisov, now I know how to do it right the next time. – feder80 Oct 09 '14 at 19:24

2 Answers2

3

As Mike Renfro has already mentioned, the problem has something to do with the citation style, in this case apalike2.

The function for "incollection" is as follows:

FUNCTION {incollection}
{ output.bibitem
  format.authors "author" output.check
  author format.key output              % special for
  output.year.check                 % apalike
  new.block
  format.title "title" output.check
  new.block
  crossref missing$
    { eho.format.in.ed.booktitle "booktitle" output.check
    % The above line is changed by Eric Ho <eho@word> on Fri Jan 12
    % 19:20:28 1990 so that it'll call eho.format.in.ed.booktitle instead
    % of format.in.ed.booktitle.

      format.bvolume output
      format.number.series output
      format.chapter.pages eho.special.output
      new.sentence
%      publisher "publisher" output.check
%      address output
% switched order of publisher and address for incollection -- BJR 1/3/90
      address eho.output    % Use eho.output instead of output.
      publisher "publisher" eho.output.check    % Use eho.output.check instead
                        % of output.check.
      format.edition output
    }
    { format.incoll.inproc.crossref output.nonnull
      format.chapter.pages output
    }
  if$
  new.block
  note output
  fin.entry
}

This function called new.block must be the one, which is responsible for the break:

FUNCTION {new.block}
{ output.state before.all =
    'skip$
    { after.block 'output.state := }
  if$
}

By deleting it, I get the right output.

But why does the problem (without modifying apalike2) only appear in the beamer but not the article class?

\documentclass[10pt,a4paper]{article}
\usepackage[utf8]{inputenc}
\usepackage[english]{babel}
\usepackage{lmodern}
\usepackage{natbib}
\usepackage{bibentry} 
\usepackage{filecontents}
\begin{filecontents}{pwaLiterature.bib}
    @incollection{Garner2009,
        Address = {Oxford and New York, NY},
        Author = {Garner, Robert},
        Booktitle = {Introduction to Politics},
        Date-Added = {2014-10-06 07:40:47 +0000},
        Date-Modified = {2014-10-06 07:42:45 +0000},
        Editor = {Garner, Robert and Ferdinand, Peter and Lawson, Stephanie},
        Pages = {1-21},
        Publisher = {Oxford University Press},
        Title = {Introduction: The Nature of Politics and Political Analysis},
        Year = {2009}}
\end{filecontents}

\begin{document}
\nobibliography*
\begin{tabular}{p{.15\textwidth} p{.85\textwidth}}
            &   \hangindent=0.5cm \bibentry{Garner2009}.\\
\end{tabular}

\bibliographystyle{apalike2}
\nobibliography{pwaLiterature}
\end{document}
saldenisov
  • 2,485
feder80
  • 369
  • 4
  • 13
0

Try to comment new.block:

FUNCTION {incollection}
{ output.bibitem
  format.authors "author" output.check
  author format.key output              % special for
  output.year.check                 % apalike
  %new.block<-----------commented!!!!!!
  format.title "title" output.check
  new.block
  crossref missing$....
saldenisov
  • 2,485
  • Yes, as I have written in the answer to my question: by deleting (or commenting) the new.block parts, I get the right output. However, the question is still unanswered, why the beamer and the article class produce different outputs with the original style-file (including the new.block function). – feder80 Oct 12 '14 at 07:16