0

I use the thesis Lyx template I went to generate the reference such as (author, year) and colored . like showing in enter image description here

I used the natbib And my setting looks like:enter image description here

but the generation look like this enter image description here

  • Welcome to TeX.SE. You need to (a) specify the package option round while loading natbib and (b) write \citep instead of \citet (or \cite). – Mico Jun 10 '18 at 11:33
  • thnak you for your answer, but i didn't understand what to do exactly, I m new with lyx, how can i specify the package option "round" ? and where i write "\citep "? – hajer jomaa Jun 10 '18 at 11:46
  • Sorry, I somehow overlooked the fact that you use lyx. I don't use lyx myself, 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
0

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:

enter image description here

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:

enter image description here

For additional hyperref options related to color that you might be interested in, see e.g. here.

| improve this answer | |
  • 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: 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
0

@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}
}
| improve this answer | |

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.