Sorry for the beginner question, but I'd like to know if there is a robust way to do what the title says. The following MWE
\documentclass{book}
\usepackage[demo]{graphicx}
\newcommand{\myoptions}{h!tb}
\begin{document}
\begin{figure}[\myoptions]
\centering
\includegraphics[width=0.5\textwidth]{whatever}
\caption[Short caption citing something]{Long caption.}
\label{fig:whatever}
\end{figure}
\end{document}
gives the error ! LaTeX Error: Unknown float option '\'..
Actually I found a workaround (in my actual document the \figure environment is used by a new command that takes many parameters needed to define a figure and puts them inside \figure), but it gives problems with \cite command inside short caption, that's why I'm looking for a robust solution.
SOLUTION
Here is the solution to this question, that was given as a comment to the accepted answer:
\documentclass{book}
\usepackage[demo]{graphicx}
\newcommand{\myoptions}{h!tb}
\def\tmp#1{\begin{figure}[#1]}% use tmp, in the form below, as many times as needed
\begin{document}
\expandafter\tmp\expandafter{\myoptions}
\centering
\includegraphics[width=0.5\textwidth]{whatever}
\caption[Short caption citing something]{Long caption.}
\label{fig:whatever}
\end{figure}
\end{document}

!) are for one-off special cases where you need to fine-tune and over-ride the defaults. there should never be a need to automate over-riding the default. If the default for a document type should behtbthen definefps@figureto behtband then no optional argument is needed to set that. – David Carlisle Sep 28 '15 at 11:35fps@figureto some value? – mmj Sep 28 '15 at 14:12\makeatletter(or be inside a package file) then\renewcommand\fps@figure{htp}– David Carlisle Sep 28 '15 at 14:15\cite. But if you want help with that do not edit the question to ask an unrelated question, ask a new question and with a new the example demonstrate the error for which you want to get help – David Carlisle Sep 28 '15 at 14:19