]> git.lyx.org Git - lyx.git/blobdiff - lib/citeengines/biblatex-natbib.citeengine
update comment
[lyx.git] / lib / citeengines / biblatex-natbib.citeengine
index 0f8545e53165f776d8e8b38bf115cf218224dbb2..bf8bcdcd319b5ee810fb9afe5b00b6b57aaa5711 100644 (file)
@@ -10,7 +10,7 @@
 
 # Author: Jürgen Spitzmüller <spitz@lyx.org>
 
-Format 63
+Format 104
 
 Requires biblatex
 
@@ -31,8 +31,12 @@ MaxCiteNames 3
 
 
 # The syntax of the cite command definitions below is:
-# LyXName|alias*<!_stardesc!_stardesctooltip>[][]=latexcmd
+# style@LyXName|alias*<!_stardesc!_stardesctooltip>[][]=latexcmd
 # 
+# * style:    A (comma-separated) list of citestyles to which
+#             this command is specific. If preceeded by '!',
+#             the list indicates citestyles for which the command
+#             is _not_ supported.
 # * LyXName:  The LyX name as output in the LyX file. For
 #             portability reasons, we try to use the same
 #             name for same-formatted commands in the
@@ -43,11 +47,13 @@ MaxCiteNames 3
 #             This is a bit like "ObsoletedBy" in the layouts.
 # * latexcmd: The actual LaTeX command that is output.
 #
-# Alias and latexcmd are optional. If no latexcmd is given, the
+# Style, alias and latexcmd are optional. If no latexcmd is given, the
 # LyXName will be output to LaTeX.
 #
 # 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).
@@ -66,6 +72,8 @@ MaxCiteNames 3
 #   dropping the '!' from the prefix (see below), e.g.:
 #   _stardesc Starred command label
 #   _stardesctooltip Tooltip for the starred command checkbox.
+# * A trailing $ indicates that a command features "qualified citation
+#   lists" (a specific Biblatex feature)
 
 #
 # CITE COMMAND DEFINITIONS for either engine type
@@ -76,26 +84,29 @@ MaxCiteNames 3
 CiteEngine authoryear
        Citet|textcite*[][]
        Citep|parencite*[][]
+       apa,apa6@nptextcite$[][]
        Citealt|cite*[][]
        Citealp*[][]
        Citeauthor*[][]
        citeyearpar[][]
-       citeyear=cite*
+       citeyear[][]=cite*
        citebyear[][]=citeyear
-       Footcite[][]=smartcite
-       Autocite[][]
+       Footcite$[][]=smartcite
+       !mla,mla-strict,mla-new,mla7@Autocite$|mlaautocite[][]
+       mla,mla-strict,mla-new,mla7@Mlaautocite|autocite,headlesscite*<!_mlaautocitestar!_mlaautocitetooltip>$[][]=autocite
        citetitle*<!_citetitlestar!_citetitlestartooltip>[][]
-       fullcite[][]
+       !mla,mla-strict,mla-new,mla7@fullcite[][]
        footfullcite[][]
        nocite
+       keyonly
 End
 
 CiteEngine numerical
        Citep|citealp,citealt*[][]
        Citet|textcite*[][]
        supercite
-       Footcite[][]=smartcite
-       Autocite[][]
+       Footcite$[][]=smartcite
+       Autocite$[][]
        Citeauthor[][]*
        citeyearpar[][]
        citeyear|citebyear[][]
@@ -103,6 +114,7 @@ CiteEngine numerical
        fullcite[][]
        footfullcite[][]
        nocite
+       keyonly
 End
 
 
@@ -117,16 +129,23 @@ 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)
+       # 1. Translatable bits (need to be marked by _ prefix, if translated to the GUI language,
+       #    or B_, if translated to the buffer language)
        #    Note that preceding and trailing spaces matter.
        #
        _notcited not cited
        _addtobib Add to bibliography only.
-       _finaland , and 
+       _keyonly Key only.
+       _key Key
+       B_finaland , and 
        _footnote Footnote
        _foot Foot
        _fullcite bibliography entry
