Some things like glass vases are sensible and can break when moving. You have to protect them from breaking using protection, for example using bubble wrap.
The same with LaTeX. Some commands in moving arguments are fragile, so you have to protect them.
Code: Select all
\documentclass[12pt,twoside,
%nofootinbib%unknown
]{book}
\usepackage[T1]{fontenc}
\usepackage{microtype}
\usepackage{amsmath}
\usepackage{graphicx}
\newcommand*\pct{\protect\scalebox{0.9}{\%}}
\begin{document}
Here, it works : $x = 2.0\,\pct$.
\begin{figure}
Test
\caption{Here, it gives a compilation error : $x = 1.0\,\pct$.}
\end{figure}
\end{document}
The smart way: Calm down and take a deep breath, read posts and provided links attentively, try to understand and ask if necessary.