1

I am trying to use the long style provided in the glossary package to use in my acronym list. However, I am also using the ragged2e package and I have my paragraphs indented too. This causes both the table and the first line of the acronym description to be indented. Any suggestions?

\documentclass{report}
\usepackage[top=1.0in,hmargin=1.25in,height=9.0in,letterpaper,showframe]{geometry}
\usepackage{setspace}
\usepackage[document]{ragged2e}
\usepackage{calc}
\usepackage[acronyms,nonumberlist,nopostdot,nogroupskip]{glossaries}

\setlength{\RaggedRightParindent}{0.5in}

\setacronymstyle{long-short}
\renewcommand*{\glsnamefont}[1]{\normalfont{#1}}
\newacronym{AAA}{AAA}{some text}
\newacronym{BBB}{BBB}{some very very very very very very very very very very very very very long long long long long long long long text}
\newacronym{CCC}{CCC}{an acronym}

\makenoidxglossaries
\setglossarystyle{long}
\newlength\glsnamewidth
\settowidth{\glsnamewidth}{MMMMM}
\setlength{\glsdescwidth}{\textwidth-\glsnamewidth-\tabcolsep}
\renewenvironment{theglossary}%
{\begin{longtable}[l]{@{}p{\glsnamewidth}p{\glsdescwidth}}}%
{\end{longtable}}%

\begin{document}
\doublespace
\printnoidxglossary[type=acronym,title={LIST OF ACRONYMS}]
\printacronyms

\gls{AAA}. Text text text \gls{BBB}. More text \gls{CCC}.

\end{document}

Gives:

Wrong

While I want it to look more like the next one, albeit with the following text indented.

Right

1

Found a way by changing the indentation inside the renewed glossary environment and then resetting it after the closing of the table. It works for this case, but unsure if there is a more elegant way.

Full code:

\documentclass{report}
\usepackage[top=1.0in,hmargin=1.25in,height=9.0in,letterpaper,showframe]{geometry}
\usepackage{setspace}
\usepackage[document]{ragged2e}
\usepackage{calc}
\usepackage[acronyms,nonumberlist,nopostdot,nogroupskip]{glossaries}

\setlength{\RaggedRightParindent}{0.5in}

\setacronymstyle{long-short}
\renewcommand*{\glsnamefont}[1]{\normalfont{#1}}
\newacronym{AAA}{AAA}{some text}
\newacronym{BBB}{BBB}{some very very very very very very very very very very very very very long long long long long long long long text}
\newacronym{CCC}{CCC}{an acronym}

\makenoidxglossaries
\setglossarystyle{long}
\newlength\glsnamewidth
\settowidth{\glsnamewidth}{MMMMM}
 \setlength{\glsdescwidth}{\textwidth-\glsnamewidth-\tabcolsep}
\renewenvironment{theglossary}{%
    \setlength{\RaggedRightParindent}{0pt}\begin{longtable}[l{@{}p{\glsnamewidth}p{\glsdescwidth}}}%
{\end{longtable}\setlength{\RaggedRightParindent}{0.5in}}%

\begin{document}
\doublespace
\printnoidxglossary[type=acronym,title={LIST OF ACRONYMS}]
\printacronyms

\gls{AAA}. Text text text \gls{BBB}. More text \gls{CCC}.

\end{document}
|improve this answer|||||

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.