3

I am writing my master thesis using Lyx and I don't know how it would be the best way to set up my bibliography due to the requirements by the university. The Bibliography has to be arranged alphabetically making subsections for each source type and has to use the Harvard Referencing System including the citation style (author,year). As I advance writing I have tried out to find the best way, but I have struggled to find out how it would be the best way. How would you guys do it and what would I have to do to be able to implement it. I am building up my .bib file and try to use natbib but it does not work. I appreciate any suggestions, as it is my first time using Lyx and I wrote my Diploma thesis in physics about 8 years ago.

  • I don't have time for a proper answer now, but you can do this with biblatex I think. See wiki.lyx.org/BibTeX/Biblatex for how to use biblatex in LyX, and tex.stackexchange.com/questions/6959/… for the problem of sorting by type. You also want style=authoryear in the options to biblatex. – Torbjørn T. Nov 21 '13 at 11:34
  • There are plenty of solutions to do what you want on the web (and on SE). And if you are stuck on a certain point, go back to us. – ppr Nov 22 '13 at 13:56
4

If I understand you correctly, you can do this with biblatex, which is a quite new LaTeX package for dealing with bibliographies. As LyX hasn't built in support for this in the GUI yet, there is some initial setup required. The information in this answer comes from two sources:

  1. The LyX wiki: http://wiki.lyx.org/BibTeX/Biblatex

  2. Sorting the bibliography by entry type

Setting up LyX for biblatex

You have to install a biblatex module, which is can be downloaded at http://wiki.lyx.org/uploads/BibTeX/biblatex.module Place the biblatex.module file in the layouts folder in the LyX user directory, the location of which is listed in Help --> About LyX. Reconfigure and restart LyX.

Change document settings

Go to Document --> Settings, and do the following:

  1. Under Modules, add the Biblatex-citation-styles module.

  2. Under Bibliography, change

    1. Processor to biber

    2. Citation to Natbib, and Natbib style to Author-year

    enter image description here

  3. Under LaTeX Preamble, add the following:

    \usepackage[style=authoryear, natbib=true]{biblatex}
    \addbibresource{path/to/your/bibfile.bib}
    

    of course changing the path to the bib-file. I think you need the complete path, and the file ending must be included.

In the document

To be able to use the LyX GUI to add citations, you have to trick LyX to search that file by first adding a LyX Note with Insert --> Note --> LyX Note, and then do Insert --> List/ToC --> BibTeX bibliography with the cursor inside the note.

Add an unnumbered (or numbered, depending on requirements) chapter (or section, if you're using an article-class) heading, called Bibliography or References, or whatever you like. Then you have to add something like

\printbibliography[type=book,title={Books},heading=subbibliography]    
\printbibliography[type=article,title={Articles},heading=subbibliography]    
\printbibliography[nottype=book,nottype=article,title={Miscellaneous},heading=subbibliography]

in an ERT (Insert --> TeX Code, or Ctrl + L) where you want to print the reference lists. Note the type=<reference type>, which defines that the reference list printed there has only one type of source, and the title=Something that changes the heading of the reference list. You have to add one \printbibliography for each type of source.

heading=subbibliography causes the heading to be typeset with a heading that is one level below the highest level. That is, section for book or report classes (where chapter is the highest), or subsection for article classes (where section is the highest).

In the last one nottype is used instead, which prints everything that does not have the specified entry type. Note there is one such for article, one for book.

Image example. Here I added three citations from biblatex-examples.bib, one book, one article, and one something else:

enter image description here

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.