1

I am using Lyx 2.1 with Harvard style referencing (Documents > Settings) but when I cite in the body of text, it renders something like following:

In Canada, the for-hire trucking activity increased by 6.2% between 2007 and 2010 [1].

However, I want it to render like this:

In Canada, the for-hire trucking activity increased by 6.2% between 2007 and 2010 (Transport Canada, 2012).

Please note that I generate a .bib file from Mendeley and use it as a bibliography database in Lyx.

4
  • 1
    Does going to Document > Settings > Bibliography and changing "Natbib style" to "Author-year" help? – scottkosty Jun 18 '14 at 1:54
  • Now I have the output as Transport Canada [2012]. I think I have to manually add parentheses. But how can I remove square brackets and add comma to make it look like this: Transport Canada, 2012 – umair durrani Jun 18 '14 at 17:00
  • @scottkosty If you add something about changing the type of citation, and adding round to natbibs options, you could undelete your answer. – Torbjørn T. Jul 4 '14 at 8:06
  • @TorbjørnT. ah I see. I will add a couple different ways. I'm not sure there is a best way to do this (please edit if you know of a better way) – scottkosty Jul 4 '14 at 13:47
2

a. Go to Document > Settings > Bibliography and change "Natbib style" to "Author-year".

To get (author, year) rather than author (year) right click the citation and choose the style of reference you want.

To get parentheses, we need to pass the "round" option to natbib. You can do this a few different ways. For example

  1. Do step a above and also in Document Settings > Document Class > Custom put "round" (without quotes). The reason that this works is that an class option not recognized by the class is passed on to the packages. The obvious side effect is that if other packages have a "round" option then it will be triggered as well.

  2. Do not do step (a) above and instead leave Document > Settings > Bibliography as "Default". Then go do Document > Settings > LaTeX Preamble and put \usepackage[round,authoryear]{natbib} the disadvantage to this is that LyX no longer knows you're using natbib.

  3. Do (2) and (a) above and in document > settings > local layout you can put the following to tell LyX not to load Natbib. See Help > Customization for more information.

    Format 31 Provides natbib 1

4
  • OK I will add as a comment. I thought this answered the question but I guess I misunderstood. Thanks for letting me know. – scottkosty Jun 18 '14 at 1:53
  • I took the liberty of adding a sentence. – Torbjørn T. Jul 4 '14 at 14:16
  • @TorbjørnT. Looks good. Please always take such liberty with my answers. – scottkosty Jul 4 '14 at 14:30
  • Another option is to do (a), then put \setcitestyle{round} into the preamble. Then LyX still knows that you're using natbib. – Sparhawk Jun 28 '17 at 8:14
1

I know this is an old post, but if someone run into this issue the following worked for me:

Go to Document > Settings > Bibliography and set Style format: Biblatex(natbib mode), Variant: Author-year, Biblatex citation style: authoryear, Biblatex bibliography style: authoryear, Processor: bibtex.

Then when you cite in the document, choose from the drop-down list under Formatting, Citation style: (Transport Canada, 2012).

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.