4

I want to write a section of Skills in resume where the output will be like-

Personal Attributes

Independent | Curious | Adaptable | Problem Solver

Technical Skills

Java | Python | AWS

the above outtput I want to achieve with something like

\begin{skills}

\skilltype{Personla Attributes}
    \begin{skilllist}
    
    \item{Independent}
    \item{curious}
    \item{adaptable}

    \end{skilllist}
.
.
.
.
\begin{skills}

How sould I write the .cls file to have \textpipes in between? P.s. I don't want to write it like Curious \textpipe Adaptable etc.

additionally

would be great if possible a solution where the items are equally distributed and spacing between them is auto generated accordingly

2
  • Define "equally distributed". Would 3 items (say) take up the same space as 5 items? Or should it just be spread across \textwidth?
    – Werner
    Nov 20, 2021 at 19:26
  • @Werner i mean irrespictive of 3 items or 5 items, they should occupy whole line (not equal width per items, but spacing should auto adjust) Nov 20, 2021 at 19:35

2 Answers 2

6

Use an inline list:

\documentclass{article}
\usepackage[inline]{enumitem}

\newlist{skillset}{enumerate*}{1}
\setlist[skillset]{label={}, afterlabel={}, itemjoin={{ \textbar{} }}}

\begin{document}
\begin{skillset}
  \item Java
  \item Python
  \item AWS
\end{skillset}
\end{document}

enter image description here

To make the list take the whole line add \hfill to the itemjoin. Margins shown:

\documentclass{article}
\usepackage[inline]{enumitem}
\usepackage[showframe]{geometry} % to show margins
\newlist{skillset}{enumerate*}{1}
\setlist[skillset]{label={}, afterlabel={}, itemjoin={{\hfill \textbar{} \hfill}}}
\begin{document}
\noindent\begin{skillset}
  \item Java
  \item Python
  \item AWS
\end{skillset}
\end{document}

enter image description here

7
  • You can directly define a new list with \newlist{skilllist}{enumerate*}{1} and then say setlist[skilllist]{label={}, afterlabel={}, itemjoin={{ \textbar{} }}} Nov 20, 2021 at 19:24
  • @JasperHabicht Good point. I've updated the answer accordingly.
    – Dan
    Nov 20, 2021 at 19:29
  • Then I'll remove mine =) Nov 20, 2021 at 19:31
  • @JasperHabicht Sorry. I hadn't refreshed my page and noticed your answer when I made the edit.
    – Dan
    Nov 20, 2021 at 19:32
  • 1
    @theSwapnilSaste Add before={\hspace{2mm}}, after={\hspace{2mm}} options to the \setlist line. You can replace 2mm with whatever length you desire.
    – Dan
    Nov 20, 2021 at 21:55
2
\NewDocumentEnvironment{skilllist}{}
   {%
     \RenewDocumentCommand{\item}{m} % ❶
        {%
          #1%
          \RenewDocumentCommand{\item}{m} % ❷
            { \textpipe\ ##1}% ❸
        }%
   }
   {%
     \par % ❹
   }

In the \begin{skilllist} definition we redefine \item ❶ to take a single argument which will be your skill. And within that redefinition, we will redefine \item again ❷ so that after the first \item each item will have | printed to separate it from the preceding items (with spaces before and after the |). Note also the use of ##1 in the inner redefinition so that LaTeX knows that we're referring to the definition of the defined command and not an outer command.

I've done no other real formatting since you'll likely handle that on your own other than to end the paragraph ❹ in the \end{skilllist} definition, but you can obviously add whatever additional formatting is necessary (e.g., enclosing each skill in \mbox to prevent line breaks in the middle of a skill).

1

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .