影像印刷计数器

影像印刷计数器

每次打印图像时,都有可能列出每个新图像,如下所示。

在此处输入图片描述

\documentclass[12pt]{standalone}
\usepackage{pgf,tikz,pgfplots}

\usepgflibrary{shadings} % LATEX and plain TEX and pure pgf
\usepgflibrary[shadings] % ConTEXt and pure pgf
\usetikzlibrary{shadings} % LATEX and plain TEX when using Tik Z
\usetikzlibrary[shadings] % ConTEXt when using Tik Z

\begin{document}

\newcommand{\camara}{%
\begin{tikzpicture}[line cap=round,line join=round,x=1.0cm,y=1.0cm]
%cajon principal
\draw[rounded corners=1pt,line width=.1pt,draw=black!30!gray,top color=gray!20!white,bottom color=black!40!gray] (0.49942,0.56) -- (1.6,0.56) -- (1.6,0.1) -- (0.5,0.1) -- cycle;
%Base
\filldraw[line width=0.1pt,rounded corners=1pt,draw=gray,top color=black!10!white,bottom color=black] (0.9,0.1) -- (1.,0.) -- (1.1,0.) -- (1.2,0.1) ;
%parte de atras
\filldraw[line width=0.1pt,draw=gray,top color=black!10!white,bottom color=black, rounded corners=0.5pt] (1.6,0.5) -- (1.65,0.48) -- (1.65,0.42) -- (1.6,0.4);
%foco delantero
\filldraw[line width=0.1pt,draw=gray,top color=black!10!white,bottom color=black,rounded corners=0.5pt] (0.5,0.5) -- (0.3,0.6) -- (0.3,0.3) -- (0.5,0.4);
%rectángulos azules
\filldraw[line width=0.1pt,color=blue,fill=blue,fill opacity=0.5,rounded corners=0.5pt] (1.2,0.5) -- (1.5,0.5) -- (1.5,0.44) -- (1.2,0.44) -- cycle;
\filldraw[line width=0.1pt,draw=blue!50,top color=blue!20!white,bottom color=blue!90!black,rounded corners=1pt] (0.7,0.4) -- (1.1,0.4) -- (1.1,0.2) -- (0.7,0.2) -- cycle;
%lumens
\fill[line width=0pt,dashed,color=blue,fill=blue,fill opacity=0.1] (0.3,0.3) -- (-0.4,-0.1) -- (-0.4,1.) -- (0.3,0.6) -- cycle;

\draw [fill=gray!50,line width=0.7pt] (0.9,0.8) circle (0.2cm);
\draw [fill=gray!50,line width=0.7pt] (1.4,0.8) circle (0.2cm);
\draw [fill=gray!50,line width=0.7pt] (0.9,1) -- (1.4,1);
\draw [fill=gray!50,line width=0.7pt] (0.9,0.6) -- (1.4,0.6);

\begin{scriptsize}
\draw [fill=blue] (0.9,0.8) circle (1.5pt);
\draw [fill=blue] (1.4,0.8) circle (1.5pt);
\draw [fill=white] (0.9,0.9) circle (1.5pt);
\draw [fill=white] (1.4,0.9) circle (1.5pt);
\draw [fill=white] (0.805,0.832) circle (1.5pt);
\draw [fill=white] (0.840,0.722) circle (1.5pt);
\draw [fill=white] (0.955,0.721) circle (1.5pt);
\draw [fill=white] (0.992,0.830) circle (1.5pt);
\draw [fill=white] (1.304,0.828) circle (1.5pt);
\draw [fill=white] (1.342,0.715) circle (1.5pt);
\draw [fill=white] (1.461,0.717) circle (1.5pt);
\draw [fill=white] (1.497,0.830) circle (1.5pt);
\draw [fill=white] (1.099,0.482) circle (1.5pt);
\end{scriptsize}
\end{tikzpicture}}


\camara \ \ Text text text,

\bigskip

