I type several fbox commands and for some reason the boxes are separated with small spaces:
MWE:
\documentclass{article}
\usepackage{fullpage}
\setlength{\oddsidemargin}{-15mm}
\raggedright
\begin{document}
\noindent
\fbox{text text text text text text text text text text text}
\fbox{text text text text text text text text text text text}
\fbox{text text text text text text text text text text text}
\fbox{text text text text text text text text text text text}
\end{document}
My first thought was that this is due to justification. But then I left aligned the contents and the "problem" is still there.
I want to remove space between these fboxes: both vertical and horizontal (shown on the screenshot with red arrows).
Edit:
The original problem is to generate badges with datatool. I have a badge template and I generate it many times from a csv file using datatool. The problem is that badges are a little bit apart from each other so I would have to cut them out manually later.
MWE:
\documentclass[a4paper,12pt]{article}
\usepackage{fullpage}
\usepackage{filecontents}
\usepackage{datatool}
\DTLsetseparator{&}
\pagestyle{empty}
\setlength{\oddsidemargin}{-15mm}
\begin{filecontents*}{data.csv}
NAME&TITLE
Name1 & Title1
Name2 & Title2
Name3 & Title3
Name4 & Title4
Name5 & Title5
Name6 & Title6
\end{filecontents*}
\DTLloaddb{data}{data.csv}
\begin{document}
\DTLforeach*
{data}
{\NAME=NAME,\TITLE=TITLE}
{
\noindent
\fbox{\begin{minipage}[t][55mm]{90mm}
\vspace{11mm}
\centering
\vfill
{\bf \fontsize{30}{36}\selectfont\textrm{\NAME}\par}
\vfill
\large\itshape\TITLE
\vspace{5mm}
\end{minipage}}
}
\end{document}
Gives:
Edit:
In case one is going to use two-sided badges — one would want to have same name written twice, as is allows to bend the badge and have the same name on both sides. In this case one might use:
\documentclass{article}
\usepackage{filecontents}
\begin{filecontents*}{data.csv}
NAME&AFFILIATION
Name1 & Title1
Name2 & Title2
Name3 & Title3
Name4 & Title4
Name5 & Title5
\end{filecontents*}
\usepackage{datatool}
\DTLsetseparator{&}
\DTLloaddb{data}{data.csv}
\usepackage{eso-pic}
\usepackage{graphicx}
% 4 per in a column:
\usepackage[a4paper,top=1cm,bottom=1cm,left=0.5in,right=0.5in]{geometry}
% % 5 per in a column:
% \usepackage[a4paper,top=0.27cm,bottom=0.1cm,left=0.5in,right=0.5in]{geometry}
\pagestyle{empty}
\begin{document}
\par
% \offinterlineskip
\noindent % <- Outside the loop
\DTLforeach*{data}{\NAME=NAME,\AFFILIATION=AFFILIATION}
{% <- Spurious space was here
\allowbreak % <- Added
\fbox{\begin{minipage}[t][55mm]{90mm}
\vspace{11mm}
\centering
\vfill
{\bf \fontsize{30}{36}\selectfont\textrm{\NAME}\par}
\vfill
\large\itshape\AFFILIATION
\vspace{5mm}
\end{minipage}}% <- Spurious space was here
\fbox{\begin{minipage}[t][55mm]{90mm}
\vspace{11mm}
\centering
\vfill
{\bf \fontsize{30}{36}\selectfont\textrm{\NAME}\par}
\vfill
\large\itshape\AFFILIATION
\vspace{5mm}
\end{minipage}}% <- Spurious space was here
}
\end{document}
Which gives:
Best Answer
You have spurious spaces. I also removed
\noindent
from the loop, put it outside, and put\allowbreak
before any\fbox
. With\offinterlineskip
all goes well. If you want to have another things in the document, you should enclose everything in a group\begingroup .. \endgroup
.