]> git.lyx.org Git - lyx.git/blobdiff - lib/citeengines/natbib.citeengine
Adapt citengine to current layout format.
[lyx.git] / lib / citeengines / natbib.citeengine
index ca6c8b829fb5c92635bde68739f0e4aa782cb889..ec3628d227266622c45bf693de33474e1f8f5cfc 100644 (file)
@@ -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 <jrioux@lyx.org>
 
-Format 62
+Format 64
 
 Requires natbib
 
@@ -23,6 +22,9 @@ CiteEngineType authoryear|numerical
 # Default style files for either engine type
 DefaultBiblio  authoryear:plainnat|numerical:plainnat
 
+# Maximum number of names before "et al." chimes in
+MaxCiteNames 2
+
 
 # The syntax of the cite command definitions below is:
 # LyXName|alias*<!_stardesc!_stardesctooltip>[][]=latexcmd
@@ -42,6 +44,8 @@ DefaultBiblio  authoryear:plainnat|numerical:plainnat
 #
 # 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).
@@ -73,6 +77,7 @@ CiteEngine authoryear
        citeyear[]
        citeyearpar[][]
        nocite
+       keyonly
 End
 
 CiteEngine numerical
@@ -84,6 +89,7 @@ CiteEngine numerical
        citeyearpar[][]
        citeyear
        nocite
+       keyonly
 End
 
 
@@ -98,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
@@ -116,7 +134,11 @@ CiteFormat default
        !endlink {!</a>!}
 
        # "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"
@@ -126,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..."
@@ -141,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
@@ -152,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..."
@@ -180,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%
 
@@ -197,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..."
@@ -227,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%