@@ -136,11 +155,13 @@ CiteFormat default
        # GUI strings for the starred commands
        _citetitlestar F&orce full title[[Possible substitute to All aut&hors]]
        _citetitlestartooltip Use full title even if shorttitle exists
+       _mlaautocitestar Omit aut&hors[[Possible substitute to All aut&hors]]
+       _mlaautocitestartooltip Omit authors or editors in the citation
        # 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]]
+       B_etal  et al.
+       B_namesep , [[separate author names in citation, except for last name]]
+       B_lastnamesep , and [[separate name of last author in citation]]
+       B_pairnamesep  and [[separate two authors in citation]]
 
        #
        # 2. Macros re-used in the style definitions
@@ -159,8 +180,10 @@ CiteFormat default
        !endlink {!</a>!}
 
        # Add " , and " before the last item (but " and " if there are only two), else ", "
-       !smartsep {%second%[[{%next%[[%_namesep%]][[%_pairnamesep%]]}]][[{%next%[[%_namesep%]][[%_lastnamesep%]]}]]}
+       !smartsep {%second%[[{%next%[[%B_namesep%]][[%B_pairnamesep%]]}]][[{%next%[[%B_namesep%]][[%B_lastnamesep%]]}]]}
 
+       # "Author et al." (if > 3 authors) or "??" (variant in parentheses)
+       !abbrvpciteauthor {%abbrvciteauthor%[[{%ifstyle:apa,apa6%[[%abbrvciteauthor&%]][[%abbrvciteauthor%]]}]][[??]]}
        # "Author et al." or "??"
        !abbrvciteauthor {%abbrvciteauthor%[[%abbrvciteauthor%]][[??]]}
        # "Author, ..." or "??"
@@ -169,12 +192,20 @@ CiteFormat default
        !makeauthor {%ifstar%[[%!fullciteauthor%]][[%!abbrvciteauthor%]]}
        # "prenote "
        !textbefore {%textbefore%[[%textbefore% ]]}
+       # Separator before textafter
+       !tasep {%ifstyle:mla,mla-strict,mla-new,mla7%[[]][[,]]}
        # ", postnote"
-       !textafter {%textafter%[[, %textafter%]]}
+       !textafter {%textafter%[[%!tasep% %textafter%]]}
+       # "prenote " (for qualified lists)
+       !ctextbefore {%curpretext%[[%curpretext% ]]}
+       # ", postnote" (for qualified lists)
+       !ctextafter {%curposttext%[[%!tasep% %curposttext%]]}
        # Add a year if it exists (else "??") and possibly a modifier (as in 2017a)
        !makeyear {%year%[[%year%]][[??]]}{%modifier%[[%modifier%]]}
        # Add a year if it exists (else "??") and indicate a possible modifier (as in 2017[a])
        !myear {%year%[[%year%]][[??]]}{%modifier%[[%modifier%]][[{%export%[[]][[%!dummymod%]]}]]}
+       # Add a shorthand if it exists else myear (see above)
+       !shmyear {%shorthand%[[%shorthand%]][[{%ifstyle:mla,mla-strict,mla-new,mla7%[[%!makeshorttitle%]][[%!myear%]]}]]}
        # Add a year if it exists (else "??") without any modifier at all
        !byear {%year%[[%year%]][[??]]}
        # Add a shorttitle or title if it exists (else "??")
@@ -191,7 +222,7 @@ CiteFormat default
        # ".., Year..." (including extra label, as in 2017a)
        !nextyear {%next%[[%!sep% %!startlink%%!makeyear%%!endlink%%!nextyear%]]}
        # "...; Nextyear ..." (including emulated extra label, as in 2017[a])
-       !nextmyear {%next%[[%!sep% %!startlink%%!myear%%!endlink%%!nextmyear%]]}
+       !nextshmyear {%next%[[%!sep% %!startlink%%!shmyear%%!endlink%%!nextshmyear%]]}
        # "...; Nextyear ..." (without any extra label)
        !nextbyear {%next%[[%!sep% %!startlink%%!byear%%!endlink%%!nextbyear%]]}
        # "...; Nexttitle ..." 
