# Non-breaking space between long and short form of acronyms with glossaries/glossaries-extras

I would like to enforce non-breaking spaces between the long and short form of acronyms with glossaries/glossaries-extras. I stumbled across this blog post where the author uses the following command in the preamble:

\renewcommand{\acrfullformat}[2]{#1~(#2)}


However, this doesn't work with my setup:

\usepackage{glossaries}

\usepackage{glossaries-extra}
\glsdisablehyper
\setabbreviationstyle[acronym]{long-short}


Any suggestions?

• Tip (unrelated to problem): although you can explicitly have \usepackage{glossaries} before \usepackage{glossaries-extra} it's better to leave glossaries-extra to load glossaries implicitly. Dec 7 '18 at 16:54

The command \acrfullformat is provided with the base glossaries acronym styles. The glossaries-extra extension package uses a different abbreviation mechanism, which is much more flexible. The long-short style uses \glsxtrfullsep{label} as the separator between the long form and the parenthetical short form. This is simply defined as:

\newcommand*{\glsxtrfullsep}[1]{\space}


(The label is provided as an argument in case some customisation is required, such as if you want to measure the short or long form to determine whether or not a non-breakable space might be appropriate or have a different separator for a particular category.)

So you just need to redefine this command to use a non-breakable space instead:

\documentclass{article}

\usepackage{glossaries-extra}

\setabbreviationstyle[acronym]{long-short}