4

I'm trying to write a document with the achemso package, but my \ref are not working right. achemso links to a package called cleveref, then renames cleveref's \cref into \ref, so any answers for cleveref should work here.

Example one:

\documentclass[journal=jacsat,layout=traditional]{achemso}
\usepackage{achemso} %loaded last due to clerverRef

\author{Canageek}
\title{Title}
\email{[email protected]}
\affiliation[University]{University, Canada}

\begin{document}
\section{Introduction \label{intro}}
blah blah blah blah

\section{two}
Will this work? See~\ref{intro}.

\end{document}

Produces as it's body text:

Introduction

blah blah blah blah

two

Will this work? See Footnote ∗.

Next example, since there is mention of a error with references in section titles in the cleveref manual.

\documentclass[journal=jacsat,layout=traditional]{achemso}
\usepackage{achemso} %loaded last due to clerverRef

\author{Canageek}
\title{Title}
\email{[email protected]}
\affiliation[University]{University, Canada}

\begin{document}
\section{Introduction}
 \label{intro}
blah blah blah blah

\section{two}
Will this work? See~\ref{intro}.

\end{document}

This gives the same output as above. Oddly enough neither produce anything odd that I can find in the .log file.

\documentclass[journal=jacsat,layout=traditional,hyperref]{achemso}
\usepackage{hyperref}
\usepackage{achemso} %loaded last due to clerverRef


\author{Canageek}
\title{Title}
\email{[email protected]}
\affiliation[University]{University, Canada}

\begin{document}
\section{Introduction}
 \label{intro}
blah blah blah blah

\section{two}
Will this work? See~\ref{intro}.

\end{document}

Gives a different output: It replaces the * with a ??. The .log file for this one also has the message

LaTeX Warning: cref reference format for label type `' undefined on input line 17.

Can anyone tell me what I'm doing wrong? I made sure to update my TeX Live install this morning when I had another problem, so everything should be up to date. Oh, and yes, I've made sure to delete everything but the test.tex file from the folder between compiles.

2
  • Also note that achemso has been updated very recently: version v3.5j, last revised 2011/11/14. (You probably update regularly, but there might be readers of this who don't do it.)
    – Stephen
    Commented Nov 18, 2011 at 18:47
  • I don't actually, unless I have a problem, but I'd happened to update the same day.
    – Canageek
    Commented Nov 18, 2011 at 19:36

1 Answer 1

6

If you want to cross-reference the sections, they should have a number associated (to be used in cross-referencing) otherwise, the wrong string will be picked up to produce the cross-reference number (in your case, it will be the one created by \affiliation which explains why you were getting "Footnote").

achemso uses section numbers only where the journal uses these in print. You can use the \SectionNumbersOn command to force section numbering; however, if you use section numbers in a submission to a journal which does not use them, things may go a bit wrong later.

Your document could be something like this:

\documentclass[journal=jacsat,layout=traditional]{achemso}
\usepackage{achemso}

\SectionNumbersOn

\author{Canageek}
\title{Title}
\email{[email protected]}
\affiliation[University]{University, Canada}

\begin{document}
\section{Introduction}\label{intro}
blah blah blah blah

\section{two}
Will this work? See~\ref{intro}.

\end{document}

enter image description here

0

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .