7

I use the following code to draw plus/minus signs

\documentclass{beamer}
\setbeamertemplate{navigation symbols}{}
\usepackage{tikz}   
\begin{document}
\begin{frame}[fragile,t]
\frametitle{}
\begin{tikzpicture}[scale=.9, transform shape]
\vspace {1.cm}
\draw [thick,orange,fill=yellow] (.25,.25) -- ++(0:.25) -- ++(-90:.25)-- ++(0:.25)-- ++(-90:.25)-- ++(180:.25)-- ++(-90:.25)-- ++(180:.25)-- ++(90:.25)-- ++(180:.25)-- ++(90:.25)-- ++(0:.25)-- ++(90:.25) -- cycle;
\draw [thick,green,fill=green](0,-1) -- ++(0:.75) -- ++(-90:.25)  -- ++(180:.75)-- ++(90:.25)-- cycle;
\end{tikzpicture}
\end{frame}
\end{document} 

which gives me

enter image description here

Is it possible to make them look as 3-D objects as any one of the following drawings?

enter image description here enter image description here enter image description here enter image description here enter image description here enter image description here

Hany
  • 4,709

3 Answers3

9

This is just a proposal; it can serve like a “base“ for further things:

\documentclass[border=5pt,tikz]{standalone}
\usetikzlibrary{calc}
\begin{document}
    \begin{tikzpicture}
        \node[inner sep=2cm] (a) {};
        \fill[red] ([xshift=-.5cm]$(a.north west)!.5!(a.north east)$) -- 
                   ([yshift=-1.5cm,xshift=-.5cm]$(a.north west)!.5!(a.north east)$) -- 
                   ([yshift=.5cm]$(a.north west)!.5!(a.south west)$) -- 
                   ([yshift=-.5cm]$(a.north west)!.5!(a.south west)$) -- 
                   ([xshift=1.5cm,yshift=-.5cm]$(a.north west)!.5!(a.south west)$) -- 
                   ([xshift=-.5cm]$(a.south west)!.5!(a.south east)$) -- 
                   ([xshift=.5cm]$(a.south west)!.5!(a.south east)$) -- 
                   ([yshift=1.5cm,xshift=.5cm]$(a.south west)!.5!(a.south east)$) --  
                   ([yshift=-.5cm]$(a.north east)!.5!(a.south east)$) -- 
                   ([yshift=.5cm]$(a.north east)!.5!(a.south east)$) --
                   ([xshift=-1.5cm,yshift=.5cm]$(a.north east)!.5!(a.south east)$) -- 
                   ([xshift=.5cm]$(a.north west)!.5!(a.north east)$) --
                   cycle;
        \draw[red!70!black,ultra thick] ([yshift=-.5cm]$(a.north west)!.5!(a.south west)$) --
                                        ([xshift=1.5cm,yshift=-.5cm]$(a.north west)!.5!(a.south west)$);
        \draw[red!70!black,ultra thick] ([xshift=-.5cm]$(a.south west)!.5!(a.south east)$) --
                                        ([xshift=.5cm]$(a.south west)!.5!(a.south east)$) --
                                        ([yshift=1.5cm,xshift=.5cm]$(a.south west)!.5!(a.south east)$) --
                                        ([yshift=-.5cm]$(a.north east)!.5!(a.south east)$) --
                                        ([yshift=.5cm]$(a.north east)!.5!(a.south east)$) --
                                        ([xshift=-1.5cm,yshift=.5cm]$(a.north east)!.5!(a.south east)$) -- 
                                        ([xshift=.5cm]$(a.north west)!.5!(a.north east)$);
    \end{tikzpicture}
\end{document}

The output:

Screenshot

EDIT: Here are some more examples:

\documentclass[border=5pt,tikz]{standalone}
\usepackage{fourier}
\begin{document}
    \begin{tikzpicture}
        \node at (0.02,-0.02) {Hier steht ein kurzer Text};
        \node[blue!70] at (0,0) {Hier steht ein kurzer Text};
    \end{tikzpicture}
