Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 645577
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T21:31:06+00:00 2026-05-13T21:31:06+00:00

LaTeX is a wonderful language for writing documents. With the hyperref package and pdflatex

  • 0

LaTeX is a wonderful language for writing documents. With the hyperref package and pdflatex, you easily generate documents with metadata, a nice feature to get your documents referenced right on the web.

I often use templates like:

\documentclass[11pt]{article}
\usepackage[pdftex, pdfusetitle,colorlinks=false,pdfborder={0 0 0}]{hyperref}%
\hypersetup{%
pdftitle={My title},%
pdfauthor={My name},%
pdfkeywords={my first keyword, my second keyword, more keywords.},%
}%
\begin{document}

\title{My title}
\author{My name}
\date{}
\maketitle

{\bf Keywords:} my first keyword, my second keyword, more keywords.%

My text is here...

\end{document}

So far, it’s well. My question pops out from the example: is there a way to define string variables in the header so that they can be passed as arguments to hyperref and then to the frontmatter or to the text. Something like:

\documentclass[11pt]{article}
%-------definitions-----
\def\Author{My name}
\def\Title{My title}
\def\Keywords{my first keyword, my second keyword, more keywords.}
%--------------------------
\usepackage[pdftex, pdfusetitle,colorlinks=false,pdfborder={0 0 0}]{hyperref}%
\hypersetup{%
pdftitle={\Title},%
pdfauthor={\Author},%
pdfkeywords={\Keywords},%
}%
\begin{document}
\title{\Title}
\author{\Author}
\date{}
\maketitle

{\bf Keywords:} \Keywords %

My text is here...

\end{document}

This fails for the \maketitle part and for the hyperref metadata with ! Use of \Title doesn't match ! Argument of \let has an extra }.but also for including the keywords.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-13T21:31:06+00:00Added an answer on May 13, 2026 at 9:31 pm

    The correct template should look like:

    \documentclass[11pt]{article}
    %-------definitions-----
    \newcommand{\Author}{My name} 
    \newcommand{\Title}{My title}
    \newcommand{\Keywords}{my first keyword, my first keyword, more keywords.}
    %--------------------------
    \usepackage[pdftex, pdfusetitle,colorlinks=false,pdfborder={0 0 0}]{hyperref}%
    \hypersetup{%
    pdftitle={\Title},%
    pdfauthor={\Author},%
    pdfkeywords={\Keywords},%
    }%
    \begin{document}
    \title{\Title}
    \author{\Author}
    \date{}
    \maketitle
    {\bf Keywords:} \Keywords %
    
    My text is here...
    
    \end{document}
    

    Compiles fine and the metadata shows fine in the pdf reader.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

The latex hyperref package makes a really nice, linked table of contents, named according
I use LaTeX with the hyperref package and I have things like: hyperref is
The LaTeX hyperref package confuses me in several ways. Here's my particular problem. In
I'm using LaTeX 's listings package to format source code. Unfortunately I get curly
I am using the wonderful sympy in python to generate the augmented system of
Latex seems to fill in white space between the paragraphs by default, to get
I recently added the wonderful MiniProfiler package to my project and it helped me
The ipython python shell has a wonderful feature, whereby you can type: foo?? and
In LaTeX you can easily reference a section by using \label{} next to a
I found Org-mode + LaTeX to be a very wonderful tool. How can I

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.