tag:support.markedapp.com,2011-09-11:/discussions/questions/3595-table-of-contents-in-exportMarked: Discussion 2016-01-04T17:09:36Ztag:support.markedapp.com,2011-09-11:Comment/292151152013-10-05T15:17:57Z2013-10-05T15:17:57ZTable of contents in export<div><p>Try <!--TOC--> in the Markdown, it should do what you
want. You can also use a max# parameter to control the depth of the
TOC: <a href=
"http://marked2app.com/help/Special_Syntax.html">http://marked2app.com/help/Special_Syntax.html</a></p></div>Bretttag:support.markedapp.com,2011-09-11:Comment/292151152014-03-06T09:29:13Z2014-03-06T09:29:15ZTable of contents in export<div><p>I'm having the same problem. It prints the Table of contents
fine. But when I export to HTML it does not work. I've added
<!--TOC--> but it does not help.</p></div>Rocketmantag:support.markedapp.com,2011-09-11:Comment/292151152014-03-06T13:50:01Z2014-03-06T13:50:01ZTable of contents in export<div><p>TOC doesn't work in HTML export.</p></div>Bretttag:support.markedapp.com,2011-09-11:Comment/292151152014-03-06T14:53:31Z2014-03-06T14:53:31ZTable of contents in export<div><p>Thanks, that's what I suspected. Would have been nice
though.</p></div>Rocketmantag:support.markedapp.com,2011-09-11:Comment/292151152014-03-06T15:01:17Z2014-03-06T15:01:17ZTable of contents in export<div><p>The Table of Contents is generated by JavaScript, so if you
needed to,<br>
you could actually embed the javascript in your exported documents.
Let<br>
me know if that's something that would be workable for your needs
and<br>
I'll look into making it possible.</p>
<p>-Brett</p></div>Bretttag:support.markedapp.com,2011-09-11:Comment/292151152014-03-06T18:12:34Z2014-03-06T18:12:38ZTable of contents in export<div><p>Thanks, that works fine. Powerful.</p></div>Rocketmantag:support.markedapp.com,2011-09-11:Comment/292151152015-08-21T21:24:52Z2015-08-21T21:24:53ZTable of contents in export<div><p>Would it be possible to add a "embed TOC javascript" check to
the HTML save box if you've either said to print TOC in prefs or
added <!--TOC-->?</p>
<p>Alternatively, add a checkbox to save to embed generated TOC
HTML into the HTML export?</p></div>Jonathantag:support.markedapp.com,2011-09-11:Comment/292151152015-08-21T21:38:52Z2015-08-21T21:38:52ZTable of contents in export<div><p>Next update will embed the TOC as actual HTML under those
circumstances.</p></div>Bretttag:support.markedapp.com,2011-09-11:Comment/292151152015-08-21T23:24:44Z2015-08-21T23:24:45ZTable of contents in export<div><p>Thanks, brett!</p>
<p>(Markdown + Marked2 n00b, and really appreciating the app)</p></div>Jonathan Bennetttag:support.markedapp.com,2011-09-11:Comment/292151152015-08-23T15:59:59Z2015-08-23T18:08:13ZTable of contents in export<div><p>Hi just a follow-up question to this. After reading <a href="http://marked2app.com/help/Special_Syntax.html#tableofcontents">http://marked2app.com/help/Special_Syntax.html#tableofcontents</a>
I'm wondering if there is a way to make the table of contents show
when exporting to HTML but not in preview. In other words, I'd like
to use the cmd+T window while previewing but have links at the top
when exporting.</p>
<p>When I have the "Print table of contents" box checked it behaves
this way for printing, just not exporting to HTML.</p></div>btoonetag:support.markedapp.com,2011-09-11:Comment/292151152015-08-23T16:16:34Z2015-08-23T16:16:34ZTable of contents in export<div><p>Not for HTML export. "Print TOC" only affects print and PDF
export. HTML<br>
export only gets what's in the preview right now.</p>
<p>It's possible to apply some CSS using the "Additional CSS" in
Style<br>
preferences to hide elements in the preview that aren't hidden in
export<br>
because Marked applies some special classes during preview.
However,<br>
these are dependent on the current theme, so the rule would have to
be<br>
repeated if you use multiple themes. Here's an example:</p>
<pre>
<code>.mkstyle--swiss #mkreplaced-toc {
display: none!important;
}</code>
</pre>
<p>The 'mkstyle--swiss' class is not exported, so the rule would
have no<br>
effect in HTML outside of Marked. It's not an ideal solution, but
it's<br>
assumed that if you want a manually-inserted TOC, you want it in
both<br>
places, and there's currently no option to automatically generate
one<br>
during export because it's generating the exported HTML prior to
display<br>
in the preview window, and the TOC is generated with JavaScript
within<br>
the preview.</p>
<p>-Brett</p></div>Bretttag:support.markedapp.com,2011-09-11:Comment/292151152015-08-23T16:54:00Z2015-08-23T16:54:02ZTable of contents in export<div><p>Great, thanks for the clarification and work-around.</p></div>btoonetag:support.markedapp.com,2011-09-11:Comment/292151152016-01-04T15:43:59Z2016-01-04T15:43:59ZTable of contents in export<div><p>With <!--TOC--> I can create a Table of Contents, which is
beautifully exported to PDF. However, when I click on an item of
this TOC in the PDF, there is no jump to the corresponding chapter.
Is it possible to have this working?</p></div>Hanstag:support.markedapp.com,2011-09-11:Comment/292151152016-01-04T17:09:33Z2016-01-04T17:09:33ZTable of contents in export<div><p>@info: please see <a href="http://support.markedapp.com/discussions/questions/16-preserving-links-and-cross-references-in-pdf-output">
this discussion</a></p></div>Brett