\end{document}

Output:

Screenshot

And:

\documentclass[border=5pt,tikz]{standalone}
\usetikzlibrary{backgrounds,calc}
\usepackage{times}
\begin{document}
    \begin{tikzpicture}
        \node[blue,text width=1.5cm,align=center,draw,fill=white] (a) {\bf\LARGE\TeX\\[3pt]\normalsize Users\\Group};
            \draw[blue,shorten >=1.2cm,shorten <=.1cm] ([yshift=6]a.west) -- ([yshift=6]a.east);
            \draw[blue,shorten >=1.2cm,shorten <=.1cm] ([yshift=6]a.east) -- ([yshift=6]a.west);
        \begin{pgfonlayer}{background}
            \fill[blue] ($(a.north west)+(-.1,-.1)$) -- ($(a.south west)+(-.1,-.1)$) -- ($(a.south east)+(-.1,-.1)$) -- ($(a.north east)+(-.1,-.1)$) -- cycle;
        \end{pgfonlayer}
    \end{tikzpicture}
\end{document}

And here is the output:

Screenshot

current_user
  • 5,235
9

This is what works for 3D marmots

\documentclass{beamer}
\setbeamertemplate{navigation symbols}{}
\usepackage{tikz}   
\begin{document}
\begin{frame}[fragile,t]
\frametitle{}
\begin{tikzpicture}[scale=.9, transform shape]
\vspace {1.cm}
\shade [ball color=orange] (.25,.25) -- ++(0:.25) -- ++(-90:.25)-- ++(0:.25)-- ++(-90:.25)-- ++(180:.25)-- ++(-90:.25)-- ++(180:.25)-- ++(90:.25)-- ++(180:.25)-- ++(90:.25)-- ++(0:.25)-- ++(90:.25) -- cycle;
\shade [ball color=orange](0,-1) -- ++(0:.75) -- ++(-90:.25)  -- ++(180:.75)-- ++(90:.25)-- cycle;
\end{tikzpicture}
\end{frame}
\end{document} 

enter image description here

5

Really just for fun, using the tricks of this answer and that answer. This works with annotations of 3D ducks. ;-)

\documentclass[margin=1cm]{standalone}
\usepackage{tikz}
\usetikzlibrary{fadings,decorations.text,calc}
\usepackage{contour}
\contourlength{0.3pt}
\usepackage{calc}
\renewcommand*\sfdefault{ugq}
\usepackage[T1]{fontenc}
\usepackage{soul}
\newsavebox\BlackHole

\newcommand{\blackHole}[1][1cm]{\tikz{%
\shade[ball color=black] circle(#1);}}
\sbox\BlackHole{\blackHole[0.6cm]}


\newcommand{\PlaceCharOverBlackHole}[2][20]{%
\begin{tikzfadingfrompicture}[name=temp]
\node[transparent!0,scale=#1] 
{\contour{black}{\bfseries\sffamily \textcolor{white}{#2}}};
\end{tikzfadingfrompicture}%
\tikz[baseline=(X.base)]{\node[inner sep=0pt,outer sep=0pt,scale=#1] (X) {\contour{black}{\bfseries\sffamily 
\textcolor{white}{#2}}};
\pgfmathsetmacro{\myscale}{1.2*max(width("#2"),height("#2"))/1cm}
\path[path fading=temp,fit fading=false,overlay,scale=\myscale] node {\usebox\BlackHole};}%
}

\makeatletter % from https://tex.stackexchange.com/a/2709/121799
\def\SOUL@soeverytoken{%
 \PlaceCharOverBlackHole[2]{\the\SOUL@token}}
\makeatother

\begin{document}
\so{+}~\so{$-$}~\so{abcdefghijklmnopqrstuvwxyz}
\end{document}

enter image description here