diff options
Diffstat (limited to 'Master/texmf-dist/tex/latex/glossaries-extra/glossary-topic.sty')
-rw-r--r-- | Master/texmf-dist/tex/latex/glossaries-extra/glossary-topic.sty | 43 |
1 files changed, 36 insertions, 7 deletions
diff --git a/Master/texmf-dist/tex/latex/glossaries-extra/glossary-topic.sty b/Master/texmf-dist/tex/latex/glossaries-extra/glossary-topic.sty index 76b6b62ef76..b73fe6dc74d 100644 --- a/Master/texmf-dist/tex/latex/glossaries-extra/glossary-topic.sty +++ b/Master/texmf-dist/tex/latex/glossaries-extra/glossary-topic.sty @@ -39,18 +39,36 @@ %% Grave accent \` Left brace \{ Vertical bar \| %% Right brace \} Tilde \~} \NeedsTeXFormat{LaTeX2e} -\ProvidesPackage{glossary-topic}[2019/03/31 v1.40 (NLCT)] +\ProvidesPackage{glossary-topic}[2019/04/09 v1.41 (NLCT)] \RequirePackage{multicol} \newglossarystyle{topic}{% - \renewenvironment{theglossary}{\glstopicInit}{\par}% + \renewenvironment{theglossary}% + {% + \glstopicInit + \def\glstopic@prechildren{}% + \def\glstopic@prevlevel{-1}% + }% + {\par}% \renewcommand*{\glossaryheader}{}% - \renewcommand*{\glsgroupheading}[1]{\glstopicGroupHeading{##1}}% + \renewcommand*{\glsgroupheading}[1]{% + \def\glstopic@prevlevel{-1}% + \glstopicGroupHeading{##1}% + }% \renewcommand{\glossentry}[2]{% \hangindent0pt\relax \parindent\glstopicParIndent\relax \glstopicItem{##1}{##2}% + \ifglshasdesc{##1}% + {% + \def\glstopic@prechildren{}% + }% + {% + \def\glstopic@prechildren{\nopagebreak}% + }% }% \renewcommand{\subglossentry}[3]{% + \ifnum\glstopic@prevlevel=0\relax\glstopic@prechildren\fi + \def\glstopic@prevlevel{##1}% \glstopicAssignSubIndent{##1}% \glstopicSubItem{##1}{##2}{##3}% }% @@ -83,6 +101,7 @@ \setlength\glstopicSubIndent{20pt} \newcommand{\glstopicInit}{} \newcommand*{\glstopicAssignSubIndent}[1]{% + \par \parindent\dimexpr#1\glstopicSubIndent-\glstopicSubIndent\relax \glstopicAssignWidest{#1}% \hangindent\dimexpr\parindent+\glstopicwidest\relax @@ -107,13 +126,13 @@ \newcommand*{\glstopicMidSkip}{\smallskip} \newcommand*{\glstopicPostSkip}{\smallskip} \newcommand*{\glstopicSubItem}[3]{% - \par \glstopicSubItemBox{#1}{\glstopicSubNameFont{\glsentryitem{#2}% \glstarget{#2}{\glossentryname{#2}}}% \glstopicSubItemSep }% \ifglshassymbol{#2}{(\glossentrysymbol{#2})\space}{}% - \glossentrydesc{#2}\glspostdescription + \ifglshasdesc{#2}% + {\glossentrydesc{#2}\glspostdescription\glstopicSubPreLocSep}{}% \glstopicSubLoc{#2}{#3}% } \newcommand*{\glstopicSubItemSep}{\quad} @@ -121,7 +140,8 @@ \ifdim\glstopicwidest>0pt\relax\makebox[\glstopicwidest][l]{#2}\else#2\fi } \newcommand*{\glstopicSubNameFont}[1]{\textbf{#1}} -\newcommand*{\glstopicSubLoc}[2]{\space#2} +\newcommand*{\glstopicSubPreLocSep}{\space} +\newcommand*{\glstopicSubLoc}[2]{#2} \newcommand*{\glstopicCols}{2} \newcommand*{\glstopicColsEnv}{multicols} \newglossarystyle{topicmcols}{% @@ -149,7 +169,16 @@ \parindent\glstopicParIndent\relax \glstopicItem{##1}{##2}% \ifnum\glstopicCols>1\relax - \edef\glstopic@prechildren{\noexpand\begin{\glstopicColsEnv}{\glstopicCols}}% + \ifglshasdesc{##1}% + {% + \edef\glstopic@prechildren{% + \noexpand\begin{\glstopicColsEnv}{\glstopicCols}}% + }% + {% + \edef\glstopic@prechildren{% + \noexpand\nopagebreak + \noexpand\begin{\glstopicColsEnv}{\glstopicCols}}% + }% \edef\glstopic@postchildren{\noexpand\end{\glstopicColsEnv}}% \fi }% |