citeyear[][]=cite*
citebyear[][]=citeyear
Footcite$[][]=smartcite
- Autocite$[][]
+ !mla,mla-strict,mla-new,mla7@Autocite$|mlaautocite[][]
+ mla,mla-strict,mla-new,mla7@Mlaautocite|autocite*<!_mlaautocitestar!_mlaautocitetooltip>$[][]=autocite
citetitle*<!_citetitlestar!_citetitlestartooltip>[][]
!mla,mla-strict,mla-new,mla7@fullcite[][]
footfullcite[][]
# 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
B_etal et al.
B_namesep , [[separate author names in citation, except for last name]]
# 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
citeyear[][]=cite*
citebyear[][]=citeyear
Footcite$[][]=smartcite
- Autocite$[][]
+ !mla,mla-strict,mla-new,mla7@Autocite$|mlaautocite[][]
+ mla,mla-strict,mla-new,mla7@Mlaautocite|autocite*<!_mlaautocitestar!_mlaautocitetooltip>$[][]=autocite
citetitle*<!_citetitlestar!_citetitlestartooltip>[][]
!mla,mla-strict,mla-new,mla7@fullcite[][]
footfullcite[][]
_citeauthorstartooltip Force a short author list (using et al.)
_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
B_etal et al.
B_namesep , [[separate author names in citation, except for last name]]
# 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
def revert_nptextcite(document):
- """Revert \\nptextcite to ERT"""
+ """Revert \\nptextcite and MLA's autocite variants to ERT"""
# 1. Get cite engine
engine = "basic"
return
# 4. Convert \nptextcite to ERT
+ new_citations = {
+ "nptextcite": "nptextcite",
+ "mlaautocite": "autocite",
+ "Mlaautocite": "Autocite",
+ "mlaautocite*": "autocite*",
+ "Mlaautocite*": "Autocite*",
+ }
i = 0
while True:
i = find_token(document.body, "\\begin_inset CommandInset citation", i)
i = j + 1
continue
cmd = get_value(document.body, "LatexCommand", k)
- if cmd == "nptextcite":
+ if cmd in list(new_citations.keys()):
pre = get_quoted_value(document.body, "before", i, j)
post = get_quoted_value(document.body, "after", i, j)
key = get_quoted_value(document.body, "key", i, j)
document.warning("Citation inset at line %d does not have a key!" % (i))
key = "???"
# Replace known new commands with ERT
- res = "\\nptextcite"
+ res = "\\" + new_citations[cmd]
if pre:
res += "[" + pre + "]"
if post: