我使用下面的代码设置pdf文档属性中的标题和作者。
\usepackage[pdftex]{hyperref}
\hypersetup{
pdftitle = {The documents title},
pdfauthor = {me}
}
我想通过放在一个样式表(.sty)中来自动化这个过程。以下是我的尝试,但它没有起作用。使用pdflatex编译pdf时会出现错误。但是pdf文档属性仍保持为空。
\usepackage[pdftex]{hyperref}
\hypersetup{
pdftitle = {\@title},
pdfauthor = {\@author}
}
我使用\@title和\@author变量创建自定义的标题页,所以我知道它们是有效的。
有什么建议吗?
.sty
文件中。 - grddev.sty
文件中使用\makeatother
,会不会引起问题?我建议从.sty
版本中删除\makeatletter
和\makeatother
,因为它们在那里并不需要。 - Scz