# Formatting back references in glossary same as in bibliography

I use this code to format back references in bibliography:

\renewcommand\backrefxxx[3]{%
\hyperlink{page.#1}{$\uparrow$#1}%
}


which prints me these lovely back references: ↑1, ↑3 and so on.

How can I get the same back references but for those in the glossary? (I use the glossaries package)

## 1 Answer

By default, locations are encapsulated with \glsnumberformat, which is defined as:

\newcommand{\glsnumberformat}[1]{\glshypernumber{#1}}


So, if you don't use the format key, you can just redefine this command to include your marker:

\documentclass{book}

\usepackage[colorlinks]{hyperref}
\usepackage{glossaries}

\makeglossaries

\newglossaryentry{sample}{name={sample},description={an example}}
\renewcommand{\glsnumberformat}[1]{$\uparrow$\glshypernumber{#1}}

\begin{document}
\chapter{Sample}
A \gls{sample}.

\chapter{Another Sample}
Another \gls{sample}.

\printglossary
\end{document}