Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

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:

\newcommand{\details}{textborder=roundedsmall,borderColor=black,headerborder=open,linewidth=1,boxshade=plain,boxColorOne=box,headerColorOne=head1,headerColorTwo=head2}

and then:

\headerbox{Aims}{name=aims,column=0,below=background,\details}{
    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?

share|improve this question
    
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
add comment

1 Answer

one way is to invert the call structure:

\newcommand\myhead[][2]{%
\headerbox{#2}{#1,textborder=roundedsmall,borderColor=black,headerborder=open,linewidth=1,boxshade=plain,boxColorOne=box,headerColorOne=head1,headerColorTwo=head2}}


..

\myhead[name=aims,column=0,below=background]{Aims}{
    Aims
}
share|improve this answer
    
Thanks for the reply, but unfortunately this doesn't seem to work. I think it might be due to head1 and head2 being custom colours (set with \definecolor)? –  Dan Jan 29 '12 at 0:09
    
@Dan David had missed an open brace. Apart from that, his code should do exactly what you seem to be asking for. Since you are not telling us what packages you are loading, it is impossible to know what "custom colours set with \definecolor" are (also, that would probably be a different question than this one). –  Bruno Le Floch Jan 29 '12 at 0:14
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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