0

I have the following call to the \hypersetup macro:

\hypersetup{
    pdfauthor={My Name},
    pdftitle={Title},
    pdfkeywords={LaTeX, PDF},
    pdfcreator={PDFLaTeX},
    pdfproducer={PDFLaTeX},
}

Which is only usable if I have the hyperref package loaded. So I tried to wrap it under conditionals:

\@ifpackageloaded{hyperref}
{\hypersetup{
    pdfauthor={My Name},
    pdftitle={Title},
    pdfkeywords={LaTeX, PDF},
    pdfcreator={PDFLaTeX},
    pdfproducer={PDFLaTeX},
}}
{ }

and I get the following compilation error:

! You can't use `\spacefactor' in vertical mode.
\@->\spacefactor 
                 \@m {}
l.19 \@
Jason
  • 459

0 Answers0