@@ -208,7 +239,7 @@ CiteFormat default
        # "cf. Author; NextAuthor, p. xx"
        citeauthor %!textbefore%%!startlink%%!makeauthor%%!endlink%%!nextauthor%%!textafter%
        # "cf. Year; NextYear, S. xx" [Authoryear] / "cf. Year, NextYear, S. xx" [Numerical]
-       citeyear %!textbefore%%!startlink%%!myear%%!endlink%%!nextmyear%%!textafter%
+       citeyear %!textbefore%%!startlink%%!shmyear%%!endlink%%!nextshmyear%%!textafter%
        # "cf. Year; Nextyear, p. xx" (without any extra label)
        citebyear %!textbefore%%!startlink%%!byear%%!endlink%%!nextbyear%%!textafter%
        # "(cf. Year; NextYear, p. xx)" [Authoryear] / "(cf. Year, NextYear, p. xx)" [Numerical]
@@ -221,6 +252,8 @@ CiteFormat default
        footfullcite {%dialog%[[%_footnote%]][[%_foot%]]}: {%dialog%[[%_bibentry%]][[{%label%[[%!fullcite%]][[%key%%!nextkey% (%_fullcite%)]]}]]}
        # "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
@@ -228,18 +261,31 @@ CiteFormat authoryear
        # MACROS
        #
        !open (
+       !tcopen {%ifstyle:mla,mla-strict,mla-new,mla7%[[]][[(]]}
        !sep ;
        !close )
-
+       !tcclose {%ifstyle:mla,mla-strict,mla-new,mla7%[[]][[)]]}
+       !aysep {%ifstyle:apa%[[,]]}
+
+       # Title (with MLA), else year
+       !mkyear {%ifstyle:mla,mla-strict,mla-new,mla7%[[, %!makeshorttitle%]][[%!makeyear%]]}
+       # "cf. Author et. al Year..."
+       !makecite %!ctextbefore%%!startlink%%!abbrvciteauthor%%!aysep% %!mkyear%%!endlink%%!ctextafter%%!nextcite%
+       # "cf. Author et. al Year..."
+       !makepcite %!ctextbefore%%!startlink%%!abbrvpciteauthor%%!aysep% %!mkyear%%!endlink%%!ctextafter%%!nextpcite%
        # "Author et al. (cf. Year..."
-       !makecitet %!startlink%%!makeauthor%%!endlink% %!open%%!textbefore%%!makeyear%%!nextcitet%
+       !makecitet %!startlink%%!makeauthor%%!endlink% %!tcopen%%!textbefore%%!mkyear%%!nextcitet%
        # "cf. Author et al. Year..."
-       !makecitealt  %!textbefore%%!startlink%%!makeauthor% %!makeyear%%!endlink%%!nextcitealt%
+       !makecitealt %!textbefore%%!startlink%%!makeauthor% %!makeyear%%!endlink%%!nextcitealt%
        # "Author et al., Year..."
        !makecitealp %!startlink%%!makeauthor%, %!makeyear%%!endlink%%!nextcitealp%
 
+       # "...; Nextauthor Year..."
+       !nextcite {%next%[[%!sep% %!makecite%]]}
+       # "...; Nextauthor Year..."
+       !nextpcite {%next%[[%!sep% %!makepcite%]]}
        # "...), [and] Nextauthor (Year..."
-       !nextcitet {%next%[[%!close%%!smartsep%%!startlink%%!makeauthor%%!endlink% %!open%%!makeyear%%!nextcitet%]]}
+       !nextcitet {%next%[[%!tcclose%%!smartsep%%!startlink%%!makeauthor%%!endlink% %!tcopen%%!mkyear%%!nextcitet%]]}
        # "...; NextAuthor et al. Year..."
        !nextcitealt {%next%[[%!sep% %!startlink%%!makeauthor% %!makeyear%%!endlink%%!nextcitealt%]]}
        # "...; NextAuthor et al., Year..."
@@ -252,27 +298,36 @@ CiteFormat authoryear
        #
 
        # "Author (cf. Year),[ and] NextAuthor (Year, p. xx)"
-       citet %!makecitet%%!textafter%%!close%
+       citet %!makecitet%%!textafter%%!tcclose%
        # "(cf. Author et al., Year; NextAuthor et al., Year, p. xx)"
-       citep %!open%%!textbefore%%!makecitealp%%!textafter%%!close%
+       citep %!open%%!textbefore%%!makepcite%%!textafter%%!close%
        # "cf. Author et al., Year; NextAuthor et al., Year, p. xx"
        citealp %!textbefore%%!makecitealp%%!textafter%
        # "cf. Author Year; NextAuthor Year, p. xx" [NB: textbefore position differs from real natbib!]
        citealt %!makecitealt%%!textafter%
        # "Footnote: cf. Author A Year; Author B Year, p. xx."
-       footcite {%dialog%[[%_footnote%]][[%_foot%]]}: %!textbefore%%!makecitealp%%!textafter%.
+       footcite {%dialog%[[%_footnote%]][[%_foot%]]}: %!textbefore%%!makecite%%!textafter%.
        # "Auto: (cf. Author A Year; Author B Year, p. xx)"
-       autocite {%dialog%[[%_autocite%]][[%_auto%]]}: %!open%%!textbefore%%!makecitealp%%!textafter%%!close%
+       autocite {%dialog%[[%_autocite%]][[%_auto%]]}: %!open%%!textbefore%%!makepcite%%!textafter%%!close%
 
        # Fallback style: "Author A (cf. Year),[ and] Author B (Year, p. xx)"
        cite %!makecitet%%!textafter%%!close%
+       
+       # Style-specifics
+       # 1. APA
+       # "cf. Author A Year; Author B Year, p. xx"
+       nptextcite %!textbefore%%!makepcite%%!textafter%
+       # 2. MLA
+       # "Auto: (cf. Author A Year; Author B Year, p. xx)"
+       mlaautocite {%dialog%[[%_autocite%]][[%_auto%]]}: %!open%%!textbefore%%!makepcite%%!textafter%%!close%
 End
 
 CiteFormat numerical
        #
        # MACROS
        #
-       # 1. Translatable bits (need to be marked by _ prefix)
+       # 1. Translatable bits (need to be marked by _ prefix, if translated to the GUI language,
+       #    or B_, if translated to the buffer language)
        #
        _super Super
        _superscript Superscript
@@ -290,6 +345,8 @@ CiteFormat numerical
        !makecitealt {%dialog%[[#ID]][[%!startlink%{%numericallabel%[[%numericallabel%]][[#%key%]]}%!endlink%]]}%!nextcitealt%
        # "ID..."
        !hashkey {%dialog%[[#ID]][[%!startlink%{%numericallabel%[[%numericallabel%]][[#%key%]]}%!endlink%%!nexthashkey%]]}
+       # "ID"
+       !makekey %!ctextbefore%{%dialog%[[#ID]][[%!startlink%{%numericallabel%[[%numericallabel%]][[#%key%]]}%!endlink%]]}%!ctextafter%%!nextkey%
 
        # "...], [and] NextAuthor [ID..."
        !nextcitet {%next%[[%!close%%!smartsep%%!makeauthor% %!open%%!textbefore%{%dialog%[[#ID]][[%!startlink%{%numericallabel%[[%numericallabel%]][[#%key%]]}%!endlink%]]}%!nextcitet%]]}
@@ -301,6 +358,8 @@ CiteFormat numerical
        !nexthashkey {%next%[[%!sep% %!startlink%{%numericallabel%[[%numericallabel%]][[#%key%]]}%!endlink%%!nexthashkey%]]}
        # "...); Nextauthor [ID..."
        !nextcitet {%next%[[%!close%%!smartsep%%!makeauthor% %!open%{%dialog%[[#ID]][[%!startlink%{%numericallabel%[[%numericallabel%]][[#%key%]]}%!endlink%]]}%!nextcitet%]]}
+       # "..., NextID..."
+       !nextkey {%next%[[%!sep% %!ctextbefore%{%dialog%[[#ID]][[%!startlink%{%numericallabel%[[%numericallabel%]][[#%key%]]}%!endlink%]]}%!ctextafter%%!nextkey%]]}
 
        #
        # ACTUAL STYLE DEFINITIONS