我使用以下代码来绘制加号/减号
\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}
这让我
是否可以使它们看起来像下列任何一幅图画一样成为 3D 物体?
答案1
这是适用于3D土拨鼠
\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}
答案2
这只是一个提议;它可以作为进一步行动的“基础”:
\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}
输出:
编辑:这里还有更多示例:
\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}
输出:
和:
\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}
输出如下:
答案3
真的只是为了好玩,使用技巧这个答案和那个答案.这适用于3D 鸭子的注释。 ;-)
\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}