自定义图形/方案编号

自定义图形/方案编号

我目前正在撰写化学领域的论文。在我的实验部分,我提出了一些方案,我想知道是否可以以及如何自定义这些方案的编号。更具体地说:我想将这些方案编号为“方案 Ex”,x 为方案的编号(从 1 开始;因此方案 E.1、方案 E.2、方案 E.3,...)。这种自定义编号应该只从实验部分开始,因此 LaTeX 文档前面部分的方案应该以正常方式编号。

我的基本文档如下所示:

    \documentclass[a4paper]{report}

    \usepackage{a4wide}                         
    \usepackage[pdftex]{graphicx}                   
    \usepackage[small,bf,hang]{caption}     
    \usepackage[latin1]{inputenc}                           
    \usepackage{fancyhdr}                   
    \usepackage{titlesec}                   
    \usepackage{subfig}                     
    \usepackage[superscript,biblabel]{cite} 
    \usepackage{chngcntr}                   
    \usepackage[nottoc,notlot,notlof]{tocbibind}    
    \usepackage{fixltx2e}                   
    \usepackage{wrapfig}                    
    \usepackage{arevtext,arevmath}          
    \usepackage{enumitem}                   
    \usepackage[Gray,squaren,thinqspace,thinspace]{SIunits} 

    \usepackage[version=3]{mhchem}              
    \usepackage{chemscheme}
    \usepackage{epstopdf}                   
    \usepackage[varioref=true,journal=jcp]{chemstyle}  
    \usepackage{float}

    \setlength{\parindent}{0cm}             
    \renewcommand{\baselinestretch}{1.3}    
    \pagenumbering{arabic}                  
    \fancyhead[L]{\nouppercase{\leftmark}}
    \fancyhead[R]{\thepage}

    \usepackage[scaled=.95]{helvet}         
    \usepackage{sectsty}
    \allsectionsfont{\sffamily}
    \renewcommand{\familydefault}{\sfdefault}   

    \usepackage{titlesec}
    \titleformat{\chapter}[display]
      {\sffamily\huge\raggedleft}    
      {\MakeUppercase{\chaptertitlename}
        \rlap{ \resizebox{!}{1.4cm}{\thechapter} \rule{5cm}{1.45cm}}} 
      {10pt}{\Huge}  % Chaptertitelgrootte
    \titlespacing*{\chapter}{0pt}{2pt}{90pt}

    \captionsetup{
    margin=1ex,
    font={small, sf},
    labelfont={bf, sf},
    labelsep= endash}

    \makeatletter 
    \def\@seccntformat#1{\llap{\csname the#1\endcsname\quad}}
    \makeatother

    \setcounter{secnumdepth}{3}
    \setcounter{tocdepth}{3}
    \newcommand{\Schemeref}[1]{\textbf{Scheme\,\ref{scheme:#1}}}

    \title{This is the title}
    \author{Machaeri}
    \date{}
    \pagenumbering{arabic}

\begin{document}

\maketitle
\tableofcontents
\listoffigures
\setlength{\parindent}{0pt}

\chapter{Chapter one}

Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.

    \begin{scheme}
        \includegraphics[scale=1]{Test.eps}
        \caption{Caption text}
        \label{Test}
    \end{scheme}

Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.

\end{document}

答案1

由于自动chemstyle加载chemscheme,我已经评论过chemschemechemscheme使用scheme计数器来控制方案。

你可以这样做

\chapter{Experimental part}
\renewcommand*{\thescheme}{E.\arabic{scheme}}%
\setcounter{scheme}{0}

就在实验部分开始的地方。

    \documentclass[a4paper]{report}

    \usepackage{a4wide}
    \usepackage[pdftex]{graphicx}
    \usepackage[small,bf,hang]{caption}
    \usepackage[latin1]{inputenc}
    \usepackage{fancyhdr}
    \usepackage{titlesec}
    \usepackage{subfig}
    \usepackage[superscript,biblabel]{cite}
    \usepackage{chngcntr}
    \usepackage[nottoc,notlot,notlof]{tocbibind}
    \usepackage{fixltx2e}
    \usepackage{wrapfig}
    \usepackage{arevtext,arevmath}
    \usepackage{enumitem}
    \usepackage[Gray,squaren,thinqspace,thinspace]{SIunits}

    \usepackage[version=3]{mhchem}
    %\usepackage{chemscheme}     %% this is loaded by chemstyle
    \usepackage{epstopdf}
    \usepackage[varioref=true,journal=jcp]{chemstyle}
    \usepackage{float}

    \setlength{\parindent}{0cm}
    \renewcommand{\baselinestretch}{1.3}
    \pagenumbering{arabic}
    \fancyhead[L]{\nouppercase{\leftmark}}
    \fancyhead[R]{\thepage}

    \usepackage[scaled=.95]{helvet}
    \usepackage{sectsty}
    \allsectionsfont{\sffamily}
    \renewcommand{\familydefault}{\sfdefault}

    \usepackage{titlesec}
    \titleformat{\chapter}[display]
      {\sffamily\huge\raggedleft}
      {\MakeUppercase{\chaptertitlename}
        \rlap{ \resizebox{!}{1.4cm}{\thechapter} \rule{5cm}{1.45cm}}}
      {10pt}{\Huge}  % Chaptertitelgrootte
    \titlespacing*{\chapter}{0pt}{2pt}{90pt}

    \captionsetup{
    margin=1ex,
    font={small, sf},
    labelfont={bf, sf},
    labelsep= endash}

    \makeatletter
    \def\@seccntformat#1{\llap{\csname the#1\endcsname\quad}}
    \makeatother

    \setcounter{secnumdepth}{3}
    \setcounter{tocdepth}{3}
    \newcommand{\Schemeref}[1]{\textbf{Scheme\,\ref{scheme:#1}}}

    \title{This is the title}
    \author{Machaeri}
    \date{}
    \pagenumbering{arabic}

\begin{document}

\maketitle
\tableofcontents
\listoffigures
\listofschemes
\setlength{\parindent}{0pt}

\chapter{Chapter one}

Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.

    \begin{scheme}
        \includegraphics[scale=0.3]{example-image-a}    %% change back
        \caption{Caption text}
        \label{Test}
    \end{scheme}

Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.

\chapter{Experimental part}
\renewcommand*{\thescheme}{E.\arabic{scheme}}%
\setcounter{scheme}{0}

Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.

    \begin{scheme}
        \includegraphics[scale=0.3]{example-image-a}    %% change back
        \caption{Caption text}
        \label{Test}
    \end{scheme}

Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.


\end{document}

在此处输入图片描述

方案清单如下

在此处输入图片描述

相关内容