5

I am very new to latex and I am trying to use the chemscheme package to help with my compound numbering (which seems to be working ok so far) but I am having trouble with the actual scheme numbering within my chapters.

I would like to have my schemes numbered continuously throughout the document, so that it begins at scheme 1, scheme 2 ... etc (rather than what is currently happening with scheme 1.1, scheme 1.2...etc). I'm sure there is probably a very simple way to do this, but my searching hasn't helped so far. I read in another post about using the chngcntr package followed by the counterwithout commands (see: here) - however, when I tried this, it told me that schemes were not a counter and didn't really work.

Here is a test file that reproduces what I am talking about below (I realise that a lot of the included packages are probably unimportant for you to reproduce the issue, but it seems like every time I change the preamble something new pops up that annoys me).

\documentclass[11 pt]{report}
%-----------------------------------------
%                  Packages
%-----------------------------------------

\usepackage{titlesec}
\usepackage[a4paper, scale=1.0, textwidth=145mm, textheight=237mm, layoutvoffset=0pt,   layouthoffset=0pt, ignoremp, includehead, marginparsep=0pt, bottom=4cm, top=2cm, left=4cm, right=2.5cm, verbose=true, bindingoffset=0pt]{geometry} 
\usepackage[utf8]{inputenc} 
\usepackage[T1]{fontenc} 
\usepackage[english]{babel} 
\usepackage{setspace} 
\usepackage[toc, page, header]{appendix} 
\usepackage{fancyhdr} 
\usepackage[super,sort&compress,comma]{natbib} 
\usepackage[plain]{fancyref} 
\usepackage[version=3]{mhchem}
\usepackage{times,mathptmx}
\usepackage{textcomp} 
\usepackage{sectsty}
\usepackage{balance} 
\usepackage{graphicx} 
\usepackage{lastpage}
 \usepackage[format=plain,justification=centering,singlelinecheck=false,font=small,labelfont=bf,labelsep=space]{caption} 

\usepackage[runs=2]{auto-pst-pdf}
\usepackage[journal=rsc]{chemstyle}

\begin{document}

\onehalfspace
\chapter[Introduction]{Introduction}
\chaptermark{Introduction}
\label{ch:introduction} % label for referring to chapter in other parts of the thesis
\section[Importance]{Importance}\label{C1:Intro}
Filling in later

\section[Synthesis]{Synthesis}
Ketone \compound{cmpd:ketone} blah blah to acid chloride \compound{cmpd:acid}.

\begin{scheme}[ht]
\begin{center}
\schemeref[TMP1]{cmpd:ketone}   
\schemeref[TMP2]{cmpd:acid}
\includegraphics[scale=0.8]{Schemes/synthesis}
\end{center}
\caption{}
\end{scheme}

\end{document}

Looks like this in the end

Thank you.

Dylan
  • 147
  • 2
  • 10

1 Answers1

5

You need to do two things

  1. Alter the display of the scheme number
  2. Stop the scheme number resetting with the chapter

The first item needs just a \renewcommand, the second is best done using the chngcntr package:

\documentclass{report}
\usepackage{chemstyle}
\usepackage{chngcntr}

\AtBeginDocument{%
  \renewcommand\thescheme{\arabic{scheme}}%
  \counterwithout{scheme}{chapter}%
}
\begin{document}

\chapter{Introduction}

\begin{scheme}[ht]
  CONTENT
  \caption{A scheme}
\end{scheme}

\chapter{Second chapter}

\begin{scheme}[ht]
  CONTENT
  \caption{A scheme}
\end{scheme}

\end{document}

(The same applies to 'standard' float types.)

Joseph Wright
  • 259,911
  • 34
  • 706
  • 1,036