3

How is it possible to get a newline at the beginning of the description? So the description starts at second line?

MWE:

\documentclass[11pt,english,ngerman,numbers=noenddot, headsepline]{scrreprt}
\usepackage[colorlinks]{hyperref}
\usepackage{glossaries}

\makeglossaries

\newglossaryentry{NIS}{
    name={NIS}, 
    description={Name Information Service \\* see \ref{subsec:nis} \nameref{subsec:nis}}
}

\newglossaryentry{Test}{
    name={Test}, 
    description={\\* This is a Test}
}


\begin{document}

\subsection{Name Information Service}
\label{subsec:nis}
A long big text about \gls{NIS}
A short text about \gls{Test}


\printglossaries

\end{document}

MWE Error:

! LaTeX Error: There's no line here to end.

See the LaTeX manual or LaTeX Companion for explanation.
Type  H <return>  for immediate help.
 ...

l.8 ...etentrycounter[]{page}\glsnumberformat{1}}}
                                                  %
2

1 Answer 1

4

The default glossary style (list) uses the description environment which doesn't like a line break immediately after \item. Your second entry has a line break at the start of the description which tries to break the line immediately after \item, which is what's causing the problem. You can add an empty box immediately before the line break (which is what the altlist style does to force the description on the line below the item):

\documentclass[11pt,english,ngerman,numbers=noenddot,headsepline]{scrreprt}
\usepackage[colorlinks]{hyperref}
\usepackage{glossaries}

\makeglossaries

\newglossaryentry{NIS}{
    name={NIS}, 
    description={Name Information Service \\* see \ref{subsec:nis}
\nameref{subsec:nis}}
}

\newglossaryentry{Test}{
    name={Test}, 
    description={\mbox{}\\* This is a Test}
}


\begin{document}

\subsection{Name Information Service}
\label{subsec:nis}
A long big text about \gls{NIS}
A short text about \gls{Test}


\printglossaries

\end{document}
2

You must log in to answer this question.

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