[Tex/LaTex] In the resume document class, how to create a subsection without items

#enumeratecvlistsresumesectioning

I have a document in which I have subsections for which I might or not have items to enumerate:

\documentclass[10pt,a4paper]{resume} % Use the custom resume.cls style  
\usepackage[left=0.4 in,top=0.4in,right=0.4 in,bottom=0.4in]{geometry} % Document margins
\usepackage{eurosym}
\usepackage[usenames, dvipsnames]{color}

\begin{document}

\begin{rSection}{Section1}

\begin{rSubsection}{Sub1}{}
{}{}
\item[] MyItem1
\item[] MyItem2
\end{rSubsection}

\begin{rSubsection}{MyEmptySubsection}{}
{}{}
\end{rSubsection}

\begin{rSubsection}{Sub2}{}
{}{}
\item[] MyItem1
\end{rSubsection}

\end{rSection}

\end{document}

My problem is that it does not accept a subsection such as the second one in which there is no item. How can I fix that ?

(Note that I want to keep the exact same font, spacing etc between every subsection)

The resume.cls can be found there:
https://github.com/treyhunner/resume

Best Answer

I think a good way to do this would be to create a new environment for a subsection that is designed to be empty, and just call it something new, such as rEmptySubsection. Looking at the source for the class you are using, here is what the environment for the rSubsection with a list looks like:

\newenvironment{rSubsection}[4]{
  %%%%%%%%%%%%%%%%%%%%%% Default Layout: %%%%%%%%%%%%%%%%%%%%%%%%
  %%    Employer (bold)                     Dates (regular)    %%
  %%    Title (emphasis)                Location (emphasis)    %%
  %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  {\bf #1}                 \hfill                  {    #2}% Stop a space
  \ifthenelse{\equal{#3}{}}{}{
  \\
  {\em #3}                 \hfill                  {\em #4}% Stop a space
  }\smallskip
  % \cdot used for bullets, items non-indented
  \begin{list}{$\cdot$}{\leftmargin=0em}
  \itemsep -0.5em \vspace{-0.5em}
}{
  \end{list}
  \vspace{0.5em}
}

Starting with the same idea, and assuming you only want to remove the list from the environment, you can do something like this:

\documentclass[10pt,a4paper]{resume} % Use the custom resume.cls style  
\usepackage[left=0.4 in,top=0.4in,right=0.4 in,bottom=0.4in]{geometry} % Document margins
\usepackage{eurosym}
\usepackage[usenames, dvipsnames]{color}

% Item-less subsection
\newenvironment{rEmptySubsection}[4]{
  %%%%%%%%%%%%%%%%%%%%%% Default Layout: %%%%%%%%%%%%%%%%%%%%%%%%
  %%    Employer (bold)                     Dates (regular)    %%
  %%    Title (emphasis)                Location (emphasis)    %%
  %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  {\bf #1}                 \hfill                  {    #2}% Stop a space
  \ifthenelse{\equal{#3}{}}{}{
  \\
  {\em #3}                 \hfill                  {\em #4}% Stop a space
  }
  % empty
}{
}

\begin{document}

\begin{rSection}{Section1}

\begin{rSubsection}{Sub1}{}
{}{}
\item[] MyItem1
\item[] MyItem2
\end{rSubsection}

\begin{rEmptySubsection}{MyEmptySubsection}{}
{}{}
\end{rEmptySubsection}

\begin{rSubsection}{Sub2}{}
{}{}
\item[] MyItem1
\end{rSubsection}

\end{rSection}

\end{document}

In this way, you can customize the environment, and decide on spacing. You could even create a different kind of subsection altogether if you like. I hope this helps.

Related Question