Problems with a minipage into tikzpicture in a beamer presentation

Im writting a presentation and i have a problem with minipages into tikz presentation.

\begin{frame}[plain]
\begin{tikzpicture}
\useasboundingbox (0,0) rectangle(\the\paperwidth,\the\paperheight);
\node (lemma) at (9.5cm,1.2cm) [lemma] {
\begin{minipage}{0.65\textwidth}\scriptsize\\

$\$\\
\noindent\textbf{Lemma.} This is a lemma
$Math$
End of the lemma\\

\end{minipage}
};
\end{tikzpicture}
\end{frame}


I can't compile it. The error is "Missing \endcsname inserted. \end{frame}". I don't know what is happening here, and i can't found nothing similar.

EDIT I'm using this kind of lemma because i want to put in a exact position. in order to do something like this: The minimal code:

\documentclass{beamer}
\usepackage[utf8]{inputenc}
\usepackage[english]{babel}
\usepackage{amsmath, amssymb, amsthm, amsfonts}
\usepackage{tikz}
\usepackage{tikz-cd}
\usetikzlibrary{shapes.geometric, arrows}
\tikzstyle{lemma} = [rectangle, minimum width=1cm, minimum height=1cm, text centered, draw=black, line width=2pt,fill=black,fill opacity=.45,text opacity=1]
\begin{document}
\begin{frame}[plain]
\begin{tikzpicture}
\useasboundingbox (0,0) rectangle(\the\paperwidth,\the\paperheight);
\node (lemma) at (9.5cm,1.2cm) [lemma] {
\begin{minipage}{0.65\textwidth}\scriptsize\\

$\$\\
\noindent\textbf{Lemma.} This is a lemma
$Math$
End of the lemma\\

\end{minipage}
};
\end{tikzpicture}
\end{frame}
\end{document}

• As always on the site, please post a full minimal example including documentclass (beamer) and a limited preamble. BTW why make your own? beamer some with lemma support – daleif Jun 10 at 10:20
• Unlearn the use of \\ in the text, the error you get is there is no line to end here, removing those \\ removes those errors. Next you forgot to define processcolor2, after defining that as well the example works – daleif Jun 10 at 10:48
• @daleif this is not the problem, because if I comment everything in the minipage the error is the same. The color i forgot to introduce it in the code, but you can replace it by black – Guille Carrion Jun 10 at 11:54
• Just remove the \\  after \scriptsize. – user194703 Jun 10 at 13:14

Too long for comment. This compiles for me on TeXLive 2020. I just removed the \\'s and the irrelevant $\$\\

\documentclass{beamer}
\usepackage[utf8]{inputenc}
\usepackage[english]{babel}
\usepackage{amsmath, amssymb, amsthm, amsfonts}
\usepackage{tikz}
\usepackage{tikz-cd}
\usetikzlibrary{shapes.geometric, arrows}
\tikzstyle{lemma} = [rectangle, minimum width=1cm, minimum height=1cm, text centered, draw=black, line width=2pt,fill=black,fill opacity=.45,text opacity=1]
\begin{document}
\begin{frame}[plain]
\begin{tikzpicture}
\useasboundingbox (0,0) rectangle(\the\paperwidth,\the\paperheight);
\node (lemma) at (9.5cm,1.2cm) [lemma] {
\begin{minipage}{0.65\textwidth}\scriptsize

\noindent\textbf{Lemma.} This is a lemma
$Math$
End of the lemma

\end{minipage}
};
\end{tikzpicture}
\end{frame}
\end{document}

• I think it's a problem of my computer, your code doesn't copiles but in other one yes. Tank you – Guille Carrion Jun 10 at 14:54