On 07/11/2011 6:01 PM, Murat Yildizoglu wrote:
The problem seems to be with natbib in my case. If I choose implicit in the
document bibtex properties and use harvard.sty with the agsm style for my
bibliography, it works.
I like the flexibility of Natbib for citing references.

While using natbib, I have tried plainnat and several authord-date bibtex
styles. Am I doing something stupid? Are these styles compatible with
Natbib (plainnat seems to be, given the information I have read in the
Natbib documentation pdf).

Very strange... Because I have been able to use natbib with LyX before, I
am very surprised by this problem. As you can see in the extracts of the
..bbl file I have attached, all main fields of the references (like title)
are transformed to "newblock" when I use Natbib + author-year in document
properties and plainnat in the references style box, at teh end of my
document.

2011/11/7 Julien Rioux<[email protected]>

On 04/11/2011 5:48 AM, Murat Yildizoglu wrote:

Hello,

I am converting a pure latex beamer to a Lyx beamer file. I get a very
strange error that puzzles me. I have searched the net and tried different
things in the exported Latex file, but if I keep the bibliography, the
problem remains. I do not know where to search any more and calling on
you,
hoping that you would have an idea about where to look.... I give the
corresponding elements below (follow the *** ).

**** The error I get:

] (./chap1intro-lyx.bbl


! LaTeX Error: \newblock undefined.


l.1 \begin{thebibliography}{3}



*** I can indeed see such instructions in the bbl file introduced by
Bibtex. I have choosen Natbib (author-year,plainat) in Lyx as the
bibliography style.


\begin{thebibliography}{3}

\providecommand{\natexlab}[1]{**#1}

\providecommand{\url}[1]{\**texttt{#1}}

\expandafter\ifx\csname urlstyle\endcsname\relax

   \providecommand{\doi}[1]{doi: #1}\else

   \providecommand{\doi}{doi: \begingroup \urlstyle{rm}\Url}\fi


\bibitem[Binmore(1999)]{**Binmore99}

Ken Binmore.

\newblock \emph{Jeux et Th\'eorie Des Jeux}.

\newblock De Boeck Universit\'e, Bruxelles, 1999.



*** The bibliography line at the bottom of the Latex file :

\lyxframeend{}\lyxframe{**Bibliographie}

\bibliographystyle{plainnat}

\bibliography{yildi,evol,**biblio}

  \lyxframeend{}

\end{document}


*** My preamble contains the following declarations (exported to
Latex(pdflatex) from Lyx) :


%% LyX 2.0.1 created this file. For more info, see http://www.lyx.org/.

%% Do not edit unless you really know what you are doing.

\documentclass[french]{beamer}

\usepackage[T1]{fontenc}

\usepackage[latin9]{inputenc}

\setcounter{secnumdepth}{3}

\setcounter{tocdepth}{3}

\usepackage{color}

\usepackage{babel}

\addto\extrasfrench{%

\providecommand{\og}{\**leavevmode\flqq~}%

\providecommand{\fg}{\ifdim\**lastskip>\z@\unskip\fi~\frqq}%

}

\usepackage{amsmath}

\usepackage{amssymb}

\usepackage{graphicx}

\usepackage[authoryear]{**natbib}

\ifx\hypersetup\undefined

\AtBeginDocument{%

\hypersetup{unicode=true,**pdfusetitle,

bookmarks=true,**bookmarksnumbered=false,**bookmarksopen=false,

breaklinks=false,pdfborder={0 0 0},backref=false,colorlinks=**true}

}

\else

\hypersetup{unicode=true,**pdfusetitle,

bookmarks=true,**bookmarksnumbered=false,**bookmarksopen=false,

breaklinks=false,pdfborder={0 0 0},backref=false,colorlinks=**true}

\fi

\makeatletter

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% Textclass specific LaTeX commands.

% this default might be overridden by plain title style

\newcommand\makebeamertitle{\**frame{\maketitle}}%

\AtBeginDocument{

\let\origtableofcontents=\**tableofcontents

\def\tableofcontents{\@**ifnextchar[{\**origtableofcontents}{\**
gobbletableofcontents}}

\def\gobbletableofcontents#1{\**origtableofcontents}

}

\usepackage{microtype}

\long\def\lyxframe#1{\@**lyxframe#1\@lyxframestop}%

\def\@lyxframe{\@ifnextchar<{\**@@lyxframe}{\@@lyxframe<*>}}%

\def\@@lyxframe<#1>{\@**ifnextchar[{\@@@lyxframe<#1>}{**
\@@@lyxframe<#1>[]}}

\def\@@@lyxframe<#1>[{\@**ifnextchar<{\@@@@@lyxframe<#1>**
[}{\@@@@lyxframe<#1>[<*>][}}

\def\@@@@@lyxframe<#1>[#2]{\@**ifnextchar[{\@@@@lyxframe<#1>[**
#2]}{\@@@@lyxframe<#1>[#2][]}}

\long\def\@@@@lyxframe<#1>[#2]**[#3]#4\@lyxframestop#5\**lyxframeend{%

\frame<#1>[#2][#3]{\**frametitle{#4}#5}}

\def\lyxframeend{} % In case there is a superfluous frame end

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% User specified LaTeX commands.


Hi,

If I remember correctly I think \newblock is usually defined by the BibTeX
style file (.bst file) just like \url, \doi, etc. If that's right then
you're seeing a bug in that style file.

You can quickly fix it by defining this command yourself in the preamble
of your document.

--
Julien





Hi Murat,

What I wrote earlier about \newblock being defined by the style file was wrong. It is defined by natbib.sty but somehow undefined when used together with beamer.cls; some googling revealed that this is a known incompatibility problem between natbib and beamer, and the solution is
\def\newblock{}
in the preamble.

Cheers,
Julien

Reply via email to