Some time ago I wrote a command that I used many times, today I realize that it could be written correctly. in particular, the command is selected as "not in a mathematical environment". I looked for other solutions but I do not like them.
I see writing pleasant, but can this command create problems? could you give me a suggestion to write it correctly? Thank you
\documentclass[a4paper]{article}
\usepackage[T1]{fontenc}
\usepackage[italian]{babel}
\usepackage{amsmath}
\usepackage{mwe}
\usepackage{scalerel}
\newcommand\scale[2]{\vstretch{#1}{\hstretch{#1}{#2}}}
\newcommand\ssp[1]{#1^{\scale{.8}{\scriptstyle{\prime}}}}
\newcommand\sspp[1]{#1^{\scale{.8}{\scriptstyle{\prime\prime}}}}
\begin{document}
\begin{minipage}[t]{.5\textwidth}
\begin{align}
\ssp{z_G}\\
\sspp{z_{G}}
\end{align}
\end{minipage}
\begin{minipage}[t]{.5\textwidth}
\begin{align}
\ssp{G}\\
\sspp{G}
\end{align}
\end{minipage}\\
\end{document}



\newcommand\ssp[1]{#1'} \newcommand\sspp[1]{#1''}– David Carlisle Feb 21 '19 at 21:17\scalecommand I found a nice size for reading and for printing. the problem is certainly the unspecified command in the proper way and the position of the quotes in some conditions – Antonio Feb 22 '19 at 10:32