Why is the following minimal example not working?
I.e., what do I need to do, in order to define the float placement specifier of a figure within a macro? (I know that I should use \newcommand, but in the "full" example the error is part of an involved "superfigure" command. \newcommand is not working too btw.)
\documentclass{scrreprt}
\usepackage{blindtext}
\def\PosNotWorking{h}
\def\FramboxNotWorking{5cm}
\def\CaptionWorking{Caption is working.}
\begin{document}
\Blindtext[1]
\begin{figure}[\PosNotWorking]
\centering
\framebox[5cm]{My special figure. (Pos: \PosNotWorking)}
\caption{\CaptionWorking}
\end{figure}
\Blindtext[1]
\end{document}
If I compile this, the figure is at the top (default behaviour). If I enter \figure[h] instead of \figure[\PosNotWorking], the figure is of course between the two paragraphs.
\edefsolution works great! Though I think the last one would be more elegant. Unfortunately, I can't seem to get it to work. If I put the redefinition in the preamble of the document, how should I call the new figure environment? The command\begin{figure}{\PosNotWorking}does not seem to work. – Adriaan Oct 26 '13 at 10:28\begin{figure}[\PosNotWorking]. You used{ }instead of[ ]. – Martin Scharrer Oct 27 '13 at 23:23