2

I have written an article for a journal of the American Chemical Society using the package achemso (Texlive 2020). After the submission I have been asked to supply also the pdf file with the line numbers. I put the \usepackage{lineno} in the preamble, the command \linenumbers in the text and the command \internallinenumbers before the \caption within the \begin{figure] environment. Everything seems fine but looking better to the results I realized that in the last line of every figure caption there were two numbers overlapped. This problem is present also using the achemso-demo.tex file and inserting the instructions for the line numbers as reported above. Anyone know how to fix this? Thank you. Here a small example where after compiling put overlapped the numbers 14 and 15 on the line of the figure caption.

\documentclass[journal=jacsat,manuscript=article]{achemso}
\usepackage{chemformula} % Formula subscripts using \ch{}
\usepackage[T1]{fontenc} % Use modern font encodings
\newcommand*\mycommand[1]{\texttt{\emph{#1}}}
\author{I. Ken Groupleader}
\email{[email protected]}
\phone{+123 (0)123 4445556}
\fax{+123 (0)123 4445557}
\affiliation[Unknown University]
{Department of Chemistry, Unknown University, Unknown Town}
\title[An \textsf{achemso} demo]
  {A demonstration of the \textsf{achemso} \LaTeX\
   class}
\abbreviations{IR,NMR,UV}
\keywords{American Chemical Society, \LaTeX}
\usepackage{lineno}
\begin{document}
\linenumbers

\begin{abstract}
  This is an example document for the \textsf{achemso} document
  class, intended for submissions to the American Chemical Society
  for publication.
\end{abstract}
\section{Introduction}
This is a paragraph of text to fill the introduction of the
demonstration file.

\section{Results and discussion}

\subsection{Outline}

The document layout should follow the style of the journal concerned.
Where appropriate, sections and subsections should be added in the
normal way.

\subsection{Floats}

New float types are automatically set up by the class file.  The
means graphics are included as follows (Scheme~\ref{sch:example}).  As
illustrated, the float is ``here'' if possible.
\begin{scheme}
  Your scheme graphic would go here: \texttt{.eps} format\\
  for \LaTeX\, or \texttt{.pdf} (or \texttt{.png}) for pdf\LaTeX\\
  \textsc{ChemDraw} files are best saved as \texttt{.eps} files:\\
  these can be scaled without loss of quality, and can be\\
  converted to \texttt{.pdf} files easily using \texttt{eps2pdf}.\\
  %\includegraphics{graphic}
  \caption{An example scheme}
  \label{sch:example}
\end{scheme}

\begin{figure}
  As well as the standard float types \texttt{table}\\
  and \texttt{figure}, the class also recognises\\
  \texttt{scheme}, \texttt{chart} and \texttt{graph}.
\internallinenumbers 
  \caption{An example figure}
  \label{fgr:example}
\end{figure}

Charts, figures and schemes do not necessarily have to be labelled or
captioned.  However, tables should always have a title. It is
possible to include a number and label for a graphic without any
title, using an empty argument to the \texttt{\textbackslash caption}
macro.

\end{document}
2
  • 2
    Hi Alby, you have asked questions before, so you should know what's needed such that people can help: A small sample code that shows the problem. Please ...
    – gernot
    Commented Jan 15, 2021 at 23:12
  • The small sample code is to take the file achemso-demo.tex put \usepackage{lineno} in the preamble, put \linenumbers after \begin{document} and \internallinenumbers before the \caption of figure 1. I will try to prepare a short file from that. Commented Jan 16, 2021 at 8:38

1 Answer 1

2

The stuff done in \caption seems to confuse the lineno package. Since the achemso document class loads the caption package one can try to move the \internallinenumbers inside the caption text (instead of putting it in front of \caption), for example by declaring and applying it as caption font:

\documentclass[journal=jacsat,manuscript=article]{achemso}
\usepackage{chemformula} % Formula subscripts using \ch{}
\usepackage[T1]{fontenc} % Use modern font encodings
\newcommand*\mycommand[1]{\texttt{\emph{#1}}}
\author{I. Ken Groupleader}
\email{[email protected]}
\phone{+123 (0)123 4445556}
\fax{+123 (0)123 4445557}
\affiliation[Unknown University]
{Department of Chemistry, Unknown University, Unknown Town}
\title[An \textsf{achemso} demo]
  {A demonstration of the \textsf{achemso} \LaTeX\
   class}
\abbreviations{IR,NMR,UV}
\keywords{American Chemical Society, \LaTeX}
\usepackage{lineno}
\DeclareCaptionFont{linenumbers}{\internallinenumbers}
\captionsetup[figure]{font+=linenumbers} % use \internallinenumbers inside figure caption texts
\begin{document}
\linenumbers

\begin{abstract}
  This is an example document for the \textsf{achemso} document
  class, intended for submissions to the American Chemical Society
  for publication.
\end{abstract}
\section{Introduction}
This is a paragraph of text to fill the introduction of the
demonstration file.

\section{Results and discussion}

\subsection{Outline}

The document layout should follow the style of the journal concerned.
Where appropriate, sections and subsections should be added in the
normal way.

\subsection{Floats}

New float types are automatically set up by the class file.  The
means graphics are included as follows (Scheme~\ref{sch:example}).  As
illustrated, the float is ``here'' if possible.
\begin{scheme}
  Your scheme graphic would go here: \texttt{.eps} format\\
  for \LaTeX\, or \texttt{.pdf} (or \texttt{.png}) for pdf\LaTeX\\
  \textsc{ChemDraw} files are best saved as \texttt{.eps} files:\\
  these can be scaled without loss of quality, and can be\\
  converted to \texttt{.pdf} files easily using \texttt{eps2pdf}.\\
  %\includegraphics{graphic}
  \caption{An example scheme}
  \label{sch:example}
\end{scheme}

\begin{figure}
  As well as the standard float types \texttt{table}\\
  and \texttt{figure}, the class also recognises\\
  \texttt{scheme}, \texttt{chart} and \texttt{graph}.
%\internallinenumbers => moved to caption font "linenumbers"
  \caption{An example figure}
  \label{fgr:example}
\end{figure}

Charts, figures and schemes do not necessarily have to be labelled or
captioned.  However, tables should always have a title. It is
possible to include a number and label for a graphic without any
title, using an empty argument to the \texttt{\textbackslash caption}
macro.

\end{document}
1
  • This elegant solution solved the problem!!! Commented Jan 16, 2021 at 13:41

You must log in to answer this question.

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