Merck / r2rtf

Easily Create Production-Ready Rich Text Format (RTF) Table and Figure
https://merck.github.io/r2rtf
GNU General Public License v3.0
78 stars 20 forks source link

How to add cover and table of contents to combined rtf file #173

Closed perphy closed 1 year ago

perphy commented 1 year ago

as the title described, we can only use assemble_rtf function to combine multiple rtf files into one , but can't add the table of content and cover for it? how do you deal with this problem?

elong0527 commented 1 year ago

It is out of scope for r2rtf.

In Microsoft Word, You can get a TOC manually by

  1. Select text in similar format (assuming titles have format different from table bodys)

https://www.laptopmag.com/articles/select-text-similar-formatting-word

  1. Define them as a named format.

  2. Use the format to define your TOC in word.

https://support.microsoft.com/en-us/office/format-or-customize-a-table-of-contents-9d85eb9c-0b55-4795-8abb-a49885b3a58d

You may try to handle it programmatically as you can either pre-specify title or extract title from RTF.

Here is a toy example : https://merck.github.io/metalite/articles/ar-grid.html