How can I add `[` and `]` around `\ref{myref}` so that I get something like this:

```
[1.1] 

```

This does not work:

```
\documentclass{article}
\usepackage[colorlinks=true,allcolors=blue]{hyperref}
\let\oldref\ref
\renewcommand{\ref}[1]{[\oldref{#1}]}
\begin{document}
\section{Section}
Why cannot include square brackets around cross references? \ref{S}
\subsection{Subsection\label{S}}
This is a subsection.
\end{document}

```

Ans: comment out `\usepackage[colorlinks=true,allcolors=blue]{hyperref}` and it works. But I need `hyperref`, I do not want to use `amsmath`, and I prefer not to add packages as they tend to clash with other things later on, such as using plastex, etc. What can I do?