[LyX/master] Consider shorthand in biblatex cite display

Juergen Spitzmueller spitz at lyx.org
Tue Nov 12 12:37:55 UTC 2019


commit 400706ad0525b43ab20993acb487ee4660823f84
Author: Juergen Spitzmueller <spitz at lyx.org>
Date:   Tue Nov 12 13:52:05 2019 +0100

    Consider shorthand in biblatex cite display
    
    Fixes #11696
---
 lib/citeengines/biblatex-natbib.citeengine |    6 ++++--
 lib/citeengines/biblatex.citeengine        |   16 ++++++++++------
 2 files changed, 14 insertions(+), 8 deletions(-)

diff --git a/lib/citeengines/biblatex-natbib.citeengine b/lib/citeengines/biblatex-natbib.citeengine
index 99bdd82..2e23a47 100644
--- a/lib/citeengines/biblatex-natbib.citeengine
+++ b/lib/citeengines/biblatex-natbib.citeengine
@@ -192,6 +192,8 @@ CiteFormat default
 	!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%]][[%!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 "??")
@@ -208,7 +210,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 ..." 
@@ -225,7 +227,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]
diff --git a/lib/citeengines/biblatex.citeengine b/lib/citeengines/biblatex.citeengine
index a5c3022..120e0d4 100644
--- a/lib/citeengines/biblatex.citeengine
+++ b/lib/citeengines/biblatex.citeengine
@@ -171,7 +171,7 @@ CiteFormat default
 	# "...; Nextyear ..." (including extra label, as in 2017a)
 	!nextyear {%next%[[%!sep% %!startlink%%!year%%!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 ..." 
@@ -197,6 +197,8 @@ CiteFormat default
 	!year {%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%]][[%!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 "??")
@@ -215,7 +217,7 @@ CiteFormat default
 	# "cf. Author; Nextautor, p. xx"
 	citeauthor %!textbefore%%!startlink%%!makeauthor%%!endlink%%!makenextauthor%%!textafter%
 	# "cf. Year; Nextyear, p. xx" (including extra label, as in 2017a)
-	citeyear %!textbefore%%!startlink%%!myear%%!endlink%%!nextyear%%!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" (without any extra label)
@@ -250,8 +252,10 @@ CiteFormat authoryear
 
 	# 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%]][[??]]}]]}
-	# "...; Nextyear ..." (including extra label, as in 2017a)
-	!nextyeartitle {%next%[[%!sep% %!startlink%%!yeartitle%%!endlink%%!nextyeartitle%]]}
+        # Add a shorthand if it exists, else yeartitle (above)
+        !shyeartitle {%shorthand%[[%shorthand%]][[%!shyeartitle%]]}
+	# "...; Shorthand|Nextyear ..." (including extra label, as in 2017a)
+	!nextshyeartitle {%next%[[%!sep% %!startlink%%!yeartitle%%!endlink%%!nextshyeartitle%]]}
 
 	#
 	# ACTUAL STYLE DEFINITIONS
@@ -266,9 +270,9 @@ CiteFormat authoryear
 	# "(cf. Author A Year; Author B Year, p. xx)"
 	citep %!open%%!textbefore%%!makecite%%!textafter%%!close%
 	# This prints year or title, if year is missing
-	citeyear %!textbefore%%!startlink%%!yeartitle%%!endlink%%!nextyeartitle%%!textafter%
+	citeyear %!textbefore%%!startlink%%!shyeartitle%%!endlink%%!nextshyeartitle%%!textafter%
 	# "(cf. Year; Nextyear, p. xx)"
-	citeyearpar %!open%%!textbefore%%!startlink%%!myear%%!endlink%%!nextmyear%%!textafter%%!close%
+	citeyearpar %!open%%!textbefore%%!startlink%%!shmyear%%!endlink%%!nextshmyear%%!textafter%%!close%
 	# "Footnote: cf. Author A Year; Author B Year, p. xx."
 	footcite {%dialog%[[%_footnote%]][[%_foot%]]}: %!textbefore%%!makecite%%!textafter%.
 	# "Auto: (cf. Author A Year; Author B Year, p. xx)"


More information about the lyx-cvs mailing list