I use the thesis Lyx template
I went to generate the reference such as (author, year) and colored .
like showing in 
2 Answers
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.
- 13,164
-
hi, thank you a lot for your answer. I used lyx 2.2. The color of the the reference worked for me. The format of the reference changed from [] to () like this "Abgrall et al. (2006) " but for me i went them in this format "(Abgrall et al., 2006)" can you help please – hajer jomaa Jun 10 '18 at 20:23
-
@hajerjomaa ah I see. In that case, just right-click on each citation in LyX. Then select the one that you want. – scottkosty Jun 10 '18 at 21:00
-
thank you for your answer , when i just right click , i dont have many options , i just have this [#ID] ? – hajer jomaa Jun 13 '18 at 13:13
-
I'm not sure why that happens. It works for me. I can look into it if you provide a minimal .lyx file and a corresponding minimal .bib file. Please read the following: https://wiki.lyx.org/FAQ/MinimalExample – scottkosty Jun 13 '18 at 17:10
-
thank you for you suggstion, how can i send you the file ?, i coudn't find an option to attach a file to a post.
thank you
– hajer jomaa Jun 14 '18 at 10:56 -
@hajerjomaa please read the link. See the section "How do I post a .lyx file...". The same is true for the .bib file. – scottkosty Jun 14 '18 at 16:23
-
@hajerjomaa thanks for your time on that, but your files were far from minimal examples. Could you please read the entire page on a minimal example that I linked to above and referenced again? I think that would save both of us some time, and would help you get help on future posts as well. There are so many things in your .lyx file that I do not think are related to the issue. You have ERT, page breaks, LyX notes, headers, nomenclature. I don't think those are related to this issue. – scottkosty Jun 16 '18 at 19:02
-
I had set some time for today to look at this issue, but when I tried to compile theis.lyx, I got an error "I couldn't open database file thesisExample.bib". If you post minimal examples, I will set some more time to take a look. A few other suggestions: you posted your files in an "answer". Did you mean to edit your post? (or maybe this requires more reputation?). Also, please do not use spaces in file names (e.g. "my collection.bib" -> "myCollection.bib"). – scottkosty Jun 16 '18 at 19:03
-
first, thank you for your time, I put it in the answer because it is more clear, the minimal example is still long because I used the thesis template of lyx and I think that maybe the error is related to that. I tried to give you another minimal example, I hope that will work for you – hajer jomaa Jun 17 '18 at 08:31
-
@ scottkosty I apologize for my insistence ? But i still waiting fir you answer – hajer jomaa Jun 25 '18 at 10:56
-
@hajerjomaa When I open your example file, I get the following from LyX: "There are spaces in the paths to your BibTeX databases. BibTeX will be unable to find them." Maybe that causes problems? – scottkosty Jun 25 '18 at 15:56
-
@ scottkosty thank you for your answer, but what do you mean sapaces in the paths, how can i remove them ? – hajer jomaa Jun 28 '18 at 09:27
-
@hajerjomaa that is just the message the LyX displays. I suggested to remove spaces in my comment above, by renaming "my collection.bib" to "myCollection.bib". Does that fix anything by chance? – scottkosty Jun 28 '18 at 16:56
-
@ scottkosty i tried but nothing change, but thank you a lot for your answer a, at least part of my problem are solved – hajer jomaa Jun 30 '18 at 06:40
-
@hajerjomaa it works for me (I get round and red). Let me know if you want to see the PDF that I get. I'm not sure what else could be wrong. Perhaps you need to update your TeX installation. Sorry for this frustrating issue. – scottkosty Jul 01 '18 at 00:47
-
@ scottkosty thank you for your answer again , but i really tried every thing – hajer jomaa Jul 02 '18 at 09:45
@scottkosty this is the minimal example, like you suggest. I tried my best to make it shortas possible thesis .lyx : is the main thesis, in which you find the part of the thesis. you have to excute this file
rapport0.lyx :is the first chapter and in which you find the refernces
collection.bib: the bibio
1/theis.lyx
#LyX 2.2 created this file. For more info see http://www.lyx.org/
\lyxformat 508
\begin_document
\begin_header
\save_transient_properties true
\origin unavailable
\textclass scrbook
\options intoc,bibliography=totoc,index=totoc,BCOR10mm,captions=tableheading,titlepage,fleqn,round
\use_default_options true
\begin_modules
customHeadersFooters
\end_modules
\maintain_unincluded_children false
\language french
\language_package default
\inputencoding auto
\fontencoding global
\font_roman "lmodern" "default"
\font_sans "lmss" "default"
\font_typewriter "lmtt" "default"
\font_math "auto" "auto"
\font_default_family default
\use_non_tex_fonts false
\font_sc false
\font_osf false
\font_sf_scale 100 100
\font_tt_scale 100 100
\graphics default
\default_output_format default
\output_sync 0
\bibtex_command bibtex
\index_command default
\float_placement h
\paperfontsize 12
\spacing onehalf
\use_hyperref true
\pdf_bookmarks true
\pdf_bookmarksnumbered true
\pdf_bookmarksopen true
\pdf_bookmarksopenlevel 1
\pdf_breaklinks false
\pdf_pdfborder true
\pdf_colorlinks false
\pdf_backref false
\pdf_pdfusetitle true
\pdf_quoted_options "pdfpagelayout=OneColumn, pdfnewwindow=true, pdfstartview=XYZ, plainpages=false,colorlinks=true,citecolor=red,"
\papersize a4paper
\use_geometry false
\use_package amsmath 2
\use_package amssymb 2
\use_package cancel 0
\use_package esint 1
\use_package mathdots 1
\use_package mathtools 0
\use_package mhchem 1
\use_package stackrel 0
\use_package stmaryrd 0
\use_package undertilde 0
\cite_engine natbib
\cite_engine_type authoryear
\biblio_style plainnat
\use_bibtopic false
\use_indices false
\paperorientation portrait
\suppress_date true
\justification true
\use_refstyle 0
\branch chapter-1
\selected 1
\filename_suffix 0
\color #ffaa00
\end_branch
\branch chapter-2
\selected 1
\filename_suffix 0
\color #55aaff
\end_branch
\branch Summary
\selected 1
\filename_suffix 0
\color #7f7f7f
\end_branch
\branch Acknowledgments
\selected 1
\filename_suffix 0
\color #ffff00
\end_branch
\branch Appendix
\selected 1
\filename_suffix 0
\color #faf0e6
\end_branch
\branch chapter-3
\selected 0
\filename_suffix 0
\color #faf0e6
\end_branch
\branch intro
\selected 1
\filename_suffix 0
\color #faf0e6
\end_branch
\index Index
\shortcut idx
\color #008000
\end_index
\secnumdepth 3
\tocdepth 2
\paragraph_separation skip
\defskip medskip
\quotes_language french
\papercolumns 1
\papersides 2
\paperpagestyle fancy
\tracking_changes false
\output_changes false
\html_math_output 0
\html_css_as_file 0
\html_be_strict false
\end_header
\begin_body
\begin_layout Title
these exmple lyx references
\end_layout
\begin_layout Standard
\begin_inset Newpage cleardoublepage
\end_inset
\end_layout
\begin_layout Standard
\begin_inset Newpage cleardoublepage
\end_inset
\end_layout
\begin_layout Standard
\begin_inset Branch chapter-1
status open
\begin_layout Standard
\begin_inset CommandInset include
LatexCommand include
filename "rapport0.lyx"
\end_inset
\end_layout
\end_inset
\end_layout
\begin_layout Standard
\begin_inset Newpage cleardoublepage
\end_inset
\end_layout
\begin_layout Standard
\begin_inset CommandInset bibtex
LatexCommand bibtex
bibfiles "My Collection"
options "plainnat"
\end_inset
\end_layout
\begin_layout Standard
\begin_inset Newpage cleardoublepage
\end_inset
\end_layout
\begin_layout Standard
\begin_inset CommandInset nomencl_print
LatexCommand printnomenclature
set_width "custom"
width "2.5cm"
\end_inset
\end_layout
\end_body
\end_document
2/rapport0.lyx
#LyX 2.2 created this file. For more info see http://www.lyx.org/
\lyxformat 508
\begin_document
\begin_header
\save_transient_properties true
\origin unavailable
\textclass scrbook
\use_default_options true
\maintain_unincluded_children false
\language french
\language_package default
\inputencoding auto
\fontencoding global
\font_roman "default" "default"
\font_sans "default" "default"
\font_typewriter "default" "default"
\font_math "auto" "auto"
\font_default_family default
\use_non_tex_fonts false
\font_sc false
\font_osf false
\font_sf_scale 100 100
\font_tt_scale 100 100
\graphics default
\default_output_format default
\output_sync 0
\bibtex_command default
\index_command default
\paperfontsize 12
\spacing onehalf
\use_hyperref false
\papersize a4paper
\use_geometry true
\use_package amsmath 1
\use_package amssymb 1
\use_package cancel 1
\use_package esint 1
\use_package mathdots 1
\use_package mathtools 1
\use_package mhchem 1
\use_package stackrel 1
\use_package stmaryrd 1
\use_package undertilde 1
\cite_engine basic
\cite_engine_type default
\biblio_style plain
\use_bibtopic false
\use_indices false
\paperorientation portrait
\suppress_date false
\justification true
\use_refstyle 1
\index Index
\shortcut idx
\color #008000
\end_index
\topmargin 4cm
\bottommargin 4cm
\headheight 4cm
\headsep 4cm
\secnumdepth 2
\tocdepth 2
\paragraph_separation indent
\paragraph_indentation default
\quotes_language french
\papercolumns 1
\papersides 1
\paperpagestyle plain
\tracking_changes false
\output_changes false
\html_math_output 0
\html_css_as_file 0
\html_be_strict false
\end_header
\begin_body
\begin_layout Chapter
Contexte de travail
\end_layout
\begin_layout Standard
A minimal example is a file that is as
\begin_inset CommandInset citation
LatexCommand cite
key "Beyer2011"
\end_inset
small as possible while still showing the behavior that you are asking
about.
It should include as few dependencies as possible -- remove any unnecessary
pictures and external files.
It should be possible for someone to download your .lyx file and without
modification see the same r
\begin_inset CommandInset citation
LatexCommand cite
key "Beyer2011,Vanderhoek2012"
\end_inset
behavior that you are seeing.A minimal
\begin_inset CommandInset citation
LatexCommand cite
key "Huang2000,Laffon2008"
\end_inset
example is a .lyx file that is as small as possible while still showing
the behavior that you are asking about.
It should include as few dependencies as possible -- remove any unnecesA
minimal example is a .
\end_layout
\end_body
\end_document
3/My collection.bib
@book{Cyon1905,
address = {Paris},
author = {Cyon, Elie},
keywords = {cyon1905},
mendeley-tags = {cyon1905},
publisher = {Alcan},
title = {{Les nerfs du coeur, anatomie et physiologie avec une preface sur les rapports de la medecine avec la physiologie et la bacteriologie.}},
url = {http://www.worldcat.org/title/nerfs-du-coeur-anatomie-et-physiologie-avec-une-preface-sur-les-rapports-de-la-medecine-avec-la-physiologie-et-la-bacteriologie/oclc/11322947},
year = {1905}
}
@article{Beyer2011,
author = {Beyer, T. and Czernin, J. and Freudenberg, L. S.},
doi = {10.2967/jnumed.110.079624},
journal = {Journal of Nuclear Medicine},
keywords = {Beyer2011},
mendeley-tags = {Beyer2011},
month = {feb},
number = {2},
pages = {303--310},
pmid = {21233186},
title = {{Variations in Clinical PET/CT Operations: Results of an International Survey of Active PET/CT Users}},
url = {http://www.ncbi.nlm.nih.gov/pubmed/21233186},
volume = {52},
year = {2011}
}
@article{Vanderhoek2012,
author = {Vanderhoek, M. and Perlman, S. B. and Jeraj, R.},
doi = {10.2967/jnumed.111.093443},
journal = {Journal of Nuclear Medicine},
keywords = {Vanderhoek2012},
mendeley-tags = {Vanderhoek2012},
month = {jan},
number = {1},
pages = {4--11},
pmid = {22213818},
title = {{Impact of the Definition of Peak Standardized Uptake Value on Quantification of Treatment Response}},
url = {http://www.ncbi.nlm.nih.gov/pubmed/22213818},
volume = {53},
year = {2012}
}
@article{Huang2000,
author = {Huang, S C},
journal = {Nuclear medicine and biology},
keywords = {Huang2000},
mendeley-tags = {Huang2000},
month = {oct},
number = {7},
pages = {643--6},
pmid = {11091106},
title = {{Anatomy of SUV. Standardized uptake value.}},
url = {http://www.ncbi.nlm.nih.gov/pubmed/11091106},
volume = {27},
year = {2000}
}
@article{Laffon2008,
author = {Laffon, Eric and Cazeau, Anne-Laure and Monet, Antoine and {De Clermont}, Henri and Fernandez, Philippe and Marthan, Roger and Ducassou, Dominique},
doi = {10.2967/jnmt.107.049627},
journal = {J Nucl Med Technol},
keywords = {Laffon2008},
mendeley-tags = {Laffon2008},
pages = {200--202},
title = {{The Effect of Renal Failure on 18 F-FDG Uptake: A Theoretic Assessment}},
url = {http://tech.snmjournals.org/content/36/4/200.full.pdf},
volume = {36},
year = {2008}
}




roundwhile loadingnatbiband (b) write\citepinstead of\citet(or\cite). – Mico Jun 10 '18 at 11:33lyx. I don't uselyxmyself, so I don't know how to translate my earlier suggestions to lyx-speak. Hopefully, somebody else will step up. – Mico Jun 10 '18 at 12:08