\camara \ \ Text text text textt,

\bigskip

\camara \ \ Text text text text text,

\end{document}

答案1

当然,只需定义一个计数器,每当调用宏时将其增加 1,然后将其添加到图片中。

\documentclass[12pt]{standalone}
\usepackage{tikz}

\usetikzlibrary{shadings} 
\newcounter{camera}

\begin{document}

\newcommand{\camara}{%
\stepcounter{camera}
\begin{tikzpicture}[line cap=round,line join=round,x=1.0cm,y=1.0cm]
%cajon principal
\draw[rounded corners=1pt,line width=.1pt,draw=black!30!gray,top color=gray!20!white,bottom color=black!40!gray] (0.49942,0.56) -- (1.6,0.56) -- (1.6,0.1) -- (0.5,0.1) -- cycle;
%Base
\filldraw[line width=0.1pt,rounded corners=1pt,draw=gray,top color=black!10!white,bottom color=black] (0.9,0.1) -- (1.,0.) -- (1.1,0.) -- (1.2,0.1) ;
%parte de atras
\filldraw[line width=0.1pt,draw=gray,top color=black!10!white,bottom color=black, rounded corners=0.5pt] (1.6,0.5) -- (1.65,0.48) -- (1.65,0.42) -- (1.6,0.4);
%foco delantero
\filldraw[line width=0.1pt,draw=gray,top color=black!10!white,bottom color=black,rounded corners=0.5pt] (0.5,0.5) -- (0.3,0.6) -- (0.3,0.3) -- (0.5,0.4);
%rectángulos azules
\filldraw[line width=0.1pt,color=blue,fill=blue,fill opacity=0.5,rounded corners=0.5pt] (1.2,0.5) -- (1.5,0.5) -- (1.5,0.44) -- (1.2,0.44) -- cycle;
\filldraw[line width=0.1pt,draw=blue!50,top color=blue!20!white,bottom color=blue!90!black,rounded corners=1pt] (0.7,0.4) -- (1.1,0.4) -- (1.1,0.2) -- (0.7,0.2) -- cycle;
%lumens
\fill[line width=0pt,dashed,color=blue,fill=blue,fill opacity=0.1] (0.3,0.3) -- (-0.4,-0.1) -- (-0.4,1.) -- (0.3,0.6) -- cycle;
\node[font=\sffamily] at (-0.15,0.45){\thecamera};
{\thecamera};
\draw [fill=gray!50,line width=0.7pt] (0.9,0.8) circle (0.2cm);
\draw [fill=gray!50,line width=0.7pt] (1.4,0.8) circle (0.2cm);
\draw [fill=gray!50,line width=0.7pt] (0.9,1) -- (1.4,1);
\draw [fill=gray!50,line width=0.7pt] (0.9,0.6) -- (1.4,0.6);

\draw [fill=blue] (0.9,0.8) circle (1.5pt);
\draw [fill=blue] (1.4,0.8) circle (1.5pt);
\draw [fill=white] (0.9,0.9) circle (1.5pt);
\draw [fill=white] (1.4,0.9) circle (1.5pt);
\draw [fill=white] (0.805,0.832) circle (1.5pt);
\draw [fill=white] (0.840,0.722) circle (1.5pt);
\draw [fill=white] (0.955,0.721) circle (1.5pt);
\draw [fill=white] (0.992,0.830) circle (1.5pt);
\draw [fill=white] (1.304,0.828) circle (1.5pt);
\draw [fill=white] (1.342,0.715) circle (1.5pt);
\draw [fill=white] (1.461,0.717) circle (1.5pt);
\draw [fill=white] (1.497,0.830) circle (1.5pt);
\draw [fill=white] (1.099,0.482) circle (1.5pt);
\end{tikzpicture}}


\camara \ \ Text text text,

\bigskip

\camara \ \ Text text text textt,

\bigskip

\camara \ \ Text text text text text,

\end{document}

在此处输入图片描述

相关内容