Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to make Latex display two items per row?

Tags:

latex

xelatex

I am using this resume template to create my resume: https://github.com/posquit0/Awesome-CV.

I am completely new to latex. Currently, when I use cvitems:

%Define an environment for cvitems(for cventry)
\newenvironment{cvitems}{
  \vspace{-4mm}
  \begin{justify}
  \begin{itemize}[leftmargin=2ex, nosep, noitemsep]
    \setlength{\parskip}{0pt}
    \renewcommand{\labelitemi}{\bullet}
}{
  \end{itemize}
  \end{justify}
  \vspace{-2mm}
}

All the items are listed as follow:

  • item A
  • item B

What modifications to the above code can I make so that the list can look like this (item A and item B are on the same row)?

  • item A * item B

Here is how I use cvitems in the tex file:

{\begin{cvitems}
        \item {item A}
        \item {item B}
        \end{cvitems}}
like image 666
Kelvin Avatar asked Jan 19 '26 14:01

Kelvin


1 Answers

I would define a special command for two-item items as follows

\newcommand\twoitems[2]{%
\item#1%
\hspace{10pt}%
\labelitemi
\hspace{\labelsep}#2
}

Notice I used 10pt as spacing between items, you could use a different one.

Here is an MWE that applies the idea. In this example, I keep the cvitmems as in your MWE, though in truth it is really not doing anything, that is, you could as well use the standard itemize environment.

\documentclass{article}
\begin{document}

\newcommand\twoitems[2]{%
\item#1%
\hspace{10pt}%
\labelitemi
\hspace{\labelsep}#2
}

\newenvironment{cvitems}%
{
\begin{itemize}
}%
{
\end{itemize}
}

\begin{cvitems}
    \item A
    \item B
    \twoitems{A}{B}
\end{cvitems}

\end{document}

Here's the output: https://i.sstatic.net/BZvt0.png

like image 53
LMBC Avatar answered Jan 23 '26 20:01

LMBC



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!