LyXLyx + Biblatex + Headers formating problems

Information and discussion about LyX, a WYSIWYM editor, available for Linux, Windows and Mac OS X systems.
Post Reply
bizwoo
Posts: 2
Joined: Tue Oct 21, 2008 8:10 pm

Lyx + Biblatex + Headers formating problems

Post by bizwoo »

Hi All

I have just started to use Lyx for writing my first year PhD report and I am having some problems which I hope you can help me to solve.

I followed all the procedures to install biblatex and use it with Lyx. It is working great now and I have managed to edit the biblatex style to suit my requirements.

However I am having basically two problems:

1. When using the \printbibliography command in ERT I have also to add the following commands before it so that the bibliography is showed in a new page and accounted for the TOC.

Code: Select all

\clearpage
\addcontentsline{toc}{chapter}{\numberline{}{Bibliography}}
This works fine but when the bibliography has more than one page the header (which is done using fancy header and works fine to all other pages) is shown in Uppercase although as I said the fancy header package is configure to show the headers in lowercase (both chapters and sections) and works fine with all other pages. So instead of showing 'Bibliography' it displays 'BIBLIOGRAPHY'.

The fancy header commands, in case are needed are:

Code: Select all

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\pagestyle{fancy}
\renewcommand{\chaptermark}[1]{\markright{\chaptername\ \thechapter.\ #1}}
\renewcommand{\sectionmark}[1]{\markright{\thesection.\ #1}{}}
\lhead[\fancyplain{}{}]%
{\fancyplain{}{\bfseries\rightmark}}
\chead[\fancyplain{}{}]%
{\fancyplain{}{}}
\rhead[\fancyplain{}{}]%
{\fancyplain{}{\bfseries\thepage}}
\lfoot[\fancyplain{}{}]%
{\fancyplain{}{}}
\cfoot[\fancyplain{}{}]%
{\fancyplain{}{}}
\rfoot[\fancyplain{}{}]%
{\fancyplain{}{\bfseries\today}}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2. The second problems has to do with the output bibliography format from biblatex.I am using Author-year style but each item in the bibliography seems to be displayed unaligned in reference to each other. I do not whether it is clear but it seems that each item (reference) has its own indentation for the first line (please see the following imaage if you can)

<img src="http://lh3.ggpht.com/jaaponte/SP4iwCIU15I/AAAAAAAADqQ/olzc_xUjkZs/s400/bio.jpg">

Hope you see what I mean. I do not know what is happening here but each time I change the fonts the errors in the indentation seems to change between the items. For instance if Author one was in the right position now it is wrong but Author two is OK and so on.

Well, hopefully someone will be able to help me.

Thanks in advance.

Recommended reading 2024:

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

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

User avatar
Maksi
Posts: 52
Joined: Sun Mar 16, 2008 12:12 pm

Re: Lyx + Biblatex + Headers formating problems

Post by Maksi »

Just some basic questions:

What document class do you use? In Memoir (and other book classes), the bibliography should automatically start a new page. I personally have no problems with Memoir and biblatex.

What are your other settings, e.g. for the header?

These questions refer to your settings in LyX -> Document -> Settings. When you click around there, LyX automatically loads some typical packages in the background, so there might always be conflicts if you have different settings in the settings dialogue and the LaTeX preamble. If you are comfortable enough in LaTeX, take a look at your LyX-file in a text editor to see the preamble that LyX generates depending on your settings.
A Humanities user of LaTeX :)
bizwoo
Posts: 2
Joined: Tue Oct 21, 2008 8:10 pm

Lyx + Biblatex + Headers formating problems

Post by bizwoo »

Hi Maksi thanks for your replay.
I am using a report class. However the preamble I am using is meant to modify the class so that it becomes close to the university requirements. I got this preamble as a thesis template for Lyx from the thesis-template website. It is quite near to what my Uni requirements are and so I started with it. Before I used biblatex it was fine with the header in the bibliography. However the template used a redefined bibliography for the report.cls which worked fine with natbib but of course I had to eliminated it as I am using now biblatex.

As I said before the bibliography is the only part presenting the problem with the header in uppercase.

I have never used latex before and that is why I am trying to use Lyx for my report. I had a look of the header as you recommended but I do not see anything wrong. I am putting all it down so you might have a look if you like.

I have been trying to find a solution since I started this tread however I am still at the beginning so all the help will be much appreciate.

Thank you...

Code: Select all

#LyX 1.6.0rc3 created this file. For more info see http://www.lyx.org/
\lyxformat 340
\begin_document
\begin_header
\textclass bblreport
\begin_preamble
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%  This is preamble.tex file should be put %
%  in the latex preamble in Lyx to set up  %
%  the format of your thesis               %
%  No Copyright for this file              %
%  Save your time and enjoy it             %
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%                                   %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%
% Biblatex 
%%%%%%%%%%%%%%%%%%%%%%%%%%
%\usepackage[style=authoryear,hyperref]{biblatex}
%\usepackage[style=authoryear,natbib=true]{biblatex}
\usepackage[bibstyle=authoryear-comp, citestyle=authoryear-comp, natbib=true, sorting=nyt, sortcites=true, firstinits=true]{biblatex}
\bibliography{mylibrary}
\usepackage[babel]{csquotes}
\ExecuteBibliographyOptions{minnames=1, maxnames=2}
\DefineBibliographyStrings{british}{%
{urlseen = {Accessed on}}}
\setlength{\bibhang}{1cm}  
\setlength{\biblabelsep}{1cm} 
\setlength{\bibitemextrasep}{0.2cm} 
%%%%%%%%%%%%%%%%%%%%%%%%%%

\setlength{\voffset}{-1in}  
\setlength{\marginparsep}{0in}  
\setlength{\marginparwidth}{0in}  
\setlength{\marginparpush}{0in}  
\setlength{\hoffset}{-1in}  
\setlength{\oddsidemargin}{3.8cm}  
\setlength{\evensidemargin}{0cm} 
\setlength{\textwidth}{15cm}
\setlength{\topmargin}{2cm}
\setlength{\headheight}{15pt}
\setlength{\headsep}{16pt}
\setlength{\textheight}{23.8cm}
\setlength{\footskip}{18pt}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%  Redefine \tableofcontents in report.cls
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\makeatletter
\renewcommand\tableofcontents{%
    \if@twocolumn
      \@restonecoltrue\onecolumn
    \else
      \@restonecolfalse
    \fi
    \chapter*{\contentsname
      \@mkboth{\contentsname}{\contentsname}}%
    \@starttoc{toc}%
    \if@restonecol\twocolumn\fi
    }

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%  Redefine \listoffigures in report.cls
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\renewcommand\listoffigures{%
    \if@twocolumn
      \@restonecoltrue\onecolumn
    \else
      \@restonecolfalse
    \fi
    \chapter*{\listfigurename
      \@mkboth{\listfigurename}{\listfigurename}}%
    \@starttoc{lof}%
    \if@restonecol\twocolumn\fi
    }

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%  Redefine \listoftables in report.cls
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\renewcommand\listoftables{%
    \if@twocolumn
      \@restonecoltrue\onecolumn
    \else
      \@restonecolfalse
    \fi
    \chapter*{\listtablename
      \@mkboth{\listtablename}{\listtablename}}%
    \@starttoc{lot}%
    \if@restonecol\twocolumn\fi
    }

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%  Redefine thebibliograph in report.cls
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%\renewenvironment{thebibliography}[1]
%    {\chapter*{\bibname
 %     \@mkboth{\bibname}{\bibname}}%
%    \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}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%  Put packages you want to use
%  here and 'fancyhdr' is required  
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\usepackage{fancyhdr}
\usepackage{epsfig}
%\usepackage{cite}
\usepackage{graphicx}
\usepackage{amsmath}
\usepackage{theorem}
\usepackage{amssymb}
\usepackage{latexsym}
\usepackage{epic}
\usepackage{setspace}
\usepackage{psfrag}
\usepackage{url}
%\usepackage{lmodern}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%    Set line spacing = 1.5 here 
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\renewcommand{\baselinestretch}{1.5}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%         Your fancy heading 
% For the final copy you need to remove 
%       '\bfseries\today' below 
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\pagestyle{fancy}
\renewcommand{\chaptermark}[1]{\markright{\chaptername\ \thechapter.\ #1}}
\renewcommand{\sectionmark}[1]{\markright{\thesection.\ #1}{}}
\lhead[\fancyplain{}{}]%
     {\fancyplain{}{\bfseries\rightmark}}
\chead[\fancyplain{}{}]%
    {\fancyplain{}{}}
\rhead[\fancyplain{}{}]%
     {\fancyplain{}{\bfseries\thepage}}
\lfoot[\fancyplain{}{}]%
     {\fancyplain{}{}}
\cfoot[\fancyplain{}{}]%
    {\fancyplain{}{}}
\rfoot[\fancyplain{}{}]%
     {\fancyplain{}{\bfseries\today}}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%  Here you set the space between the main 
%  text and the start of the footnote
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\addtolength{\skip\footins}{5mm}


%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%  Define new counter so you can have 
%  the equation number 4.2.1a for example, 
%  this a gift from J.F.Blowey 
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\newcounter{ind}
\def\eqlabon{
\setcounter{ind}{\value{equation}}\addtocounter{ind}{1}
\setcounter{equation}{0}
\renewcommand{\theequation}{\arabic{chapter}%
         .\arabic{section}.\arabic{ind}\alph{equation}}}
\def\eqlaboff{
\renewcommand{\theequation}{\arabic{chapter}%
         .\arabic{section}.\arabic{equation}}
\setcounter{equation}{\value{ind}}}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%  New theorem you want to use
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
{\theorembodyfont{\rmfamily}%
   \newtheorem{Pro}{{\textbf Proposition}}[section]}
{\theorembodyfont{\rmfamily}%
   \newtheorem{The}{{\textbf Theorem}}[section]}
{\theorembodyfont{\rmfamily}%
   \newtheorem{Def}[The]{{\textbf Definition}}}
{\theorembodyfont{\rmfamily}%
   \newtheorem{Cor}[The]{{\textbf Corollary}}}
{\theorembodyfont{\rmfamily}%
   \newtheorem{Lem}[The]{{\textbf Lemma}}}
{\theorembodyfont{\rmfamily}%
   \newtheorem{Exp}{{\textbf Example}}[section]}
\def\remark{\textbf{Remark}:}
\def\remarks{\textbf{Remarks}:}
\def\bproof{\textbf{Proof}: }
\def\eproof{\hfill$\Box$}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%  Bold font in math mode, a gift from J.F.Blowey
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\def\bv#1{\mbox{\boldmath$#1$}}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%   New symbol which is not defined in Latex
%   a gift from J.F.Blowey
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% The Mean INTegral
% to be used in displaystyle
\def\mint{\textstyle\mints\displaystyle}
% to be used in textstyle
\def\mints{\int\!\!\!\!\!\!{\rm-}\ }
%
% The Mean SUM
% to be used in displaystyle
\def\msum{\textstyle\msums\displaystyle}
% to be used in textstyle
\def\msums{\sum\!\!\!\!\!\!\!{\rm-}\ }

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%  Define your short cut here
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\def\poincare{Poincar\'e }
\def\holder{H\"older }


\end_preamble
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\language english
\inputencoding auto
\font_roman cmr
\font_sans default
\font_typewriter default
\font_default_family rmdefault
\font_sc false
\font_osf false
\font_sf_scale 100
\font_tt_scale 100

\graphics default
\paperfontsize 12
%\spacing single
\use_hyperref true
\pdf_bookmarks true
\pdf_bookmarksnumbered false
\pdf_bookmarksopen false
\pdf_bookmarksopenlevel 1
\pdf_breaklinks false
\pdf_pdfborder true
\pdf_colorlinks false
\pdf_backref false
\pdf_pagebackref false
\pdf_pdfusetitle true
\papersize a4paper
\use_geometry false
%\use_amsmath 1
%\use_esint 0
\cite_engine natbib_authoryear
\use_bibtopic false
\paperorientation portrait
\secnumdepth 3
\tocdepth 3
\paragraph_separation indent
\defskip smallskip
\quotes_language english
\papercolumns 1
\papersides 1
\paperpagestyle default
\bullet 1 0 9 -1
\tracking_changes false
\output_changes false
\author "" 
\author "" 
\end_header
Post Reply