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

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

  • Thank you very much. Just one enquiry please. Is it possible to control the colours for example using inner color= , outer color=; and center/angle of shading – Hany Aug 5 '18 at 13:58
  • 2
    @Hany No, for this kind of shading you can only set the ball color. But you could try other shading, e.g. radial fo which you can controll the colours with inner color= , outer color= – user36296 Aug 5 '18 at 14:02
  • How to use radial shading? – Hany Aug 5 '18 at 14:03
  • 2
    @Hany By using inner color= , outer color= – user36296 Aug 5 '18 at 14:03
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

  • Thank you very much. It is very lengthy, but it works fine. – Hany Aug 5 '18 at 14:29
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

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.