0

I have define a new float "scheme" and want to reference it as figure or table floats do. How could I define a new label type for the "scheme" float to reference it in the article? I have tried to use fig or tab labels, but they do not work. See the picture. enter image description here

Tex code:

\documentclass[a4paper, 11pt]{article}
\usepackage{caption}           % Use table caption
\usepackage{chemfig}           % Use chemical strutures
\usepackage{hyperref}

\DeclareCaptionType[fileext=ext, name=Scheme, placement=tbph!]{scheme}
\captionsetup[scheme]{labelsep=period, font={small, bf}, skip=8pt}

\begin{document}
This is a chemical reaction:

\begin{scheme}[h!]
\renewcommand*{\figurename}{scheme}
\centering
\schemestart
\chemfig{*6(-=-=-=)} \+ \chemfig{H_2} \arrow \chemfig{*6(-(-H)=-=(-H)-=)}
\schemestop
\label{sh1}  % define a new label type for scheme float
\caption{Reaction of Benzene Synthesis}
\end{scheme}

A relatively simple, as shown in Scheme~\ref{sh1}, is neutralized by the solution contained within it to form a charged double layer, which under the influence of an applied electric field leads to the electroosmotic mobilization of the solution.

\end{document}
2

Place \label after \caption. The \caption macro is the one actually stepping the associated counter which is referred to by \label and \ref. This is the same for figure, table or any newly defined float:

\documentclass[a4paper, 11pt]{article}
\usepackage{caption}           % Use table caption
\usepackage{chemfig}           % Use chemical strutures
\usepackage{hyperref}

\DeclareCaptionType[fileext=ext, name=Scheme, placement=tbph!]{scheme}
\captionsetup[scheme]{labelsep=period, font={small, bf}, skip=8pt}

\begin{document}
This is a chemical reaction:

\begin{scheme}
% \renewcommand*{\figurename}{scheme}
  \centering
  \schemestart
    \chemfig{*6(-=-=-=)} \+ \chemfig{H_2} \arrow \chemfig{*6(-(-H)=-=(-H)-=)}
  \schemestop
  \caption{Reaction of Benzene Synthesis}
  \label{sh1}  % define a new label type for scheme float
\end{scheme}

A relatively simple, as shown in Scheme~\ref{sh1}, is neutralized by the
solution contained within it to form a charged double layer, which under the
influence of an applied electric field leads to the electroosmotic
mobilization of the solution.

\end{document}

enter image description here

|improve this answer|||||

Not the answer you're looking for? Browse other questions tagged or ask your own question.