]> git.lyx.org Git - lyx.git/commitdiff
Improve on-screen representation with MLA style
authorJuergen Spitzmueller <spitz@lyx.org>
Thu, 11 Jul 2024 11:38:22 +0000 (13:38 +0200)
committerJuergen Spitzmueller <spitz@lyx.org>
Thu, 11 Jul 2024 11:39:17 +0000 (13:39 +0200)
This style is quite unique, so we need to accommodate that

lib/citeengines/biblatex-natbib.citeengine
lib/citeengines/biblatex.citeengine

index b0848f51080f975b7d7318ee6a424a24d5b94e5f..8c034b9bed397b7c5f56c143816d88029968910d 100644 (file)
@@ -187,18 +187,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%[[, %curposttext%]]}
+       !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%]][[%!myear%]]}
+       !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 "??")
@@ -254,16 +256,20 @@ 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% %!makeyear%%!endlink%%!ctextafter%%!nextcite%
+       !makecite %!ctextbefore%%!startlink%%!abbrvciteauthor%%!aysep% %!mkyear%%!endlink%%!ctextafter%%!nextcite%
        # "cf. Author et. al Year..."
-       !makepcite %!ctextbefore%%!startlink%%!abbrvpciteauthor%%!aysep% %!makeyear%%!endlink%%!ctextafter%%!nextpcite%
+       !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%
        # "Author et al., Year..."
@@ -274,7 +280,7 @@ CiteFormat authoryear
        # "...; 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..."
@@ -287,7 +293,7 @@ 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%%!makepcite%%!textafter%%!close%
        # "cf. Author et al., Year; NextAuthor et al., Year, p. xx"
index c69806d1535982a6bfeaec4385d688c4528297c1..0d77bc811cff87a2987ee091eeec987162e2a422 100644 (file)
@@ -192,18 +192,20 @@ CiteFormat default
        !makeauthor {%ifstar%[[%!forceabbrvciteauthor%]][[%!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%[[, %curposttext%]]}
+       !ctextafter {%curposttext%[[%!tasep% %curposttext%]]}
        # Add a year if it exists (else "??") and possibly a modifier (as in 2017a)
        !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%]]}
+       !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 "??")
@@ -242,23 +244,27 @@ 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
+       !makeyear {%ifstyle:mla,mla-strict,mla-new,mla7%[[, %!makeshorttitle%]][[%!year%]]}
        # "cf. Author et. al Year..."
-       !makecite %!ctextbefore%%!startlink%%!abbrvciteauthor%%!aysep% %!year%%!endlink%%!ctextafter%%!nextcite%
+       !makecite %!ctextbefore%%!startlink%%!abbrvciteauthor%%!aysep% %!makeyear%%!endlink%%!ctextafter%%!nextcite%
        # "cf. Author et. al Year..."
-       !makepcite %!ctextbefore%%!startlink%%!abbrvpciteauthor%%!aysep% %!year%%!endlink%%!ctextafter%%!nextpcite%
+       !makepcite %!ctextbefore%%!startlink%%!abbrvpciteauthor%%!aysep% %!makeyear%%!endlink%%!ctextafter%%!nextpcite%
        # Author et al. (cf. Year...
-       !maketextcite {%ifqualified%[[%!textbefore%]]}%!startlink%%!abbrvciteauthor%%!endlink% %!open%{%ifqualified%[[%!ctextbefore%]][[%!textbefore%]]}%!year%%!ctextafter%%!nexttextcite%
+       !maketextcite {%ifqualified%[[%!textbefore%]]}%!startlink%%!abbrvciteauthor%%!endlink% %!tcopen%{%ifqualified%[[%!ctextbefore%]][[%!textbefore%]]}%!makeyear%%!ctextafter%%!nexttextcite%
 
        # "...; Nextauthor Year..."
        !nextcite {%next%[[%!sep% %!makecite%]]}
        # "...; Nextauthor Year..."
        !nextpcite {%next%[[%!sep% %!makepcite%]]}
        # "...); Nextauthor (Year..."
-       !nexttextcite {%next%[[%!close%%!smartsep%%!startlink%%!abbrvciteauthor%%!endlink% %!open%%!ctextbefore%%!year%%!ctextafter%%!nexttextcite%]]}
+       !nexttextcite {%next%[[%!tcclose%%!smartsep%%!startlink%%!abbrvciteauthor%%!endlink% %!tcopen%%!ctextbefore%%!makeyear%%!ctextafter%%!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%]][[??]]}]]}
@@ -276,7 +282,7 @@ CiteFormat authoryear
        # "cf. Author A Year; Author B Year, p. xx"
        cite %!textbefore%%!makecite%%!textafter%
        # "cf. Author A (Year),[ and] Author B (Year, p. xx)"
-       citet %!maketextcite%%!textafter%%!close%
+       citet %!maketextcite%%!textafter%%!tcclose%
        # "(cf. Author A Year; Author B Year, p. xx)"
        citep %!open%%!textbefore%%!makepcite%%!textafter%%!close%
        # This prints year or title, if year is missing