1

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

  • 2
    Welcome to TEX.SE! Please provide a full minimal working example starting with \documentclass{...} and ending with \end{document} instead of code snippets. This makes our lives easier and increases the chance of people helping you. And a link to resume.cls might be helpful too: it is not a standard class and googling for it throws several different results. – campa May 18 '17 at 14:07
  • Hmm.. internally rSubsection creates a new environment from list, I was hoping it wrapped itemize since this could have applied. I'm not familiar with list I'm afraid. – Carel May 18 '17 at 16:47
  • That template is deprecated. – Johannes_B May 19 '17 at 5:12
0

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.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.