How do you Remove the Table of Contents from Published Code?

21 ビュー (過去 30 日間)
Christian
Christian 2024 年 10 月 5 日
回答済み: Udit06 2024 年 10 月 5 日
When using the publish to show my code in a pdf a table of contents is added. This is showing up without any input in the code itself or observable settings. Even when there is nothing for the TOC to index it is included in the pdf.

採用された回答

Udit06
Udit06 2024 年 10 月 5 日
Hi,
Currently there is no direct way to remove the contents section from the published code. However, as a workaround, you can publish the code in HTML format and then edit the resultant HTML file to remove the contents section. To remove that section, you can search the "Contents" which is within <H2> tag and remove the heading and the following table from the HTML file. The removed part will look similar to the following:
<h2>Contents</h2>
<div>
<ul>
<li>
<a href="#1">Add an Odd Harmonic and Plot It</a>
</li>
<li>
<a href="#5">Note About Gibbs Phenomenon</a>
</li>
</ul>
</div>
I hope this helps.

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeMATLAB Report Generator についてさらに検索

タグ

製品


リリース

R2023b

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by