It could be also done with style=super
. Here is a step-by-step solution. At the end i added another alternative with \usepackage{glossary-superragged}
. But first i will start with adaptions to your mwe.
- (OPTIONAL) Visualize the margins with
\usepackage{showframe}
- (OPTIONAL) Visualize borders of the style
super
with superborder
\usepackage[style=superborder,automake]{glossaries}
. Later you could use the original \usepackage[style=super,automake]{glossaries}
without lines around it.
- Shift page number to the right with
\renewcommand*\glspostdescription{\hfill}
. Similar to @clemens answer here.
- For the next step you need
\usepackage{calc}
. Have a look to 15.1.5 Supertabular Styles,p.226 and redefine glsdescwidth
so that it fits the rest of the page. Done with \setlength\glsdescwidth{\textwidth-\widthof{longest Name}-4\tabcolsep}
. Note: Instead of longest Name
you have to write always your longest glossaries entry.
Results with superborder
, border
and as an alternativeglossary-supperragged
:
MWE: style=super
/ superborder
(=super with horizontal and vertical
lines around it)
\documentclass[a4paper,11pt]{article}
\usepackage[utf8]{inputenc}
%\usepackage{showframe}
\usepackage[style=super,automake]{glossaries}
%OR \usepackage[style=superborder,automake]{glossaries}
\renewcommand*\glspostdescription{\hfill}
\usepackage{calc}
\makeglossaries
\newglossaryentry{label}{name={Name}, description={Description}}
\newglossaryentry{labelLong}{name={longest Name}, description={Description}}
\begin{document}
\setlength\glsdescwidth{\textwidth-\widthof{longest Name}-4\tabcolsep}
\glsaddall
\printglossaries
\end{document}
MWE: alternative with glossary-supperragged
\documentclass[a4paper,11pt]{article}
\usepackage[utf8]{inputenc}
\usepackage[automake]{glossaries}
\usepackage{glossary-superragged}
\renewcommand*\glspostdescription{\hfill}
\makeglossaries
\newglossaryentry{label}{name={Name}, description={Description}}
\newglossaryentry{labelLong}{name={longest Name}, description={Description}}
%\usepackage{showframe}
\begin{document}
\glsaddall
\printglossaries
\end{document}