我有布局(图标和数字)。
现在我想为每个(图标和数字)添加非常细的边框,我使用了框架,但没有成功。
\frame{
\begin{center}
\includegraphics[width=4cm]{example-image-a}
{\Huge \dataNo}
\linebreak
\end{center}
}
我当前的代码:删除边框页
\documentclass[oneside,10pt]{article}
\usepackage[a4paper,landscape,left=0.0cm,right=5cm,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}[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.2\textwidth}
%\begin{wrapfigure}{l}{0.1\textwidth}
\vspace{1.0cm}
~\\
\frame{
\begin{center}
\includegraphics[width=4cm]{example-image-a}
{\Huge \dataNo}
\linebreak
\end{center}
}
\end{minipage}\quad%
}%
}
\end{document}
我想要的结果
请帮忙。
答案1
尝试一下此代码。该代码\fbox
封装了小页面。
% !TeX TS-program = pdflatex
\documentclass[oneside,10pt]{article}
\usepackage[a3paper,landscape, left=2cm,right=2cm,top=1.5cm,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\medskip\par}%changed <<<<<<<<<<<
\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}
\renewcommand\fbox{\fcolorbox{red}{white}}% added <<<<<<<<<<<<
\begin{document}
\pagestyle{empty}%
\parindent0pt
\repeatthis{2}{%
\DTLforeach{data1}{\dataNo=No,\dataName=Name}{%
\fbox{\begin{minipage}[t]{0.13\textwidth} %changed <<<<<<<<<<<
\vspace{2mm}
\centering
\includegraphics[width=4cm]{example-image-a}\par
\medskip
{\huge \dataNo}
\smallskip
\end{minipage}}\quad%
}%
}
\end{document}