![重复图像但不重复数字(升序计数)](https://linux22.com/image/446971/%E9%87%8D%E5%A4%8D%E5%9B%BE%E5%83%8F%E4%BD%86%E4%B8%8D%E9%87%8D%E5%A4%8D%E6%95%B0%E5%AD%97%EF%BC%88%E5%8D%87%E5%BA%8F%E8%AE%A1%E6%95%B0%EF%BC%89.png)
我想使用相同的图标,重复图像,但数量(\dataNo)需要增加
我当前的代码:
\documentclass[a4paper,oneside,14pt]{article}
\usepackage[a4paper,landscape,left=0.0cm,right=0cm,top=0.0cm,bottom=0.0cm]{geometry}
\usepackage{graphicx}
\usepackage{showframe}
\usepackage{datatool}
\usepackage{caption}
\newcounter{repeatcount}
\usepackage{wrapfig}
\usepackage{xcolor}
\definecolor{shadecolor}{rgb}{1,.8,.3}
\newcommand{\repeatthis}[3][]{%
\setcounter{repeatcount}{0}%
\loop%
{#3}%
\stepcounter{repeatcount}%
\ifnum\value{repeatcount}<#2%
{#1}%
\repeat%
}
\begin{filecontents}{data1.tex}
No|Name
1|AAA
2|BCA
3|DXY
4|AAA4
5|BCA5
6|DXY6
7|AAA7
8|BCA8
9|DXY9
10|XYA
11|AAA
12|BCA
13|DXY
14|AAA4
15|BCA5
16|DXY6
17|AAA7
18|BCA8
19|DXY9
\end{filecontents}
\DTLsetseparator{|}
\DTLsetdelimiter{"}
\DTLloaddb[autokeys=false]{data1}{data1.tex}
\begin{document}
\pagestyle{empty}%
\noindent
\repeatthis{2}{%
\DTLforeach{data1}{\dataNo=No,\dataName=Name}{%
\begin{minipage}{0.3\textwidth}
%\begin{wrapfigure}{l}{0.1\textwidth}
\vspace{1.0cm}
~\\
\begin{center}
\includegraphics[width=5cm]{example-image-a}
{\Huge \dataNo}
\linebreak
\end{center}
\end{minipage}\quad%
}%
}
\end{document}
请参阅图片和帮助编号(\dataNo)= 1,2,..8,9, 10,11...20 谢谢
答案1
一切都在那里,只是溢出了页面。我添加了 #20 并稍微改变了几何形状(右边距)。
\documentclass[oneside,10pt]{article}
\usepackage[a3paper,landscape, left=0.0cm,right=5cm,top=0.0cm,bottom=0.0cm]{geometry}% changed
\usepackage{graphicx}
\usepackage{showframe}
\usepackage{datatool}
\usepackage{caption}
\newcounter{repeatcount}
\usepackage{wrapfig}
\usepackage{xcolor}
\definecolor{shadecolor}{rgb}{1,.8,.3}
\newcommand{\repeatthis}[3][]{%
\setcounter{repeatcount}{0}%
\loop%
{#3}%
\stepcounter{repeatcount}%
\ifnum\value{repeatcount}<#2%
{#1}%
\repeat%
}
\begin{filecontents}[overwrite]{data1.csv}
No|Name
1|AAA
2|BCA
3|DXY
4|AAA4
5|BCA5
6|DXY6
7|AAA7
8|BCA8
9|DXY9
10|XYA
11|AAA
12|BCA
13|DXY
14|AAA4
15|BCA5
16|DXY6
17|AAA7
18|BCA8
19|DXY9
20|XXY9
\end{filecontents}
\DTLsetseparator{|}
\DTLsetdelimiter{"}
\DTLloaddb[autokeys=false]{data1}{data1.csv}
\begin{document}
\pagestyle{empty}%
\noindent
\repeatthis{2}{%
\DTLforeach{data1}{\dataNo=No,\dataName=Name}{%
\begin{minipage}{0.1\textwidth}
%\begin{wrapfigure}{l}{0.1\textwidth}
\vspace{1.0cm}
~\\
\begin{center}
\includegraphics[width=4cm]{example-image-a}
{\Huge \dataNo}
\linebreak
\end{center}
\end{minipage}\quad%
}%
}
\end{document}