Flushright and whitespace
\flushright
etc. introduce additional vertical white space, making \vspace
'necessary', I recommend \raggedright
etc. for this.
\item
does not have a mandatory argument!
In addition, I recommend the enumitem
package for fine control of the vertical spacings in an itemize
list.
\documentclass{article}
\usepackage{enumitem}
\usepackage{showframe}% Remove this later on
\newcommand{\resitemwithdate}[2]{%
\item
\begin{minipage}[t]{.80\linewidth}
\raggedright #1%
\end{minipage}
\hfill
\begin{minipage}[t]{.15\linewidth}
\raggedleft #2%
\end{minipage}
}
\begin{document}
\begin{itemize}[itemsep=0pt]
\resitemwithdate{A}{B}
\resitemwithdate{A}{B}
\resitemwithdate{A}{B}
\end{itemize}
\end{document}
And now for something completely different!
I use the listliketab
package, to emulate an itemize
environment, customised with enumitem
, and the date-time2
package to format the date, within a tabularx
environment:
\documentclass[british]{article}%
\usepackage{enumitem, tabularx, listliketab}
\usepackage{babel} %
\usepackage[british]{datetime2, }%
\usepackage{datetime2-calc, fmtcount}%
\DTMlangsetup[en-GB]{abbr, ord=raise}
\usepackage{lipsum}%
\usepackage{showframe}% Remove this later on
\newlist{myitemize}{itemize}{1}
\setlist[myitemize]{wide=0pt, label=\textbullet, leftmargin=*}
\newcommand{\resitemwithdate}[2]{%
\item
\begin{minipage}[t]{.80\linewidth}
\raggedright #1%
\end{minipage}
\hfill
\begin{minipage}[t]{.15\linewidth}
\raggedleft #2%
\end{minipage}
}
\let\tabitem=\textbullet
\begin{document}
\storestyleof{myitemize}
\begin{listliketab}
\begin{tabularx}{\linewidth}{@{}L >{\hsize=1.6\hsize}X >{\hsize=0.42\hsize\raggedleft\arraybackslash}X@{}}
\tabitem & \lipsum[11] & \Today \\
\tabitem & \lipsum[3] & \Today%
\end{tabularx}
\end{listliketab}
\end{document}
As exercise:
\documentclass{article}
\newcommand{\resitemwithdate}[2]
{
\setlength\itemsep{0pt}%
\item \begin{minipage}[t]{.80\linewidth}\raggedright
#1
\end{minipage}
\hfill
\begin{minipage}[t]{.15\linewidth}\raggedleft
#2
\end{minipage}%
}
\usepackage{showframe} % remove in real document
\renewcommand*\ShowFrameColor{\color{red}} % remove in real document
\begin{document}
\begin{itemize}
\resitemwithdate{A}{B}
\resitemwithdate{A}{B}
\resitemwithdate{A}{B}\break
\resitemwithdate{A}{B}
\end{itemize}
\end{document}