X-Git-Url: https://git.lyx.org/gitweb/?a=blobdiff_plain;f=lib%2Fciteengines%2Fnatbib.citeengine;h=ec3628d227266622c45bf693de33474e1f8f5cfc;hb=d4e30ad88f2967a2e464fd3a54a52feeb25e72f1;hp=0eee3cc840a0c9a68b7bbef86b81ced3492fbca8;hpb=979294d5ecd91f8831db234738f9e769966b391f;p=lyx.git diff --git a/lib/citeengines/natbib.citeengine b/lib/citeengines/natbib.citeengine index 0eee3cc840..ec3628d227 100644 --- a/lib/citeengines/natbib.citeengine +++ b/lib/citeengines/natbib.citeengine @@ -5,11 +5,10 @@ # 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 -Format 63 +Format 64 Requires natbib @@ -45,6 +44,8 @@ MaxCiteNames 2 # # Note further: # +# * The LyXName "keyonly" has a special meaning: only the citation key, +# without any latex command, is output. # * Capitalization indicates that the command also has a capitalized # form (\Latexcmd vs. \latexcmd). These usually enforce upcasing of # name prefixes (von Goethe => Von Goethe). @@ -76,6 +77,7 @@ CiteEngine authoryear citeyear[] citeyearpar[][] nocite + keyonly End CiteEngine numerical @@ -87,6 +89,7 @@ CiteEngine numerical citeyearpar[][] citeyear nocite + keyonly End @@ -101,14 +104,26 @@ End # There are common definitions (default) and specific definitions for # either cite engine type (which overwrite existing defaults. # + +# Input standard format definitions for the bibliography +Input stdciteformats.inc + CiteFormat default # # MACROS # # 1. Translatable bits (need to be marked by _ prefix) + # Note that preceding and trailing spaces matter. # _notcited not cited _addtobib Add to bibliography only. + _keyonly Key only. + _key Key + # The following are handled by BiblioInfo + _etal et al. + _namesep , [[separate author names in citation, except for last name]] + _lastnamesep , and [[separate name of last author in citation]] + _pairnamesep and [[separate two authors in citation]] # # 2. Macros re-used in the style definitions @@ -119,7 +134,11 @@ CiteFormat default !endlink {!!} # "Author et al." or "??" - !abbrvauthor {%abbrvauthor%[[%abbrvauthor%]][[??]]} + !abbrvciteauthor {%abbrvciteauthor%[[%abbrvciteauthor%]][[??]]} + # "Author, ..." or "??" + !fullciteauthor {%fullciteauthor%[[%fullciteauthor%]][[??]]} + # Handle starred command: abbr. or full author list + !makeauthor {%ifstar%[[%!fullciteauthor%]][[%!abbrvciteauthor%]]} # "prenote " !textbefore {%textbefore%[[%textbefore% ]]} # ", postnote" @@ -129,6 +148,8 @@ CiteFormat default # "...; Author..." !nextauthor {%next%[[%!sep% %!startlink%%!abbrvauthor%%!endlink%%!nextauthor%]]} + # Handle starred command: abbr. or full author list + !makenextauthor {%next%[[%!sep% %!startlink%%!makeauthor%%!endlink%%!makenextauthor%]]} # "..., CiteKey..." !nextkey {%next%[[%!sep% %key%%!nextkey%]]} # "..., Year..." @@ -144,6 +165,8 @@ CiteFormat default citeyearpar %!open%%!textbefore%%!startlink%%!year%%!endlink%%!nextyear%%!textafter%%!close% # "Add to bibliography only." (dialog) / "[ID] (not cited)" (button) nocite {%dialog%[[%_addtobib%]][[%key%%!nextkey% (%_notcited%)]]} + # Output only the key + keyonly {%dialog%[[%_keyonly%]][[%_key%: %key%%!nextkey%]]} End CiteFormat authoryear @@ -155,14 +178,14 @@ CiteFormat authoryear !close ) # "Author et al. (cf. Year..." - !makecitet %!startlink%%!abbrvauthor%%!endlink% %!open%%!textbefore%%!year%%!nextcitet% + !makecitet %!startlink%%!makeauthor%%!endlink% %!open%%!textbefore%%!year%%!nextcitet% # "Author et al. cf. Year..." [sic!] - !makecitealt %!startlink%%!abbrvauthor% %!textbefore%%!year%%!endlink%%!nextcitealt% + !makecitealt %!startlink%%!makeauthor% %!textbefore%%!year%%!endlink%%!nextcitealt% # "Author et al., Year..." - !makecitealp %!startlink%%!abbrvauthor%, %!year%%!endlink%%!nextcitealp% + !makecitealp %!startlink%%!makeauthor%, %!year%%!endlink%%!nextcitealp% # "...); Nextauthor (Year..." - !nextcitet {%next%[[%!close%%!sep% %!startlink%%!abbrvauthor%%!endlink% %!open%%!year%%!nextcitet%]]} + !nextcitet {%next%[[%!close%%!sep% %!startlink%%!makeauthor%%!endlink% %!open%%!year%%!nextcitet%]]} # "...; NextAuthor et al. Year..." !nextcitealt {%next%[[%!sep% %!makecitealt%]]} # "...; NextAuthor et al., Year..." @@ -183,7 +206,7 @@ CiteFormat authoryear # "Author cf. Year; NextAuthor Year, p. xx" [sic!] citealt %!makecitealt%%!textafter% # "Author; NextAuthor, p. xx" - citeauthor %!startlink%%!abbrvauthor%%!endlink%%!nextauthor%%!textafter% + citeauthor %!startlink%%!makeauthor%%!endlink%%!makenextauthor%%!textafter% # "Year; NextYear, p. xx" citeyear %!startlink%%!year%%!endlink%%!nextyear%%!textafter% @@ -200,16 +223,16 @@ CiteFormat numerical !close ] # "Author [cf. ID..." - !makecitet %!abbrvauthor% %!open%%!textbefore%{%dialog%[[#ID]][[%!startlink%{%numericallabel%[[%numericallabel%]][[#%key%]]}%!endlink%]]}%!nextcitet% + !makecitet %!makeauthor% %!open%%!textbefore%{%dialog%[[#ID]][[%!startlink%{%numericallabel%[[%numericallabel%]][[#%key%]]}%!endlink%]]}%!nextcitet% # "Author cf. ID..." - !makecitealt %!abbrvauthor% %!textbefore%{%dialog%[[#ID]][[%!startlink%{%numericallabel%[[%numericallabel%]][[#%key%]]}%!endlink%]]}%!nextcitealt% + !makecitealt %!makeauthor% %!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%]]} + !nextcitet {%next%[[%!close%%!sep% %!makeauthor% %!open%%!textbefore%{%dialog%[[#ID]][[%!startlink%{%numericallabel%[[%numericallabel%]][[#%key%]]}%!endlink%]]}%!nextcitet%]]} # "..., NextAuthor ID..." - !nextcitealt {%next%[[%!sep% %!abbrvauthor% {%dialog%[[#ID]][[%!startlink%{%numericallabel%[[%numericallabel%]][[#%key%]]}%!endlink%]]}%!nextcitealt%]]} + !nextcitealt {%next%[[%!sep% %!makeauthor% {%dialog%[[#ID]][[%!startlink%{%numericallabel%[[%numericallabel%]][[#%key%]]}%!endlink%]]}%!nextcitealt%]]} # FIXME: What is this? !nexthashid {%next%[[%!sep% #ID%!nexthashid%]]} # "..., NextID..." @@ -230,7 +253,7 @@ CiteFormat numerical # "Author cf. ID, NextAuthor ID, p. xx" citealt %!makecitealt%%!textafter% # "Author, NextAuthor" - citeauthor %!startlink%%!abbrvauthor%%!endlink%%!nextauthor% + citeauthor %!startlink%%!makeauthor%%!endlink%%!makenextauthor% # "Year, NextYear" citeyear %!startlink%%!year%%!endlink%%!nextyear%