Advertisement
NervousEnergy

Untitled

Jun 5th, 2021
178
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Latex 2.07 KB | None | 0 0
  1. \usepackage[none]{hyphenat}                                             % avoid hypenation
  2. \usepackage{ragged2e}                                                   % more powerful text alignment
  3. \usepackage[nonumberlist]{glossaries}
  4. \usepackage{glossary-longextra}
  5. \makeglossaries
  6.  
  7. % allow using hyperlinked short forms in the same way as \glsdesc etc.
  8. \newcommand{\glsshort}[1]{\glslink{#1}{\glsentryshort{#1}}}
  9.  
  10. \newglossarystyle{mystyle}{
  11.     \setglossarystyle{long-booktabs}
  12.     \renewcommand{\glsgroupskip}{}
  13.     \renewcommand{\glossaryheader}{
  14.         \toprule
  15.         \bfseries Term &
  16.         \bfseries Abbr &
  17.         \bfseries Definition
  18.         \tabularnewline\midrule\endhead
  19.         \bottomrule\endfoot
  20.     }
  21.     \newlength{\glsnamewidth}
  22.     \newlength{\glsshortwidth}
  23.  
  24.     \setlength{\glsnamewidth}{0.35\linewidth}
  25.     \setlength{\glsshortwidth}{0.1\linewidth}
  26.     \setlength{\glsdescwidth}{0.65\linewidth}%
  27.    
  28.     \renewenvironment{theglossary}{
  29.         \begin{longtable}[l]{p{\glsnamewidth}p{3em}p{\glsdescwidth}}}%
  30.         {\end{longtable}
  31.     }%
  32.    
  33.     \renewcommand{\glossentry}[2]{%  Change the displayed items
  34.             \RaggedRight{\glstarget{##1}{\glossentryname{##1}}} &
  35.             \RaggedRight{\glsentryshort{##1}} &
  36.             \RaggedRight{\glossentrydesc{##1}.} \tabularnewline
  37.     }
  38.     % format first occurency <name> (<short>), use %glsshort{<key>} to print
  39.     % only abbreviation, for the rest use %gls as usual  
  40.     \renewcommand{\glsentryfmt}{\glsgenentryfmt\ifglsused{\glslabel}{}{\space(\glsentryshort{\glslabel})}}
  41.    
  42.     \renewcommand{\arraystretch}{1.2} % more spacing between entries
  43. }
  44. \setglossarystyle{mystyle}
  45.  
  46. % D
  47. \newglossaryentry{dbms}{name={Database Management System},description={Lorem
  48. ipsum dolor sit amer consecutur adipscin elit Lorem ipsum dolor sit
  49. ame Lorem ipsum dolor sit
  50. ame Lorem ipsum dolor sit
  51. ame},short={DBMS}}
  52. \newglossaryentry{db}{name={Database},description={Lorem ipsum dolor sit
  53. ame},short={DB}}
  54.  
  55. % E
  56. \newglossaryentry{ects}{
  57.  name={European Accumulation Credit Transfer System},
  58.  short={ECTS},
  59.  description={Test test},
  60. }
  61.  
  62. \cleardoublepage
  63. \phantomsection
  64. \addcontentsline{toc}{chapter}{Glossary}
  65. \printglossary
  66.  
  67. \gls{ects} 2nd usage \gls{ects}
  68. I like \glsshort{dbms}
  69.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement