I use the thesis Lyx template
I went to generate the reference such as (author, year) and colored .
like showing in
I used the natbib
And my setting looks like:
but the generation look like this
Best Answer
To add the "round" option as an option to Natbib, put "round" in the "Options" text are of "Citation Style" in Document > Settings > Bibliography. Here is a screenshot:
Note that the above screenshot is for the latest version of LyX. If you do not have LyX version 2.3.0 or greater, perhaps just add "round" as a class option, in Document > Settings > Class Options > Custom.
To change the citation color, go to Document > Settings > PDF Properties make sure "Use Hyperref Support" is checked. Then, under "Additional Options", put "colorlinks=true,citecolor=red". Here is a screenshot:
For additional hyperref options related to color that you might be interested in, see e.g. here.
If you're writing the bibliography yourself, then you need to add a label for each item. Right click the grey box in the reference list where the citation key is written - highlighted by the red ellipse in the screenshot below - and choose Settings (the only option).
In the Label field write authorname(year)without a space before the parenthesis, e.g. Author(2012). Quoting the natbib manual:
oneself, such that it conforms to natbib.
This syntax looks as follows:
\bibitem[Jones et al.(1990)]{jon90}...
or alternatively
\bibitem[Jones et al.(1990)Jones, Baker, and Williams]{jon90}...
The text in square brackets contains the pieces of citation texts, the
short author list, Jones et al., the year 1990, and the optional long
author list Jones, Baker and Williams. If the long list is missing,
the short list will be used instead. The parentheses around the year
are not part of the text, but merely delimit the year from the author
lists. Round parentheses must always be used, even if square brackets
are wanted for the citations. And there must be no space before or
after the year parentheses, else it will become part of the author
list.
A well-known bibliography style that generates authoryear-style citation call-outs and uses & as the conjunction if the bib entry has exactly two authors (or editors) is agsm. This bibliography style is part of the harvard citation management package, but it's compatible with the natbib package as well.
Best Answer
To add the "round" option as an option to Natbib, put "round" in the "Options" text are of "Citation Style" in Document > Settings > Bibliography. Here is a screenshot:
Note that the above screenshot is for the latest version of LyX. If you do not have LyX version 2.3.0 or greater, perhaps just add "round" as a class option, in Document > Settings > Class Options > Custom.
To change the citation color, go to Document > Settings > PDF Properties make sure "Use Hyperref Support" is checked. Then, under "Additional Options", put "colorlinks=true,citecolor=red". Here is a screenshot:
For additional hyperref options related to color that you might be interested in, see e.g. here.