4

I would like to add an url at the end of each description.

\documentclass[12pt,BCOR=15mm]{scrbook}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage[ngerman]{babel}
\usepackage{hyperref}

\usepackage[xindy,nonumberlist]{glossaries}
\GlsSetXdyCodePage{duden-utf8}
\makeglossaries

\begin{document}

\newglossaryentry{glossaries}
{
  name=Glossaries,
  description={...},
  url={http://test.de}
}


\glsaddall
\printglossary[title={\LaTeX-Pakete},toctitle={\LaTeX-Pakete}]

\end{document}

The output is:

Glossaries ...

and I need a new line with the url:

Glossaries ...

http://...

4

You can use the user keys to store additional information. For example:

\documentclass[12pt,BCOR=15mm]{scrbook}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage[ngerman]{babel}
\usepackage{hyperref}

\usepackage[xindy,nonumberlist]{glossaries}
\GlsSetXdyCodePage{duden-utf8}
\makeglossaries

\newglossaryentry{glossaries}
{
  name=Glossaries,
  description={...},
  user1={http://test.de}
}

\newglossaryentry{tildeurl}
{
  name=tildeurl,
  description={...},
  user1={http://test.de/\string~abc}
}

\newglossaryentry{percenturl}
{
  name=percenturl,
  description={...},
  user1={http://test.de/\%7Eabc}
}

\newglossarystyle{url}
{% based on list style (adapt as required)
  \setglossarystyle{list}%
    \renewcommand{\glossentry}[2]{%
    \item[\glsentryitem{##1}%
          \glstarget{##1}{\glossentryname{##1}}]
       \glossentrydesc{##1}\glspostdescription\space##2%
    \ifglshasfield{useri}{##1}{\glspar
     \glsletentryfield{\thisurl}{##1}{useri}%
     \expandafter\url\expandafter{\thisurl}}{}}%
}

\setglossarystyle{url}

\begin{document}

\glsaddall
\printglossary[title={\LaTeX-Pakete},toctitle={\LaTeX-Pakete}]

\end{document}

This produces:

Image of resulting glossary

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.