mirror of
https://git.lyx.org/repos/lyx.git
synced 2024-11-06 00:10:59 +00:00
4df02801a6
output, due to failure to clean the ids in the new citation stuff. I've solved this by allowing the citation format information to contain keys of the form "clean:key". This signals that we are to apply the html::cleanAttr() function to the key before returning it. I.e., we strip non-alphanumeric stuff, basically.
104 lines
3.0 KiB
Plaintext
104 lines
3.0 KiB
Plaintext
# \DeclareLyXModule[natbib.sty]{Natbib}
|
|
# DescriptionBegin
|
|
# Loads the LaTeX package natbib, a citation engine. Natbib supports
|
|
# both author-year and numerical styles for citations, automatic sorting
|
|
# and merging of numerical citations, annotations, capitalization of the
|
|
# `van' part of author names, shortened and full author lists, and more.
|
|
# DescriptionEnd
|
|
# Excludes: basic | jurabib
|
|
# Category: Citation engine
|
|
|
|
# Author: Julien Rioux <jrioux@lyx.org>
|
|
|
|
Format 45
|
|
|
|
Requires natbib
|
|
|
|
CiteEngineType authoryear|numerical
|
|
DefaultBiblio plainnat
|
|
|
|
CiteEngine authoryear
|
|
Citet*[][]
|
|
Citep*[][]
|
|
Citealt*[][]
|
|
Citealp*[][]
|
|
Citeauthor*[]
|
|
citeyear[]
|
|
citeyearpar[][]
|
|
nocite
|
|
End
|
|
|
|
CiteEngine numerical
|
|
Citep*[][]
|
|
Citealp*[][]
|
|
Citet*[][]
|
|
Citealt*[][]
|
|
Citeauthor*
|
|
citeyearpar[][]
|
|
citeyear
|
|
nocite
|
|
End
|
|
|
|
CiteFormat default
|
|
# translatable bits
|
|
_notcited not cited
|
|
_addtobib Add to bibliography only.
|
|
|
|
# macros
|
|
!open [
|
|
!sep ,
|
|
!close ]
|
|
|
|
!startlink {!<a href='#LyXCite-%clean:key%'>!}
|
|
!endlink {!</a>!}
|
|
|
|
!nextauthor {%next%[[%!sep% %!startlink%%!abbrvauthor%%!endlink%%!nextauthor%]]}
|
|
!nextkey {%next%[[%!sep% %key%%!nextkey%]]}
|
|
!nextyear {%next%[[%!sep% %!startlink%%!year%%!endlink%%!nextyear%]]}
|
|
|
|
!abbrvauthor {%abbrvauthor%[[%abbrvauthor%]][[??]]}
|
|
!textbefore {%textbefore%[[%textbefore% ]]}
|
|
!textafter {%textafter%[[, %textafter%]]}
|
|
!year {%year%[[%year%]][[??]]}
|
|
|
|
# cite styles
|
|
citet %!citet%%!textafter%%!close%
|
|
citealt %!citealt%%!textafter%
|
|
citeyearpar %!open%%!textbefore%%!startlink%%!year%%!endlink%%!nextyear%%!textafter%%!close%
|
|
nocite {%dialog%[[%_addtobib%]][[%key%%!nextkey% (%_notcited%)]]}
|
|
End
|
|
|
|
CiteFormat authoryear
|
|
!citet %!startlink%%!abbrvauthor%%!endlink% %!open%%!textbefore%%!year%%!nextcitet%
|
|
!citealt %!startlink%%!abbrvauthor% %!textbefore%%!year%%!endlink%%!nextcitealt%
|
|
!citealp %!startlink%%!abbrvauthor%, %!year%%!endlink%%!nextcitealp%
|
|
|
|
!nextcitet {%next%[[%!close%%!sep% %!citet%]]}
|
|
!nextcitealt {%next%[[%!sep% %!citealt%]]}
|
|
!nextcitealp {%next%[[%!sep% %!citealp%]]}
|
|
|
|
cite %!citet%%!textafter%%!close%
|
|
citep %!open%%!textbefore%%!citealp%%!textafter%%!close%
|
|
citealp %!textbefore%%!citealp%%!textafter%
|
|
citeauthor %!startlink%%!abbrvauthor%%!endlink%%!nextauthor%%!textafter%
|
|
citeyear %!startlink%%!year%%!endlink%%!nextyear%%!textafter%
|
|
End
|
|
|
|
CiteFormat numerical
|
|
!citet %!abbrvauthor% %!open%%!textbefore%{%dialog%[[#ID]][[%!startlink%#%key%%!endlink%]]}%!nextcitet%
|
|
!citealt %!abbrvauthor% %!textbefore%{%dialog%[[#ID]][[%!startlink%#%key%%!endlink%]]}%!nextcitealt%
|
|
|
|
!hashkey {%dialog%[[#ID]][[%!startlink%#%key%%!endlink%%!nexthashkey%]]}
|
|
|
|
!nextcitet {%next%[[%!close%%!sep% %!citet%]]}
|
|
!nextcitealt {%next%[[%!sep% %!citealt%]]}
|
|
!nexthashid {%next%[[%!sep% #ID%!nexthashid%]]}
|
|
!nexthashkey {%next%[[%!sep% %!startlink%#%key%%!endlink%%!nexthashkey%]]}
|
|
|
|
cite %!open%%!textbefore%%!hashkey%%!textafter%%!close%
|
|
citep %!open%%!textbefore%%!hashkey%%!textafter%%!close%
|
|
citealp %!textbefore%%!hashkey%%!textafter%
|
|
citeauthor %!startlink%%!abbrvauthor%%!endlink%%!nextauthor%
|
|
citeyear %!startlink%%!year%%!endlink%%!nextyear%
|
|
End
|