如何为新的浮点数定义新的标签类型(例如 fig 和 tab)?

如何为新的浮点数定义新的标签类型(例如 fig 和 tab)?

我已经定义了一个新的浮动“方案”,并希望像图形或表格浮动一样引用它。我该如何为“方案”浮动定义一种新的标签类型,以便在文章中引用它?我曾尝试使用图或标签标签,但它们不起作用。看图片。在此处输入图片描述

特克斯代码:

\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}

答案1

地方\label \caption。宏实际上是对由和\caption引用的关联计数器进行步进的宏。这对于或任何新定义的浮点数都是一样的:\label\reffiguretable

\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}

在此处输入图片描述

相关内容