# Using a string defined with \newcommand as a function argument

I'm currently using LaTeX to make a poster, which is all going very nicely. However for each of the seven boxes on the poster, I've got to pass eight arguments which may change in the future. I thought a sensible thing to do would be:

and then:

Aims
}

However this throws out an error

Package xkeyval Error: blabla (the contents of \details) undefined in families posterbox.

I have checked that replacing the \details with the contents of the custom command works fine!

Any ideas on how to solve this?

-
Welcome to TeX.SE. If the answer below does not solve your issue, keep in mind that while code snippets are useful in explanations, it is always best to compose a fully compilable MWE that illustrates the problem including the \documentclass and the appropriate packages so that those trying to help don't have to recreate it. This will also help to ensure that the proposed solution actually works for you. –  Peter Grill Jan 29 '12 at 0:45
@craq the original fails because xkeyval (following keyval) goes to some lengths not to expand macros in its argument so that you can have a setting such as zzz=\wibble and the value of the value of the key is \wibble not the value of \wibble prematurely expanded while parsing the key list. –  David Carlisle Nov 21 '14 at 11:35
@craq Are you asking why the code in the question failed or why Dan's initial attempt to implement the answer given didn't work? (But I thought the latter was addressed in the comments.) –  cfr Nov 22 '14 at 23:37
@cfr I was asking about the initial attempt. I agree, @DavidCarlisle's comment explains that nicely. I assume that there is no workaround, such as double-escaping e.g. zzz=\\wibble in the same vein as nested arguments ##1 or like shell scripts? –  craq Nov 24 '14 at 8:45
@craq you can pre-expand the argument see the added example (below the line) in my answer using \edef –  David Carlisle Nov 24 '14 at 9:53

one way is to invert the call structure:

..

Aims
}

If you do not want to do that you need to expand \details before passing the keyval optional argument to the macro, one way is

\newcommand{\details}{textborder=roundedsmall,borderColor=black,