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 \@
\makeatletter\@ifpackageloaded{packagename}{true}{false}\makeatother-- You need this syntax only in a document, in a.styor.clsfile it's not necessary! – Aug 23 '16 at 20:34\makeatletter...\makeatotherpair. See What do\makeatletterand\makeatotherdo? – Werner Aug 23 '16 at 20:35