Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit a8627ac

Browse files
committed
Use hyperref to set up the PDF information dictionary (fixes sphinx-doc#3551)
1 parent 254c045 commit a8627ac

3 files changed

Lines changed: 9 additions & 12 deletions

File tree

CHANGES

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -109,6 +109,7 @@ Bugs fixed
109109
* #2693: Sphinx latex style file wrongly inhibits colours for section headings
110110
for latex+dvi(ps,pdf,pdfmx)
111111
* C++, properly look up ``any`` references.
112+
* #3551: PDF information dictionary is lacking author and title data
112113

113114
Deprecated
114115
----------

sphinx/texinputs/sphinxhowto.cls

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -31,13 +31,11 @@
3131
%
3232
\renewcommand{\maketitle}{%
3333
\noindent\rule{\textwidth}{1pt}\par
34-
% FIXME: use \hypersetup{pdfauthor={\@author}, pdftitle={\@title}}
35-
\ifdefined\pdfinfo
36-
\begingroup
37-
%\pdfstringdefDisableCommands{\def\\{, }\def\endgraf{ }\def\and{, }}%
38-
%\hypersetup{pdfauthor={\@author}, pdftitle={\@title}}%
34+
\begingroup % for PDF information dictionary
35+
\def\endgraf{ }\def\and{\& }%
36+
\pdfstringdefDisableCommands{\def\\{, }}% overwrite hyperref setup
37+
\hypersetup{pdfauthor={\@author}, pdftitle={\@title}}%
3938
\endgroup
40-
\fi
4139
\begin{flushright}
4240
\sphinxlogo
4341
\py@HeaderFamily

sphinx/texinputs/sphinxmanual.cls

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -41,13 +41,11 @@
4141
\let\footnotesize\small
4242
\let\footnoterule\relax
4343
\noindent\rule{\textwidth}{1pt}\par
44-
% FIXME: use \hypersetup{pdfauthor={\@author}, pdftitle={\@title}}
45-
\ifdefined\pdfinfo
46-
\begingroup
47-
%\pdfstringdefDisableCommands{\def\\{, }\def\endgraf{ }\def\and{, }}%
48-
%\hypersetup{pdfauthor={\@author}, pdftitle={\@title}}%
44+
\begingroup % for PDF information dictionary
45+
\def\endgraf{ }\def\and{\& }%
46+
\pdfstringdefDisableCommands{\def\\{, }}% overwrite hyperref setup
47+
\hypersetup{pdfauthor={\@author}, pdftitle={\@title}}%
4948
\endgroup
50-
\fi
5149
\begin{flushright}%
5250
\sphinxlogo
5351
\py@HeaderFamily

0 commit comments

Comments
 (0)