我想在每个描述的末尾添加一个 url。
\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}
输出为:
词汇表 ...
我需要一个包含以下 URL 的新行:
词汇表 ...
http://...
答案1
您可以使用用户密钥来存储其他信息。例如:
\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}
得出的结果为: