pingcap / docs

TiDB database documentation.
https://docs.pingcap.com
Other
579 stars 673 forks source link

Title of PDF is incorrect #15983

Open dveeden opened 8 months ago

dveeden commented 8 months ago

Error Report

  1. What is the URL/path of the document related to this issue?

https://download.pingcap.org/tidb-stable-en-manual.pdf

image

$ pdfinfo tidb-stable-en-manual.pdf 
Title:           TiDB Introduction                                          <--------------------------------------
Creator:         LaTeX with hyperref package
Producer:        XeTeX 0.99992
CreationDate:    Fri Dec 29 13:06:16 2023 CET
Custom Metadata: no
Metadata Stream: no
Tagged:          no
UserProperties:  no
Suspects:        no
Form:            none
JavaScript:      no
Pages:           5926
Encrypted:       no
Page size:       612 x 792 pts (letter)
Page rot:        0
File size:       111419027 bytes
Optimized:       no
PDF version:     1.5

The title is "TiDB Introduction", which it should be something like "TiDB User Manual".

  1. How would you like to improve it?
dveeden commented 8 months ago

Looks like ./scripts/merge_by_toc.py should be updated to only have a single metadata section with a proper title.

$ grep -E '^title:' doc.md | head -1
title: TiDB Introduction
$ grep -E '^title:' doc.md | tail -1
title: Glossary
dveeden commented 8 months ago

Looks like there is an easier method:

diff --git a/templates/template.tex b/templates/template.tex
index cf372e561..7dd44ee0f 100644
--- a/templates/template.tex
+++ b/templates/template.tex
@@ -115,7 +115,7 @@ $endif$
 \hypersetup{breaklinks=true,
             bookmarks=true,
             pdfauthor={$author-meta$},
-            pdftitle={$title-meta$},
+            pdftitle="TiDB User Manual"
             colorlinks=true,
             citecolor=$if(citecolor)$$citecolor$$else$blue$endif$,
             urlcolor=$if(urlcolor)$$urlcolor$$else$blue$endif$,