From fc7124b39e456b563d93111282cb21caa000d4cd Mon Sep 17 00:00:00 2001 From: Kenshi Muto Date: Sat, 15 Aug 2020 21:14:32 +0900 Subject: [PATCH] prefer hypersetup for pdf information. Closes: #1533 --- templates/latex/review-jlreq/review-base.sty | 28 +++++++++------ templates/latex/review-jsbook/review-base.sty | 36 ++++++++++++------- 2 files changed, 41 insertions(+), 23 deletions(-) diff --git a/templates/latex/review-jlreq/review-base.sty b/templates/latex/review-jlreq/review-base.sty index d193ddada..dacb7c51c 100644 --- a/templates/latex/review-jlreq/review-base.sty +++ b/templates/latex/review-jlreq/review-base.sty @@ -7,16 +7,24 @@ pdfcreator={Re:VIEW \review@reviewversion, with LaTeX} } \else - \newcommand*\PDFDocumentInformation[1]{% - \AtBeginShipoutFirst{\special{pdf:docinfo <<#1>>}}} - \@onlypreamble\PDFDocumentInformation - \PDFDocumentInformation{ - /Title (\review@booktitlename) - \ifdefined\review@autnames /Author (\review@autnames)\fi - % /Subject () - % /Keywords (,,) - /Creator (Re:VIEW \review@reviewversion, with LaTeX) - } + \def\recls@tmp{ebook}\ifx\recls@cameraready\recls@tmp + \hypersetup{ + pdftitle={\review@booktitlename}, + pdfauthor={\ifdefined\review@autnames\review@autnames\fi}, + pdfcreator={Re:VIEW \review@reviewversion, with LaTeX} + } + \else + \newcommand*\PDFDocumentInformation[1]{% + \AtBeginShipoutFirst{\special{pdf:docinfo <<#1>>}}} + \@onlypreamble\PDFDocumentInformation + \PDFDocumentInformation{ + /Title (\review@booktitlename) + \ifdefined\review@autnames /Author (\review@autnames)\fi + % /Subject () + % /Keywords (,,) + /Creator (Re:VIEW \review@reviewversion, with LaTeX) + } + \fi \fi \RequirePackage{pxrubrica} diff --git a/templates/latex/review-jsbook/review-base.sty b/templates/latex/review-jsbook/review-base.sty index de7724b3e..c6f731527 100644 --- a/templates/latex/review-jsbook/review-base.sty +++ b/templates/latex/review-jsbook/review-base.sty @@ -1,4 +1,4 @@ -\ProvidesClass{review-base}[2020/08/14] +\ProvidesClass{review-base}[2020/08/15] \RequirePackage{ifthen} \@ifundefined{Hy@Info}{% for jsbook.cls \RequirePackage[dvipdfmx,bookmarks=true,bookmarksnumbered=true]{hyperref} @@ -60,18 +60,6 @@ \newcommand{\parasep}{\vspace*{3zh}} -\newcommand*\PDFDocumentInformation[1]{% - \AtBeginShipoutFirst{\special{pdf:docinfo <<#1>>}}} -\@onlypreamble\PDFDocumentInformation - -\PDFDocumentInformation{ - /Title (\review@booktitlename) - \ifdefined\review@autnames /Author (\review@autnames)\fi - % /Subject () - % /Keywords (,,) - /Creator (Re:VIEW \review@reviewversion, with LaTeX) -} - \RequirePackage{pxrubrica} \@ifpackagelater{pxrubrica}{2017/04/20}{% \rubysetup{J}}{% @@ -378,6 +366,28 @@ \renewcommand{\appendixname}{\reviewappendixname} \fi +% PDF meta information +\def\recls@tmp{ebook}\ifx\recls@cameraready\recls@tmp +\hypersetup{ + pdftitle={\review@booktitlename}, + pdfauthor={\ifdefined\review@autnames\review@autnames\fi}, + pdfcreator={Re:VIEW \review@reviewversion, with LaTeX} + } +\else +\newcommand*\PDFDocumentInformation[1]{% + \AtBeginShipoutFirst{\special{pdf:docinfo <<#1>>}}} +\@onlypreamble\PDFDocumentInformation + +% for non hyperref. escaped character will be displayed funny... +\PDFDocumentInformation{ + /Title (\review@booktitlename) + \ifdefined\review@autnames /Author (\review@autnames)\fi + % /Subject () + % /Keywords (,,) + /Creator (Re:VIEW \review@reviewversion, with LaTeX) +} +\fi + %% maxwidth is the original width if it is less than linewidth %% otherwise use linewidth (to make sure the graphics do not exceed the margin) \def\maxwidth{%