From bf12d24391ad0ae423bbf9fd4daf34490b479d88 Mon Sep 17 00:00:00 2001 From: tlming16 Date: Mon, 7 Mar 2022 09:47:52 +0800 Subject: [PATCH] add tikz --- LaTeX/tikz/an.tex | 8 +++ LaTeX/tikz/chains.tex | 25 +++++++++ LaTeX/tikz/external.tex | 17 ++++++ LaTeX/tikz/gp.tex | 115 +++++++++++++++++++++++++++++++++++++++ LaTeX/tikz/latex.tex | 7 +++ LaTeX/tikz/matrix.tex | 68 +++++++++++++++++++++++ LaTeX/tikz/mc.tex | 33 +++++++++++ LaTeX/tikz/mv.tex | 109 +++++++++++++++++++++++++++++++++++++ LaTeX/tikz/p0305_11.tex | 28 ++++++++++ LaTeX/tikz/p0306_12.tex | 58 ++++++++++++++++++++ LaTeX/tikz/p11.tex | 51 +++++++++++++++++ LaTeX/tikz/p16.tex | 70 ++++++++++++++++++++++++ LaTeX/tikz/p16_list.tex | 91 +++++++++++++++++++++++++++++++ LaTeX/tikz/p29.tex | 26 +++++++++ LaTeX/tikz/p8.tex | 30 ++++++++++ LaTeX/tikz/soluction.tex | 40 ++++++++++++++ LaTeX/tikz/tab.tex | 80 +++++++++++++++++++++++++++ LaTeX/tikz/test2.tex | 82 ++++++++++++++++++++++++++++ LaTeX/tikz/test3.tex | 39 +++++++++++++ LaTeX/tikz/token.tex | 74 +++++++++++++++++++++++++ 20 files changed, 1051 insertions(+) create mode 100644 LaTeX/tikz/an.tex create mode 100644 LaTeX/tikz/chains.tex create mode 100644 LaTeX/tikz/external.tex create mode 100644 LaTeX/tikz/gp.tex create mode 100644 LaTeX/tikz/latex.tex create mode 100644 LaTeX/tikz/matrix.tex create mode 100644 LaTeX/tikz/mc.tex create mode 100644 LaTeX/tikz/mv.tex create mode 100644 LaTeX/tikz/p0305_11.tex create mode 100644 LaTeX/tikz/p0306_12.tex create mode 100644 LaTeX/tikz/p11.tex create mode 100644 LaTeX/tikz/p16.tex create mode 100644 LaTeX/tikz/p16_list.tex create mode 100644 LaTeX/tikz/p29.tex create mode 100644 LaTeX/tikz/p8.tex create mode 100644 LaTeX/tikz/soluction.tex create mode 100644 LaTeX/tikz/tab.tex create mode 100644 LaTeX/tikz/test2.tex create mode 100644 LaTeX/tikz/test3.tex create mode 100644 LaTeX/tikz/token.tex diff --git a/LaTeX/tikz/an.tex b/LaTeX/tikz/an.tex new file mode 100644 index 0000000..0c6eea9 --- /dev/null +++ b/LaTeX/tikz/an.tex @@ -0,0 +1,8 @@ +\documentclass{article} +\usepackage{tikz} +\usetikzlibrary{animations} + +\begin{document} + +\tikz \node [fill, text = white, animate = {myself:fill = {0s = "red", 2s = "blue", begin on = click }}] {Click me}; +\end{document} diff --git a/LaTeX/tikz/chains.tex b/LaTeX/tikz/chains.tex new file mode 100644 index 0000000..ccea55a --- /dev/null +++ b/LaTeX/tikz/chains.tex @@ -0,0 +1,25 @@ +\documentclass{standalone} +%\url{http://tex.stackexchange.com/q/141259/86} +\usepackage{tikz} +\usetikzlibrary{chains} +\begin{document} +\begin{tikzpicture}[start chain=circle placed {at=(\tikzchaincount*30:1.5)},regular/.style={draw,circle,inner sep=0,minimum size=4mm}] +\foreach \i in {0,...,11} + \node [on chain, regular] (\i) {\i}; +\foreach[evaluate=\i as \ni using {int(mod(\i+1,12))}] \i in {0,...,11} + \draw [->] (\i) to (\ni); +\end{tikzpicture} +\begin{tikzpicture}[ +declare function={ +excitation(\t,\w) = sin(\t*\w); +noise = rnd - 0.5; +source(\t) = excitation(\t,20) + noise; +filter(\t) = 1 - abs(sin(mod(\t, 90))); +speech(\t) = 1 + source(\t)*filter(\t); +} +] +\draw [help lines] (0,0) grid (3,2); +\draw [blue, thick, x=0.0085cm, y=1cm] (0,1) -- +plot [domain=0:360, samples=144, smooth] (\x,{speech(\x)}); +\end{tikzpicture} +\end{document} diff --git a/LaTeX/tikz/external.tex b/LaTeX/tikz/external.tex new file mode 100644 index 0000000..dbb18b2 --- /dev/null +++ b/LaTeX/tikz/external.tex @@ -0,0 +1,17 @@ +\documentclass{article} +% main document, called main.tex +\usepackage{tikz} +\usetikzlibrary{external} +\tikzexternalize[prefix=figures/] +\tikzexternalize % activate! +\begin{document} +\begin{tikzpicture} +\node {root} +child {node {left}} +child {node {right} +child {node {child}} +child {node {child}} +}; +\end{tikzpicture} +A simple image is \tikz \fill (0,0) circle(5pt);. +\end{document} diff --git a/LaTeX/tikz/gp.tex b/LaTeX/tikz/gp.tex new file mode 100644 index 0000000..fcc06eb --- /dev/null +++ b/LaTeX/tikz/gp.tex @@ -0,0 +1,115 @@ +\documentclass{article} +\usepackage{tikz} +\usepackage{animate} +\usepackage{amsmath} +\usepackage{ifthen} +\usepackage{pgfmath} +\usetikzlibrary {matrix} +\usepackage{tikzlings} +\usepackage{tikzlings-penguins} +\usepackage{graphics,graphicx} + +\newcommand{\token}{ + \begin{scope}[node distance=0pt] + \node[ rectangle,fill=red] at (0,0) {}; + \node[ rectangle,fill=red!20] at (1,0) {}; + \node[ rectangle,fill=red!40] at (2,0) {}; + \node[ rectangle,fill=blue!20] at (3,0) {}; + \node[ rectangle,fill=blue!40] at (4,0) {}; + \node[ rectangle,fill=blue] at (5,0) {}; + \end{scope} +} +\begin{document} +\begin{figure} +\begin{tikzpicture}[>=latex,domain=-0.3:1.2] + \xdef\a{0.125} + \xdef\b{0.5} + \xdef\scale{1.2} + \xdef\ppos{-0.6} + \begin{scope} + \draw[->] (-0.5,0) -- (1.6,0) node[right] {$x$}; + \draw[->] (0,-0.3)--(0,1.2) node[right] {$y$}; + \node (a) at (\a,-0.15) {$a$}; + \node (b) at (\b,-0.15) {$b$}; + \node (o) at (-0.2,-0.1){ $o$}; + \draw plot (\x,{\scale*abs(\x-\a)*abs(\x-\b)}); + \end{scope} + \begin{scope}[xshift=2.5cm] + \draw[->] (-0.3,0) -- (1.6,0) node[right] {$x$}; + \draw[->] (0,-0.3)--(0,1.2) node[right] {$y$}; + \node (a) at (\a,-0.15) {$a$}; + \node (b) at (\b,-0.15) {$b$}; + \node (o) at (-0.2,-0.1){ $o$}; + \draw plot (\x,{\scale*abs(\x-\a)*(\x-\b)}); + \end{scope} + \begin{scope}[xshift=5cm] + \draw[->] (-0.3,0) -- (1.6,0) node[right] {$x$}; + \draw[->] (0,-0.3)--(0,1.2) node[right] {$y$}; + \node (a) at (\a,-0.15) {$a$}; + \node (b) at (\b,-0.15) {$b$}; + \node (o) at (-0.2,-0.1){ $o$}; + \draw plot (\x,{\scale(\x-\a)*abs(\x-\b)}); + \end{scope} + \begin{scope}[xshift=7.5cm,domain=-0.5:1] + \draw[->] (-0.6,0) -- (1.2,0) node[right] {$x$}; + \draw[->] (0,-0.3)--(0,1.2) node[right] {$y$}; + \node (a) at (\a,-0.15) {$a$}; + \node (b) at (\b,-0.15) {$b$}; + \node (o) at (-0.2,-0.1){ $o$}; + \draw plot (\x,{\scale*-1*abs(\x-\a)*(\x-\b)}); + \end{scope} +\end{tikzpicture} +\begin{tikzpicture}[>=latex,domain=-3:3,x=0.5cm,y=2cm] + \pgfmathparse{ {1.0/sqrt{2*pi}/4}} + \let\ymax\pgfmathresult + \xdef\mr{1.8} + \draw[->] (-3.2,0)--(3.4,0) node[right] {$x$}; + \draw[->] (0,-0.1) --(0,\ymax) node[above] {$y$}; + \draw[smooth,samples=100] plot (\x,{exp(-\x *\x/2)/sqrt(2*pi)}); + \filldraw[fill=gray,domain=\mr:3] (\mr,0) node[below] {$\alpha$} -- plot (\x,{exp(-\x *\x/2)/sqrt(2*pi)}) --(3,0)--cycle; +\end{tikzpicture} +\end{figure} + \begin{center} +\begin{figure} +\begin{tikzpicture}[>=latex,x=0.5cm,y=2cm] + \draw[->] (-1,0) --(4,0) node[right] {$x$}; + \draw[->] (0,-0.2) --(0,1) node[above] {$y$}; + \foreach \ll[evaluate=\ll as \c using 10*\ll] in {1,2,3,4}{ + \draw[domain=0.4:3,smooth,red!\c!blue] plot (\x, { \ll*exp(\ll*-\x)}); + } +\end{tikzpicture} +\begin{tikzpicture} + \draw[->] (-1.2,0) --(1.3,0) node[right] {$x$}; + \draw[->] (0,-0.2) --(0,1.2) node[above] {$y$}; + \foreach \a in {1/2,1.1,2}{ + \draw[domain=-1:1,smooth] plot(\x, {\a*\x*\x}) node[right] {$\a x^2$}; + } +\end{tikzpicture} +\end{figure} +\end{center} + +\begin{animateinline}[poster=first,autoplay, palindrome]{4} +\multiframe{3}{iangle=5+5}{ +\begin{tikzpicture}[>=latex,x=0.5cm,y=2cm] + \draw[->] (-1,0) --(4,0) node[right] {$x$}; + \draw[->] (0,-0.2) --(0,1) node[above] {$y$}; + \pgfmathparse{\iangle/5} + \let\ll\pgfmathresult + \draw[domain=0.4:3,smooth,red!\iangle!blue] plot (\x, { \ll*exp(\ll*-\x)}) node[above right]{$\ll e^{-\ll x}$} ; +\end{tikzpicture} +} +\end{animateinline} +\begin{tikzpicture}[>=latex] + \draw [->] (-5,0) --(5.2,0) node[below right]{$x_1$}; + \draw[->] (0,-5) --(0,5.2) node[above left] {$x_2$}; + \foreach \r in {1,2,3,4}{ + \draw[blue,thick] (0,0) circle[radius=\r] ; + } + \pgfmathparse{sqrt(2)*2} + \let\ss\pgfmathresult + \draw [domain=-3:5,smooth,thick,red] plot(\x,{-\x + \ss}) node[below right] {$g(x_1,x_2)=0$}; +\end{tikzpicture} +\begin{tikzpicture} + \token ; +\end{tikzpicture} +\end{document} diff --git a/LaTeX/tikz/latex.tex b/LaTeX/tikz/latex.tex new file mode 100644 index 0000000..f00ea05 --- /dev/null +++ b/LaTeX/tikz/latex.tex @@ -0,0 +1,7 @@ +\documentclass{standalone} +\usepackage{graphicx,graphics} +\usepackage{tikz} +\begin{document} + +\includegraphics[width=0.8\textwidth]{match_doll.png} +\end{document} diff --git a/LaTeX/tikz/matrix.tex b/LaTeX/tikz/matrix.tex new file mode 100644 index 0000000..98b2180 --- /dev/null +++ b/LaTeX/tikz/matrix.tex @@ -0,0 +1,68 @@ +\documentclass{standalone} +\usepackage{tikz} +\usepackage{animate} +\usepackage{ifthen} +\usetikzlibrary {matrix} +\usepackage{tikzlings} +\usepackage{tikzlings-penguins} + +\begin{document} +\begin{tikzpicture} + \matrix (a) [matrix of math nodes,left delimiter=(,right delimiter=)] +{ +a_8 & a_1 & a_6 \\ +a_3 & a_5 & a_7 \\ +a_4 & a_9 & a_2 \\ +}; +\node at (a.west) [xshift=-0.5cm] {$P=$}; +\end{tikzpicture} +\begin{animateinline}[poster=first,autoplay, palindrome]{12} +\multiframe{29}{iangle=80+10, rdim=2.0+-0.2}{ + \begin{tikzpicture}[scale=0.1] +\fill[blue] (\iangle+45:\rdim) - - (\iangle+135:.5)- - + (\iangle+225:\rdim)- -(\iangle+315:.5) - - cycle; +\fill[blue] (\iangle+45:.5) - - (\iangle+135:\rdim)- - (\iangle+ + 225:.5)- -(\iangle+315:\rdim) - - cycle; +\end{tikzpicture} } +\end{animateinline} + +\begin{animateinline}[poster=first,autoplay, palindrome]{12} +\multiframe{29}{iangle=2+1}{ + \begin{tikzpicture}[scale=1] + \draw[domain=0:1.2] plot (\x,\x*\x) node[right] {$f(x)=x^2$}; + \draw[->] (0,0) --(1.5,0) node[right] {$x$}; + \draw[->] (0,-0.1) --(0,1.5) node[above] {$y$}; + \foreach \i in {0,1,...,\iangle} { + \xdef \dx {1.0/\iangle} + \xdef \x {\i *\dx} + \xdef \s {2} + \pgfmathparse{\i<\iangle?1:6} + \let\s\pgfmathresult + \filldraw[blue] (\x,0) -- (\x,\x*\x) --(\x+\dx/\s,\x*\x) --(\x+\dx/\s,0)--cycle; + } +\end{tikzpicture} +} +\end{animateinline} + +\begin{animateinline}[poster=first,autoplay, palindrome]{12} +\multiframe{15}{iangle=2+1}{ + \begin{tikzpicture}[scale=0.5] + \foreach \i in {0,2,...,\iangle} { + \xdef\dx{\i} + \pgfmathparse{\dx/4} + \let\s\pgfmathresult + \draw[blue] (0,0) circle( \s); + } +\end{tikzpicture} +} +\end{animateinline} + +\begin{animateinline}[poster=first,autoplay, palindrome]{4} +\multiframe{13}{iangle=0+1}{ + \begin{tikzpicture}[scale=0.2] + %\draw[blue] (0,0) circle( \s); + \ifthenelse{\isodd{\iangle}}{\penguin[rotate=-30,scale=0.4]; \penguin[xshift=1cm,rotate=30,scale=0.3];} { \penguin[rotate=-30,scale=0.4]; \penguin[rotate=30,xshift=1cm,scale=0.3]} +\end{tikzpicture} +} +\end{animateinline} +\end{document} diff --git a/LaTeX/tikz/mc.tex b/LaTeX/tikz/mc.tex new file mode 100644 index 0000000..5b2bfef --- /dev/null +++ b/LaTeX/tikz/mc.tex @@ -0,0 +1,33 @@ +\documentclass{standalone} +\usepackage{ctex} +\usepackage{tikz} +\usetikzlibrary {decorations,arrows.meta,automata,positioning,shadows} +\usetikzlibrary{decorations.pathreplacing,decorations.markings} +\begin{document} +\begin{tikzpicture}[->,>={Stealth[round]}, + shorten >=1pt,auto,node distance=1.8cm,on grid,semithick, % + every state/.style={fill=blue!40,draw=none,circular drop shadow,text=white},% + mid arrow/.style={postaction={decorate,decoration={ + markings,mark=at position .5 with {\arrow[red]{Stealth[round]}}}}}] +\node[state] (A) at (0,0) {$S_1$}; +\node[state] (B) at (3,2) {$S_2$}; +\node[state] (C) at (3,-2) {$S_3$}; +\draw[mid arrow] (A.east) to [bend left=15] node{$0.28$} (B.south); +\draw[mid arrow] (A.east) to [bend left=15] node[left] {$0.07$ } (C.north); +\draw[mid arrow] (B.south) to [bend left=15] node[right] {$0.18$} (C.north); +\draw[mid arrow] (B.south) to [bend left=15] node[left] {$0.15$} (A.east); +\draw[mid arrow] (C.north) to [bend left=15] node {$0.12$} (A.east); +\draw[mid arrow] (C.north) to [bend left=15] node {$ 0.36$} (B.south); +\draw (A) edge [loop left] node {$0.65$} (A); +\draw (B) edge[loop above] node {$0.67$} (B); +\draw (C) edge[loop below] node {$0.52$} (C); +\begin{scope}[xshift=6cm,yshift=0.5cm] + \matrix[nodes={minimum size=5mm}]{ + &\node[red]{0.65}; &\node{0.28}; &\node{0.07};\\ + \node[red]{$P=$};& \node{0.15}; &\node[red]{0.67}; &\node{0.18}; \\ + & \node{0.12}; &\node{0.36}; &\node[red]{0.52} ;\\ + } + ; +\end{scope} +\end{tikzpicture} +\end{document} diff --git a/LaTeX/tikz/mv.tex b/LaTeX/tikz/mv.tex new file mode 100644 index 0000000..e97fe42 --- /dev/null +++ b/LaTeX/tikz/mv.tex @@ -0,0 +1,109 @@ +\documentclass{article} +\usepackage[]{graphicx} +\usepackage[]{color} +\usepackage{geometry} +\usepackage{tikz} +\usepackage{tikzit} +\usepackage{multimedia} + +\begin{document} +\tikzstyle{bg}=[-, line width=0.5mm, fill={rgb,255: red,217; green,217; blue,217}] +\tikzstyle{fg}=[-, fill=black] +\tikzstyle{dir}=[->] +\tikzstyle{region A}=[-, draw=none, fill={rgb,255: red,255; green,160; blue,162}, opacity=0.8] +\tikzstyle{region B}=[-, draw=none, fill={rgb,255: red,190; green,185; blue,255}, opacity=0.8] +\tikzstyle{region C}=[-, fill={rgb,255: red,179; green,255; blue,192}, draw=none, opacity=0.8] + \begin{figure} +\begin{tikzpicture} + \node [red,circle] (0) at (-5.25, 2.75) {}; + \node [red,circle] (1) at (-3.75, 2.75) {}; + \node [red,circle] (2) at (-3.75, 2.75) {}; + \node [red,circle] (3) at (-4.75, 5.25) {}; + \node [red,circle] (4) at (10.5, 28.75) {x}; +\end{tikzpicture} +\tikzstyle{bg}=[-, line width=0.5mm, fill={rgb,255: red,217; green,217; blue,217}] +\tikzstyle{fg}=[-, fill=black] +\tikzstyle{dir}=[->] +\tikzstyle{region A}=[-, draw=none, fill={rgb,255: red,255; green,160; blue,162}, opacity=0.8] +\tikzstyle{region B}=[-, draw=none, fill={rgb,255: red,190; green,185; blue,255}, opacity=0.8] +\tikzstyle{region C}=[-, fill={rgb,255: red,179; green,255; blue,192}, draw=none, opacity=0.8] +\begin{tikzpicture} + \begin{pgfonlayer}{nodelayer} + \node [style=none] (5) at (-0.5, -1.25) {}; + \node [style=none] (6) at (0.5, 1.25) {}; + \node [style=none] (7) at (1.25, 0.5) {}; + \node [style=none] (8) at (1.25, 2) {}; + \node [style=none] (9) at (2, 1.25) {}; + \node [style=none] (10) at (2.75, 2) {}; + \node [style=none] (11) at (2, 2.75) {}; + \node [style=none] (18) at (1.25, -2) {}; + \node [style=none] (20) at (2.75, -2) {}; + \node [style=none] (22) at (2, -2.75) {}; + \node [style=none] (23) at (2, -1.25) {}; + \node [style=none] (26) at (-2.75, -2) {}; + \node [style=none] (28) at (-1.25, -2) {}; + \node [style=none] (30) at (-2, -2.75) {}; + \node [style=none] (31) at (-2, -1.25) {}; + \node [style=none] (32) at (0.5, -1.25) {}; + \node [style=none] (33) at (-1.25, -0.5) {}; + \node [style=none] (35) at (1.25, -0.5) {}; + \node [style=none] (36) at (-0.5, 1.25) {}; + \node [style=none] (37) at (-1.25, 0.5) {}; + \node [style=none] (65) at (0, 3) {}; + \node [style=none] (69) at (0.775, -2.9) {}; + \node [style=none] (70) at (2, -3.5) {}; + \node [style=none] (71) at (3.5, -2) {}; + \node [style=none] (72) at (2.9, -0.775) {}; + \node [style=none] (80) at (-3, 0) {}; + \node [style=none] (81) at (-0.775, -2.9) {}; + \node [style=none] (82) at (-2, -3.5) {}; + \node [style=none] (83) at (-3.5, -2) {}; + \node [style=none] (84) at (-2.9, -0.775) {}; + \node [style=none] (85) at (0.775, 2.9) {}; + \node [style=none] (86) at (2, 3.5) {}; + \node [style=none] (87) at (3.5, 2) {}; + \node [style=none] (88) at (2.9, 0.775) {}; + \end{pgfonlayer} + \begin{pgfonlayer}{edgelayer} + \draw [style=bg] (72.center) + to [in=90, out=-30, looseness=0.75] (71.center) + to [in=0, out=-90] (70.center) + to [in=-60, out=180, looseness=0.75] (69.center) + to [in=-15, out=-165] (81.center) + to [in=0, out=-120, looseness=0.75] (82.center) + to [in=-90, out=180] (83.center) + to [in=-150, out=90, looseness=0.75] (84.center) + to [in=-90, out=105, looseness=0.75] (80.center) + to [in=-180, out=90] (65.center) + to [in=165, out=0, looseness=0.75] (85.center) + to [in=-180, out=60, looseness=0.75] (86.center) + to [in=90, out=0] (87.center) + to [in=30, out=-90, looseness=0.75] (88.center) + to [in=75, out=-75] cycle; + \draw [style=fg] (36.center) + to [in=135, out=45] (6.center) + to [in=-90, out=-45, looseness=1.25] (8.center) + to [in=-180, out=90] (11.center) + to [in=90, out=0] (10.center) + to [in=0, out=-90] (9.center) + to [in=135, out=180, looseness=1.25] (7.center) + to [in=45, out=-45] (35.center) + to [in=180, out=-135, looseness=1.25] (23.center) + to [in=90, out=0] (20.center) + to [in=0, out=-90] (22.center) + to [in=-90, out=180] (18.center) + to [in=45, out=90, looseness=1.25] (32.center) + to [in=-45, out=-135, looseness=1.25] (5.center) + to [in=90, out=135, looseness=1.25] (28.center) + to [in=0, out=-90] (30.center) + to [in=-90, out=180] (26.center) + to [in=-180, out=90] (31.center) + to [in=-45, out=0, looseness=1.25] (33.center) + to [in=-135, out=135] (37.center) + to cycle; + \end{pgfonlayer} +\end{tikzpicture} +\end{figure} + + +\end{document} diff --git a/LaTeX/tikz/p0305_11.tex b/LaTeX/tikz/p0305_11.tex new file mode 100644 index 0000000..9cabd9c --- /dev/null +++ b/LaTeX/tikz/p0305_11.tex @@ -0,0 +1,28 @@ +\documentclass{standalone} +\usepackage{tikz} +\usepackage{animate} +\usepackage{amsmath} +\usepackage{ifthen} +\usetikzlibrary {matrix} +\usepackage{tikzlings} +\usepackage{tikzlings-penguins} + +\begin{document} +\begin{tikzpicture}[>=latex] + \begin{scope} + \draw[->] (-pi/2,0) --(pi/2+0.2,0) node[below] {$x$}; + \draw[->] (0,-2.3) --(0,2.5) node[left] {$y$}; + \draw[domain=-pi/3:pi/2,smooth,samples=200,thick] plot[id=log2] function { 2*sin(2*x-pi/6)} ; + \node[below left] (o) at (0,0) {$o$}; + \node[below ] (x1) at (pi/3,0) {$\frac{\pi}{3}$}; + \node[below left] (x2) at (-pi/6,0) {$-\frac{\pi}{6}$}; + \node[below left] (y2) at (0,-2) {$-2$}; + \node[left] (y1) at (0,2) {$2$}; + \draw[dashed] (-pi/6,0)--(-pi/6,-2)--(0,-2); + \draw[dashed] (pi/3,0)--(pi/3,2)--(0,2); + \end{scope} + +\end{tikzpicture} + + +\end{document} diff --git a/LaTeX/tikz/p0306_12.tex b/LaTeX/tikz/p0306_12.tex new file mode 100644 index 0000000..2443635 --- /dev/null +++ b/LaTeX/tikz/p0306_12.tex @@ -0,0 +1,58 @@ +\documentclass{standalone} +\usepackage{tikz} +\usepackage{animate} +\usepackage{amsmath} +\usepackage{ifthen} +\usetikzlibrary {matrix} +\usepackage{tikzlings} +\usepackage{tikzlings-penguins} + +\newcommand{\AB}[2]{ + \draw[->] (-4,0)--(4,0) node[below] {$x$}; + \draw[->] (0,-1.3)--(0,1.5) node[right]{$y$}; + \draw[domain=-3.5:3.5,smooth,samples=200,thick] plot[id=#2] function { #1(x*pi)} ; + \draw[dashed] (-3.6,-1) --(3.6,-1); + \draw[dashed] (-3.6,1) --(3.6,1); + \foreach \x in {-2,-1,0,1,2} { + \draw (\x,0.1)--(\x,0) node[below]{$\x$}; + } + \node at (0,-1.5) {#2}; +} + + +\newcommand{\CD}[2]{ + + \draw[->] (-4,0)--(4,0) node[below] {$x$}; + \draw[->] (0,-1.3)--(0,1.5) node[right]{$y$}; + \draw[domain=-3.5:3.5,smooth,samples=200,thick] plot[id=#2] function { #1(x*pi)} ; + \draw[dashed] (-3.6,-1) --(3.6,-1); + \draw[dashed] (-3.6,1) --(3.6,1); + \foreach \x in {-4,-2,0,2,4} { + \draw (\x/2,0.1)--(\x/2,0) node[below]{$\x$}; + } + \node at (0,-1.5) {#2}; +} + + + +\begin{document} +\begin{tikzpicture}[>=latex,x=0.6cm,y=0.9cm] + \begin{scope} + \AB{sin}{A} + \end{scope} + \begin{scope}[xshift=6cm] + \AB{-cos}{B} + \end{scope} + + \begin{scope}[yshift=-3cm,x=0.6cm,y=0.9cm] + \CD{sin}{C} + \end{scope} + \begin{scope}[yshift=-3cm,xshift=6cm,x=0.6cm,y=0.9cm] + \CD{-cos}{D} + \end{scope} + + +\end{tikzpicture} + + +\end{document} diff --git a/LaTeX/tikz/p11.tex b/LaTeX/tikz/p11.tex new file mode 100644 index 0000000..b782c5f --- /dev/null +++ b/LaTeX/tikz/p11.tex @@ -0,0 +1,51 @@ +\documentclass{standalone} +\usepackage{tikz} +\usepackage{animate} +\usepackage{amsmath} +\usepackage{ifthen} +\usetikzlibrary {matrix} +\usepackage{tikzlings} +\usepackage{tikzlings-penguins} + +\begin{document} +\begin{tikzpicture}[>=latex,domain=-0.3:1.2] + \xdef\a{0.125} + \xdef\b{0.5} + \xdef\scale{1.2} + \xdef\ppos{-0.6} + \begin{scope} + \draw[->] (-0.5,0) -- (1.6,0) node[right] {$x$}; + \draw[->] (0,-0.3)--(0,1.2) node[right] {$y$}; + \node (a) at (\a,-0.15) {$a$}; + \node (b) at (\b,-0.15) {$b$}; + \node (o) at (-0.2,-0.1){ $o$}; + \draw plot (\x,{\scale*abs(\x-\a)*abs(\x-\b)}); + \end{scope} + \begin{scope}[xshift=2.5cm] + \draw[->] (-0.3,0) -- (1.6,0) node[right] {$x$}; + \draw[->] (0,-0.3)--(0,1.2) node[right] {$y$}; + \node (a) at (\a,-0.15) {$a$}; + \node (b) at (\b,-0.15) {$b$}; + \node (o) at (-0.2,-0.1){ $o$}; + \draw plot (\x,{\scale*abs(\x-\a)*(\x-\b)}); + \end{scope} + \begin{scope}[xshift=5cm] + \draw[->] (-0.3,0) -- (1.6,0) node[right] {$x$}; + \draw[->] (0,-0.3)--(0,1.2) node[right] {$y$}; + \node (a) at (\a,-0.15) {$a$}; + \node (b) at (\b,-0.15) {$b$}; + \node (o) at (-0.2,-0.1){ $o$}; + \draw plot (\x,{\scale(\x-\a)*abs(\x-\b)}); + \end{scope} + \begin{scope}[xshift=7.5cm,domain=-0.5:1] + \draw[->] (-0.6,0) -- (1.2,0) node[right] {$x$}; + \draw[->] (0,-0.3)--(0,1.2) node[right] {$y$}; + \node (a) at (\a,-0.15) {$a$}; + \node (b) at (\b,-0.15) {$b$}; + \node (o) at (-0.2,-0.1){ $o$}; + \draw plot (\x,{\scale*-1*abs(\x-\a)*(\x-\b)}); + \end{scope} +\end{tikzpicture} + + +\end{document} diff --git a/LaTeX/tikz/p16.tex b/LaTeX/tikz/p16.tex new file mode 100644 index 0000000..0249169 --- /dev/null +++ b/LaTeX/tikz/p16.tex @@ -0,0 +1,70 @@ +\documentclass{standalone} +\usepackage{tikz} +\usepackage{animate} +\usepackage{amsmath} +\usepackage{ifthen} +\usetikzlibrary {matrix} +\usepackage{tikzlings} +\usepackage{tikzlings-penguins} + +\begin{document} +\begin{tikzpicture}[>=latex] + \begin{scope} + \draw[->] (-0.2,0) --(2.5,0) node[below right] {$x$}; + \draw[->] (0,-0.2) --(0,2.5) node[above left] {$y$}; + \draw[domain=0:1] plot (\x,\x); + \draw[domain=1:2] plot (\x,{(\x-1)*(\x-1)+1}); + \draw[dotted] (1,0)--(1,1)--(0,1); + \draw[dotted] (2,0)--(2,2)--(0,2); + \node[below left] (o) at (0,0) {$O$}; + \foreach \x in {1,2}{ + \node[below] (x\x) at (\x,0) {$\x$}; + \node[left] (y\x) at (0,\x) {$\x$}; + } + \end{scope} + \begin{scope}[xshift=4.5cm] + \draw[->] (-1.2,0)--(1.2,0) node[below right] {$x$}; + \draw[->] (0,-0.2)--(0,2.5) node[above left] {$y$}; + \draw[domain=0:1] plot (\x,1-\x); + \draw[domain=-1:0] plot(\x,{\x*\x+1}); + \draw[dotted] (-1,0)--(-1,2)--(0,2); + \node[below left] (o) at (0,0) {$O$}; + \foreach \x in {-1,1} + { + \node[below] at (\x,0) {$\x$}; + } + \foreach \x in {1,2} + \node [right] at (0,\x) {$\x$}; + \end{scope} + \begin{scope}[xshift=8cm] + \draw[->] (-1.2,0)--(1.2,0) node [below right] {$x$}; + \draw[->] (0,-0.2) --(0,2.5) node[above left] {$y$}; + \draw[domain=-1:1] plot (\x,{\x*\x+1}); + \draw[dotted] (-1,0)--(-1,2)--(1,2)--(1,0); + \node[below left] (o) at (0,0) {$O$}; + \foreach \x in {-1,1} + { + \node[below] at (\x,0) {$\x$}; + } + \foreach \x in {1,2} + \node [right] at (0,\x) {$\x$}; + \end{scope} + \begin{scope}[xshift=12cm] + \draw[->] (-1.2,0)--(1.2,0) node [below right] {$x$}; + \draw[->] (0,-0.2) --(0,2.5) node[above left] {$y$}; + \draw[domain=0:1] plot (\x,{\x*\x+1}); + \draw[domain=-1:0] plot(\x,{1-\x}); + \draw[dotted] (-1,0)--(-1,2)--(1,2)--(1,0); + \node[below left] (o) at (0,0) {$O$}; + \foreach \x in {-1,1} + { + \node[below] at (\x,0) {$\x$}; + } + \foreach \x in {1,2} + \node [right] at (0,\x) {$\x$}; + \end{scope} + +\end{tikzpicture} + + +\end{document} diff --git a/LaTeX/tikz/p16_list.tex b/LaTeX/tikz/p16_list.tex new file mode 100644 index 0000000..57fb4a4 --- /dev/null +++ b/LaTeX/tikz/p16_list.tex @@ -0,0 +1,91 @@ +\documentclass{article} +\usepackage{tikz} +\usepackage{animate} +\usepackage{amsmath} +\usepackage{ifthen} +\usetikzlibrary {matrix} +\usepackage{tikzlings} +\usepackage{tikzlings-penguins} +\usepackage{tcolorbox} +\tcbuselibrary{skins,listings,raster} +\tcbset{listing engine=listings} +\begin{document} +\begin{tikzpicture}[>=latex] + \begin{scope} + \draw[->] (-0.2,0) --(2.5,0) node[below right] {$x$}; + \draw[->] (0,-0.2) --(0,2.5) node[above left] {$y$}; + \draw[domain=0:1] plot (\x,\x); + \draw[domain=1:2] plot (\x,{(\x-1)*(\x-1)+1}); + \draw[dotted] (1,0)--(1,1)--(0,1); + \draw[dotted] (2,0)--(2,2)--(0,2); + \node[below left] (o) at (0,0) {$O$}; + \foreach \x in {1,2}{ + \node[below] (x\x) at (\x,0) {$\x$}; + \node[left] (y\x) at (0,\x) {$\x$}; + } + \end{scope} + \begin{scope}[xshift=4.5cm] + \draw[->] (-1.2,0)--(1.2,0) node[below right] {$x$}; + \draw[->] (0,-0.2)--(0,2.5) node[above left] {$y$}; + \draw[domain=0:1] plot (\x,1-\x); + \draw[domain=-1:0] plot(\x,{\x*\x+1}); + \draw[dotted] (-1,0)--(-1,2)--(0,2); + \node[below left] (o) at (0,0) {$O$}; + \foreach \x in {-1,1} + { + \node[below] at (\x,0) {$\x$}; + } + \foreach \x in {1,2} + \node [right] at (0,\x) {$\x$}; + \end{scope} + \begin{scope}[xshift=8cm] + \draw[->] (-1.2,0)--(1.2,0) node [below right] {$x$}; + \draw[->] (0,-0.2) --(0,2.5) node[above left] {$y$}; + \draw[domain=-1:1] plot (\x,{\x*\x+1}); + \draw[dotted] (-1,0)--(-1,2)--(1,2)--(1,0); + \node[below left] (o) at (0,0) {$O$}; + \foreach \x in {-1,1} + { + \node[below] at (\x,0) {$\x$}; + } + \foreach \x in {1,2} + \node [right] at (0,\x) {$\x$}; + \end{scope} + \begin{scope}[xshift=12cm] + \draw[->] (-1.2,0)--(1.2,0) node [below right] {$x$}; + \draw[->] (0,-0.2) --(0,2.5) node[above left] {$y$}; + \draw[domain=0:1] plot (\x,{\x*\x+1}); + \draw[domain=-1:0] plot(\x,{1-\x}); + \draw[dotted] (-1,0)--(-1,2)--(1,2)--(1,0); + \node[below left] (o) at (0,0) {$O$}; + \foreach \x in {-1,1} + { + \node[below] at (\x,0) {$\x$}; + } + \foreach \x in {1,2} + \node [right] at (0,\x) {$\x$}; + \end{scope} +\end{tikzpicture} + +\begin{tcblisting}{colback=green!5!white,colframe=green!50!black,listing only, +hbox,enhanced,drop fuzzy shadow,before=\begin{center},after=\end{center}} +\begin{tikzpicture} +\fill[red] (0,0) rectangle (1,1); +\end{tikzpicture} +\end{tcblisting} +\begin{tcbitemize}[raster equal height=rows,raster columns=1, + title={$Q_{\thetcbrasternum}$},colframe=red!50!black,colback=red!10!white] +\tcbitem[colframe=blue!50!black,colback=blue!10!white,raster multicolumn=1] +multicolumn=1 +\tcbitem +\tcbitem +\tcbitem[colframe=blue!50!black,colback=blue!10!white,raster multicolumn=2] +multicolumn=2 +\tcbitem +\tcbitem[colframe=blue!50!black,colback=blue!10!white,raster multicolumn=3] +multicolumn=3 +\tcbitem +\tcbitem[colframe=blue!50!black,colback=blue!10!white,raster multicolumn=2] +multicolumn=2 +\end{tcbitemize} +\end{document} diff --git a/LaTeX/tikz/p29.tex b/LaTeX/tikz/p29.tex new file mode 100644 index 0000000..2f7a7d3 --- /dev/null +++ b/LaTeX/tikz/p29.tex @@ -0,0 +1,26 @@ +\documentclass{standalone} +\usepackage{tikz} +\usepackage{animate} +\usepackage{amsmath} +\usepackage{ifthen} +\usetikzlibrary {matrix} +\usepackage{tikzlings} +\usepackage{tikzlings-penguins} + +\begin{document} +\begin{tikzpicture}[>=latex, thick] + \begin{scope} + \draw[->] (-1.5,0) --(3,0) node[below right] {$x$}; + \draw[->] (0,-1.5) --(0,3) node[above left] {$y$}; + \draw[domain=-1.1:2.5,very thick] plot (\x,\x) node[right] {$y=x$}; + \draw[domain=-1.0:1,smooth,samples=200,red,very thick] plot[id=exp2] function { exp(x)} node[right] {$y=2^x$}; + \draw[domain=0.3:3,smooth,samples=200,blue,very thick] plot[id=log2] function { log(x)} node[right] {$y=\log_{2}{x}$}; + \node[below left] (o) at (0,0) {$O$}; + \node[below] (x1) at (1,0) {(1,0)}; + \node[left] (y1) at (0,1) {(0,1)}; + \end{scope} + +\end{tikzpicture} + + +\end{document} diff --git a/LaTeX/tikz/p8.tex b/LaTeX/tikz/p8.tex new file mode 100644 index 0000000..f00eaa1 --- /dev/null +++ b/LaTeX/tikz/p8.tex @@ -0,0 +1,30 @@ +\documentclass{standalone} +\usepackage{tikz} +\usepackage{animate} +\usepackage{amsmath} +\usepackage{ifthen} +\usetikzlibrary {matrix} +\usepackage{tikzlings} +\usepackage{tikzlings-penguins} + +\begin{document} +\begin{tikzpicture}[>=latex,thick] + \begin{scope} + \coordinate (O) at (0,0) node[below] {$O$}; + \coordinate (a) at (3,0) ; + \coordinate (b) at (0,5) ; + \draw (O)--(a); + \node (r) at (1.7,2.5) {$r$}; + \draw (O) --(b) ; + \node (h) at (-0.2,2.5) {$h$}; + \draw (a)--(b) ; + \node (R) at (1.5,-0.2) {$R$}; + \draw (0,0) circle [x radius=3, y radius=0.5]; + \draw[bend left] (2.6,0) to (2.8,0.3335); + \node (theta) at (2.55,0.4) {$\theta$}; + \end{scope} + +\end{tikzpicture} + + +\end{document} diff --git a/LaTeX/tikz/soluction.tex b/LaTeX/tikz/soluction.tex new file mode 100644 index 0000000..52824e3 --- /dev/null +++ b/LaTeX/tikz/soluction.tex @@ -0,0 +1,40 @@ +\documentclass{standalone} +\usepackage{tikz} +\usepackage{animate} +\usepackage{amsmath} +\usepackage{ifthen} +\usetikzlibrary {matrix} +\usepackage{tikzlings} +\usepackage{tikzlings-penguins} + +\begin{document} +\begin{tikzpicture}[inner sep =0mm,>=latex,thick,x=1.2cm,y=1cm] + \begin{scope} + \xdef\ww{20} + \xdef\wwm{ 19} + \xdef\stagem {13} + \xdef\stage {14} + \xdef\stagep{15} + + + \foreach \i in {\stagep,\stage,...,1} { + \pgfmathparse { int(\stagep-\i)} + \xdef\tt { \pgfmathresult} + \node (t_\i) at ( -\i,0) { $t_{\tt}$}; + } + \foreach \i in { \stage,\stagem,...,1} { + \foreach \j in { 1,2,...,\ww} { + \pgfmathparse{random(0,1)} + \xdef\label{\pgfmathresult} + \node[] (a_\i\j) at (-\i,-\j ) { $w_{\j}(\label)$}; + } + } + \foreach \j in { 1,2,...,\ww} { + \node (w_\j) at ( -\stagep,-\j) { $w_{\j}$}; + } + \end{scope} + +\end{tikzpicture} + + +\end{document} diff --git a/LaTeX/tikz/tab.tex b/LaTeX/tikz/tab.tex new file mode 100644 index 0000000..fe022e4 --- /dev/null +++ b/LaTeX/tikz/tab.tex @@ -0,0 +1,80 @@ +\documentclass{ctexart} +\usepackage[a6paper]{geometry} +\usepackage{longtable} + +\begin{document} + +\begin{longtable}{|l|l|} + \caption{试验Longtable的四个命令} \\ + \hline + 序号 & 内容 \\ + \hline + \endfirsthead + % + \hline + 命令 & 描述\\ + \hline + \endhead + % + \hline + \multicolumn{2}{r@{}}{接下一页} + \endfoot + % + \hline + \endlastfoot + % + 1 & a \\ + 2 & b \\ + 3 & c \\ + 4 & d \\ + 5 & e \\ + 6 & f \\ + 7 & g \\ + 8 & h \\ + 9 & i \\ + 10 & j \\ + 11 & k \\ + 12 & l \\ + 13 & m \\ + 14 & n \\ + 15 & o \\ + 16 & p \\ + 17 & q \\ + 18 & r \\ + 19 & s \\ + 20 & t \\ + 21 & u \\ + 22 & v \\ + 23 & w \\ + 24 & x \\ + 25 & y \\ + 26 & z \\ + 27 & A \\ + 28 & B \\ + 29 & C \\ + 30 & D \\ + 31 & E \\ + 32 & F \\ + 33 & G \\ + 34 & H \\ + 35 & I \\ + 36 & J \\ + 37 & K \\ + 38 & L \\ + 39 & M \\ + 40 & N \\ + 41 & O \\ + 42 & P \\ + 43 & Q \\ + 44 & R \\ + 45 & S \\ + 46 & T \\ + 47 & U \\ + 48 & V \\ + 49 & W \\ + 50 & X \\ + 51 & Y \\ + 52 & Z \\ +\end{longtable} + +\end{document} diff --git a/LaTeX/tikz/test2.tex b/LaTeX/tikz/test2.tex new file mode 100644 index 0000000..9b3f511 --- /dev/null +++ b/LaTeX/tikz/test2.tex @@ -0,0 +1,82 @@ + +\documentclass[parskip]{scrartcl} +\usepackage[margin=15mm]{geometry} +\usepackage{tikz} +\usetikzlibrary{calc,arrows} + +\newdimen\XCoord +\newdimen\YCoord + +\newcommand*{\ExtractCoordinate}[1]{\path (#1); \pgfgetlastxy{\XCoord}{\YCoord};}% + +\begin{document} + +% ============================= modify these for altered appearence +\pgfmathsetmacro{\mintime}{0} +\pgfmathsetmacro{\maxtime}{15} +\newcommand{\timeunit}{Months} +\pgfmathtruncatemacro{\timeintervals}{15} +\pgfmathsetmacro{\scaleitemseparation}{4} +\pgfmathsetmacro{\timenodewidth}{2cm} +\newcounter{itemnumber} +\setcounter{itemnumber}{0} +\newcommand{\lastnode}{n-0} +% ============================= + +\newcommand{\timeentry}[2]{% time, description +\stepcounter{itemnumber} +\node[below right,minimum width=\timenodewidth, text width=\timenodewidth-1mm] (n-\theitemnumber) at (\lastnode.south west) {#1}; +\node[right] at (n-\theitemnumber.east) {#2}; + +\edef\lastnode{n-\theitemnumber} + +\expandafter\edef\csname nodetime\theitemnumber \endcsname{#1} +} + +\newcommand{\drawtimeline}{% + \draw[very thick,-latex] (0,0) -- ($(\lastnode.south west)-(\scaleitemseparation,0)+(0,-1)$); + \ExtractCoordinate{n-\theitemnumber.south} + \pgfmathsetmacro{\yposition}{\YCoord/28.452755} + \foreach \x in {1,...,\theitemnumber} + { \pgfmathsetmacro{\timeposition}{\yposition/(\maxtime-\mintime)*\csname nodetime\x \endcsname} + %\node[right] at (0,\timeposition) {\yposition}; + \draw (0,\timeposition) -- (0.5,\timeposition) -- ($(n-\x.west)-(0.5,0)$) -- (n-\x.west); + } + \foreach \x in {0,...,\timeintervals} + { \pgfmathsetmacro{\labelposition}{\yposition/(\maxtime-\mintime)*\x} + \node[left] (label-\x) at (-0.2,\labelposition) {\x\ \timeunit}; + \draw (label-\x.east) -- ++ (0.2,0); + } +} + +\begin{tikzpicture} +\node[inner sep=0] (n-0) at (\scaleitemseparation,0) {}; +\timeentry{1}{The first entry.} +\timeentry{1.2}{The second entry.} +\timeentry{1.23456}{The third entry.} +\timeentry{3}{Entry number \theitemnumber} +\timeentry{5}{Entry number \theitemnumber} +\timeentry{5.1}{Entry number \theitemnumber} +\timeentry{5.2}{Entry number \theitemnumber} +\timeentry{5.3}{Entry number \theitemnumber} +\timeentry{5.4}{Entry number \theitemnumber} +\timeentry{5.5}{Entry number \theitemnumber} +\timeentry{5.6}{Entry number \theitemnumber} +\timeentry{6}{Entry number \theitemnumber} +\timeentry{7}{Entry number \theitemnumber} +\timeentry{8}{Entry number \theitemnumber} +\timeentry{9}{Entry number \theitemnumber} +\timeentry{10}{Entry number \theitemnumber} +\timeentry{11}{Entry number \theitemnumber} +\timeentry{11.1}{Entry number \theitemnumber} +\timeentry{11.2}{Entry number \theitemnumber} +\timeentry{11.3}{Entry number \theitemnumber} +\timeentry{11.5}{Entry number \theitemnumber} +\timeentry{11.7}{Entry number \theitemnumber} +\timeentry{11.9}{Entry number \theitemnumber} +\timeentry{13}{Entry number \theitemnumber} +\timeentry{15}{Entry number \theitemnumber} +\drawtimeline +\end{tikzpicture} + +\end{document} diff --git a/LaTeX/tikz/test3.tex b/LaTeX/tikz/test3.tex new file mode 100644 index 0000000..de93392 --- /dev/null +++ b/LaTeX/tikz/test3.tex @@ -0,0 +1,39 @@ +\documentclass[a4paper, twoside, 11pt]{report} +\usepackage[utf8]{inputenc} +\usepackage[TS1,T1]{fontenc} +\usepackage{fourier, heuristica} +\usepackage{array, booktabs, longtable} +\usepackage{graphicx} +\usepackage[x11names,table]{xcolor} +\usepackage{caption} +\DeclareCaptionFont{blue}{\color{LightSteelBlue3}} +\newcommand{\foo}{\color{LightSteelBlue3}\makebox[0pt]{\textbullet}\hskip-0.5pt\vrule width 1pt\hspace{\labelsep}} + +\begin{document} +\begingroup +\renewcommand\arraystretch{1.4}\arrayrulecolor{LightSteelBlue3} +\captionsetup{font=blue, labelfont=sc, labelsep=quad, + skip=0.5\baselineskip} +\begin{longtable}{@{\,}r <{\hskip 2pt} !{\foo} >{\raggedright\arraybackslash}p{5cm}} +% header and footer information +\caption{Timeline}\\ +\toprule +\addlinespace[1.5ex] +\endhead +\addlinespace[1.5ex] +\bottomrule +\endlastfoot +% body of table +1947 & AT\&T Bell Labs develop the idea of cellular phones\\ +1968 & Xerox Palo Alto Research Centre envisage the `Dynabook'\\ +1971 & Busicom `Handy-LE' Calculator\\ +1973 & First mobile handset invented by Martin Cooper\\ +1978 & Parker Bros.\ Merlin Computer Toy\\ +1981 & Osborne 1 Portable Computer\\ +1982 & Grid Compass 1100 Clamshell Laptop\\ +1983 & TRS-80 Model 100 Portable PC\\ +1984 & Psion Organiser Handheld Computer\\ +1991 & Psion Series 3 Minicomputer\\ +\end{longtable} +\endgroup +\end{document} diff --git a/LaTeX/tikz/token.tex b/LaTeX/tikz/token.tex new file mode 100644 index 0000000..4d4effd --- /dev/null +++ b/LaTeX/tikz/token.tex @@ -0,0 +1,74 @@ +\documentclass{article} +\usepackage{tikz} +\usepackage{animate} +\usepackage{amsmath} +\usepackage{ifthen} +\usepackage{pgfmath} +\usetikzlibrary {matrix} +\usepackage{tikzlings} +\usepackage{tikzlings-penguins} +\usepackage{graphics,graphicx} + +\newcommand{\token}[2]{ + \begin{scope}[yshift=-#1] + \node [circle] at (-2,0) { $token_{#2}$}; + \node[ rectangle,fill=red] at (0,0) {}; + \node[ rectangle,fill=red!20] at (1,0) {}; + \node[ rectangle,fill=red!40] at (2,0) {}; + \node[ rectangle,fill=blue!20] at (3,0) {}; + \node[ rectangle,fill=blue!40] at (4,0) {}; + \node[ rectangle,fill=blue] at (5,0) {}; + \node[ rectangle,fill=blue!20!red] at (6,0) {}; + \node[ rectangle,fill=blue!40!red] at (7,0) {}; + \node[ rectangle,fill=blue!60!red] at (8,0) {}; + \end{scope} +} +\begin{document} +%\begin{comment} +%\begin{tikzpicture} +% \foreach \i in {1,2,3,4,...,8} { +% \token{\i cm} {\i}; +%} +%\end{tikzpicture} +% +%\begin{frame}[fragile,allowframebreaks]{Review of CNN} +% \begin{longtable}{l|l} +% 1998 &LeNet\cite{lecun1998gradient} LeCun \etal built the first deep CNN. \\ +% 2012 & AlexNet \cite{krizhevsky2012imagenet}pushed forward the state of the art of ImageNet classification.\\ +% 2015 & VGGNet \cite{simonyan2015very}; GoogLeNet \cite{szegedy2015going} \cite{szegedy2016rethinking,szegedy2017inception}\\ +% 2016 & ResNet \cite{he2016deep} manages to build very deep networks. \\ +% 2017 & ResNeXt\cite{xie2017aggregated}. DenseNet\cite{huang2017densely}; MobileNet \cite{howard2017mobilenets,sandler2018mobilenetv2} \\ +% 2018 & ShuffleNet \cite{zhang2018shufflenet,ma2018shufflenet},SENet\cite{senet}\\ +% 2019 & MnasNet \cite{tan2019mnasnet}; EfficientNet \cite{tan2019efficientnet}\\ +% \caption{ Key milestones in the development of CNN.} +%\end{longtable} +%\end{frame} +%\end{comment} +\newcommand{\lenet} { 1998,LeNet\cite{lecun1998gradient} LeCun \etal built the first deep CNN. } +\newcommand{\alexnet} {2012, AlexNet \cite{krizhevsky2012imagenet}pushed forward the state of the art of ImageNet classification. } +\newcommand{\vggnet} { VGGNet \cite{simonyan2015very} } +\newcommand{\googlenet}{ GoogLeNet \cite{szegedy2015going} \cite{szegedy2016rethinking,szegedy2017inception} } +\newcommand{\resnet} { ResNet \cite{he2016deep} manages to build very deep networks. } +\newcommand{\resnext} { ResNeXt\cite{xie2017aggregated} } +\newcommand{\densenet} { DenseNet\cite{huang2017densely}} +\newcommand{\mobilenwt} {MobileNet \cite{howard2017mobilenets,sandler2018mobilenetv2} } +\newcommand{\shufflenet} { \cite{zhang2018shufflenet,ma2018shufflenet}} +\newcommand{\senet } { SENet\cite{senet}} +\newcommand{\mnasnet} {MnasNet \cite{tan2019mnasnet}} +\newcommand{\efficientnet} {EfficientNet \cite{tan2019efficientnet}} + +\begin{tikzpicture}[>=latex,very thick,x=1.2cm,rectangle/.style={fill=red!10,text width=3cm}] + \draw[->] (-2,-0.5) -- ( 13,-0.5); + \node (y1998) at (-1,0) { 1998}; + \node (y2012) at (1,-1) {2012}; + \node ( y2015) at (3,0) {2015}; + \node (y2016) at ( 5,-1) {2016}; + \node (y2017) at (7,0) {2017}; + \node (y2018) at (9,-1) { 2018}; + \node (y2019) at (11,0) {2019}; + \node[rectangle] (lenet) at ( -1,1) { \lenet } ; + \node[rectangle] (alenet) at (1,-2.5){ \alexnet } ; +\end{tikzpicture} + + +\end{document}