1

I need to modify description style. I want the description entry to be on the next line, with a different color and

\newenvironment{mydescription}{%
    \let\olditem\item% 
    \begin{list}{}{
        \renewcommand\item[2][]{
            \olditem \textbf{\textsc{\color{black}{##1}}} \\ \normalfont \color{light-gray} ##2
        }
        \setlength{\leftmargin}{1.5em}
        \setlength{\itemsep}{0.05em}
        \setlength{\parskip}{5pt}
        \setlength{\parsep}{0.8em}
        }
}
{
    \end{list}%
}

My problem is the extra space between the first and the second letters of the description.

I am not able to post an image as it is my first post.

1 Answers1

2

What you want to do is described here.

That said, the explanation of the odd spaces is that LaTeX puts spaces at newlines. So if you see spurious spaces, the first thing to try is adding % to the end of the lines in your definitions.

\documentclass{article}
\usepackage{xcolor}
\newenvironment{mydescription}{%
    \let\olditem\item% 
    \begin{list}{}{
        \renewcommand\item[2][]{
            \olditem\textbf{\textsc{\color{black}{##1}}}\\%
            \normalfont \color{red}##2%
        }%
        \setlength{\leftmargin}{1.5em}
        \setlength{\itemsep}{0.05em}
        \setlength{\parskip}{5pt}
        \setlength{\parsep}{0.8em}
        }
}
{
    \end{list}%
}

\begin{document}
\begin{mydescription}
  \item [Something] More things
  \item [foo] Bar
\end{mydescription}
\end{document}

I changed to red because I don't know where light-gray was defined.

Seamus
  • 73,242