Improve Table of Contents rendering when exported
The data for a simple Table Of Contents section looks like this:
{
{
"category": "MPSectionCategory:toc",
"priority": 1,
"title": "Table of Contents",
"path": [
"MPSection:0DC9C0CD-01CC-4D57-8E99-1D43BFED443A"
],
"elementIDs": [
"MPTOCElement:2B926C18-EEBD-4E03-97F4-DD18FB33A0C8"
],
"_id": "MPSection:0DC9C0CD-01CC-4D57-8E99-1D43BFED443A",
"objectType": "MPSection"
},
{
"contents": "<div id=\"MPTOCElement:2B926C18-EEBD-4E03-97F4-DD18FB33A0C8\" class=\"MPElement MPParagraphStyle_A0B8C229-8670-49BA-A242-EE1B0B50503B\"><ul data-paragraph-style=\"MPParagraphStyle:A0B8C229-8670-49BA-A242-EE1B0B50503B\" class=\"manuscript-toc-list\"><li class=\"manuscript-toc-list-item\" data-referenced-section=\"MPSection:D0DCACD7-1872-418D-BB87-A267F0060860\" data-referenced-section-path-length=\"1\">1. Introduction</li></ul></div>",
"elementType": "div",
"paragraphStyle": "MPParagraphStyle:A0B8C229-8670-49BA-A242-EE1B0B50503B",
"_id": "MPTOCElement:2B926C18-EEBD-4E03-97F4-DD18FB33A0C8",
"objectType": "MPTOCElement"
},
{
"kind": "body",
"preferredXHTMLElement": "p",
"name": "bodyText",
"title": "Table of Contents",
"objectType": "MPParagraphStyle",
"bundled": true,
"nextStyle": "MPParagraphStyle:bodyText",
"textStyling": {
"_id": "MPTextStyling:2E79D76D-CAC1-492F-8709-DAD9FD369B8B",
"objectType": "MPTextStyling",
"fontFamily": "Charter",
"fontSize": 12,
"bold": false,
"italic": false,
"color": "MPColor:black"
},
"listHeadIndent": 30,
"listItemIndentPerLevel": 30,
"listTailIndent": 0,
"hierarchicalListNumbering": false,
"hideListNumberingSuffixForLastLevel": true,
"embeddedListItemBulletStyles": {
"1": {
"_id": "MPListItemBulletStyle:DD563297-776A-42C6-9408-21501DD0B0AC",
"objectType": "MPListItemBulletStyle",
"bulletStyle": "none"
},
"2": {
"_id": "MPListItemBulletStyle:EC293DED-80AD-414C-9988-9EF62A9A4EF4",
"objectType": "MPListItemBulletStyle",
"bulletStyle": "none"
}
},
"embeddedListItemNumberingStyles": {
"1": {
"_id": "MPNumberingStyle:43D2A1BA-0ED9-4B8E-8C29-265B17B9F1DD",
"objectType": "MPNumberingStyle",
"startIndex": 1,
"prefix": "",
"numberingScheme": "none",
"suffix": "."
},
"2": {
"_id": "MPNumberingStyle:9D6F6970-0273-4C53-BC7A-8B2FAA784D4A",
"objectType": "MPNumberingStyle",
"startIndex": 1,
"prefix": "",
"numberingScheme": "none",
"suffix": "."
},
"3": {
"_id": "MPNumberingStyle:AAB86A8A-5D9D-4C37-995F-F0226E22E10D",
"objectType": "MPNumberingStyle",
"startIndex": 1,
"prefix": "",
"numberingScheme": "none",
"suffix": "."
}
},
"alignment": "left",
"bottomSpacing": 10,
"firstLineIndent": 0,
"lineSpacing": 2,
"headIndent": 0,
"tailIndent": 0,
"topSpacing": 10,
"priority": 20,
"partOfTOC": false,
"prototype": "MPParagraphStyle:toc",
"containerID": "MPProject:D9F4C4F1-4560-434A-B9C9-762558BB5846",
"manuscriptID": "MPManuscript:A9962806-6363-4A1F-A5C8-6FD432E0F259",
"_id": "MPParagraphStyle:A0B8C229-8670-49BA-A242-EE1B0B50503B"
},
}
(the MPParagraphStyle…
class attribute and data-paragraph-style
have been added, they're not present in the JSON exported by the desktop app)
LaTeX/PDF
When exporting to LaTeX/PDF, this is converted to the following:
\tableofcontents\begin{itemize}
\item 1. Introduction
\end{itemize}
which leads to a "Contents" heading and a list with both bullets and numbers:
Ideally the section title would be used and no bullets would be visible (the numbering is in the content already).
DOCX
When exporting to DOCX the output currently looks like this:
There should be a way to set a section with "category" : "MPSectionCategory:toc"
as excluded from the numbering, and the paragraph style should be applied (either via the object's paragraphStyle
property or the HTML class attribute) to hide the bullets in the content.