-----------------------
+2019-08-12 Jürgen Spitzmüller <spitz@lyx.org>
+ * Format incremented to 588: Support \theendnotes of endnotes package via a faked
+ float list.
+
2019-08-07 Jürgen Spitzmüller <spitz@lyx.org>
* Format incremented to 587: Use more generic paper names as LyX names
(rather than LaTeXisms; e.g., "a4" rather than "a4paper").
#\DeclareLyXModule[endnotes.sty]{Endnotes}
#\DeclareCategory{Foot- and Endnotes}
#DescriptionBegin
-#Adds an endnote inset, in addition to footnotes. You will need to add
-#\theendnotes in TeX-code where you want the endnotes to appear.
+#Adds an endnote inset, in addition to footnotes. You will need to add an
+#endnotes list (Insert > List/Contents/References > Endnotes) where you
+#want the endnotes to appear.
#DescriptionEnd
Format 79
LabelString endnote
Requires endnotes
End
+
+# We are only interested in the list
+Float
+ Type endnote
+ ListName "Endnotes"
+ IsPredefined true
+ UsesFloatPkg false
+ ListCommand theendnotes
+ Requires endnotes
+End
#\DeclareLyXModule[endnotes.sty]{Footnotes as Endnotes}
#\DeclareCategory{Foot- and Endnotes}
#DescriptionBegin
-#Sets all footnotes as endnotes. You will need to add \theendnotes
-#in TeX-code where you want the endnotes to appear.
+#Sets all footnotes as endnotes. You will need to add an
+#endnotes list (Insert > List/Contents/References > Endnotes) where you
+#want the endnotes to appear.
#DescriptionEnd
Format 79
AddToPreamble
\let\footnote=\endnote
EndPreamble
+
+# We are only interested in the list
+Float
+ Type endnote
+ ListName "Endnotes"
+ IsPredefined true
+ UsesFloatPkg false
+ ListCommand theendnotes
+ Requires endnotes
+End
if val in newnames:
newval = val + "paper"
document.header[i] = "\\papersize " + newval
+
+
+def revert_theendnotes(document):
+ " Reverts native support of \\theendnotes to TeX-code "
+
+ if not "endnotes" in document.get_module_list() and not "foottoend" in document.get_module_list():
+ return
+
+ i = 0
+ while True:
+ i = find_token(document.body, "\\begin_inset FloatList endnote", i + 1)
+ if i == -1:
+ return
+ j = find_end_of_inset(document.body, i)
+ if j == -1:
+ document.warning("Malformed LyX document: Can't find end of FloatList inset")
+ continue
+
+ document.body[i : j + 1] = put_cmd_in_ert("\\theendnotes")
##
[584, []],
[585, [convert_pagesizes]],
[586, []],
- [587, [convert_pagesizenames]]
+ [587, [convert_pagesizenames]],
+ [588, []]
]
-revert = [[586, [revert_pagesizenames]],
+revert = [[587, [revert_theendnotes]],
+ [586, [revert_pagesizenames]],
[585, [revert_dupqualicites]],
[584, [revert_pagesizes,revert_komafontsizes]],
[583, [revert_vcsinfo_rev_abbrev]],
continue;
}
+ if (t.cs() == "theendnotes") {
+ context.check_layout(os);
+ begin_inset(os, "FloatList endnote\n");
+ end_inset(os);
+ skip_spaces_braces(p);
+ continue;
+ }
+
if ((where = is_known(t.cs(), known_text_font_families))) {
parse_text_attributes(p, os, FLAG_ITEM, outer,
context, "\\family", context.font.family,
// Do not remove the comment below, so we get merge conflict in
// independent branches. Instead add your own.
-#define LYX_FORMAT_LYX 587 // spitz: generic paper size names
-#define LYX_FORMAT_TEX2LYX 587
+#define LYX_FORMAT_LYX 588 // spitz: support \theendnotes
+#define LYX_FORMAT_TEX2LYX 588
#if LYX_FORMAT_TEX2LYX != LYX_FORMAT_LYX
#ifndef _MSC_VER