]> git.lyx.org Git - lyx.git/blobdiff - lib/citeengines/biblatex.citeengine
Implement "key only" citation style
[lyx.git] / lib / citeengines / biblatex.citeengine
index 957fba01166a415d359cbc8557227cdf2d04d29e..657547e403649294afe1770de8f6470fad61b09f 100644 (file)
@@ -5,7 +5,6 @@
 #   and provides many features that are not possible with BibTeX.
 #   The use of 'biber' as bibliography processor is advised.
 # DescriptionEnd
-# Excludes: basic | jurabib | natbib | biblatex-natbib
 
 # Author: Jürgen Spitzmüller <spitz@lyx.org>
 
@@ -45,6 +44,8 @@ MaxCiteNames 3
 #
 # 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).
@@ -81,6 +82,7 @@ CiteEngine authoryear
        fullcite[][]
        footfullcite[][]
        nocite
+       keyonly
 End
 
 CiteEngine numerical
@@ -95,6 +97,7 @@ CiteEngine numerical
        fullcite[][]
        footfullcite[][]
        nocite
+       keyonly
 End
 
 
@@ -118,6 +121,8 @@ CiteFormat default
        #
        _notcited not cited
        _addtobib Add to bibliography only.
+       _keyonly Key only.
+       _key Key
        _footnote Footnote
        _foot Foot
        _fullcite bibliography entry
@@ -151,7 +156,7 @@ CiteFormat default
        !dummymod [a]
 
        # "...; Nextauthor ..."
-       !nextauthor {%next%[[%!sep% %!startlink%%!abbrvauthor%%!endlink%%!nextauthor%]]}
+       !nextauthor {%next%[[%!sep% %!startlink%%!abbrvciteauthor%%!endlink%%!nextauthor%]]}
        # Handle starred command: abbr. or full author list
        !makenextauthor {%next%[[%!sep% %!startlink%%!makeauthor%%!endlink%%!makenextauthor%]]}
        # "...; [NextID] ..."
@@ -168,11 +173,11 @@ CiteFormat default
        !nextfullcite {%next%[[%!sep% %bibentry%%!nextfullcite%]]}
 
        # "Author et al." (if > 3 authors) or "??"
-       !abbrvauthor {%abbrvauthor%[[%abbrvauthor%]][[??]]}
+       !abbrvciteauthor {%abbrvciteauthor%[[%abbrvciteauthor%]][[??]]}
        # "Author et al." (always) or "??"
-       !forceabbrvauthor {%forceabbrvauthor%[[%forceabbrvauthor%]][[??]]}
+       !forceabbrvciteauthor {%forceabbrvciteauthor%[[%forceabbrvciteauthor%]][[??]]}
        # Handle starred command: force of abbr. author list, independent of maxcitenames
-       !makeauthor {%ifstar%[[%!forceabbrvauthor%]][[%!abbrvauthor%]]}
+       !makeauthor {%ifstar%[[%!forceabbrvciteauthor%]][[%!abbrvciteauthor%]]}
        # "prenote "
        !textbefore {%textbefore%[[%textbefore% ]]}
        # ", postnote"
@@ -210,6 +215,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
@@ -221,14 +228,14 @@ CiteFormat authoryear
        !close )
 
        # "cf. Author et. al Year..."
-       !makecite %!startlink%%!abbrvauthor% %!year%%!endlink%%!nextcite%
+       !makecite %!startlink%%!abbrvciteauthor% %!year%%!endlink%%!nextcite%
        # Author et al. (cf. Year...
-       !maketextcite %!startlink%%!abbrvauthor%%!endlink% %!open%%!textbefore%%!year%%!nexttextcite%
+       !maketextcite %!startlink%%!abbrvciteauthor%%!endlink% %!open%%!textbefore%%!year%%!nexttextcite%
 
        # "...; Nextauthor Year..."
        !nextcite {%next%[[%!sep% %!makecite%]]}
        # "...); Nextauthor (Year..."
-       !nexttextcite {%next%[[%!close%%!smartsep%%!startlink%%!abbrvauthor%%!endlink% %!open%%!year%%!nexttextcite%]]}
+       !nexttextcite {%next%[[%!close%%!smartsep%%!startlink%%!abbrvciteauthor%%!endlink% %!open%%!year%%!nexttextcite%]]}
 
        # Add a year if it exists (else title, else "??") and possibly a modifier (as in 2017a)
        !yeartitle {%year%[[%year%{%modifier%[[%modifier%]][[{%export%[[]][[%!dummymod%]]}]]}]][[{%title%[[%title%]][[??]]}]]}
@@ -274,12 +281,12 @@ CiteFormat numerical
        !close ]
 
        # "Author [cf. ID..."
-       !maketextcite %!abbrvauthor% %!open%%!textbefore%{%dialog%[[#ID]][[%!startlink%{%numericallabel%[[%numericallabel%]][[#%key%]]}%!endlink%]]}%!nexttextcite%
+       !maketextcite %!abbrvciteauthor% %!open%%!textbefore%{%dialog%[[#ID]][[%!startlink%{%numericallabel%[[%numericallabel%]][[#%key%]]}%!endlink%]]}%!nexttextcite%
        # "ID"
        !makekey {%dialog%[[#ID]][[%!startlink%{%numericallabel%[[%numericallabel%]][[#%key%]]}%!endlink%%!nextkey%]]}
 
        # "...); Nextauthor [ID..."
-       !nexttextcite {%next%[[%!close%%!smartsep%%!abbrvauthor% %!open%{%dialog%[[#ID]][[%!startlink%{%numericallabel%[[%numericallabel%]][[#%key%]]}%!endlink%]]}%!nexttextcite%]]}
+       !nexttextcite {%next%[[%!close%%!smartsep%%!abbrvciteauthor% %!open%{%dialog%[[#ID]][[%!startlink%{%numericallabel%[[%numericallabel%]][[#%key%]]}%!endlink%]]}%!nexttextcite%]]}
        # "..., NextID..."
        !nextkey {%next%[[%!sep% %!startlink%{%numericallabel%[[%numericallabel%]][[#%key%]]}%!endlink%%!nextkey%]]}