2

I want to reference sections in the form '§1'. I use hyperref.sty, and I have changed the sectionautorefname: \renewcommand{\sectionautorefname}{\S}. This prints '§ 1', with a space. Can I remove the space?

\documentclass{article}
\usepackage{hyperref}
\renewcommand{\sectionautorefname}{\S}
\begin{document}
\section{section}
\label{section}
\autoref{section}
\end{document}
twsh
  • 2,718

1 Answers1

2

You could \kern it to the left.

\documentclass{article}
\usepackage{hyperref}
\renewcommand{\sectionautorefname}{\S\kern-4pt}
\begin{document}
\section{section}
\label{section}
\autoref{section}
\end{document}

enter image description here

Perhaps a better way is to gobble the space:

\makeatletter
\renewcommand{\sectionautorefname}{\S\@gobble}
\makeatother

though I don't know if this latter approach has any unintended pitfalls.