I have some problems related to the application of an answer that I received to a previous question of mine, that can be found here.
Below there is a MWE, where I used \clearpageextensively, because I noticed that when \hypertargetdoes not work properly, it links to the first page of the document.
Problem:
When I use[\hypertarget{...}{...}]along with\begin{proof}or\begin{namedtheorem}, no additional round braces appear in the text.However, when I use it along with
\begin{step},\begin{claim}, or\begin{myclaim}, there two additional round braces appear.Is there a way to get rid of those round braces?
\documentclass[12pt]{article}
\usepackage{amsthm,xcolor}
\usepackage[colorlinks, linkcolor=red]{hyperref}
\usepackage[noabbrev,nameinlink]{cleveref}
\theoremstyle{plain}
\newtheorem{theorem}{Theorem}
\theoremstyle{remark}
\newtheorem{claim}{Claim}
\newtheorem*{myclaim}{Claim}
\newtheorem{step}{Step}
\newtheoremstyle{named}%
{}{}{\itshape}{}{\bfseries}{.}{.5em}{\thmnote{#3}}
\theoremstyle{named}
\newtheorem*{namedtheorem}{Theorem}
\newcommand{\aref}[2][blue]{%
\begingroup%
\hypersetup{linkcolor=#1}%
\cref{#2}%
\endgroup}
\newcommand\bref[3][blue]{%
\begingroup%
\hypersetup{linkcolor=#1}%
\hyperlink{#2}{#3}%
\endgroup}
\begin{document}
\section{One}
LaTeX Problems.
\clearpage
\section{Two} \label{section:two}
\begin{theorem}[Bla]\label{thm:bla}
Bla.
\end{theorem}
\begin{proof}[\hypertarget{proof:1}{Proof.}]
Bla
\end{proof}
\begin{namedtheorem}[\hypertarget{thm:mystery}{Mystery theorem}]
A mysterious theorem
\end{namedtheorem}
\begin{proof}
\begin{step}[\hypertarget{step1}{}]
Here step 1.
\end{step}
\begin{step}
Here step 2.
\end{step}
\begin{claim}[\hypertarget{claim1}{}]
A numbered claim.
\end{claim}
\end{proof}
\clearpage
\begin{theorem}
Bla bla
\end{theorem}
\begin{proof}
\begin{myclaim}[\hypertarget{myclaim}{}]
An unnumbered claim.
\end{myclaim}
\end{proof}
\clearpage
\section{Three}
In \cref{section:two}, we have both a \aref{thm:bla}, a \bref{proof:1}{proof}, \bref{step1}{step 1}, a numbered \bref{claim1}{claim 1}, and a single \bref{myclaim}{claim}.
\end{document}
Thank you for your time.
\hypertarget{label}without the second couple of curly braces, nothing really change. May I ask you why it is the case? Are there some side-effects in doing this? – Kolmin May 19 '16 at 20:10\hypertarget, and luckily for you that token isn't needed elsewhere. Could you give a specific example? – Mico May 19 '16 at 20:18{}element as long as the next token is an ordinary letter or punctuation mark. All bets are off if the next token is a macro, say\textbfor\begin{equation}. – Mico May 20 '16 at 03:56