0

I'm trying to create a macro that takes $4$ parameters. A name, a date, a hyperlink address, and text for the hyperlink. My macro is:

\newcommand\authordate[4]{\textbf{Author}: #1, #2. \\ \textbf{Source}:
\href{#3}{#4}}

However it's working, if I call it with the following:

\authordate{Joe, 2017, http://www.google.com, Google}

I get the error message:

! Paragraph ended before \hyper@n@rmalise was complete.

It should look like:

Author: John, 2017.

Source: Google

Does anyone know how I can fix it?

  • 2
    You say it should have 4 arguments. You would have to use \authordate{Joe}{2017}{http://www.google.com}{Google}. – TeXnician Mar 17 '17 at 17:31
  • Then please close/delete this question. – TeXnician Mar 17 '17 at 17:35
2

Just to transfer my comment to an answer: You defined the following:

\newcommand\authordate[4]{\textbf{Author}: #1, #2. \\ \textbf{Source}:
\href{#3}{#4}}

The [4] indicates you want it to have 4 arguments. The problem: TeX does not interpret lists like a,b,c,d. It wants them to have as {a}{b}{c}{d}.

So you need the following call to have it do its job:

\authordate{Joe}{2017}{http://www.google.com}{Google}
| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.