2

I am trying to use the chemmacros package to easily generate a List of Schemes (as suggested here), which my thesis committee is requiring.

I am probably overlooking something, but why do I get an error message when I try to compile the following? The error seems to be related to \listofschemes.

\documentclass[oneside,11pt]{book}

\usepackage[semibold,tt=false]{libertine}
\usepackage{libertinust1math}
\usepackage[font={sf,small},labelsep=quad,labelfont=sc]{caption}
\usepackage[subrefformat=parens]{subcaption}
\usepackage[
  expansion = false ,
  tracking = smallcaps ,
  letterspace = 40 ,
]{microtype}
\usepackage{booktabs}
\usepackage{acro}
\acsetup{
  barriers/use, barriers/reset,
  use-id-as-short,
}
\newcommand{\ie}{i.e.}
\newcommand{\eg}{e.g.}
\newcommand{\cf}{cf.}
\newcommand{\avg}[1]{\overline{#1}}
\usepackage{mdframed}
\usepackage[capitalize]{cleveref}
\usepackage{chemformula}
\setchemformula{charge-hshift=.5pt}
\usepackage{chemmacros}
\usechemmodule{scheme}
\usepackage{graphicx}
\usepackage{enumitem}
\usepackage{calc}
\usepackage{tabto}
\usepackage[titles]{tocloft}
\setlength{\cftfignumwidth}{2.9em}
\setlength{\cfttabnumwidth}{2.9em}

\begin{document}

\addcontentsline{toc}{chapter}{\listfigurename}
\listoffigures

% \phantomsection %% Remove if using hyperref
\addcontentsline{toc}{chapter}{\listtablename}
\listoftables

\addcontentsline{toc}{scheme}{\listschemename}
\listofschemes

\chapter{First chapter}
Refer to \cref{fig:firstfig} using cleveref package.
Refer to \cref{tbl:firsttbl}.
Refer to scheme, \cref{scm:eventualscheme}.
% Example figure
\begin{figure}[!h]
  \centering
  \includegraphics[width=0.02\textwidth]{example-image}
  \caption{Caption of figure in first chapter.}\label{fig:firstfig}
\end{figure}

% Example table 
\begin{table}[!h]
  \centering
  \begin{tabular}{ll}
    \toprule
    A & B\\
    \bottomrule
  \end{tabular}
  \caption{Caption of table in first chapter.}\label{tbl:firsttbl}
\end{table}

\begin{scheme}[!h]
  \centering
  \includegraphics[width=0.02\textwidth]{example-image-a}
  \caption{Caption of eventual scheme.}\label{scm:eventualscheme}
\end{scheme}

\end{document}
4

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.