lyx_mirror/lib/citeengines/natbib.citeengine

152 lines
5.3 KiB
Plaintext
Raw Normal View History

# \DeclareLyXCiteEngine[natbib.sty]{Natbib (BibTeX)}
# DescriptionBegin
# Natbib supports a range of both author-year and numerical styles mainly
2017-01-01 07:36:13 +00:00
# aimed at the Humanities. It features 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 | biblatex
# Author: Julien Rioux <jrioux@lyx.org>
2016-10-22 07:25:01 +00:00
Format 62
Requires natbib
CiteFramework bibtex
CiteEngineType authoryear|numerical
DefaultBiblio authoryear:plainnat|numerical: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.
# A link that lets us jump to the bibliography entry in LyXHTML
# %clean:key% will be substituted by the cite key to give a unique id
!startlink {!<a href='#LyXCite-%clean:key%'>!}
!endlink {!</a>!}
# Abbreviated author (with et al.) or "??" if there is no author
!abbrvauthor {%abbrvauthor%[[%abbrvauthor%]][[??]]}
# Prenote: "cf. "
!textbefore {%textbefore%[[%textbefore% ]]}
# Postnote: ", p. xx"
!textafter {%textafter%[[, %textafter%]]}
# Add a year if it exists (else "??") and possibly a modifier (as in 2017a)
!year {%year%[[%year%]][[??]]}{%modifier%[[%modifier%]]}
# ...; Author...
!nextauthor {%next%[[%!sep% %!startlink%%!abbrvauthor%%!endlink%%!nextauthor%]]}
# ..., CiteKey...
!nextkey {%next%[[%!sep% %key%%!nextkey%]]}
# ..., Year...
!nextyear {%next%[[%!sep% %!startlink%%!year%%!endlink%%!nextyear%]]}
## The actual cite styles (identical in authoryear and numerical except for the separator) ##
# (cf. Year; NextYear, p. xx) [Authoryear] / (cf. Year, NextYear, p. xx) [Numerical]
citeyearpar %!open%%!textbefore%%!startlink%%!year%%!endlink%%!nextyear%%!textafter%%!close%
# Add to bibliography only. / [ID] (not cited)
nocite {%dialog%[[%_addtobib%]][[%key%%!nextkey% (%_notcited%)]]}
End
CiteFormat authoryear
# Macros
!open (
!sep ;
!close )
# Author et al. (cf. Year...
!makecitet %!startlink%%!abbrvauthor%%!endlink% %!open%%!textbefore%%!year%%!nextcitet%
# Author et al. cf. Year... [sic!]
!makecitealt %!startlink%%!abbrvauthor% %!textbefore%%!year%%!endlink%%!nextcitealt%
# Author et al., Year...
!makecitealp %!startlink%%!abbrvauthor%, %!year%%!endlink%%!nextcitealp%
# ...); Nextauthor (Year...
!nextcitet {%next%[[%!close%%!sep% %!startlink%%!abbrvauthor%%!endlink% %!open%%!year%%!nextcitet%]]}
# ...; NextAuthor et al. Year...
!nextcitealt {%next%[[%!sep% %!makecitealt%]]}
# ...; NextAuthor et al., Year...
!nextcitealp {%next%[[%!sep% %!makecitealp%]]}
## The actual cite styles (additions and modifications to default) ##
# Author (cf. Year); NextAuthor (Year, p. xx)
citet %!makecitet%%!textafter%%!close%
# (cf. Author et al., Year; NextAuthor et al., Year, p. xx)
citep %!open%%!textbefore%%!makecitealp%%!textafter%%!close%
# cf. Author et al., Year; NextAuthor et al., Year, p. xx
citealp %!textbefore%%!makecitealp%%!textafter%
# Author cf. Year; NextAuthor Year, p. xx [sic!]
citealt %!makecitealt%%!textafter%
# Author; NextAuthor, p. xx
citeauthor %!startlink%%!abbrvauthor%%!endlink%%!nextauthor%%!textafter%
# Year; NextYear, p. xx
citeyear %!startlink%%!year%%!endlink%%!nextyear%%!textafter%
# Fallback style: Author (cf. Year); NextAuthor (Year, p. xx)
cite %!makecitet%%!textafter%%!close%
End
CiteFormat numerical
# Macros
!open [
!sep ,
!close ]
# Author [cf. ID...
!makecitet %!abbrvauthor% %!open%%!textbefore%{%dialog%[[#ID]][[%!startlink%{%numericallabel%[[%numericallabel%]][[#%key%]]}%!endlink%]]}%!nextcitet%
# Author cf. ID...
!makecitealt %!abbrvauthor% %!textbefore%{%dialog%[[#ID]][[%!startlink%{%numericallabel%[[%numericallabel%]][[#%key%]]}%!endlink%]]}%!nextcitealt%
# ID...
!hashkey {%dialog%[[#ID]][[%!startlink%{%numericallabel%[[%numericallabel%]][[#%key%]]}%!endlink%%!nexthashkey%]]}
# ...], NextAuthor [ID...
!nextcitet {%next%[[%!close%%!sep% %!abbrvauthor% %!open%%!textbefore%{%dialog%[[#ID]][[%!startlink%{%numericallabel%[[%numericallabel%]][[#%key%]]}%!endlink%]]}%!nextcitet%]]}
# ..., NextAuthor ID...
!nextcitealt {%next%[[%!sep% %!abbrvauthor% {%dialog%[[#ID]][[%!startlink%{%numericallabel%[[%numericallabel%]][[#%key%]]}%!endlink%]]}%!nextcitealt%]]}
# FIXME: What is this?
!nexthashid {%next%[[%!sep% #ID%!nexthashid%]]}
# ..., NextID...
!nexthashkey {%next%[[%!sep% %!startlink%{%numericallabel%[[%numericallabel%]][[#%key%]]}%!endlink%%!nexthashkey%]]}
## The actual cite styles (additions and modifications to default) ##
# [cf. ID, NextID, p. xx]
citep %!open%%!textbefore%%!hashkey%%!textafter%%!close%
# Author [cf. ID], Nextauthor [NextID, p. xx]
citet %!makecitet%%!textafter%%!close%
# cf. ID, NextID, p. xx
citealp %!textbefore%%!hashkey%%!textafter%
# Author cf. ID, NextAuthor ID, p. xx
citealt %!makecitealt%%!textafter%
# Author, NextAuthor
citeauthor %!startlink%%!abbrvauthor%%!endlink%%!nextauthor%
# Year, NextYear
citeyear %!startlink%%!year%%!endlink%%!nextyear%
# Fallback style: [cf. ID, NextID, p. xx]
cite %!open%%!textbefore%%!hashkey%%!textafter%%!close%
End