TransWikia.com

Problems with a minipage into tikzpicture in a beamer presentation

TeX - LaTeX Asked on June 23, 2021

I’m writing a presentation and I have a problem with minipages into tikz presentation.

begin{frame}[plain]
begin{tikzpicture}
    useasboundingbox (0,0) rectangle(thepaperwidth,thepaperheight);
    node (lemma) at (9.5cm,1.2cm) [lemma] {
            begin{minipage}{0.65textwidth}scriptsize
            
            $ $
            noindenttextbf{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(thepaperwidth,thepaperheight);
        node (lemma) at (9.5cm,1.2cm) [lemma] {
            begin{minipage}{0.65textwidth}scriptsize
            
            $ $
            noindenttextbf{Lemma.} This is a lemma
            [Math]
            End of the lemma
            
            end{minipage}
        };
        end{tikzpicture} 
    end{frame}
end{document}

One Answer

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(thepaperwidth,thepaperheight);
        node (lemma) at (9.5cm,1.2cm) [lemma] {
            begin{minipage}{0.65textwidth}scriptsize

            noindenttextbf{Lemma.} This is a lemma
            [Math]
            End of the lemma

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

Answered by daleif on June 23, 2021

Add your own answers!

Ask a Question

Get help from others!

© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP