5

I am editing a document for my classes, the idea is that when I talk about technology, I add the code in the document.

I wish there was something similar to the attached image.

enter image description here

\documentclass[12pt]{standalone}

\usepackage{graphicx}
\usepackage{amsmath,amsfonts,amssymb}
\usepackage{pgf,tikz}
\usepackage{xcolor}
\usepackage{ifsym}

\newcommand{\calculator}{ %
        \begin{tikzpicture}[rounded corners=1pt]
        \draw[line width=.4pt,draw=gray!50, ball color = black!70, opacity = 0.7] (0.,0.) -- (0.44,0.) -- (0.44,0.64) -- (0.,0.64) -- cycle;
        \draw[line width=.5pt,draw=white,fill=white] (0.04,0.6) -- (0.4,0.6) -- (0.4,0.44) -- (0.04,0.44) -- cycle;
        \draw[line width=.05pt,draw=blue!50,ball color=blue!50] (0.04,0.4) -- (0.2,0.4) -- (0.2,0.24) -- (0.04,0.24) -- cycle;
        \draw[line width=.05pt,draw=blue!50,ball color=blue!50] (0.24,0.4) -- (0.4,0.4) -- (0.4,0.24) -- (0.24,0.24) -- cycle;
        \draw[line width=.05pt,draw=blue!50,fill=blue, ball color=blue!50] (0.04,0.2) -- (0.2,0.2) -- (0.2,0.04) -- (0.04,0.04) -- cycle;
        \draw[line width=.05pt,draw=orange,ball color=orange] (0.24,0.2) -- (0.4,0.2) -- (0.4,0.04) -- (0.24,0.04) -- cycle;

        \draw (-0.17,0.755) node[anchor=north west] { \scalebox{.4}{ \textifsym{123}}};

        \draw (-0.15,0.52) node[anchor=north west] {\scalebox{.4}{ $\mathbf{ \boldsymbol{+}}$}};
        \draw (0.06,0.52) node[anchor=north west] {\scalebox{.4}{ $\mathbf{-}$}};
        \draw [white] (0.06,0.28) node[anchor=north west] {\scalebox{.4}{ $\mathbf{=}$}};
        \draw (-0.08,0.3) node[anchor=north west] {\scalebox{.4}{\textbf{x}}};
        \end{tikzpicture} }

\begin{document}

\calculator  Calculadora $\boldsymbol{3x+x^2=7}$ 

\end{document}
8

Here is a proposal. Since the calculators you are using are tiny, I start with a full scale thing.

\documentclass{article}
\usepackage{amsmath,amsfonts,amssymb}
\usepackage{tikz}
\usetikzlibrary{shadings,fit}
\usepackage{ifsym}
\pgfdeclarelayer{bbground}
\pgfdeclarelayer{background}
\pgfdeclarelayer{foreground}
\pgfsetlayers{bbground,background,main,foreground}
\definecolor{display}{RGB}{206,192,160}
\newcommand{\calculator}[1][0.1]{%
\scalebox{#1}{\begin{tikzpicture}
        \begin{scope}[local bounding box=plus]
         \shade[top color=black!50!white,bottom color=black,rounded corners]
          (0,0) rectangle ++ (1,1);
         \fill[rounded corners=1pt,gray!10] (0.2,0.5) |- (0.4,0.6) |- (0.5,0.8) -| (0.6,0.6)
         -| (0.8,0.5) |- (0.6,0.4) |- (0.5,0.2) -| (0.4,0.4) -| cycle; 
        \end{scope} 
        \begin{scope}[xshift=1.1cm,local bounding box=minus]
         \shade[top color=black!50!white,bottom color=black,rounded corners]
          (0,0) rectangle ++ (1,1);
         \fill[rounded corners=1pt,gray!10] (0.2,0.5) |- (0.5,0.6) -| (0.8,0.5) 
         |- (0.5,0.4) -| cycle; 
        \end{scope} 
        \begin{scope}[local bounding box=times,yshift=-1.1cm]
         \shade[top color=black!50!white,bottom color=black,rounded corners]
          (0,0) rectangle ++ (1,1);
         \fill[rounded corners=1pt,gray!10,rotate around={45:(0.5,0.5)}] 
         (0.2,0.5) |- (0.4,0.6) |- (0.5,0.8) -| (0.6,0.6)
         -| (0.8,0.5) |- (0.6,0.4) |- (0.5,0.2) -| (0.4,0.4) -- (0.2,0.4) -- cycle; 
        \end{scope} 
        \begin{scope}[local bounding box=equal,xshift=1.1cm,yshift=-1.1cm]
         \shade[top color=orange!70!black,bottom color=orange!90!black,rounded corners]
          (0,0) rectangle ++ (1,1);
         \fill[rounded corners=1pt,gray!10,yshift=1.5mm] (0.2,0.5) |- (0.5,0.6) -| (0.8,0.5) 
         |- (0.5,0.4) -| cycle; 
         \fill[rounded corners=1pt,gray!10,yshift=-1.5mm] (0.2,0.5) |- (0.5,0.6) -| (0.8,0.5) 
         |- (0.5,0.4) -| cycle; 
        \end{scope} 
        \begin{scope}[local bounding box=display,yshift=1.1cm]
         \shade[top color=display,bottom color=display!90!black,rounded corners]
          (0,0) rectangle ++ (2.1,1);
         \node[anchor=east,font=\Large\bfseries,text=gray,opacity=0.8] at (2,0.5){\textifsym{123}};
        \end{scope} 
        \begin{pgfonlayer}{background}
         \node[draw=gray!40,line width=0.9pt,top color=gray!70,bottom color=black,rounded corners=4pt,fit=(display) (equal)]
         (fit1){};
        \end{pgfonlayer}
        \begin{pgfonlayer}{bbground}
         \node[top color=gray!70,bottom
         color=gray!70,middle color=black,rounded corners=4pt,fit=(fit1)]
         (fit2){};
        \end{pgfonlayer}
\end{tikzpicture}}}      

\begin{document}
\calculator[1]

\calculator Ingresar la siguiente ecuaci\'{o}n en la calculadora $\boldsymbol{3x+x^2=7}$, determine la cantidad de soluciones. 

\bigskip

\calculator Con Shift 93 limpia la calculadora.

\end{document}

enter image description here

3
  • 2
    +1, very nice, but for me the number is missing some contrast (it doesn't look very realistic that way except if the calculator is low on battery). – TeXnician Nov 9 '18 at 6:50
  • @marmota the code you made is repeated. – Samuel Diaz Nov 9 '18 at 21:17
  • @SamuelDiaz Good catch! That was a copy and paste error. – user121799 Nov 9 '18 at 21:19

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.