Books found online often do not come with a table of contents, and some of the existing tables of contents are garbled. This tutorial is written to solve this problem.
It can be roughly divided into the following situations:
-
No table of contents bookmark
-
Table of contents bookmark with only page numbers
-
Garbled table of contents bookmark
In general, the addition of a table of contents can be divided into the following three steps: 1. Find the table of contents; 2. Enter the table of contents text; 3. Insert the table of contents bookmark.
The following tutorial is only for use with PDF files.
1. Find the table of contents#
Some books come with a table of contents, in which case you can skip to the second step, but some books do not have a table of contents.
- First, you can log in to the National Library Reference and Consulting Alliance to search for books.
Taking "Jianshang" as an example:
Pay attention to the table of contents page in the upper right corner
Note: If you can find the book in the National Library Reference and Consulting Alliance and the book is not a newly published book, you can quickly obtain the table of contents with the help of the SS number, see the second part
- You can search on websites such as Douban, Taobao, and JD.com.
Kongfuzi Old Book Network
Douban
Taobao
JD.com
- You can also try your luck on websites like Baidu Baike and Wikipedia, or see if anyone on JD.com or Taobao has uploaded the table of contents in their reviews.
If you still can't find it, you can only suggest typing it manually, in which case you need to refer to the second step.
2. Enter the table of contents text#
-
Typing manually is a method you can always trust, just like the No. 11 bus.
-
Use the SS number to obtain the table of contents. Use it in conjunction with the National Library Reference and Consulting Alliance to download the bookmark acquisition tool (https://wwgz.lanzoue.com/i74lM1cs6qx password: 73bp), enter the SS number, and copy it all. In most cases, the table of contents is already organized, but sometimes it needs to be adjusted.
You can enter the book's table of contents page to query the SS number, which is the number after "base".
15190286 is the SS number
Note: The bookmark tool may be reported as a virus.
Shortcoming: The bookmark tool may not work for books without a book overview, and it may not work for newly published books.
-
Copy and paste. If the PDF document is copyable, directly copy the document content to Word.
-
OCR input. Use it on images or documents. I haven't found a software that is particularly suitable for this. Here, I only recommend the OCR action in Quicker software, which can be adjusted in the settings. Both Baidu API and Tencent API can be used.
Note: You can organize it in the text box of Quicker, and use regular expressions to complete the organization.
Shortcoming: When using the OCR action to recognize the table of contents, it always recognizes the numbers at the end of the table of contents as the next line, and manual adjustment is required.
- PDF conversion. This is a bit more complicated and requires more requirements.
(1) First, split the PDF file and save the table of contents (if any) as a separate PDF. There are three methods.
A. Split using the Quicker action. Use PDF Processing to directly split the original file.
B. Go to Split PDF, select the "Extract pages" option, select the table of contents page, and then click "Extract" and finally download it. (Note: The PDF file cannot exceed 100MB and needs to be downloaded with IDM)
B. Download PDFPatcher, an open-source PDF toolkit. After downloading, open the PDF file, click on the toolkit, click on "Extract Document Content", select "Split Document", choose the PDF path and output path, fill in the appropriate page range (as shown in the figure), and finally extract it.
Note that the page range is based on the actual pages.
(2) Convert the PDF file using ABBYY FineReader (recommended version 16, version 15 is not accurate enough) to make it searchable.
Copy after selecting all
(3) Paste the obtained table of contents in Word, and use wildcards to organize it by deleting blank lines, blank half-width spaces, unnecessary text, page number symbols, etc. After organizing, the format of each line should be chapter, table of contents title, and page number in order.
Note: (There should be a space between the chapter and the title, and if you want an expandable table of contents bookmark, you need to add a tab)
Example 1
Example 2
3. Insert the table of contents bookmark (core)#
- Download the software pdgcteditor from the blog.
strnghrs - 博客园
老马的原创空间
- Open pdgcteditor.exe, select the PDF file, paste the content organized in Word and select all, click "Automatic Split Page Numbers", modify the base page, and click "Save".
Order
The situation after splitting the page numbers
The base code is the actual page of the first page of the page number. (The first page of the page may vary depending on the situation, it may be the table of contents, preface, or main text)
- Actual effect display:
Special case:
Sometimes PDF files do not allow editing.
Solution: Download pdfdir and open it, select the PDF, paste the content from Word, click "Write", and you will get a new *_new.pdf file. Then re-edit the table of contents bookmark with pdgcnteditor. The principle is unknown, but it is speculated that it is forcibly written.
Summary: I'm really tired after writing this, and I'm not very proficient, please forgive me. At the beginning, the mouse would occasionally malfunction, the mouse pointer would drift, and the delete key would always delete two spaces, which made me very annoyed during the process of writing the blog. Later, I found that it was caused by the extension. I used to encounter this problem when writing on Zhihu and Douban, and I always thought it was a problem with the platform. I just discovered that it was caused by the extension. I'm exhausted.